#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <set>
#include <map>
#include <sstream>
#include <deque>

# define iOS ios_base::sync_with_stdio(false)

typedef unsigned long long ull;

using namespace std;

string str1, str2;

char letter, checkLet1, checkLet2;

bool checkStrs()
{
  int posletter = str1.find(letter);
  if (posletter == std::string::npos)
  {
    posletter = str2.find(letter);
  }

  int poscheckLet1 = str1.find(checkLet1);
  if (poscheckLet1 == std::string::npos)
  {
    poscheckLet1 = str2.find(checkLet1);
  }

  int poscheckLet2 = str1.find(checkLet2);
  if (poscheckLet2 == std::string::npos)
  {
    poscheckLet2 = str2.find(checkLet2);
  }

  if (abs(posletter-poscheckLet1) <= 1 && abs(posletter-poscheckLet2) <= 1)
  {
    return true;
  }
  else
  {
    return false;
  }
}

void move()
{
  char str1Last = str1[12];
  char str2First = str2[0];

  str1 = str2First + str1.substr(0, 12);

  str2 = str2.substr(1, 12) + str1Last;
}

int main()
{
  iOS;

  string str;
  cin >> str;

  int first = 0, second = 0;

  for (size_t i = 0; i < str.size(); i++)
  {
    int pos = str.find_last_of(str[i]);
    if (pos != i)
    {
      first = i;
      second = pos;
      break;
    }
  }

  if (second-first == 1 /*|| (first == 0 && second == 26)*/)
  {
    cout << "Impossible" << endl;
    return 0;
  }

  letter = str[first];

  checkLet1 = str[second-1];
  if (second == 26)
  {
    checkLet2 = str[0];
  }
  else
  {
    checkLet2 = str[second+1];
  }

  str.erase(second, 1);

  str1 = str.substr(0, 13);

  str2 = str.substr(13, 25);
  std::reverse(str2.begin(), str2.end());

  while(!checkStrs())
  {
    move();
  }

  cout << str1 << endl;
  cout << str2 << endl;

  return 0;
}

#include <bits/stdc++.h>
#define ll long long
#define mod 1000000007
#define pi acos(-1)
#define pb push_back
#define mp make_pair
#define filein freopen("input.txt","r",stdin)
#define fileout freopen("output.txt","w",stdout)
using namespace std;
int  main()
{
    string str;
    cin>>str;
    string name1,name2;
    int s,f;
    for(int i=0;i<str.size();i++)
    {
        for(int j=i+1;j<str.size();j++)
        {
            if(str[i]==str[j])
            {
                s=i; f=j;
                str.erase(str.begin()+j);
                break;
            }
        }
    }
    if(f==s+1)
    {
        cout<<"Impossible"<<endl; return 0;
    }
    int mid=(s+f)>>1;
    if((f-s)%2==0) mid=(mid-1+26)%26;
    for(int i=mid,j=0;j<13;j++,i=(i-1+26)%26)
    {
        name1+=str[i];
    }
    cout<<name1<<endl;
    for(int i=mid+1,j=0;j<13;j++,i=(i+1)%26)
    {
        name2+=str[i];
    }
    cout<<name2<<endl;

}

#include <iostream>
#include <string>
#include <algorithm>
#include <memory.h>

int main()
{
    std::string line;
    std::cin>>line;
    for (int i = 0; i< 26;++i) {
        if (line[i] == line[i+1]) {
            std::cout << "Impossible\n";
            return 0;
        }
    }

    int letter[26], pos1, pos2;
    memset(letter, -1, sizeof(letter));
    for (int i = 0; i< 27;++i) {
        int c = line[i] - 'A';
        if (letter[c] == -1) {
            letter[c] = i;
        } else {
            pos1 = letter[c];
            pos2 = i;
            //std::cout << pos1 << " " << pos2 << "\n";
        }
    }

    if (pos1 == 0 && pos2 == 26) {
        std::cout << line.substr(0, 13) << "\n";
        std::string last = line.substr(13, 13);
        reverse(last.begin(), last.end());
        std::cout << last << "\n";
        return 0;
    }

    int len = (pos2 - pos1 - 1) / 2;
    char grid[2][13];
    grid[0][len] = line[pos1];
    //position the letters between the 2 occurences
    int grid_row = 0;
    int grid_col = len - 1;
    bool left = true;
    for (int i = pos1 + 1; i < pos2; ++i) {
		if (grid_col < 0) {
    		grid_col = 0;
    		grid_row = 1;
    		left = !left;
    	}
    	grid[grid_row][grid_col] = line[i];
 	   //std::cout<< "put " << line[i] << " to grid " << grid_row << " " << grid_col << "\n";
    	if (left) {
    		grid_col--;
    	} else {
    		grid_col++;
    	}
    }
    // the first part
    left = false;
    grid_row = 0;
    grid_col = len + 1;
    for (int i = pos1 - 1; i >= 0; --i) {
		if (grid_col > 12) {
    		grid_col = 12;
    		grid_row = 1;
    		left = !left;
    	}
    	grid[grid_row][grid_col] = line[i];
 	   //std::cout<< "put " << line[i] << " to grid " << grid_row << " " << grid_col << "\n";
    	if (left) {
    		grid_col--;
    	} else {
    		grid_col++;
    	}
   }
   // the last
    left = false;
    grid_row = 1;
    grid_col = len + (pos2 - pos1 - 1) % 2;
    for (int i = pos2 + 1; i < 27; ++i) {
		if (grid_col > 12) {
    		grid_col = 12;
    		grid_row = 0;
    		left = !left;
    	}
    	grid[grid_row][grid_col] = line[i];
 	   //std::cout<< "put " << line[i] << " to grid " << grid_row << " " << grid_col << "\n";
    	if (left) {
    		grid_col--;
    	} else {
    		grid_col++;
    	}
   }

   for (int i = 0; i < 13; ++i)
     std::cout<< grid[0][i];
   std::cout << "\n";
   for (int i = 0; i < 13; ++i)
     std::cout<<grid[1][i];
   std::cout << "\n";
   return 0;
}

#include <bits/stdc++.h>
using namespace std;
int cnt[200];
int main()
{
   string ss;
   cin>>ss;
   int x, y, p, pp;
   for(int i=0; i<27; i++){
      cnt[ss[i]]++;
      if(cnt[ss[i]]==2) x=i;
   }
   for(int i=0; i<27; i++){
      if(cnt[ss[i]]==2){
         y=i; break;
      }
   }
   if(x-y==1){
      puts("Impossible"); exit(0);
   }
   string a, b;
   p=(x-y+1)>>1; pp=x-y-p;
   a=ss.substr(0, y+p);
   b=ss.substr(y+p, pp)+ss.substr(x+1);
   reverse(b.begin(), b.end());
   while(a.size()<b.size()){
      a=b[0]+a;
      b=b.substr(1);
   }
   while(b.size()<a.size()){
      b=a[0]+b;
      a=a.substr(1);
   }
   cout<<a<<endl<<b<<endl;
}

#include <bits/stdc++.h>
using namespace std;
struct Hidden{
    string s;
    map<char,int> frequen;
    char rep;
    vector<int> pos_rep;
    int part_dis_rep;
    pair<string,string> ans;
public:
    void read(){
        cin >> s;
    }
    bool check(){
        for(int i=0;i<s.length();++i)
            frequen[s[i]]++;
        if(frequen.size()!=26) return false;
        else{
            for(auto &it:frequen)
                if(it.second==2){
                    rep = it.first;
                    break;
                }
            for(int i=0;i<s.size();++i)
                if(s[i]==rep) pos_rep.push_back(i);
            part_dis_rep = (pos_rep[1] - pos_rep[0]-1);
            s.erase(s.begin()+pos_rep[1]);
            if(part_dis_rep>0) {
                    part_dis_rep/=2;
                    return true;
            }
            else return false;
        }
    }
        void show_ans(){
            if(check()){
                ans.first = s.substr(0,pos_rep[0]+part_dis_rep+1);
                ans.second = s.substr(pos_rep[0]+part_dis_rep+1);
                reverse(ans.first.begin(),ans.first.end());
                while(ans.first.length()<13){
                    ans.first+=*(ans.second.end()-1);
                    ans.second.erase(ans.second.end()-1);
                }
                while(ans.second.length()<13){
                    ans.second+=*(ans.first.end()-1);
                    ans.first.erase(ans.first.end()-1);
                }
                cout<<ans.first<<endl<<ans.second<<endl;

            }
            else cout<<"Impossible";
        }
};
int main(){
    Hidden hi;
    hi.read();
    hi.show_ans();
    return 0;
}

#pragma comment(linker, "/STACK:250000000")
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <vector>
#include <string>
#include <ctime>
#include <cassert>
#include <algorithm>
#include <memory.h>
#include <fstream>
#include <bitset>
#include <cmath>

//#include <unordered_set>
//#include <unordered_map>

#define forn(i, n) for (int i = 0; i < int(n); i++)
#define for1(i, n) for (int i = 1; i < int(n); i++)
#define forft(i, from, to) for (int i = int(from); i < int(to); i++)
#define forr(i, n) for (int i = int(n) - 1; i >= 0; i--)
#define X first
#define Y second
#define mp make_pair
#define pb push_back
#define sz(a) int(a.size())
#define all(a) a.begin(), a.end()
#define ms(a, v) memset(a, v, sizeof(a))
#define correct(x, y, n, m) (x >= 0 && x < n && y >= 0 && y < m)
#define iter(i, a) for (auto i = a.begin(); i != a.end(); ++i)

using namespace std;

template<typename T> T sqr(const T &x) {
	return x * x;
}

typedef long long ll;
typedef long long li;
typedef unsigned long long uli;
typedef pair<int, int> pt;
typedef pair<li, li> pl;
typedef long double ld;
typedef pair<ld, ld> pd;

const int INF = int(1e9);
const ll INF_LL = ll(4e18);
const ll INF64 = ll(4e18);
const ll LINF = ll(4e18);
const ld EPS = 1e-15;
const ld PI = 3.14159265358979323846264338;

int dx[8] = {1, 0, -1, 0, 1, 1, -1, -1};
int dy[8] = {0, 1, 0, -1, 1, -1, 1, -1};

int ddx[8] = {-1, -2, -2, -1, 1, 2, 2, 1};
int ddy[8] = {-2, -1, 1, 2, 2, 1, -1, -2};

const int N = 2e5 + 10;
const int M = 2e3 + 10;
const li MOD = li(1e9) + 7;
const int SQN = 450;

string s;
int cnt[26];

char ans[2][26];

bool read() {
	cin >> s;
	return true;
}

bool check(int i, int j, char c) {
	int pi = i;
	int pj = j;

	if (pi == 0) {
		pj--;

		if (pj < 0) {
			pi = 1;
			pj = 0;
		}
	} else {
		pj++;

		if (pj > 12) {
			pi = 0;
			pj = 12;
		}
	}

	if (ans[i][j] == c) {
		return true;
	}

	forn(idx, 8) {
		int ci = i + dx[idx];
		int cj = j + dy[idx];

		if (abs(ci - pi) >= 2 || abs(cj - pj) >= 2) {
			continue;
		}

		if (correct(ci, cj, 2, 13) && (ci != pi || cj != pj) && ans[ci][cj] == c) {
			return true;
		}
	}

	return false;
}

bool fills(int i, int j, int idx) {
	forn(pos, sz(s)) {
		if (pos != idx) {
			ans[i][j] = s[pos];

			if (i == 0) {
				++j;

				if (j == 13) {
					i = 1;
					j = 12;
				}
			} else {
				--j;

				if (j < 0) {
					i = 0;
					j = 0;
				}
			}
		} else {
			if (!check(i, j, s[pos])) {
				return false;
			}
		}
	}

	return true;
}

void solve() {
	forn(i, sz(s)) {
		cnt[s[i] - 'A']++;
	}

	char c = 'A';

	forn(i, 26) {
		if (cnt[i] > 1) {
			c = i + 'A';
			break;
		}
	}

	int pos = -1;

	forr(i, sz(s)) {
		if (s[i] == c) {
			pos = i;
			break;
		}
	}

	forn(starti, 2) {
		forn(startj, 13) {
			ms(ans, 0);

			if (fills(starti, startj, pos)) {
				forn(i, 2) {
					forn(j, 13) {
						cout << ans[i][j];
					}

					cout << endl;
				}

				return;
			}
		}
	}

	cout << "Impossible" << endl;
}

int main() {
#ifdef _DEBUG
	freopen("input.txt", "rt", stdin);
	freopen("output.txt", "wt", stdout);
#endif

	srand((int) time(NULL));
	cout << setprecision(2) << fixed;

	read();
	solve();

	//gen();
	cerr << clock() << endl;

	return 0;
}

#ifdef LOCAL
#include "/home/dima/seminars/headers/debug.h"
#else
void nop();
#define dbg(...) nop
#define dbgl(...) nop
#endif
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef vector<int> VI;
typedef vector<bool> VB;
typedef vector<VI> VVI;
typedef vector<string> VS;
const int inf = INT_MAX / 2;
const int mod = 1000000007;

int main() {
#ifdef LOCAL
	freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
#endif
	string s;
	cin >> s;
	dbg(s);
	int n = s.length();

	if (s[0] == s[n - 1]) {
		cout << string(s.begin(), s.begin() + 13) << endl;
		cout << string(s.rbegin() + 1, s.rbegin() + 14) << endl;
		return 0;
	}

	for (int i = 0; i < n; ++i) {
		int j = find(s.begin() + i + 1, s.end(), s[i]) - s.begin();
		if (j != n) {
			if (j - i == 1 || j - i == n - 1) {
				printf("Impossible\n");
				return 0;
			} else {
				string t = s.substr(i) + s.substr(0, i);
				dbg(i, j, s[i], s[j], t);
				VS a(2, string(13, '.'));
				j -= i;
				int k = (j - 1) / 2;
				dbg(k);

				a[0][k] = s[i];
				for (int q = 1; q <= k; ++q)
					a[0][k - q] = t[q];
				for (int q = k + 1; q < j; ++q)
					a[1][q - k - 1] = t[q];
				for (int q = j + 1; q - k - 2 < 13; ++q)
					a[1][q - k - 2] = t[q];
				for (int q = n - 1; k + n - q < 13; --q)
					a[0][k + n - q] = t[q];

				cout << a[0] << endl;
				cout << a[1] << endl;
				return 0;
			}
		}
	}
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
int cnt[26];
void init()
{
    for(int i=0;i<26;i++)
        cnt[i]=-1;
}
int main()
{
    init();
    int d=0;
    char arr[2][13];
    string s;
    cin>>s;
    int i=0;
    for(i=0;i<s.length();i++)
    {
        //cout<<"i is "<<i<<endl;
        if(cnt[s[i]-'A']==-1)
            cnt[s[i]-'A']=i;
        else
        {
            d=i-cnt[s[i]-'A'];
            break;
        }
    }
    if(d==1)
    {
        cout<<"Impossible";
        return 0;
    }
    //cout<<"d is "<<d<<endl;
    i=cnt[s[i]-'A'];
    int idx=12-(d-1)/2;
    //cout<<"idx is "<<idx<<endl;
    arr[0][idx]=s[i];
    idx++;
    for(int j=i+1;j<i+d;j++)
    {
        //cout<<"j is "<<j<<" idx is "<<idx<<endl;
        if(idx<13)
            arr[0][idx]=s[j],idx++;
        else
            arr[1][12-(idx%13)]=s[j],idx++;
    }
    int flag=0;
    for(int j=i+d+1;j<27;j++)
    {
        //cout<<"j is "<<j<<" idx is "<<idx<<endl;
        if(flag==0){
            arr[1][12-(idx%13)]=s[j];
            if(12-(idx%13)==0)
                idx=-1,flag=1;
            idx++;
        }
        else
            arr[0][idx]=s[j],idx++;
    }
    idx=12-(d-1)/2;
    idx--;
    for(int j=i-1;j>=0;j--)
    {
        //cout<<"j is "<<j<<" idx is "<<idx<<endl;
        if(idx>=0)
            arr[0][idx]=s[j],idx--;
        else
            arr[1][abs(idx)-1]=s[j],idx--;
    }
    for(int i=0;i<=12;i++)
        cout<<arr[0][i];
    cout<<endl;
    for(int i=0;i<=12;i++)
        cout<<arr[1][i];
}

#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main(int argc, char **argv)
{
    ios_base::sync_with_stdio(false);
    cin.tie(0), cout.tie(0), cout.precision(15);
    //|s| = 27
    string s;
    cin >> s;
    vector<int> vis(256, -1); //not portable
    int a = -1, b = -1;
    for(int i = 0; i < 27; i++){
        if(vis[s[i]] != -1){
            a = vis[s[i]];
            b = i;
            break;
        }
        vis[s[i]] = i;
    }
    //[a, b - 1]
    int cnt = b - 1 - a;
    if(cnt == 0){
        cout << "Impossible" << endl;
        return 0;
    }
    vector<string> t(2, string(13, ' '));
    int m = cnt/2;
    int p0 = 13 - m - 1;
    int p1;
    //symmetric. so put a in first row
    if(cnt%2){
        //odd + two a => odd. remain must be even
        //so put b - 1 below a
        //a..
        //b-1..
        p1 = p0;
    }else{
        //even + two a=> even. remain must be odd
        //so put b - 1 in the right of the one below a. even to fit two rows.
        //a...
        // b-1
        p1 = p0 + 1;
    }
    //fill loop in row 0
    for(int i = 0; i <= m; i++){
        t[0][p0 + i] = s[a + i];
    }
    for(int i = 1; 13 - i >= p1; i++){
        t[1][13 - i] = s[a + m + i];
    }
    //fill head
    int cnt_head = a;
    int col = p0 - 1;
    bool right = false;
    for(int i = 1; i <= cnt_head; i++){
        if(col == -1){
            //rightward (row 1)
            col = 0;
            right = true;
        }
        if(right){
            t[1][col] = s[a - i];
            col ++;
        }else{
            t[0][col] = s[a - i];
            col --;
        }
    }
    int cnt_tail = 27 - 1 - b;
    //fill tail
    col = p1 - 1;
    right = false;
    for(int i = 1; i <= cnt_tail; i++){
        if(col == -1){
            //rightward (row 0)
            right = true;
            col = 0;
        }
        if(right){
            t[0][col] = s[b + i];
            col ++;
        }else{
            t[1][col] = s[b + i];
            col --;
        }
    }
    cout << t[0] << endl;
    cout << t[1] << endl;
    return 0;
}

#include <iostream>
#include <string>
#include <set>
#include <math.h>
#include <stack>
#include <limits.h>
#include <queue>
#include <functional>
#include <algorithm>
#include <sstream>
#include <iomanip>
#include <map>
#include <deque>
#include <unordered_map>
#include <complex>
#include <unordered_set>
#include <time.h>
#include <assert.h>
#define REP(i,N)for(long long i=0;i<(N);i++)
#define FOR(i,a,b)for(long long i=(a);i<=(b);i++)
#define FORD(i,a,b)for(long long i=a;i>=(b);i--)
#define ll long long
#define vi vector<ll>
#define vii vector<pair<ll,ll> >
#define vvi vector<vector<ll> >
#define pii pair<ll,ll>
#define ALL(x) (x).begin(), (x).end()
#define SZ(a)((ll)(a).size())
#define CHECK_BIT(n,x)((n)&(((ll)1)<<(x)))
#define pow2(x) ((x)*(x))
#define VELA 99999999999999999ll
using namespace std;

int main(){
	cin.sync_with_stdio(0);
	string path;
	cin >> path;
	vi vyskyt(26, 0ll);
	char dvojka;
	ll prvy;
	ll druhy;
	REP(i, SZ(path)){
		vyskyt[path[i] - 'A'] ++;
		if (vyskyt[path[i] - 'A'] == 2){
			dvojka = path[i];
			druhy = i;
		}
	}
	REP(i, 27){
		if (path[i] == dvojka){ prvy = i; break; }
	}
	/*bool bolo = false;
	string newPath;
	ll start = 0ll;
	REP(i, SZ(path)){
		if (path[(start + i) % 27] == dvojka&&!bolo){ newPath += path[(start + i) % 27]; bolo = true; }
		else if (path[(start + i) % 27] != dvojka){
			newPath += path[(start + i) % 27];
		}
	}
	vector<string> finalSequence;
	finalSequence.push_back(newPath.substr(0,13));
	string temp = newPath.substr(13, 13);
	reverse(ALL(temp));
	finalSequence.push_back(temp);
	REP(i, 26){
		if (path[i] == '0'){

		}
	}*/
	if (druhy - prvy == 1){
		cout << "Impossible\n";
		return 0;
	}
	ll midSize = druhy - prvy;
	string firstPart = path.substr(prvy,midSize-(midSize/2ll));
	string secondPart = path.substr(prvy + midSize - (midSize / 2ll), midSize / 2);
	reverse(ALL(secondPart));
	string added = "";
	FOR(i, druhy + 1ll, prvy+27-1ll){
		ll index = i % 27;
		if (SZ(secondPart) < 13)secondPart = path[index] + secondPart;
		else added += path[index];
	}
	cout << added << firstPart<<"\n";
	cout << secondPart << "\n";
	return 0;
}

#include <iostream>
#include <cstdlib>
#include <string>
#include <map>

using namespace std;

int main() {
	string s;
	cin >> s;
	char char_x;
	int start, end;
	for (int i = 0; i < 27; ++i)
		for (int j = 0; j < i; ++j)
			if (s[i] == s[j]) {
				char_x = s[i];
				start = j;
				end = i;
				break;
			}
	if (end == start + 1) {
		cout << "Impossible\n";
	}
	else {
		int half = (end - start + 1) / 2;
		string tail = s.substr(end + 1, 26 - end) + s.substr(0, start);
		string first = s.substr(start, half);
		reverse(first.begin(), first.end());
		string second = s.substr(start + half, end - start - half);
		string tail_first = tail.substr(0, 13 - half);
		string tail_second = tail.substr(13 - half, tail.size() + half - 13);
		reverse(tail_second.begin(), tail_second.end());
		cout << first + tail_first + "\n" + second + tail_second + "\n";
	}
	return 0;
}

#define _CRT_SECURE_NO_WARNINGS

#include <algorithm>
#include <iostream>
#include <iomanip>
#include <utility>
#include <cstring>
#include <cstdlib>
#include <cassert>
#include <fstream>
#include <string>
#include <vector>
#include <cstdio>
#include <cmath>
#include <queue>
#include <deque>
#include <ctime>
#include <stack>
#include <map>
#include <set>

using namespace std;

#define INF 1000000000000000000ll
#define inf 1000000000
#define mp make_pair
#define pb push_back
#define F first
#define S second
#define sz(v) (ll((v).size()))
#define forn(i,n) for(ll i=0;i<(n);++i)
#define forv(i,v) forn(i,sz(v))
#define fors(i,s) for(auto i=(s).begin();i!=(s).end();++i)
#define all(v) (v).begin(),(v).end()
typedef long long ll;
typedef unsigned long long ull;
typedef vector<ll> vll;
typedef vector<vll> Vll;
typedef vector<string> vstr;
typedef vector<vstr> Vstr;

ll n, posx, posy;
string s;
char ans[2][13];
map<char, vll> a;

int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);

	cin >> s;

	forv(i, s)
	{
		if (sz(a[s[i]]))
		{
			posx = a[s[i]][0];
			posy = i;
			s = s.substr(0, i) + s.substr(i + 1, sz(s));
			break;
		}

		a[s[i]].pb(i);

	}

	if (posy - posx == 1)
	{
		cout << "Impossible";
	}
	else
	{
		ll b = (posy - posx) / 2 + (posy - posx) % 2;

		if (b + posx <= 13)
		{
			ll j = 0;

			for (ll i = 13 - b - posx; i < 13; i++, j++)
			{
				ans[0][i] = s[j];
			}

			for (ll i = 12; i >= 0; i--, j++)
			{
				ans[1][i] = s[j];
			}

			for (ll i = 0; i < 13 - b - posx; i++, j++)
			{
				ans[0][i] = s[j];
			}
		}
		else
		{
			ll j = b + posx - 13;

			for (ll i = 0; i < 13; i++, j++)
			{
				ans[0][i] = s[j];
			}

			for (ll i = 12; i >= 0; i--, j++)
			{
				if (j > 25)
					j = 0;
				ans[1][i] = s[j];
			}
		}

		forn(i, 2)
		{
			forn(k, 13)
			{
				cout << ans[i][k];
			}
			cout << "\n";
		}
	}
}

/*Up-To-110H - Abdulloh Qudratullayev*/

#include<bits/stdc++.h>

using namespace std;

string s;
int len, x, y;
int bio[28];
string polje[2];

pair <int, int> pos(char a){
	for(int i = 0; i < 2; i++){
		for(int j = 0; j < 13; j++){
			if(polje[i][j] == a){
				return make_pair(i, j);
			}
		}
	}
}

int px[8] = {0, 0, 1, -1, 1, -1, 1, -1};
int py[8] = {1, -1, 0, 0, 1, -1, -1, 1};

int blizu(pair <int, int> p1, pair <int, int> p2){
	int x1 = p1.first, x2 = p2.first, y1 = p1.second, y2 = p2.second;
	//cout << x1 << ' ' << y1 << ' ' << x2 << ' ' << y2 << endl;
	for(int i = 0; i < 8; i++){
		if (x1 + px[i] == x2 && y1 + py[i] == y2){
			//cout << x1 + px[i] << ' ' << x2 << ' ' << y1 + py[i] << ' ' << y2 << endl;
			/*char bzv;
			cin >> bzv;*/
			return 1;
		}
	}
	return 0;
}

int dalje(char a, char b){
	pair <int, int> pos1 = pos(a);
	pair <int, int> pos2 = pos(b);
	//cout << a << " i " << b << ' ';
	if (blizu (pos1, pos2)){
		return 1;
	} else{
		return 0;
	}
}

int probaj(){
	for (int i = 0; i < len - 1; i++){
		if (!dalje(s[i], s[i + 1])){
			//cout << s[i] << ' ' << s[i + 1] << endl;
			return 0;
		}
	}
	return 1;
}

void rotiraj(){
	char zadnji = polje[0][12];
	char prvi = polje[1][0];
	for (int i = 12; i > 0; i--){
		polje[0][i] = polje[0][i - 1];
	}
	polje[0][0] = prvi;
	for (int i = 0; i < 12; i++){
		polje[1][i] = polje[1][i + 1];
	}
	polje[1][12] = zadnji;
}

int main(){
	cin >> s;
	len = s.size();
	x = 0;
	polje[0] = "";
	polje[1] = "";
	for (int i = 0; i < len; i++){
		if (!bio[s[i] - 'A']){
			bio[s[i] - 'A'] = 1;
			if (x < 13) {
				polje[0] = polje[0] + s[i];
				x++;
			} else{
				polje[1] = s[i] + polje[1];
			}
		}
	}

	//cout << polje[0] << endl << polje[1] << endl;
	int count = 0;
	while( !probaj() && count < 26){
		rotiraj();
		count++;
		//cout << polje[0] << endl << polje[1] << endl;
	}
	if (count == 26) {
		cout << "Impossible" << endl;
	} else {
		cout << polje[0] << endl << polje[1] << endl;
	}

	return 0;
}

/*
यत्र योगेश्वर: कृष्णो यत्र पार्थो धनुर्धर: |
तत्र श्रीर्विजयो भूतिध्रुवा नीतिर्मतिर्मम ||

सरस्वति नमस्तुभ्यं वरदे कामरूपिणि !
विद्यारम्भं करिष्यामि सिद्धिरभवतु मे सदा!!
*/

#include<bits/stdc++.h>
using namespace std;                                                            //        ███        ▄▄▄▄███▄▄▄▄
                                                                                //    ▀█████████▄  ▄██▀▀▀███▀▀▀██▄
#define pb push_back                                                            //       ▀███▀▀██  ███   ███   ███
#define mp make_pair                                                            //        ███   ▀  ███   ███   ███                                                                              //        ███      ███   ███   ███
#define sqr(a) ((a) * (a))                                                      //        ███      ███   ███   ███
#define io() ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);   //        ███      ███   ███   ███
#define co() cout.precision(10);                                                //       ▄████▀     ▀█   ███   █▀
#define F for(li i=0;i<n;i++)
#define fo(i,n) for(i=0;i<n;i++)
#define ne cout<<"\n";
#define test int t;cin>>t;while(t--)

typedef long long li;
typedef long double ld;

const li mod = 1000000007;

li mul(li a,li b) {
    return (1LL * a * b) % mod;
}

li add(li a,li b) {
    li s = (a+b);
    if (s>=mod) s-=mod;
    return s;
}

li sub(li a,li b) {
    li s = (a+mod-b);
    if (s>=mod) s-=mod;
    return s;
}

li po(li a,li deg)
{
    if (deg==0) return 1;
    if (deg%2==1) return mul(a, po(a, deg-1));
    li t = po(a, deg/2);
    return mul(t, t);
}

li inv(li n)
{
    return po(n,mod-2);
}

bool isPrime(li n)
{
    if (n <= 1)  return false;
    if (n <= 3)  return true;
    if (n%2 == 0 || n%3 == 0) return false;
    for (li i=5; i*i<=n; i=i+6)
        if(n%i == 0 || n%(i+2) == 0)
           return false;

    return true;
}

int main()
{
    io();co();
    string s;
    cin>>s;
    li i;
    for(i=0;i<s.length()-1;i++)
    {
        if(s[i]==s[i+1])
        {
            cout<<"Impossible\n";
            return 0;
        }
    }
    li a[100]={0},b=-1,c=0,d=0;
    i=0;
    for(i=0;i<s.length();i++)
    {
        a[s[i]]++;
        if(a[s[i]]==2)
        d=s[i];
    }
    i=0;
    for(i=0;i<s.length();i++)
    {
        if(s[i]==d && b==-1)
        b=i;
        else if(s[i]==d)
        c=i;
    }
    //cout<<b<<" "<<c;ne;
    li ans=c-b-1,an;an=ans;
    string str="",st="",ss="";
    str=str+s[b];
    ans=ans/2;
    for(i=1;i<=ans;i++)
    str+=s[b+i];
    for(i=an/2+1;i<=an;i++)
    st=s[b+i]+st;
    for(i=c+1;i<s[i];i++)
    ss=ss+s[i];
    for(i=0;i<b;i++)
    ss=ss+s[i];
    //cout<<st<<" "<<str<<" "<<ss<<" ";
    string sa="",sb="";
    sa=ss.substr(0,12-ans);
    sb=ss.substr(12-ans,ss.length()-(12-ans));
    reverse(sa.begin(),sa.end());
    //reverse(sb.begin(),sb.end());
    str=sa+str;
    st=sb+st;
    cout<<str<<"\n";
    cout<<st;
}

#define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <vector>
#include <algorithm>
#include <stack>
#include <map>
#include <functional>
#include <cstring>
#include <queue>
#include <cmath>
#include <deque>
#include <list>
#include <iomanip>
#include <fstream>
#include <string>
#include <iterator>
#include <set>
#include <bitset>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair <int, int> pii;
#define mp make_pair
#define pb push_back
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, N) FOR(i, 0, N)
#define SZ(x) ((int)(x).size())

const int MAXN = 27, Q = 20, INF = 1000000007;

int main()
{
	string s;
	char c, t, ans1[13], ans2[13];
	bool r = false, u = true;
	int cnt[MAXN], p, cur = 0, x;
	cin >> s;
	REP(i, SZ(s) - 1) if (s[i] == s[i + 1]){cout << "Impossible"; return 0;}
	memset(cnt, 0, 4*MAXN);
	REP(i, SZ(s)) ++cnt[s[i] - 'A'];
	REP(i, MAXN) if (cnt[i] == 2) c = i + 'A';
	while (s[0] != c){
		reverse(s.begin(), s.end());
		t = s[SZ(s) - 1]; s.pop_back();
		reverse(s.begin(), s.end());
		s.push_back(t);
	}
	FOR(i, 1, SZ(s)) if (s[i] == c) p = i;
	x = (p - 1) >> 1;
	while (cur < SZ(s)){
		if (x < 0){x = 0; u = false; r = !r;}
		if (x >= 13) {x = 12; u = false; r = !r;}
		if (cur == p) {x = (p - 1) >> 1; u = true; r = true;}
		if (u) ans1[x] = s[cur];
		else ans2[x] = s[cur];
		if (r) ++x;
		else --x;
		++cur;
	}
	REP(i, 13) cout << ans1[i];
	cout << endl;
	REP(i, 13) cout << ans2[i];
	//cout << endl; system("pause");
	return 0;
}//don't forget about const

#include <iostream>
#include <fstream>
#include <string>
#include <cstring>
#include <stdio.h>
#include <iomanip>
#include <math.h>
#include <vector>
#include<cctype>
#include<algorithm>
#include<set>
#include<stack>
#include<map>
#include<time.h>
#include<iterator>
#include <deque>
#include <sstream>
#include<queue>
#include<stdlib.h>
#include<bitset>
#include <utility>

#define fn(i,n) for(int (i) = 0;(i) < (n);(i)++)
#define f1n(i,n) for(int (i) = 1;(i) <= (n);(i)++)
#define mk(f,s) make_pair((f),(s))

#define defV(dp,e) memset(dp,e,sizeof dp)

#define ri(n) scanf("%d",&n)
#define rl(n) scanf("%lld",&n)
#define rs(s) scanf("%s",s)

#define PI acos(-1.0)

using namespace std;

typedef long long ll;
typedef pair<int ,int > pp;

typedef vector<int  > v1;
typedef vector<ll  > vl;
typedef vector<pp  > vpp;
typedef vector<bool  > vb;
typedef vector<char > vc;
typedef vector<v1 > v2;

typedef map<int ,int > mf;
typedef map<int ,vpp > mv;
typedef map<int ,v1 > ad;

int const oo = 1e9,bound = 1e6,mod = oo+7;
ll const OO=1e18;

char tile[2][26];
string s;
int app[26];
int main() {
//	freopen("o.txt","w",stdout);
//	freopen("in.txt","r",stdin);
//	ios::sync_with_stdio(0);cin.tie();
	cin>>s;
	defV(app,-1);
	int ed=-1,cr;
	fn(i,s.size()){
		if(i<s.size()-1&&s[i]==s[i+1]){
			cout<<"Impossible\n";
			return 0;
		}
		if(app[s[i]-'A']==-1){
			app[s[i]-'A']=i;
		}else {
			ed=i;
			cr=s[i]-'A';
			break;
		}

	}
	int i=0,j=13-(ed-app[cr]+1)/2,fl=0,idx=app[cr],dir=1;
	while(fl<26){
		tile[i][j]=s[idx];
		idx=(idx+1)%27;
		j+=dir;
		fl++;
		if(j==13)j=12,i=1,dir=-1;
		if(j==-1)j=0,i=0,dir=1;
		if(s[idx]-'A'==cr)idx=(idx+1)%27;
	}
	fn(i,2){
		fn(j,13)cout<<tile[i][j];
		cout<<endl;
	}
	return 0;
}

#include <bits/stdc++.h>
#define inf 4611686018427387904
using namespace std;

string s;
vector <char> ans[2];
int apr[26];
int range = 0, pos;

void solve1()
{
  int first = pos + range - 13 + 1;
  for (int i = first; i < first + 13; ++i)
    ans[0].push_back(s[i]);
  for (int i = 0; i < first; ++i)
    ans[1].push_back(s[first - i - 1]);
  for (int i = 26; first <= 13; --i, ++first)
    if (s[i] != s[pos]) ans[1].push_back(s[i]);
}

void solve2()
{
  int first = pos + range - 13 + 1;
  for (int i = 26 + first + 1; i <= 26; ++i)
    ans[0].push_back(s[i]);
  for (int i = 0; i < 13; ++i)
    ans[0].push_back(s[i]);
  for (int i = 26 + first; ans[1].size() < 13; --i)
    if (s[i] != s[pos]) ans[1].push_back(s[i]);
}

int main()
{
  #ifndef ONLINE_JUDGE
  freopen("inp.txt", "r", stdin);
  #endif // ONLINE_JUDGE
  cin >> s;
  memset(apr, -1, sizeof(apr));
  for (int i = 0; i < s.size(); ++i)
  {
    if (apr[s[i] - 'A'] >= 0)
    {
      range = i - apr[s[i] - 'A'];
      pos = apr[s[i] - 'A'];
      break;
    }
    apr[s[i] - 'A'] = i;
  }
  if (range < 2)
  {
    cout << "Impossible";
    return 0;
  }
  range = (range - 1)/2;
  if (pos + range >= 12) solve1();
  else solve2();
  for (int i = 0; i < 2; ++i, cout << endl)
    for (int j = 0; j < 13; ++j)
      cout << ans[i][j];
}

#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
const int MAX_N=27;
char s[MAX_N];
int a[MAX_N];
char ans[2][13];
int main()
{
	//freopen("input.txt","r",stdin);
	//freopen("output.txt","w",stdout);
	int x=0,d=0,p;
	for (int i=0;i<MAX_N;i++)
	{
		cin>>s[i];
		a[s[i]-'A']++;
		if (a[s[i]-'A']==2)
			x=s[i]-'A';
	}
	for (int i=0;i<MAX_N;i++)
	{
		if (s[i]-'A'==x)
		{
			p=i;
			for (int j=i+1;j<MAX_N;j++)
			{
				if (s[j]-'A'==x)
					break;
				d++;
			}
			break;
		}
	}
	if (d==0)
	{
		cout<<"Impossible";
		return 0;
	}
	int y=12-d/2,b=p;
	for (p;p<MAX_N;p++)
	{
		if (y==13)
		{
			y=12;
			for (p;p<MAX_N;p++)
			{
				if (s[p]-'A'!=x)
				{
					ans[1][y]=s[p];
					y--;
					if (y==-1)
					{
						y=0;
						for (p=p+1;p<MAX_N;p++)
						{
							if (s[p]-'A'!=x)
							{
								ans[0][y]=s[p];
								y++;
							}
						}
						break;
					}
				}
			}
			break;
		}
		ans[0][y]=s[p];
		y++;
	}
	y=12-d/2;
	for (p=b-1;p>=0;p--)
	{
		y--;
		if (y==-1)
		{
			y=0;
			for (p;p>=0;p--)
			{
				ans[1][y]=s[p];
				y++;
				if (y==13)
				{
					y=12;
					for (p=p-1;p>=0;p--)
					{
						ans[0][y]=s[p];
						y--;
					}
					break;
				}
			}
			break;
		}
		ans[0][y]=s[p];
	}
	for (int i=0;i<2;i++)
	{
		for (int j=0;j<13;j++)
			cout<<ans[i][j];
		cout<<endl;
	}
	return 0;
}

#include <bits/stdc++.h>
using namespace std;
int n = 13;
char str[50];
int l,r;
char ans[2][20];
int nx[]={0,-1,0,1};
int ny[]={1,0,-1,0};
bool can(int a,int b)
{
	if(a<0 || a>1 || b<0 || b>12) return false;
	if(ans[a][b] != '\0') return false;
	return true;
}
bool solve()
{
	if(l==r-1) return false;
	int num = (r-l) >> 1;
	num += l-1;
	int x = 1, y = n - num;
	y-=2;
	if((r-l)&1) y--;
	int ty = 0;
	for(int i = 0; i < 27; i++)
	{
		if(i==l)
		{
			x += nx[ty];
			y += ny[ty];
			ans[x][y] = str[i];
			continue;
		}
		if(i==r) continue;
		while(!can(x+nx[ty],y+ny[ty])) ty = (ty+1)%4;
		x += nx[ty];
		y += ny[ty];
		ans[x][y] = str[i];
//		printf("%d %d %d\n",i,x,y);
	}
	printf("%s\n",ans[0]);
	printf("%s\n",ans[1]);
	return true;
}
int main()
{
	cin>>str;
	for(int i = 0; i < 27; i++)
		for(int j = i+1; j < 27; j++)
			if(str[i]==str[j]) l = i, r = j;
	if(l > 26-r)
	{
		for(int i = 0; i < 13; i++)
			swap(str[i],str[26-i]);
		int tl = l, tr = r;
		l = 26-tr;
		r = 26-tl;
	}
	if(!solve()) printf("Impossible\n");
	return 0;
}

#include <bits/stdc++.h>
using namespace std;
const int N = 30;
char a[N];
char out[N];
int cnt[N];

int main() {
    memset(out, '*', sizeof out);
    memset(cnt, 0, sizeof cnt);
    int p, q, r;
    char tar = 0;
    scanf("%s", a);
    for (int i = 0; i < 27; ++i) {
        cnt[a[i]-'A']++;
        if (cnt[a[i]-'A']>1) {
            tar = a[i];
            break;
        }
    }
    for (int i = 0; i < 27; ++i) if (a[i] == tar) {
        p = i;
        break;
    }
    for (int i = 26; i >= 0; --i) if (a[i] == tar) {
        q = i;
        break;
    }
    if (p + 1 == q) {
        puts("Impossible");
        return 0;
    }
    r = p + (q - p - 1) / 2;
    // printf("%d %d\n", p, q);
    //
    if (r >= 13) {
        reverse(a, a + 27);
        p = 26 - p; q = 26 - q;
        swap(p, q);
        r = p + (q - p - 1) / 2;
    }
    // printf("%d %d %d\n", p, q, r);
    //
    int shift = (q - p) & 1;
    // printf("%d %d %d %d\n", p, q, r, shift);
    for (int i = 0; i < p; ++i) out[12 - r + i + shift] = a[i];
    for (int i = p; i <= r; ++i) out[25 - r + i] = a[i];
    for (int i = r + 1; i < q; ++i) out[13 - i + r] = a[i];
    for (int i = q + 1; i < 15 + r - shift; ++i) out[26 + r - i + (!shift)] = a[i];
    for (int i = 15 + r - shift; i < 27; ++i) out[i - 15 - r + shift] = a[i];

    //
    for (int i = 0; i < 13; ++i) printf("%c", out[i]);
    puts("");
    for (int i = 13; i < 26; ++i) printf("%c", out[i]);
    puts("");

    return 0;
}

/*
ABCDEFGHIJKLMNOPQRGSTUVWXYZ

*ABCDEFSRQPON 12
******GHIJKLM 25

ABCDEFGHIJKLMNOPQRSGTUVWXYZ
      ^     ^      ^
      p     r      q
p = 6; q = 19; r = 12;

XTSHBGLRJAMDUIPCWYOZVERNKQF
FQKNREVZOYWCPIUDMAJRLGBHSTX
LCFNHUQWXBPOSJMYTGKDAZVREIF
*/

#include <iostream>
#include <string>
using namespace std;
char pat[3][24];
int main(){
    string s;
    cin>>s;
    int a[32]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
    char c='l';
    for(int i=0;i<27;i++){
        a[s[i]-'A']++;
        if(a[s[i]-'A']==2)
            c=s[i];
    }
    //   cout<<c<<endl;
    int k=-1,j=-1;
    for(int i=0;i<27;i++){
        if(s[i]==c){
            if(k==-1)
                k=i;
            else
                j=i;
        }
    }
    if(j-k==1){
        cout<<"Impossible"<<endl;
        return 0;
    }
    int l=(j-k-1)/2;
    int p=k;
    int ch=0;
    for(int i=13-l-1;i<13;i++){
        pat[1][i]=s[p];
        p++;
        ch++;
    }
    int i=12;
    while(p<27 && i>=0){
        if(s[p]==c)
            p++;
        if(p>=27)
            break;
        pat[2][i]=s[p];
        p++;
        i--;
        ch++;
    }
    if(p>=27){
        int t=0;
        while(i>=0){
            pat[2][i]=s[t];
            i--;
            t++;
            ch++;
        }
        for(i=0;t<27;i++){
            if(pat[1][i]==c)
                break;
            pat[1][i]=s[t];
            t++;
            ch++;
        }
    }
    else{
        i=-1;
        while(p<27){
            i++;
            pat[1][i]=s[p];
            p++;
            ch++;
        }
        p=0;
        while(ch<26){
            i++;
            pat[1][i]=s[p];
            p++;
            ch++;
        }
    }
    for(int i=1;i<=2;i++){
        for(int j=0;j<13;j++)
            cout<<pat[i][j];
        cout<<endl;
    }
    return 0;
}/*
  ABCDEFGHIJKLMNOPQRSTUVWXYZA
  ABCDEFHIGJKLMNOPQRSGTUVWXYZ
  ABCDEFGHIJKLMNOPQRSGTUVWXYZ
  ABCDEFGHIJKLMNOPQRSTUVWXAYZ
  */

#pragma comment(linker, "/STACK:36777216")
#include <iostream>
#include <vector>
#include <queue>
#include <cmath>
#include <cstring>
#include <set>
#include <map>
#include <fstream>
#include <string>
#include <stack>
#include <deque>
#include <algorithm>
#include <random>
#include <ctime>
#include <sstream>
#include <functional>
using namespace std;

#define all(x) x.begin(), x.end()

using ll = long long;
using ull = unsigned long long;
using intpair = pair<int, int>;
using llpair = pair<ll, ll>;
using ld = long double;
using vint = vector<int>;

ll N, M, K;
string S, T;

int was[26];

int main()
{
	ios_base::sync_with_stdio(0);

	cin >> S;
	int dupB;
	char dupC;
	int shift = 0;
	for (int i = 0; i < S.length(); ++i)
	{
		S[i + shift] = S[i];
		if (was[S[i] - 'A'])
		{
			dupC = S[i];
			dupB = i;
			shift = -1;
		}
		else
			was[S[i] - 'A'] = i + 1;
	}
	S.pop_back();

	int dupA = was[dupC - 'A'] - 1;

	if (dupB - dupA == 1)
	{
		cout << "Impossible\n";
		return 0;
	}

	int hloop = (dupA + dupB) / 2 + (dupB - dupA) % 2;

	if (hloop > 13)
		rotate(S.begin(), S.begin() + (hloop - 13), S.end());
	else
		rotate(S.begin(), S.begin() + (S.length() + hloop - 13), S.end());

	reverse(S.begin() + 13, S.end());

	cout << S.substr(0, 13) << "\n" << S.substr(13, 26) << endl;

	return 0;
}

#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()

#define FIO ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);

#define mod 1000000007
#define inf 1e18

ll expo(ll x,ll n)
{
    if(n==0)
        return 1;
    else if(n%2 == 0)
        return expo((x*x)%mod,n/2);
    else
        return (x*expo((x*x)%mod,(n-1)/2))%mod;
}

int main()
{
	FIO

	string s;
	cin>>s;

	map<char,ll> mp;
	ll d,pos;
	for(ll i=0;i<27;i++)
	{
	    if(mp.find(s[i])!=mp.end())
	    {
	        pos=mp[s[i]];
	        d=i-mp[s[i]];
	        break;
	    }
	    mp[s[i]]=i;
	}
	if(d==1)
	{
	    cout<<"Impossible";
	    return 0;
	}
	d--;
	ll cc= d/2;
	vector<char> s1(13),s2(13);

    ll init=pos;
    if((init+cc+1)<=13)
    {
        ll st=13 - init - cc - 1;
        ll j=0;
        for(ll i=st;i<13;i++)
        {
            s1[i]=s[j];
            j++;
        }

        for(ll i=12;i>=0;i--)
        {
            if(s[j]==s[pos])
            {
                i++;
            }
            else{
                s2[i]=s[j];
            }
            j++;
        }

        for(ll i=0;i<st;i++)
        {
            s1[i]=s[j];
            j++;
        }
    }
    else{
        ll st=init + cc - 13;

        ll j=0;

        for(ll i=st;i>=0;i--)
        {
            s2[i]=s[j];
            j++;
        }

        for(ll i=0;i<13;i++)
        {
            s1[i]=s[j];
            j++;
        }

        for(ll i=12;i>st;i--)
        {
            if(s[j]==s[pos])
            {
                i++;
            }
            else{
                s2[i]=s[j];
            }
            j++;
        }
    }
    string ans1="",ans2="";

    for(ll i=0;i<13;i++)
    {
        ans1+=s1[i];
        ans2+=s2[i];
    }

    cout<<ans1<<endl<<ans2;

}

#include <iostream>
#include <vector>
#include <cstring>
#include <string>
#include <algorithm>
#include <iomanip>
#include <cmath>
#include <cassert>
#include <map>
#include <set>
using namespace std;
typedef pair<int, int> P;

char b[2][13];
int dx[4] = { 1, 0, -1, 0 }, dy[4] = { 0, 1, 0, -1 };

bool in(int x, int y) {
	return 0 <= x  && x < 13 && 0 <= y && y < 2;
}

bool adj(int x1, int y1, int x2, int y2) {
	if(x1 == x2 && y1 == y2) return false;
	return abs(x1 - x2) <= 1 && abs(y1 - y2) <= 1;
}

vector<int> p[26];

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);

	string s;
	cin >> s;

	int c = -1, d = -1;
	for(int i = 0; i < 27; i++) {
		int k = s[i] - 'A';
		p[k].push_back(i);
		if(p[k].size() == 2) {
			c = k;
			d = abs(p[c][0] - p[c][1]);
			if(d == 1) {
				cout << "Impossible" << endl;
				return 0;
			}
		}
	}

	map<int, P> pos;
	int cnt = 0;
	for(int i = 12; i >= 0; i--) {
		pos[cnt++] = P(0, i);
	}
	for(int i = 0; i < 13; i++) {
		pos[cnt++] = P(1, i);
	}

	int n = p[c][0], t = 12 - (d - 1) / 2;
	for(int i = 0; i < 27; i++) {
		int x = pos[t].second, y = pos[t].first;
		if(p[c][1] != n) {
			b[y][x] = s[n];
			t = (t + 1) % 26;
		}
		n = (n + 1) % 27;
	}

	for(int i = 0; i < 2; i++) {
		for(int j = 0; j < 13; j++) {
			cout << b[i][j];
		}
		cout << endl;
	}

}

// rc.cpp
//

#include <assert.h>
#include <time.h>
#include <math.h>
#include <string.h>

#include <iterator>
#include <fstream>
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <list>
#include <stack>
#include <queue>
#include <algorithm>
#include <numeric>
#include <functional>

using namespace std;

#define PI 3.1415926535897932384626433832795
#define EPS 1E-7

typedef unsigned char uchar;
typedef unsigned int uint;
typedef unsigned long long uint64;
typedef long long sint64;

char s[28];

uint q[26];

void rot(uint x)
{
	for (uint i = 0; i < x; ++i)
	{
		char g = s[0];
		for (uint j = 1; j < 26; ++j)
			s[j - 1] = s[j];
		s[25] = g;
	}
}

int main(int argc, char* argv[])
{
	cin >> s;

	uint v[2];

	for (uint i = 0; i < 27; ++i)
	{
		uint ix = s[i] - 'A';
		if (q[ix])
		{
			v[0] = q[ix] - 1;
			v[1] = i;
		}
		else
			q[ix] = i + 1;
	}

	if (v[1] - v[0] == 1)
		cout << "Impossible\n";
	else
	{
		uint d = 13 - (v[1] - v[0] + 1) / 2;
		strcpy(s + v[1], s + v[1] + 1);

		if (d < v[0])
			rot(v[0] - d);
		else
			rot(26 - d + v[0]);

		char g = s[13];
		s[13] = 0;
		cout << s << endl;
		s[13] = g;
		reverse(s + 13, s + 26);
		cout << s + 13 << endl;
	}

	return 0;
}

// re
#include <string>
#include <iostream>
#include <map>
using namespace std;

int main() {
	// your code goes here
//	freopen ("in.txt", "r", stdin);
	string s;
	cin>>s;
	char rep = 0;
	map <char, int> vis;
	for (int i=0; i<26; i++) {
		if (s[i] == s[i+1]) {
			cout<<"Impossible\n";
			return 0;
		}
		if (vis.count (s[i]) > 0) rep = s[i];
		vis [s[i]] = 1;
	}
	if (rep == 0) rep = s[26];
	int beg = -1, end = -1;
	for (int i=0; i<27; i++) {
		if (s[i] == rep) {
			if (beg == -1) beg = i;
			else end = i;
		}
	}
//	cout<<beg<<" "<<end<<endl;
	int tot_cnt = 1;
	char grid[2][13];
	int diff = end - beg;
	grid[0][ 12 - ((diff - 1) / 2)] = rep;

	int it = beg;
	int i = 0, j = 12 - ((diff - 1) / 2);
	while (j + 1 < 13) {
		j++;
		it++;
		grid[i][j] = s[it];
		tot_cnt++;
	}
	it++;
	i++;
	while (it < end) {
		grid[i][j] = s[it];
		tot_cnt++;
		it++;
		j--;
	}
	i = 0;
	j = 12 - ((diff - 1) / 2);
	it++;
	if (it == 27) it = 0;
	while (j >= 1) {
		j--;
		grid[i][j] = s[it];
		tot_cnt++;
		it++;
		if (it == 27) it = 0;
	}
	i++;

	while (tot_cnt < 26) {
		grid[i][j] = s[it];
		tot_cnt++;
		it++;
		if (it == 27) it = 0;
		j++;
	}

	// print
	for (int i=0; i < 2; i++) {
		for (int j=0; j<13; j++) {
			cout<<grid[i][j];
		}
		cout<<endl;
	}
	return 0;
}

#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <string>
#include <set>
#include <queue>
#include <map>
#include <math.h>
#include <stack>
#include <sstream>

using namespace std;

#define ll long long
#define pii pair<ll, ll>
#define endl "\n"
#define mp make_pair
#define pll pair<ll,ll>
#define flush cout.flush();
#define y1 asdskdjgsasdasd123
#define x1 sdkjfksdasdjfk
#define y2 sdkjfks123
#define x2 skaaaasd
/*
#include <fstream>
ifstream in("input.txt");
ofstream out("output.txt");

#define cin in
#define cout out
/**/

int x[6] = {4,5,6,3,2,1};

int main()
{
    ios_base::sync_with_stdio(0);
    cout.precision(9);
    cout << fixed;

    string s;
    cin >> s;

    char c;

    vector<int> a(27, 0);
    for (int i = 0; i < 27; ++i)
       a[s[i] - 'A']++;
    for (int i = 0; i < 27; ++i)
        if (a[i] == 2)
            c = char('A' + i);

    int first = -1, second = -1;

    for (int i = 0; i < 27; ++i)
    {
        if (s[i] != c)
            continue;
        if (first == -1)
        {
            first = i;
            continue;
        }
        second = i;
    }
    int len = second - first;
    if (len == 1)
    {
        cout << "Impossible" << endl;
        return 0;
    }

    string ss(13, 'a');
    vector<string> ans(2, ss);

    int pos = 13 - (len - len / 2);
    int i;
    for (i = first; pos < 13; ++i, ++pos)
        ans[1][pos] = s[i];

    pos = 12;
    for (; i < second; ++i, --pos)
        ans[0][pos] = s[i];

    int x = 0;
    int delta = -1;
    ++i;
    while (i < 27)
    {
        if (pos == -1 && x == 0)
        {
            x = 1;
            pos = 0;
            delta = 1;
            continue;
        }
        ans[x][pos] = s[i];
        pos += delta;
        ++i;
    }
    i =0;
    while (i < first)
    {
        if (pos == -1 && x == 0)
        {
            x = 1;
            pos = 0;
            delta = 1;
            continue;
        }
        ans[x][pos] = s[i];
        pos += delta;
        ++i;
    }

    std::cout << ans[0] << "\n" <<ans[1] << "\n";

    return 0;
}

/*
	Author: Luis Manuel Díaz Barón (LUISMO)
	Problem:
	Online Judge: COJ
	Idea:
*/
#include<bits/stdc++.h>
// Types
#define ll long long
#define ull unsigned long long
// IO
#define sf scanf
#define pf printf

using namespace std;

const int lim = 1e2 + 7;

string str;

vector<int> adj[lim];

struct pp
{
    int X, Y;
    pp(){}
    pp(int xx, int yy){X = xx; Y = yy;}
};

int alph[26];
bool markAlph[26];

int mt[2][13];
bool mark[2][13];

bool valid(int x, int y)
{
    return x >= 0 && x < 2 && y >= 0 && y < 13;
}

pp next1(int x, int y)
{
    // if can go to the left
        if(valid(x, y - 1) && mark[x][y - 1] == 0)
            return pp(x, y - 1);

        // if can go up
        if(valid(x - 1, y) && mark[x - 1][y] == 0)
            return pp(x - 1, y);

        // ifcan go to the right
        if(valid(x, y + 1) && mark[x][y + 1] == 0)
            return pp(x, y + 1);

    return pp(-1, -1);
}

pp next2(int x, int y)
{
    // ifcan go to the right
        if(valid(x, y + 1) && mark[x][y + 1] == 0)
            return pp(x, y + 1);

    // if can go up
        if(valid(x - 1, y) && mark[x - 1][y] == 0)
            return pp(x - 1, y);

    // if can go to the left
        if(valid(x, y - 1) && mark[x][y - 1] == 0)
            return pp(x, y - 1);
}

void solve()
{
    cin >> str;

    bool flag = true;
    int rep = -1;
    int dist = 0;
    for(int i = 0; i < str.length(); i++)
    {
        int idx = str[i] - 'A';
        if(markAlph[idx] == true)
        {
            dist = i - alph[idx];
            rep = idx;
        }
        else
        {
            alph[idx] = i;
            markAlph[idx] = true;
        }
    }

    if(dist <= 1)
    {
        cout << "Impossible\n";
        return;
    }

    else
    {
        if(dist == 26)
        {
            for(int i = 0; i < 13; i++)
                mt[0][i] = str[i] - 'A';

            for(int i = 0; i < 14; i++)
                mt[1][13 - i] = str[i + 12] - 'A';
        }
        else
        {
            int startPositionX = 0;
            int startPositionY = (dist-1) >> 1;

            mt[startPositionX][startPositionY] = rep;
            mark[startPositionX][startPositionY] = true;
            // print the cycle
            int x = startPositionX + 1;
            int y = startPositionY;
            if(dist % 2 == 1)
                y--;

            // printing the cycle
            for(int i = alph[rep] + 1; i - alph[rep] <= dist; i++)
            {
                mt[x][y] = str[i] - 'A';
                mark[x][y] = true;
                pp aux = next1(x, y);
                x = aux.X;
                y = aux.Y;
            }

            x = startPositionX + 1;
            y = startPositionY;
            if(dist % 2 == 0)
                y++;
            // printing the first part of the word
            for(int i = alph[rep] - 1; i >= 0; i--)
            {
                mt[x][y] = str[i] - 'A';
                mark[x][y] = true;
                pp aux = next2(x, y);
                x = aux.X;
                y = aux.Y;
            }

            // the last paert
            for(int i = str.length() - 1; i >= alph[rep] + dist + 1; i--)
            {
                mt[x][y] = str[i] - 'A';
                mark[x][y] = true;
                pp aux = next2(x, y);
                x = aux.X;
                y = aux.Y;
            }
        }

    }

    for(int i = 0; i < 2; i++)
    {
        for(int j = 0; j < 13; j++)
            cout << (char)('A' + mt[i][j]);
        cout << endl;
    }
}

int main()
{
	if(fopen("d:\\lmo.in","r") != NULL)
	{
		freopen("d:\\lmo.in","r",stdin);
	}
	else if(fopen("/media/luismo/Pablo's Destruction/lmo.in","r") != NULL)
	{
		freopen("/media/luismo/Pablo's Destruction/lmo.in", "r", stdin);
	}

	cin.sync_with_stdio(false);
	cin.tie(0);

	solve();
}

#include <bits/stdc++.h>
#define fi first
#define se second
using namespace std;

using ll = long long;

void no() {
    puts("Impossible");
    exit(0);
}

vector<string> a;

void next(int& i, int& j) {
    if (i == 0) {
        if (j + 1 != 13 || a[i][j + 1] == '.') {
            ++j;
        } else if (j + 1 == 13) {
            ++i;
        }
    } else {
        --j;
        if (j == -1) {
            i = 0;
            j = 0;
        }
    }
}

void prev(int& i, int& j) {
    if (i == 0) {
        if (j - 1 != -1 || a[i][j - 1] == '.') {
            --j;
        } else if (j - 1 == -1) {
            ++i;
        }
    } else {
        ++j;
        if (j == 13) {
            i = 0;
            j = 12;
        }
    }
}

int main() {
    string s;
    cin >> s;

    for (int i = 1; i < s.size(); i++) {
        if (s[i] == s[i - 1]) no();
    }

    map<char, int> got;
    int p1, p2;
    for (int i = 0; i < s.size(); i++) {
        if (got.find(s[i]) != got.end()) {
            p2 = i;
            p1 = got[s[i]];
            break;
        } else {
            got[s[i]] = i;
        }
    }

    a.resize(2, string(13, '.'));
    if (p2 - p1 > 13) {
        int len = 26 - (p2 - p1);
        int pos = len / 2;

        a[0][pos] = s[p1];

        int posi = 0, posj = pos;
        for (int i = (p2 + 1) % 27; i != p2; i = (i + 1) % 27) {
            if (i == p1) continue;
            prev(posi, posj);
            a[posi][posj] = s[i];
        }
    } else {
        int len = p2 - p1 - 1;
        int pos = len / 2;

        a[0][pos] = s[p1];
        int posi = 0, posj = pos;
        for (int i = (p2 + 1) % 27; i != p2; i = (i + 1) % 27) {
            if (i == p1) continue;
            next(posi, posj);
            a[posi][posj] = s[i];
        }
    }

    cout << a[0] << '\n' << a[1] << '\n';
}

#include <bits/stdc++.h>

#define ll long long
#define pb push_back
#define mp make_pair
#define fs first
#define sec second
#define N 100005
#define M 1000005

using namespace std;

typedef pair<int,int> ii;
typedef pair<ll,ll> lii;
typedef vector<int> vi;
typedef vector<ii> vii;
const double pi = acos(-1);

string s;
char t[2][15] , test[2][15] , c;
int f[500];
bool ok;

bool valid(int i , int j) {
      return i < 2 && i >= 0 && j >= 0 && j < 13;
}
void rotate() {
      for(int i = 0; i < 13; ++i) {
            test[0][i] = t[0][i];
            test[1][i] = t[1][i];
      }

      char temp1 = t[0][12];
      char temp2 = t[1][0];
      for(int i = 1; i < 13; ++i)
            t[0][i] = test[0][i-1];
      for(int i = 11; i >= 0; --i)
            t[1][i] = test[1][i+1];
      t[1][12] = temp1;
      t[0][0] = temp2;
}

bool check() {

      int dx[] = {1 , 1 , 0 , -1 , -1 , -1 , 0 , 1};
      int dy[] = {0 , 1 , 1 , 1 , 0 , -1 , -1 , -1};
      ii pos;
      for(int i = 0; i < 13; ++i) {
            if(t[0][i] == s[0]) {
                  pos = mp(0 , i);
                  break;
            }
            else if(t[1][i] == s[0]) {
                  pos = mp(1 , i);
                  break;
            }
      }
      int cnt = 0 , n = 1;
      while(1) {
            if(n >= 27)
                  return true;

            ok = 0;
            for(int i = 0; i < 8; ++i) {
                  int nx = pos.fs + dx[i] , ny = pos.sec + dy[i];
                  if(!valid(nx , ny) || t[nx][ny] != s[n])
                        continue;
                  else {
                        ok = 1;
                        pos.fs = nx;
                        pos.sec = ny;
                        ++n;
                  }
            }
            if(!ok)
                  return false;
      }
}
int main() {
      #ifndef ONLINE_JUDGE
            freopen("in.in", "r", stdin);
            freopen("out.in", "w", stdout);
      #endif
      cin >> s;
      for(int i = 0; i < 27; ++i) {
            f[s[i]]++;
            if(f[s[i]] == 2) {
                  c = s[i];
                  break;
            }
      }
      for(int i = 1; i < 27; ++i)
            if(s[i] == s[i-1])
                  return puts("Impossible") , 0;
      int n = 0;
      bool k = 0;
      for(int i = 0; i < 13; ++i) {
            if(k && s[n] == c) {
                  --i;
                  n++;
                  continue;
            }
            t[0][i] = s[n];
            if(t[0][i] == c)
                  k = 1;
            ++n;
      }
      for(int i = 12; i >= 0; --i) {
            if(k && s[n] == c) {
                  ++i;
                  n++;
                  continue;
            }
            t[1][i] = s[n];
            if(t[1][i] == c)
                  k = 1;
            ++n;
      }

      while(!check())
            rotate();

      cout << t[0] << endl;
      cout << t[1] << endl;

      return 0;
}

#include <iostream>
#include <cstdio>

const int MAX_C=100;

char buf[MAX_C],ans[2][14];
int pos[26];

int main() {
	for(int i=0;i<26;++i) pos[i]=-1;
	scanf("%s",buf);
	for(int i=0;i<27;++i) {
		int cur=buf[i]-'A';
		if(pos[cur]==-1) pos[cur]=i;
		else {
			//printf("Circle At %d %d\n",pos[cur],i);
			//	circle found
			//	a = 0 ~ pos[cur]-1
			//	i = pos[cur]
			//	b = pos[cur]+1 ~ i-1
			//	j = i
			//	c = i+1 ~ 26
			if(i==pos[cur]+1) {
				printf("Impossible\n");
				break;
			}
			int bu_len=(i-pos[cur]+1)>>1, bd_len=(i-pos[cur])-bu_len;
			int bi=pos[cur]+bu_len-1, fi=12;	//	buf index, fill index
			bool flag=true;
			do {
				ans[flag?0:1][fi]=buf[bi];
				--bi;
				if(flag) {
					--fi;
					if(fi<0) {
						fi=0;
						flag=false;
					}
				}
				else {
					++fi;
				}
			}while(bi>=0);

			bi=pos[cur]+bu_len, fi=12;
			flag=true;
			do {
				if(bi==i) {
					++bi;
					if(bi==27) break;
				}
				ans[flag?1:0][fi]=buf[bi];
				++bi;
				if(flag) {
					--fi;
					if(fi<0) {
						fi=0;
						flag=false;
					}
				}
				else {
					++fi;
				}
			}while(bi!=27);
			//printf("Len = %d %d\n",bu_len, bd_len);
			/*for(int i=0;i<13-bu_len;++i) ans[0][i]=buf[pos[cur]-(13-bu_len)+i];
			for(int i=0;i<pos[cur]-(13-bu_len);++i) ans[1][pos[cur]-(13-bu_len)-i-1]=buf[i];
			for(int i=0;i<bu_len;++i) ans[0][13-bu_len+i]=buf[pos[cur]+i];
			for(int i=0;i<bd_len;++i) ans[1][12-i]=buf[pos[cur]+bu_len+i];
			for(int i=0;i<13-bd_len;++i) ans[1][12-bd_len-i]=buf[pos[cur]+bu_len+bd_len+i+1];
			for(int i=0;i<)*/
			ans[0][13]=ans[1][13]=0;
			printf("%s\n%s\n",ans[0],ans[1]);
			break;
		}
	}
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define endl "\n"
#define F first
#define S second
#define mod 1000000007
#define pb push_back
#define FOR(i,a,n) for(ll i=a;i<n;i++)
#define all(a) a.begin(),a.end()
const int NUM = 2e5 + 5;

int main(){
    ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    int num_tests=1;
    //cin>>num_tests;
    while(num_tests-->0){
        string s; cin >> s;
        int n = 27;
        FOR(i,0,26){
            if(s[i]==s[i+1]){
                cout<<"IMPOSSIBLE"; return 0;
            }
        }
        map<char,vector<ll>> done;
        FOR(i,0,27){
            done[s[i]].pb(i);
        }
        int a,b;
        for(auto x:done){
            if(x.S.size()==2){
                a = x.S[0];
                b = x.S[1];
            }
        }
        int mid;
        if((b-a)%2==0) mid = (a+b)/2;
        else mid = (a+b)/2+1;
        string ans1="",ans2="",ans3="",ans4="";
        FOR(i,a,mid) ans2+=s[i];
        FOR(i,mid,b) ans3+=s[i];
        reverse(all(ans3));
        string note="";
        FOR(i,b+1,n) note+=s[i];
        FOR(i,0,a) note+=s[i];
        FOR(i,0,note.size()/2) ans1+=note[i];
        reverse(all(ans1));
        FOR(i,note.size()/2,note.size()) ans4+=note[i];
        cout<<ans1<<ans2<<endl;
        cout<<ans4<<ans3;
    }
}

#include <bits/stdc++.h>
using namespace std;
void def1(){
#define elf else if
#define sz size()
#define lth length()
#define pb push_back
#define beg begin()
#define end end()
}
void def2(){
#define ld long double
#define ll long long
#define rbeg rbegin()
#define rbeg rbegin()
#define rend rend()
#define sp setprecision(10) << fixed
#define one first
#define too second
#define ss stringstream
#define umap unordered_map
#define res top << endl << low; return 0;
}

int main(){

    string s; cin >> s;

    for(int i = 0; i < 25; ++i)
        if(s[i] == s[i + 1]){
            cout << "Impossible";
            return 0;
        }

    umap<char, int> repet;
    char seek, prev;
    for(int i = 0; i < 27; ++i){
        repet[s[i]] ++;
        if(repet[s[i]] == 2){
            seek = s[i];
            prev = s[i - 1];
            s.erase(i, 1);
            break;
        }
    }

    for(int i = 0; i < 26; ++i){
        string top = s.substr(0, 13);
        string low = s.substr(13, 13);
        reverse(low.beg, low.end);

        int l_prev = low.find(prev),
            t_prev = top.find(prev),
            l_seek = low.find(seek),
            t_seek = top.find(seek),
            np = string::npos;

        if((t_prev == l_seek || t_prev == (l_seek - 1))
            && (t_prev > -1 && l_seek > -1))
            {cout << res;}
        elf((l_prev == t_seek || l_prev == (t_seek + 1))
            && (l_prev > -1 && t_seek > -1))
            {cout << res;}

        rotate(s.rbeg, s.rbeg + 1, s.rend);
    }
    cout << "Impossible";
}

#include <iostream>
using namespace std;

#define per(i, a, b) for(int (i) = (a); (i) < (b); (i) += 1)
#define Per(i, a, b) for((i) = (a); (i) < (b); (i) += 1)
#define rep(i, a, b) for(int (i) = (a); (i) > (b); (i) -= 1)
#define Rep(i, a, b) for((i) = (a); (i) > (b); (i) -= 1)
#define abs(a) ((a) < 0 ? -(a) : (a))
#define min(a, b) ((a) < (b) ? (a) : (b))
#define ol cout << endl
#define o(a) cout << (a)
#define o_(a) cout << (a) << " "
#define oo(a) cout << (a) << endl
#define g(a) cin >> (a);

char ch(string str, int i) {
	while(i < 0)
		i += 27;
	i %= 27;
	return str[i];
}

string spin(string s) {
	s = s[s.size() - 1] + s.substr(0, s.size() -1);
	return s;
}

int main() {
	string s;
	cin >> s;

	int i, j;
	Per(i, 0, s.size()) {
		bool flag = false;
		Per(j, 0, s.size())
			if(s[i] == s[j] && i != j) {
				flag = true;
				break;
			}
		if(flag)
			break;
	}

	if(abs(i - j) == 1) {
		cout << "Impossible" << endl;
		return 0;
	}

	int m = i + j;
	m /= 2;

	string out;
	if((i + j) % 2 == 1) {
		per(i, m - 12, m + 1)
			out += ch(s, i);
		rep(i, m + 14, m)
			if(ch(s, i) != ch(s, j))
				out += ch(s, i);
	} else {
		per(i, m - 13, m)
			out += ch(s, i);
		rep(i, m + 13, m - 1)
			if(ch(s, i) != ch(s, j))
				out += ch(s, i);
	}

	per(i, 0, out.size())
		i == 12 ? oo(out[i]) : o(out[i]);

	ol;

	return 0;
}

#include <iostream>
using namespace std;

int main()
{
	char str[30], pos1, pos2;
	int flag[26];
	int i, j, k;

	char ans0[14], ans1[14];

	for(i=0;i<26;i++)
		flag[i] = -1;

	for(i=0;i<27;i++)
	{
		cin>>str[i];
		if(flag[str[i]-65] == -1)
			flag[str[i]-65] = i;
		else
		{
			pos1 = flag[str[i]-65];
			pos2 = i;
		}
	}

	//cout<<pos1<<" "<<pos2<<endl;
	//cout<<pos1-1<<endl;
	//cout<<pos2<<endl;
	//cout<<pos2-1<<endl;

	if(pos2-pos1 == 1)
		cout<<"Impossible"<<endl;

	else
	{

		if((pos2-pos1)%2)
		{
			if(pos1==0)
			{
				char a = str[26];

				//cout<<"hi1"<<endl;

				for(i=26;i>0;i--)
			    {
			    	//cout<<i<<endl;
			    	str[i] = str[i-1];
			    }

				str[0] = a;
				pos1++;
				pos2++;

				//cout<<"hi"<<endl;

			}

			char temp = str[pos1-1];
			str[pos1-1] = str[pos1];
			str[pos1] = temp;
			pos1--;

		}

		//cout<<pos1-1<<endl;
		//cout<<pos2<<endl;
		//cout<<pos2-1<<endl;

		int l1 = pos1;
		int l2 = pos2-pos1-1;
		int l3 = 26-pos2;

		//cout<<l1<<" "<<l2<<" "<<l3<<endl;

		if(l1<l3)
		{
			int index = l3-l1;
			i = 26, j = 0;

			while(index)
			{
				ans0[j] = str[i--];
				ans1[j] = str[i--];
				j++;
				index-=2;
			}

			for(k=0;k<l1;k++)
			{
				ans0[j] = str[k];
				ans1[j] = str[i--];
				j++;
			}
		}

		else
		{
			int index = l1-l3;
			i = 0, j = 0;

			while(index)
			{
				ans0[j] = str[i++];
				ans1[j] = str[i++];
				j++;
				index-=2;
			}

			for(k=0;k<l3;k++)
			{
				ans0[j] = str[i++];
				ans1[j] = str[26-k];
				j++;
			}
		}

		k = pos1;
		ans1[j] = str[k++];
		ans0[j] = str[k++];
		j++;

		i = 0;
		for(;j<13;j++)
		{
			ans0[j] = str[pos2-i-1];
			ans1[j] = str[k++];
			i++;
		}

		for(i=0;i<13;i++)
			cout<<ans0[i];
		cout<<endl;
		for(i=0;i<13;i++)
			cout<<ans1[i];
		cout<<endl;

	}

	return 0;
}

#include <bits/stdc++.h>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define fr first
#define sc second
#define ll  long long
#define mp make_pair
#define mod 1000000007

using namespace std;

bool v[27];
char res[2][30];
int main(){
    ios::sync_with_stdio(0);
    string s;
    cin>>s;
    char z;
    int n = 27;
    for(int i=0 ; i<n ; i++){
        if(v[s[i]-'A']){
            z = s[i];
        }
        v[s[i]-'A'] = 1;
    }
    int j;
    bool b =0;
    int r =0;
    int in1;
    for( j=0 ; j<n ; j++){
        if(s[j] == z){
            if(b)
            break;
            b =1;
            in1 = j-1;
            continue;
        }
        if(b)
        r++;
    }
    if(r == 0){
        cout<<"Impossible";
        return 0;
    }

    r =r/2;
    res[0][r] = z;

    if(r == 13){
        res[1][r-1] = z;
    }
    b= 0;
    res[0][r] = z;
    int k =r-1;
    bool b1 =0;
    int in = -1;
    bool b2 = 0;
    for( j=0 ; j<n ; j++){
        if(k < 0){
            b1 = !b1;
            k = 0;
        }
        if(k >= 13){
            b2 =1;
            k = 12;
            b1 = !b1;
        }
        if(s[j] == z){
            if(b)
            break;
            b =1;
            continue;
        }
        if(b){
            if(!b1)
                res[b1][k--] = s[j];
            else
                res[b1][k++] = s[j];
        }
        if(b2){
                if(!b1){
                    res[b1][k++] = s[j];
                }
                else{
                    res[b1][k--] = s[j];
                }

        }
        in  =j+1;
    }
    b1 =0;
    int k1 = k;
    k = r+1;
    b2 = 0;
    for(int i=in1 ; i>=0 ; i--){
        if(k >= 13){
            b1 = !b1;
            k = 13-1;
        }
        if(k < 0){
            b2 = 1;
            b1 = !b1;
            k = 0;

        }
        if(s[i] == z)
            break;
        if(!b2){
        if(!b1){
                res[b1][k++] = s[i];
        }
        else{
                res[b1][k--] = s[i];
        }

        }
        else{
        if(b1){
                res[b1][k++] = s[i];
        }
        else{
                res[b1][k--] = s[i];
        }
        }
    }
    k = k1;
    b1 =1;
    b2 = 0;
    for(int i=in+1 ;i<n ; i++){
        if(k >= 13){
            b1 = !b1;
            k = 13-1;
        }
        if(k < 0){
            b2 = 1;
            b1 = !b1;
            k = 0;
        }
        if(s[i] == z)
            break;
        if(!b2){
            if(b1){
                    res[b1][k++] = s[i];
            }
            else{
                    res[b1][k--] = s[i];
            }
        }
        else{
            if(!b1){
                    res[b1][k++] = s[i];
            }
            else{
                    res[b1][k--] = s[i];
            }
        }
    }
    for(int j=0 ; j<2 ; j++){
        for(int i=0 ; i<13 ; i++){
            cout<<res[j][i];
        }
        cout<<endl;
    }
    return 0;
}

/* -------------------------------- */
/* Name: MD. Khairul Basar          */
/* Institute: HSTU                  */
/* Dept: CSE                        */
/* Email: khairul.basar93@gmail.com */
/* -------------------------------- */

#include <bits/stdc++.h>
/* all header files */

#define fs            first
#define sc            second
#define sp            printf(" ")
#define nl            printf("\n")
#define pb(a)         push_back(a)

#define setzero(a)    memset(a,0,sizeof(a))
#define setneg(a)     memset(a,-1,sizeof(a))
#define setinf(a)     memset(a,126,sizeof(a))

#define tc1(x)        printf("Case %d: ",x)
#define tc2(x)        printf("Case #%d: ",x)
#define tc3(x)        printf("Case %d:\n",x)
#define tc4(x)        printf("Case #%d:\n",x)

#define iin(x)        scanf("%d",&x)
#define din(x)        scanf("%lf",&x)
#define lin(x)        scanf("%lld",&x)
#define clin(x)       scanf("%I64d",&x)

#define pr1(x)        cout<<x<<"\n"
#define pr2(x,y)      cout<<x<<" "<<y<<"\n"
#define pr3(x,y,z)    cout<<x<<" "<<y<<" "<<z<<"\n"
#define pr4(w,x,y,z)  cout<<w<<" "<<x<<" "<<y<<" "<<z<<"\n"
#define fast          ios::sync_with_stdio(0)
#define read          freopen("input.txt","r",stdin)
#define write         freopen("output.txt","w",stdout)
#define prflag1(flag) printf("%s\n",(flag)?"YES":"NO")
#define prflag2(flag) printf("%s\n",(flag)?"Yes":"No")
#define prflag3(flag) printf("%s\n",(flag)?"yes":"no")
/* macro definitions */

using namespace std;

typedef long long LL;
typedef unsigned long long ULL;
typedef pair<int, int>pii;
typedef pair<LL, LL>pll;
typedef vector<int>vi;
typedef vector<LL>vll;
typedef vector<pii>vpii;
typedef vector<pll>vpll;
/* type definitions */

LL MOD_EXPO(LL b, LL p, LL m)
{
    if(p==0) return 1;
    LL ret=MOD_EXPO(b,p/2,m)%m;
    ret=(ret*ret)%m;
    return ((p&1) ? (ret*b)%m : ret%m);
}
LL POWER(LL N, LL K)
{
    LL i,ans=1;
    for(i=1;i<=K;i++) ans*=N;
    return ans;
}
int SET(int N, int pos)
{
    return (N | (1<<pos));
}
int RESET(int N, int pos)
{
    return (N & !(1<<pos));
}
bool CHECK(int N, int pos)
{
    return (N & (1<<pos));
}
/* necessary functions */

int dx4[]= {1,-1,0,0};
int dy4[]= {0,0,1,-1};
int dx6[]= {0,0,1,-1,0,0};
int dy6[]= {1,-1,0,0,0,0};
int dz6[]= {0,0,0,0,1,-1};
int dx8[]= {1,-1,0,0,-1,1,-1,1};
int dy8[]= {0,0,1,-1,1,1,-1,-1};
int dkx8[]= {-1,1,-1,1,-2,-2,2,2};
int dky8[]= {2,2,-2,-2,1,-1,1,-1};
/* direction arrays */

int tc=1;
const double eps=1e-9;
const double pi=acos(-1.0);
const long long int mx=1e5;
const long long int mod=1e9+7;
/* global declarations */

int main()
{
    string str,out[5];
    int i,n,col,j,k,r,l,len,cnt;
    char ch;
    bool flag;
    while(cin>>str)
    {
        flag=false;
        map<char,int>mp;
        l=r=-1;
        for(i=0;i<27;i++)
        {
            if(mp[str[i]])
            {
                ch=str[i];
                r=i;
                break;
            }
            mp[str[i]]++;
        }
        for(i=0;i<27;i++)
        {
            if(str[i]==ch)
            {
                l=i;
                break;
            }
        }
        len=r-l-1;
        flag=(len==0);
        if(flag)
        {
            pr1("Impossible");
            continue;
        }
        for(i=0;i<13;i++)
        {
            out[0]+="a";
            out[1]+="a";
        }
        col=12-(len/2);
        i=l+1;
        j=0;
        out[j][col]=ch;
        col++;
        if(col>12) col=12,j=1;
        cnt=0;
        while(1)
        {
            if(i==r)
            {
                i++;
                if(i>26) i=0;
                if(i==l) break;
            }
            out[j][col]=str[i];
            i++;
            if(j==0) col++;
            if(j==1) col--;
            cnt++;
            if(i>26) i=0;
            if(col>12) col=12,j=1;
            if(col< 0) col= 0,j=0;
            if(i==l) break;
        }
        pr1(out[0]);
        pr1(out[1]);
    }
    return 0;
}

#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <random>
#include <iomanip>

using namespace std;

//defines
typedef long long ll;
typedef long double ld;
#define TIME clock() * 1.0 / CLOCKS_PER_SEC

//permanent constants
const ld pi = acos(-1.0);
const int day[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
const int digarr[10] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
const int dx[4] = {-1, 0, 1, 0};
const int dy[4] = {0, 1, 0, -1};
const int dxo[8] = {-1, -1, -1, 0, 1, 1, 1, 0};
const int dyo[8] = {-1, 0, 1, 1, 1, 0, -1, -1};
const int alf = 26;
const int dig = 10;
const int two = 2;
const int th = 3;
const ll prost = 239;
const ll bt = 31;
const ld eps = 1e-8;
const ll INF = (ll)(1e18 + 239);
const int BIG = (int)(1e9 + 239);
const int MOD = 998244353; //1e9 + 7;
const ll MOD2 = (ll)MOD * (ll)MOD;

//random
mt19937_64 rnd(239); //(chrono::high_resolution_clock::now().time_since_epoch().count());

//constants
const int M = (int)(2e5 + 239);
const int N = (int)(2e3 + 239);
const int L = 20;
const int T = (1 << 19);
const int B = (int)(trunc(sqrt(M)) + 1);
const int X = 1e4 + 239;

int main()
{
#ifdef ONPC
    freopen("input.txt", "r", stdin);
#endif
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    int n = 27;
    string s;
    cin >> s;
    for (int i = 0; i < n; i++)
        for (int j = i + 1; j < n; j++)
            if (s[i] == s[j])
            {
                if (j == i + 1)
                {
                    cout << "Impossible";
                    return 0;
                }
                string s1 = "";
                for (int x = i + 1; x < j; x++)
                    s1 += s[x];
                string s2 = "";
                for (int x = (j + 1) % n; x != i; x = (x + 1) % n)
                    s2 += s[x];
                vector<string> ans(2);
                for (int d = 0; d < 2; d++)
                    for (int x = 0; x < 13; x++)
                        ans[d] += " ";
                int num = (int)s1.size() + 1;
                int p = (num + 1) / 2;
                p--;
                ans[0][p] = s[i];
                int l = p;
                for (int x = p - 1; x >= 0; x--)
                    ans[0][x] = s1[p - 1 - x];
                for (int x = 0; x < (int)s1.size() - p; x++)
                    ans[1][x] = s1[p + x];
                p = (int)s1.size() - p;
                for (int x = p; x < 13; x++)
                    ans[1][x] = s2[x - p];
                for (int x = 12; x > l; x--)
                    ans[0][x] = s2[(int)s2.size() + l - x];
                cout << ans[0] << "\n" << ans[1] << "\n";
                return 0;
            }
    return 0;
}

#include <bits/stdc++.h>

using namespace std;

const int N = 100050;
typedef long long ll;

string s;
char ans[30][30];

int main()
{
    ios::sync_with_stdio(0);
    cin >> s;
    int n = 27;
    int st, en;
    for (int i = 0; i < n; i++)
        for (int j = i + 1; j < n; j++)
            if (s[i] == s[j]) {
                st = i;
                en = j;
            }
    if (st + 1 == en)
        return cout << "Impossible", 0;
    int d = en - st - 1;
    int pos = 13 - d / 2 - 1;
    ans[0][pos] = s[st];
    int k = st;
    for (int i = 0; i < d / 2; i++) {
        pos++;
        k++;
        ans[0][pos] = s[k];
    }
    pos = 13;
    for (int i = 0; i < (d + 1) / 2; i++) {
        k++;
        pos--;
        ans[1][pos] = s[k];
    }
    int p1 = 1;
    for (int i = 0; i < st; i++) {
        if (p1 == 1)
            pos--;
        else
            pos++;
        if (pos == -1) {
            p1 = 0;
            pos = 0;
        }
        ans[p1][pos] = s[st - i - 1];
    }
    k = n;
    for (int i = en + 1; i < n; i++) {
        k--;
        if (p1 == 1)
            pos--;
        else
            pos++;
        if (pos == -1) {
            p1 = 0;
            pos = 0;
        }
        ans[p1][pos] = s[k];
    }
    for (int i = 0; i < 2; i++) {
        for (int j = 0; j < 13; j++)
            cout << ans[i][j];
        cout << endl;
    }
    return 0;
}

#include <iostream>
#include <algorithm>
#include <cstring>
#include <stdio.h>
#include <string>
#include <cmath>
#include <queue>
#include <set>
#include <map>
#include <stack>
#include <bitset>
#include <cstdlib>
#include <vector>

using namespace std;
#define   lson          l,m,rt<<1
#define   rson          m+1,r,rt<<1|1
#define   ll            long long
#define   ull           unsigned long long
#define   mem(n,v)      memset(n,v,sizeof(n))
#define   MAX           100005
#define   MAXN          10005
#define   PI            3.1415926
#define   E             2.718281828459
#define   opnin         freopen("input.txt","r",stdin)
#define   opnout        freopen("output.txt","w",stdout)
#define   clsin         fclose(stdin)
#define   clsout        fclose(stdout)
#define   haha1         cout << "haha1"<< endl
#define   haha2         cout << "haha2"<< endl
#define   haha3         cout << "haha3"<< endl

const int    INF    =   0x3f3f3f3f;
const ll     INFF   =   0x3f3f3f3f3f3f3f3f;
const double pi     =   3.141592653589793;
const double inf    =   1e18;
const double eps    =   1e-8;
const ll     mod    =   1e18;
const ull    mx     =   133333331;
/**************************************************************************/
int main()
{
//    opnin;
//    opnout;

    int vis[200];
    mem(vis,-1);
    string str;
    cin >> str;
    int l = 0,r = 0;
    for(int i=0;i<str.size();i++){
        if(vis[str[i]]!=-1){
            l = vis[str[i]];
            r = i;
            break;
        }
        vis[str[i]] = i;
    }
    if(l == r-1){
        cout << "Impossible" << endl;
        return 0;
    }
    char ans1[100],ans2[100];
    int mid = (l+r)/2;
//    cout << "m,l,r " << mid << ' ' << l << ' ' << r << endl;
    int i;
    int cnt1 = 0;
    for(i=mid+1;i<str.size();i++) ans1[cnt1++] = str[i];
    ans1[cnt1] = 0;
//    haha1;
//    cout << cnt1 << ' ' << ans1 << endl;
    int cnt2 =0;
    for(i=mid;i>=0;i--){
        if(i == l) continue;
        ans2[cnt2++] = str[i];
    }
    ans2[cnt2] = 0;
//    cout << cnt2 << ' ' << ans2 << endl;
    if(cnt1 > cnt2){
        for(int i=13;i<cnt1;i++){
            ans2[25-i] = ans1[i];
        }
    }
    else{
        for(int i=13;i<cnt2;i++){
            ans1[25-i] = ans2[i];
        }
    }
    ans1[13] = 0;
    ans2[13] = 0;
//    haha3;
    cout << ans1 << endl;
    cout << ans2 << endl;
//    clsin;
//    clsout;

    return 0;
}

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<int,int> ii;

int occ[26];
char rez[13][2];

int main(){
    string s;
    cin>>s;

    char povtoruvan;
    for(int ctr1=0;ctr1<s.length();ctr1++){
        occ[s[ctr1]-'A']++;
        if(occ[s[ctr1]-'A']==2)
            povtoruvan=s[ctr1];
    }
    vector<int> p;
    for(int ctr1=0;ctr1<s.length();ctr1++)
        if(occ[s[ctr1]-'A']==2)
            p.push_back(ctr1);
    if(p[1]-p[0]==1){
        cout<<"Impossible";
        return 0;
    }
    while(p[1]!=26){
        char t=s[26];
        s=s.substr(0,26);
        s=t+s;
        p[0]++;
        p[1]++;
    }
    s=s.substr(0,26);
    string gore;
    string dole;
    for(int ctr1=0;ctr1<13;ctr1++){
        gore.push_back(s[(25+p[0])/2-ctr1]);
    }
    for(int ctr1=(25+p[0])/2+1;ctr1<26;ctr1++)
        dole.push_back(s[ctr1]);
    for(int ctr1=0;ctr1<(25+p[0])/2-12;ctr1++)
        dole.push_back(s[ctr1]);

    cout<<gore<<"\n"<<dole;
    return 0;
}

#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <cstdio>
#include <string>
#include <stdlib.h>
#include <set>
#include <vector>
#include <list>
#include <algorithm>
#include <regex>
#include <math.h>
#include <map>
#include <iterator>
#include <limits>
#include <numeric>
#include <bitset>
#include <unordered_map>
#include <unordered_set>
#include <iomanip>
#include <queue>
#include <deque>
#include <stack>
#include <array>
#include <valarray>
#include <complex>

using namespace std;

typedef array<int, 2> hv;
typedef int integer;
#define int long long
#define double long double
#define make(type, x) type x; cin>>x
#define make2(type, x, y) type x, y; cin>>x>>y
#define make3(type, x, y, z) type x, y, z; cin>>x>>y>>z
#define make4(type, x, y, z, q) type x, y, z, q; cin>>x>>y>>z>>q
#define ALL(x) (x).begin(), (x).end()
#define FORIT(p) for(auto it = p.begin(); it != p.end(); it++)
#define FOR(b) for(int i = 0; i <(b); i++)
#define VI vector<int>
#define VVI vector<vector<int>>
#define PII pair<int, int>
#define PPII pair<PII, int>

vector<vector<char>> a(2, vector<char>(13));
vector<bool> was(26);
string s;
vector<PII> g = { {1,0}, {1,1}, {1,-1}, {0,1}, {0,-1}, {-1,1}, {-1,0}, {-1, -1} };

bool doit() {
	FOR(was.size()) was[i] = false;
	int pos = 0;
	while (pos < s.length() && s[pos] != a[0][0]) pos++;
	if (pos == s.length()) return false;
	was[s[pos] - 'A'] = true;
	int tempPos = pos + 1;
	int stI = 0, stJ = 0;
	for (; tempPos  < s.length(); tempPos++) {
		bool t = false;
		for (int q = 0; q < g.size(); q++) {
			int i = stI + g[q].first;
			int j = stJ + g[q].second;
			if (i < 0 || i > 1 || j < 0 || j > 12) continue;
			if (a[i][j] == s[tempPos]) {
				was[s[tempPos] - 'A'] = true;
				t = true;
				stI = i;
				stJ = j;
				break;
			}
		}
		if (t) continue;
		if (was[s[tempPos] - 'A']) return false;
		t = false;
		for (int q = 0; q < g.size(); q++) {
			int i = stI + g[q].first;
			int j = stJ + g[q].second;
			if (i < 0 || i > 1 || j < 0 || j > 12) continue;
			if (a[i][j] == 0) {
				t = true;
				a[i][j] = s[tempPos];
				stI = i;
				stJ = j;
				break;
			}
		}
		if (!t) return false;
		was[s[tempPos] - 'A'] = true;
	}
	if (pos == 0) return true;
	tempPos = 0;
	for (; tempPos <= pos; tempPos++) {
		bool t = false;
		for (int q = 0; q < g.size(); q++) {
			int i = stI + g[q].first;
			int j = stJ + g[q].second;
			if (i < 0 || i > 1 || j < 0 || j > 12) continue;
			if (a[i][j] == s[tempPos]) {
				was[s[tempPos] - 'A'] = true;
				t = true;
				stI = i;
				stJ = j;
				break;
			}
		}
		if (t) continue;
		if (was[s[tempPos] - 'A']) return false;
		t = false;
		for (int q = 0; q < g.size(); q++) {
			int i = stI + g[q].first;
			int j = stJ + g[q].second;
			if (i < 0 || i > 1 || j < 0 || j > 12) continue;
			if (a[i][j] == 0) {
				t = true;
				a[i][j] = s[tempPos];
				stI = i;
				stJ = j;
				break;
			}
		}
		if (!t) return false;
		was[s[tempPos] - 'A'] = true;
	}
	return true;
}

void cleans() {
	FOR(13) a[0][i] = 0;
	FOR(13) a[1][i] = 0;
}

void Solve() {
	cin >> s;
	cleans();
	FOR(was.size()) was[i] = false;
	for (int i1 = 0; i1 < 26; i1++) {
		for (int i2 = 0; i2 < 26; i2++) {
			if (i2 == i1) continue;
			for (int i3 = 0; i3 < 26; i3++) {
				if (i1 == i3 || i2 == i3) continue;
				for (int i4 = 0; i4 < 26; i4++) {
					if (i4 == i3 || i4 == i2 || i4 == i1) continue;
					cleans();
					a[0][0] = 'A' + i1;
					a[1][0] = 'A' + i2;
					a[0][12] = 'A' + i3;
					a[1][12] = 'A' + i4;
					if (a[0][0] == 'N' && a[1][0] == 'J' && a[0][12] == 'Y' && a[1][12] == 'L') {
						int q = 0;
					}
					if (doit()) {
						FOR(13) cout << a[0][i];
						cout << endl;
						FOR(13) cout << a[1][i];
						return;
					}

				}
			}
		}
	}
	cout << "Impossible";
}

integer main() {
	ios_base::sync_with_stdio(0);
	cin.tie();
#if  _DEBUG
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	Solve();
	while (!cin.eof()) {
		string s = "_";
		do getline(cin, s);
		while (!cin.eof() && !s.empty());
		if (cin.eof()) return 0;
		FOR(3) cout << endl;
		Solve();
	}
#else
	Solve();
#endif
	return 0;
}

#include <bits/stdc++.h>
using namespace std;

const int N = 200;
int a[N]; char str[N];

int kiri, kanan, selisih;
int ab, kk, ab1, kk1;

int row[2][13];

void cek_kiri_kanan(){
	for(int i=0; i<27; i++){
		if(a[str[i]] != -1){
			kiri = a[str[i]];
			kanan = i;
			break;
		}

		a[str[i]] = i;
	}
}

void tentuin_posisi(){
	selisih = kanan - kiri - 1;

	int atas = selisih/2;

	ab = 0, kk = 12 - atas;
}

void isimid(){
	int idx = kiri;

	int ta = ab, tb = kk;

	while(idx < kanan){
		if(ab == 0 && kk < 13){
			row[ab][kk] = str[idx];
			idx++;
			kk++;
		}
		else if(ab == 0){
			ab = 1;
			kk = 12;
		}
		else if(ab == 1){
			row[ab][kk] = str[idx];
			kk--;
			idx++;
		}
	}

	ab1 = 1;
	kk1 = kk;

	ab = ta, kk = tb;
}

void isikanan(){
	int idx = kanan;

	int ta = ab, tb = kk;

	while(idx < 27){
		if(ab == 0 && kk >= 0){
			row[ab][kk] = str[idx];
			idx++;
			kk--;
		}
		else if(ab == 0){
			ab = 1;
			kk = 0;
		}
		else if(ab == 1){
			row[ab][kk] = str[idx];
			kk++;
			idx++;
		}
	}

	ab = ta, kk = tb;
}

void isikiri(){

	ab = 1, kk = kk1;

	int idx = kiri - 1;

	while(idx >= 0){
		if(ab == 1 && kk >= 0){
			row[ab][kk] = str[idx];
			idx--;
			kk--;
		}
		else if(ab == 1){
			ab = 0;
			kk = 0;
		}
		else if(ab == 0){
			row[ab][kk] = str[idx];
			idx--;
			kk++;
		}
	}

}

int main(){
	memset(a, -1, sizeof(a));

	scanf("%s", str);

	cek_kiri_kanan();
	tentuin_posisi();

	if(selisih == 0){
		puts("Impossible");
		return 0;
	}

	isimid();
	isikanan();
	isikiri();

	for(int i=0; i<13; i++) printf("%c", row[0][i]);
	puts("");
	for(int i=0; i<13; i++) printf("%c", row[1][i]);
	puts("");
}

/**********************************************************
 *     Code written by Akikaze                            *
 *     Duy-Bach Le, #Team4T's Chief Executor              *
 *     #Team4T Tertiary Flagship - Oblivion               *
 *                                                        *
 *     Written by a random fan of momocashew and Chiho    *
 *                                                        *
 *     Arigatougozaimasu, imouto-chan.                    *
 **********************************************************/

/************** [OPTIMIZATION PROTOCOL] **************/
#pragma comment(linker, "/stack:225450978")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
/*****************************************************/

/************** [LIBRARY PROTOCOL] **************/
#include <bits/stdc++.h>
using namespace std;
/************************************************/

/************** [LEGENDS/CONSTANTS] **************/
#define endl '\n'
#define i64 long long
#define ld long double
#define rsz resize
#define pub push_back
#define mp make_pair
#define fi first
#define se second
typedef vector<i64> vi;
typedef vector<ld> vd;
typedef vector<string> vs;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef pair<i64, i64> pii;
typedef pair<i64, pii> pip;
typedef pair<pii, i64> ppi;
const long long Mod = 1000000007LL, INF = 1e9, LINF = 1e18;
const long double Pi = 3.141592653589793116, EPS = 1e-9, Gold = ((1+sqrt(5))/2);
long long keymod[] = {1000000007LL, 1000000009LL, 1000000021LL, 1000000033LL};
long long keyCount = sizeof(keymod) / sizeof(long long);
/*************************************************/

/************** [BITWISE FUNCTIONS] **************/
template<class T> int getbit(T s, int i) { return (s >> i) & 1; }
template<class T> T onbit(T s, int i) { return s | (T(1) << i); }
template<class T> T offbit(T s, int i) { return s & (~(T(1) << i)); }
template<class T> int cntbit(T s) { return __builtin_popcountll(s); }
/*************************************************/

/************** [MASTER CONTROLS - PHASE 1] **************/
auto TimeStart = chrono::steady_clock::now();
auto TimeEnd = chrono::steady_clock::now();
#define OImode 227420978
#define MultiTest 227420978

#undef OImode // Switch this off if submitting OI problems.
#undef MultiTest // Switch this off if submitting multi-test problems.

void ControlIO(int argc, char* argv[]);
void TimerStart();
void TimerStop();
void Exit();
/*********************************************************/

/************** [GLOBAL VARIABLES] **************/
string s; vi L(26, -1), R(26, -1);
/************************************************/

/************** [FUNCTIONS] **************/

void Input() {
	cin >> s;
}

void Solve() {
	vector<vc> A(2, vc(13, '.'));
	for (i64 i=0; i<26; i++) {
		if (s[i] == s[i+1]) {
			cout << "Impossible";
			return;
		}
	}
	for (i64 i=0; i<27; i++) {
		if (L[s[i]-'A'] == -1) L[s[i]-'A'] = i;
		R[s[i]-'A'] = i;
	}
	for (i64 i=0; i<26; i++) {
		if (L[i] == R[i]) continue;
		i64 Gap = R[i] - L[i] - 1;
		A[0][12-Gap/2] = char(65+i);
		i64 x = 0, y = 12 - Gap / 2;
		for (i64 r=L[i]+1; r<27; r++) {
			if (s[r] == char(65+i)) continue;
			if (y == 12 && x == 0) x = 1;
			else if (y == 0 && x == 1) x = 0;
			else if (x == 0) y++; else y--;
			A[x][y] = s[r];
		}
		x = 0; y = 12 - Gap / 2;
		for (i64 r=L[i]-1; r>=0; r--) {
			if (y == 0 && x == 0) x = 1;
			else if (y == 12 && x == 1) x = 0;
			else if (x == 0) y--; else y++;
			A[x][y] = s[r];
		}
	}
	for (auto r: A) {
		for (auto q: r) cout << q;
		cout << endl;
	}
}
/*****************************************/

/************** [MAIN] **************/
int main(int argc, char* argv[]) {
	ControlIO(argc, argv);
	ios_base::sync_with_stdio(0); cin.tie(NULL);
	#ifndef MultiTest
		Input(); TimerStart();
		Solve(); TimerStop();
	#else
		int T; cin >> T; TimerStart();
		while(T--) {Input(); Solve();}
		TimerStop();
	#endif
	return 0;
}
/************************************/

/************** [MASTER CONTROLS - PHASE 2] **************/
void ControlIO(int argc, char* argv[]) {
	#ifdef Akikaze
	time_t t = time(0);
	tm* now = localtime(&t);
	cout << "Source code by #Team4T-Akikaze.\n";
	cout << "Current time: ";
	cout << (now->tm_year + 1900) << '-'
	     << (now->tm_mon + 1) << '-'
	     <<  now->tm_mday << " | "
	     <<  now->tm_hour << ":"
	     <<  now->tm_min << ":"
	     <<  now->tm_sec
	     << "\n\n";
	if (argc > 1) assert(freopen(argv[1], "r", stdin));
	if (argc > 2) assert(freopen(argv[2], "w", stdout));
	#elif OImode
	freopen("FILENAME.INP", "r", stdin);
	freopen("FILENAME.OUT", "w", stdout);
	#endif
}

void TimerStart() {
	#ifdef Akikaze
	TimeStart = chrono::steady_clock::now();
	#endif
}

void TimerStop() {
	#ifdef Akikaze
	TimeEnd = chrono::steady_clock::now();
	auto ElapsedTime = TimeEnd - TimeStart;
	cout << "\n\nTime elapsed: " << chrono::duration<double>(ElapsedTime).count() << " seconds.\n";
	#endif
}

void Exit() {
	TimerStop(); exit(0);
}
/*********************************************************/

/*********************************************************************************************************************************************************************************************************
 * ti;.                               .:,:i:         :,;;itt;.        fDDEDDEEEEEEKEEEEEKEEEEEEEEEEEEEEEEE###WKKKKKKKKKKKKKKKKKKKKWWWWWWWWWWWWWWWWWWW#WWWWWKKKKKEE      :,:.    f::::. .,ijLGDDDDDDDEEEEEEE*
 *ti;.                               .:,:i:          .:,;itt;:      GLDEEGEEEEEEEEEEEEEEEEEEDEEEEEEEEEEE#W#WEKKKKKKKKKKKKKKKKKKKKKKKWWWWWWWWWWWWWWWWWWWWWWKKKKKKG.     .::.      f:,...,ijLGDDDDDDDDEEEEEE *
 *ti;.                               .:,:i:            :,;;iti,    :fDDEEEEEEEEEEEEEEEKEEEEDEEEEEEEEEEEW##WEEEKKKKKKKKKKKKKKKKKKKKKWWWWWWWWWWWWWWWWWWWWWWWKKKKKKEG     .::.       .f,::,ijLGDDDDDDDDEEEEEE *
 *ti;.                               .:,:i:             .,,;iti;.  LDDEEEEEEEEEEKEEEEWEEEDDEEEEEEEEEEE#WWWEEEEEKKKKKKKKKKKKKKKKKKKKKKKKKWWWWWWWWWWWWWWWWWWWKKKKKEDj    .::.        .:L;;ijfGDDDDDDDDDEEEEE *
 *ti;.                               .:,:i:              .:,;;iii:LLDEEEEEEEEEEEKEEEEEEEEDEEEEEEEEEEEW#WWEEEEEEEKKKKKKKKKKKKKKKKKKKKKKKKKWWKWWWWWWWWWWWWWWKKKKKKKEL    .::.         .:;LijLGGDDDDDDDDEEEEE *
 *ti;.                               .:,:;:                :,;;ittfDEEEEEEEEEEEEEEEEKEEEGEEEEEEEEEEEKWWWEEEEEEEEEKKKKKKKKKKKKKKKKKKKKKKKKKKWWWWWWWWWWWWWWWKKKKKKKELj   .::.          :,;jffGGDDDDDDDDDEEEE *
 *ti;.                               .:,:i:                 .,;;tGGDEEEEEEEEEEEKEEEKEEEDEEEEEEEEEEEEWWWEEEEEEEEEEEEKKKKKKKKKKKKKKKKKKKKKKKKKKWWWWWWKWWWWWWKKKKKKKEEL   .::.          .:;itDGGDDDDDDDDDEEEE *
 *ti;.                               .:::;:                   :;ifDEEEEEEEEEEEEKEEEKEEEEEEEEEEEEEEEWWWEEEEEEEEEEEEEEKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKW#WWWKKKKKKKKEEf   .::.           :,itfGEDDDDDDDDDDDEE *
 *ti;.                               .:::;:                    :GGEEEEEEEEEEEKEKEEKEEEEEEEEEEEEEEEEWWEEEEEEEEEEEEEEEEEKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKW#WKKKKKKKKKEEDG  .::.           .,;jfLGKDLDDDDDDEEDD *
 *ti;.                               .:::;:                     fDEEEEEEKKKKKKKKKEKEEEEEEEEEEEEEEE#WEEEEEEEEEEEEEEEEEEKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKW#KKKKKKKKKKEEf .:::.           .,;tfLGDEDDDDDDDDEEE *
 *ti;.                                :::;:                    fDEEEEEEKKKKKKKKKKWKEEEEEEEEEEEEEEEWKEEEEEEEEEEEEEEEEEEEEKEKKKKKKKKKKKKKKKKKKKKKKKKKKKKW##KKKKKKKKKEEft :::.           .,;tfLGDDDKDDDDDDDDD *
 *ti;.                                .::;:                    fDEEEEEEKKKKKKKWKKKKKEEEEEEEEEEEEE#WEEWEEEEEDEEDEEEEEEEEEEEEKKKKKKKKKKKKKKKKKKKKKKKKKKKKW#WKKKKKKKKEEGG :,:.           .,;tfLGGDDDKDDDDDDDD *
 *ti;.                                .:.;:                   tGDEEEEKKKKKKKKKKKKKKKKKEEEEEEEEEEEWEEKWEEEEEEEDEEEEEEEEEEEEEEKEKKKKKKKKKKKKKKKKKKKKKKKKKKWWWKKKKKKKEEDf :::.           .,;tfLGGDDDDEDDDDDDD *
 *ti;.                                .::;:                   fDEEEEEKKKKKKKKKKKWKKKKKKKKEEEEEEEWWEEWEEEEEEEEEEEEEEEEEEEEEEEEEEKKKKKKKKKKKKKKKKKKKKKKKKKW##KKKKKKKEEEft.::.           .,;tfLGGDDDDDDEDDDDD *
 *ti;.                                .:.;:                  tGDEEEKKKKKKKKKKKKKKKKKKKKKKEKEEEEE#EEWWEEEEEEEEEEEEEEEEEEEEEEEEEEEEKKKKKKKKKKKKKKKKKKKKKKKKW#WKKKKKKEEEGD:::.           .,;tfLGGDDDDDDDEDDDD *
 *ti;.                                .:.,.                  LDEEEEKKKKKKKKKKWKWKKKKKKKKKKKKEEEKWEKW#EEEEEEEEEEEEEEEEKEEEEEEEEEEEEEEEKKKKKKKKKKKKKKKKKKKKW##KKKKKKEEEEf,,:.           .,;tfLGGDDDDDDDDEDDD *
 *ti;.                               ..:.,.                 LGDEEEEKKKKKKKKKKWKKKKKKKKKKKKKKKKKWEEW#WEEEEEEEEEEEEEEEKEEEEEEEEEEEEEEEEEEEKEKKKKKKKKKKKKKKKK##KKKKKEEEEEfi;,.           .,;tfLGGDDDDDDDDDKDD *
 *tt;.                                .:.,:                 jDEEEEKKKKKKKKKKWWKKKKKKKKKKKKKKKKKWKE#WWEEEEEEEEEEEEEEWEEEEEEEEEEEEEEEEEEEEEEEKKKKKKKKKKKKKKKKWWKKKKEEEEDfG;,:           .,;tfLGGDDDDDDDDDDKD *
 *tii,.                               .:.,.                tGDEEEEKKKKKKKKKKWWWKKKKKKKKKKKKKKKWKKWWWKEEEEEEEEEEEEEKEEEEEEEEEEEEEEEEEEEEEEEEEEEEEKKKKKKKKKKKW#KKKKEEEEDGGi;,.          .,;tfLGGDDDDDDDDDDDE *
 *ti;;,:.                             .:.,:                fDEEEEKKKKKKKKKKKWKKKKKKKKKKKKKKKKKWEK#WWKEEEEEEEEEEEEDEEEEEEEEEEEEEEGEEEEEEEEEEEEEEEEEEEKKKKKKKWWKKEEEEEEDDf;;;,.         .,;tfLGGDDDDDDDDDDDD *
 *tii;,,:..                           ...,.               ;LEEEEEKKKKKKWKKKKWKKKKKKKKKKKKKKKKKEKKW#WEEEEEEEEEEEEEjEEEEEEEEEKEEEEGEEEEEEEEEKEEEEEEEEEEEEEEEEE#WKEEEEEEDDf;;;;,:        .,itfLGGDDDDDDDDDDDD *
 *ti;,,,,,:.                          ...,.               LDEEEEKKKKKKKKKKKWWWKKKKKKKKKKKKKKKWKK#W#WEEEEEEEEEEEDDLEEEEEEEEEWEEEEDEEEEEEEEEKEEEEEEEEEEEEEEEEEWWEEEEEEEDDfj,,,,,:.      .,itfGGGDDDDDDDDDDDD *
 *tii,,,,::::.                        ...,:              .fDEEEEKKKKKKWKKKKWWWKKKKKKKKKKKKKKKEKKW#WWEEEEEEEEEEEKiKEEKEEEEEEWEEEEDEEEEEEEEEEEEEEEEEEEEEEEEEEEWWEEEEEEEDDLD:::,,,:.     .,ijfGGGDDDDDDDDDDDD *
 *ti;:::::::::..                      .:.,:              LDEEEEKKKKKKKWKKKKWWKKKKKKKKKKKKKKKKtKKWWWWKEEEEEEEEEDiiDEEEEEEEEWWEEEEEEDEEEEEEEEEEEEEEEEEEEEEEEEEEWKEEEEEDDDGL:. .:,,,:    .,ijLGGGDDDDDDDDDDDD *
 *tt;. .::::::::..                    ...,:             :fDEEEKKKKKKKKKKKKWW#KKKKKKKKKKKKKKKKfKKWWWWKEEEEEEEEDti,DEKEEEEEEWWEEEDEEEEEEEEEKEEEEEEEEEEEEEDEEEEE#WEEEEEGGDGf:.  .:,;,:.  .,ijLGGDDDDDDDDDDDDD *
 *tt;.   .:::::::..                   ...,:             GDEEEKKKKKKKKWKKKKWWWKKKWKKKKKKKWWWKDEKLWWWWKKEEEEEEDEi,LDEEEEEEEEWWEEEEEEEEEEEEEEEEEEEEEEEEEDEDEEEEEW#EEEEDDDDGf,.    :,,,:...,ijLGGGDDDDDDDDDDDD *
 *tt;.    .....::::..                 ...,:             fDEEEKKKKKKKKWKKKKWWWWKKKWKKKKKKKKKKfWKiWWW#KKEEEEEEEi;.EDfEEEDEEiWWEEEEEEEEEEEEDGKEEEEEEEEEEDEEEEEEEWWEEEEDDDGGLi.     .,;,:::,ijLGGGDDDDDDDDDDDD *
 *tt;.      ....:::::.                ...,.            iDEEEEKKKKKKKKWKKWKWWWWWKKWWWKKKKKKKKtWKt#WWWKKEEEEEDji..DDKDDEDEGiWKEEEEEEEEEEDDEjEEEEEEEEEEEDEEEEEEEKWKEEDDDDGGff.      .:,;,,;ijLGGGDDDDDDDDDDDD *
 *tt;.        ....::::..              .:.,:           .LDEEEKKKKKKKKKKKKWWWWKWWWWWWWWWWKKKKWtKKiDWWWKKKEEEEKi:..DEDDDDDDiiWKEEEEEEEEEEDDEijDEEEEEKEEEEEEEEEEEEWWEEGDDDGGLG.       .:,;;iijLGGGDDDDDDDDDDDD *
 *tt;.          .....:::..            ...,.           .fEEEEKKKKKKKKWKKKKWWWWWWWWWWWWWWKWKKKiKDiLWWWWKEEEEEi,..fD:DDDDDti;WEEEEEEEEEEKDDi:iDDEEEEWEEEEEEEEEEEE#WEEGDDDDGGG.         :,iitjLGGGDDDDDDDDDDDD *
 *tti.            .....:::..          ...,.           GDEEEKKKKKKKKKWKKKWWW#WWWWWWWWWWWKWKKjiEjitWWWKKWEEEDi...DDLDDDDji;;WEEEEEEEEEEEDEj.iDDEEEEWEEEEEEEEEEEEWWEEDDDDDDGf.          .,;tjfLGGDDDDDDDDDDDD *
 *tti.              ....::::..        ...,.           fEEEKKKKKKKKKKKKKKKW#WWWWWWWWWWWWWWWWtiEiiiWWWKKEWKEi....D.EDDDEi;.fWEEEEEEEEEEDDfL.;EDDEEEWEEEEEEEEEEEEWWEEEDDDDDGf.           :;ijfLGGDDDDDDDDDDDD *
 *tti.                ....::::..      ...,.          LDEEEKKKKKKKKKKKKKKWWWWWWWWWWWWWWWW####WKiiiWWWKKKEEK,...:E:DDDEii..GWEEEEEEEEDWDDiL.,KDDEEEWEEEEEEEEEEEEWWKEEDDDDDGf:           .,itfLGGDDDDDDDDDDDD *
 *tti.                 .....:::..     ...,.          fDEEEKKKKKKKKKWKKKKWWWWWWWWWWWWW########WLiiWWWKKKEEjD...G,DDDDi;...EWEEEEEEEEDKDEii..LDDEEEWEEEEEEEEEEEEWWWEEDDDDDGfi           .,;tfLGGGDDDDDDDDDDD *
 *tti.                   .....:::..   ...,.         iGEEEKKKKKKKKKKWKKKKWWWWWWWWWWWW###########KiWWWKKEEE,.D..D.DDDii:...KKEEEEEEEEEDDj:...tEDEEEWEEEEEEEEEEEEWWWEEEDDDDDLL           .,;tjLLGGDDDDDDDDDDD *
 *tti.                     ....::::......:.         LEEEKKKKKKKKKKWWKKKWWW#KWWWWWWWW#####W####W##KWWKKEEL..:D.jjDDi;,....KKEEEEEEEDfDDi...:iKDEEEWKEEEEEEEEEEEWWWEEEEDDDDLG           .,;tjLLGGDDDDDDDDDDD *
 *tti.                        ...::::::..,.        :GEEEKKKKKKKKKKKKWWWWW##WWWWWWWWW##WKWK#W#W####WWKEEK.....G.DDti,.....KKEEEEEEDWGDf.,...iKDEEEWWEEEEEEEEEEEW#WEEEEEDDDGL           .,;tjLLGGDDDDDDDDDDD *
 *tti.                         ....::::::,.        GDEEKKKKKKKKKKKKKWWWW###WWWWWWWWWW#WWWK###W#####WKEKK.....jDDL;;......KKEEEEEEEEEDi.f...;KDEEEWWEEEEEEEEEEEWWWWEEEEEDDGf           .,;tjLLGGDDDDDDDDDDD *
 *tti.                           ....:::,,.       .LEEEKKKKKWKKKKKWWWWWW###WWWWWWWWWW#WWKW#WW##W#WWWKEKD:....:DD:;......;KEEEEEEEKiDD..f...,KKEEEWWEEEEEEEEEEEWWWWEEEEEDDDf           .:;tjLLGGGDDDDDDDDDD *
 *tti.                             ...::,,,:.     GDEEKKKKKKKKKKKKWWWWWWW#WWWWWWWWWWW#KjKWWWWWWWWWWWWEK.j,..;fD.;.......fKEEEEEDKG:Di..,....DKEEEWWEEEEEEKEKKKWWWWEEEEEEDDf           .:;tjLLGGDDDDDDDDDDD *
 *jti.                              ...::,,,,:.  .fEEEKKKKKWKKKKKKWWWWWWW#WWWWWWWWWWK#KKKWWWWWWWWWWWWWK..f:.:G.,:.......EKEEEEEKK;:E:.......fKEEEWWKEKEKKKKKKKW#WWEEEEEEDDf:          .,;tfLLGGDDDDDDDDDDD *
 *tti.                               ...:,,,;;,: iDEEKKKKKWKKKKKKKWWWWWWW#WWWWWWWWWWK#WDKWWKKWWWWWWWWWE..;G:G..,........KKEEEEEKi.Gi..:.....tKEEKWWWKKKKKKKKKKW##WKEEEEEEDfi          .,;tfLLGGGDDDDDDDDDD *
 *tti.                               ....::,,;;;,LEEKKKKKKWKKKKKWWWWWWW###WWWWWWWWWWKWWDKWEEEWKKWWWWWKKj.:LG..;.........EKEEEEKG;.G...;.....;KKEKWWWKKKKKKKKKKW##WWKEEEEEDfL          .,;tfLGGGDDDDDDDDDDD *
 *jti.                                ...::::,;ijDEEKKKKKWKKKKKKWKWWWWW##WWWWWWWWWWWKK#KKGDGDWEEWKKWKKGE,.i;.:.........:EKEEEKE;.:L...j.....,KWEKWWWKKKKKKKKKK####WKKEEEEDLG          .,;tfLGGGGDDDDDDDDDD *
 *jti.                                ...:...,,;GEEKKKKKWWKKKKKWWWWWWWW###WWWWWWWWWKKKWWKiLGGEDEDEKGKKiEG..;...........jKEEEKK;:.G....,.....:KKEWWWWKKKKKKKWKK####WKKKKEEEGL          .,;tfLGGGGDDDDDDDDDD *
 *jti.                                ...:.  .:,GEEKKKKKWKKKKKWWWWWWWW####WWWWWWWWWKKKWWKii;fDLGDK: EEi:E:.............EKEEKK;;..L...........KKKWWWWKKKKKKKWKK####WKKKWKEEDf          .,;tfGGGGDDDDDDDDDDD *
 *jti.                                ...:.    ,EEKKKKKWWKKKKKWWWWWWWWW###WWWWWWWWKKKKfWWLt;i,. fi  EG..D:.............EKEKK;;..t....:.......KWKWWWWKKKKKKKWKK####WKKKWEEEDf:.        .,;tfGGGGDDDDDDDDDDD *
 *jti.                                ...:.    GEEKKKKKWKKKKKWWWWWWWWW####WWWWWWWKKKKKt;KKEfff     .;t.................KKKKi;:..GtGGfG.......KWWWWWWKKKKKKKWKK###WWWKKKKEEEf,,:       .,;tfGGGGDDDDDDDDDDD *
 *jti.                                ...:.    GEKKKKKWWKKKKKWWWWWWWWWW##WWWWWWWKKKKKKt;EiKKKK,   ...t................jEKKG;;..,.....,LGi....KWWWWWWKKKKKKWKKKW####WKKKKKEEL,,,:.     .,;tfGGGDDDDDDDDDDDD *
 *jti.                                ...:.  .GEEKKKKKWKKKKKWWWWWWWWWW###WWWWWWWKKKKKKtiE::tGG........................EEEj;;...,.........:D..DKWWWWWWKKKKK#KKW###W#WKKKKKEEfj:,,,:.   .,;tfGGGDDDDDDDDDDDD *
 *jti.                                ...:.   DEKKKKKWWKKKKKWWWWWWWWW####WWWWWWWKKKKKKiiE:::.::.......................EEi;;...j.....f......:iDKWWWWWWKKKKK#WW######WKKKKKEELG :,,,,:. .,;tfGGGDDDDDDDDDDDD *
 *jti.                                ...:.  fEEKKKKWWKKKKWWWWWWWWWWW###WWWWWWWWKKKKKK;tE::..........................DD;.;,.::......;........EWWWWWWWKKKKW#WW#####WWKKKWKKELG  .:,,,:::,;tfGGGDDDDDDDDDDDD *
 *jti.                                ...:. .DEKEKKKWWKKKKWWWWWWWWWWW###WWWWWWWWKKKKKE,iD::..........................D..,;.,;tLffi...........DWDWWWW#KKKWWWWW#####W#KKKWKEEGL    .:,;,,,;tfGGGDDDDDDDDDDDD *
 *jti.                                ...:. ;EEKKKKWWKKKKKWWWWWW#WWWW####WWWWWWKKKKKEL:iD:..........................j ..;..;;:.....i,........DKtWWWWWKKWWWWWW#####WWWKKKEKEDf     .:,;;;itfGGGDDDDDDDDDDDD *
 *jti.                                ...:. DEKKKKKWWKKKKWWWWWWW#WWWW####WWWWWWKKKKKEj:iG...............................:....................GKiWWWWWKKWW#WWW######WWKKKKKEEf       .,;iitfGGGDDDDDDDDDDDD *
 *jti.                                ...:.:EKKKKKWWKKKKKWWWWWWW#WWW#####WWWWWKWKKKKEi:if:.................................iEKEKKKKKKDj......DKiWWWWWKWK##WW#######WWKKK:KEEL        .:;itfGGGDDDDDDDDDDDD *
 *jji.                                ...:,DEEKKKWWWKWKKWWWWWWWWWWWW#####WWWWWWWKKKKEi:it..................................j.  KKKKKKKKKKKf..DKiWWWWWKWW##WW#######WWKKK,KEEf         .,;tfGGGDDDDDDDDDDDD *
 *jji.                                ..L:iDEEKKKWWKKKKKWWWWWWWWWWWW#####WWWWWKWKKKKKi.i;..................................  . KKKWWWWWWWWK..DGiWWWWWKK##WWW#####W#WWKKKjEKEL,        .:;tfGGGDDDDDDDDDDDD *
 *jji.                               .f:::EEEKKKWWWKKKKKWWWWWWWWWWWW#####WWWWWKWKKKKK;.i,.................................::  KKEKWWWWWWfWK..EiiWWWWWKWW#WW##########KKKD,KELj        .:;tfGGDDDDDDDDDDDDD *
 *jji.                             .t::::,DEEKKKWWKKKKWWWWWWWWW#WWWW#####WWWWKKWKKKEK;.i:.................................GDDEEEKKKWWWWWtWWD.E;iWWWWWW###WW#########WWKKK.EEDG        .:;tfGGGDDDDDDDDDDDD *
 *jji.                          . j..::::EKEKKKWWWKKKKWWWWWWWWW#WWW######WWWWKKWKKKEK;.t:.................................ELLEDDEEEWWWWEtWK,.KiiWWWWWW###W##########WWKKK:EEEG     .;tjfLLGDDDDDDDDDDDDDDD *
 *jji.                          i.::::::,EEEKKWWWKKKKKWWWWWWWWW#WWW#####WWWWWKWKKKKEE,.t..................................DfiEGDDDEEKKKttKWG.KiiWWWWW##WWW##########WWKKK:fEEL  ,fGGGDDDDDDDDEEEDDDDDDDDDD *
 *jji.                        .;:..:::::DEEEKKWWWKKKKKWWWWWWWWW#WWWW####WWWWWWWKKKKED,.t..................................ifjDDGGEGDKK.ttKKE.DiWWWWW###WW##########WWWKKK:.KELiLGGGGDDDDDDDDDDDDEEEDDDDDDD *
 *jji.                       i.:.::::::,KEEKKWWWKKKKKKWWWWWWWWW#WWWW####WWWWWWWKKKKEL:.j..................................GGf,;ifLLED .iiKKi:fWWWWWW##W#W##########WWWKKK:.KKLGGDDDDDDDDDDDDDDDDEDDEEDDDDD *
 *jji.                     .j:.::::::::EEEKKKWWWKKKKKKWWWWWWWW##WWW#####WWWWWWWKKKKKf:.f..................................:EEfftf .,. ;iE,..jWWWWWWW###W############WWKKK,:KKGDDDDDDDDDDDDDDDDDDDDDDDEDDDD *
 *jji.                    .:.::::::::,,EEEKKWWWKKKKKKKWWWWWWWW##WWW#####WWWWWWWKKKKKt..G....................................EEELL;   .j....tKWWWWWWW################WWWKKtfGKGEDDDDDDDDDDDDDDDDDDDDDDDEEDD *
 *jji.                   :...:::::::,,jEEKKWWWWKKKKKKWWWWWWWWW##KWW#####KWWWWWWKKKKEi..D....................................:jEEE.........;KKWWWWWWWW#WW##W##########WWKKDLGKEKDDDDDDDDDDDDDDDDDDDDDDDDDED *
 *jji.                  i:.::::::::,,,EEEKKWWWWKKKKKWWWWWWWWWW##WWW#####WWWWWWWKKKKKi..D......................................:::::......,KKKWWWWWWWWW#####W########WWWKKKGGKKEGGGGGGGGDDDDDDDDDDDDDDDDDDE *
 *jji.                 i..:::::::::,,tEEKKWWWWKKKKKWWWWWWWWWWW##WW######WWWWWWWKKKKKi..D......................................::::......:EKKKWWWWWWWWWWW##WW########W#WKKWGGKKGGGGGGGGGGGGGGGDDDDDDDDDDDDD *
 *jji.                .:::::::::::,,,EEEKKWWWWKKKKKWWWWWWWWWWW##WW#####WWWWWWWWKKKKKi..D....................................:::::::::..tELii;KWWWWWWWWWW##WW######WWWWWWKWGGGKGGGGGGGGGGGGGGGGGGGGGGGGGGDG *
 *jjt.                :.::::::::,,,,fEEKKWWWWKKKKKKWWWWWWWWWW###WW####WWWWWWW#WKKKKKi..D....................................:::::::.:.,;;;;;;,KKWWWWWWWWW#WW########WWWKKWGGGKGGGGGGGGGGGGGGGGGGGGGGGGGGGG *
 *jji.               ;.::::::::,,,,;EEEKWWWWWKKKKKWWWWWWWWWWWW##WW###WKWWWWWK#WKKKKKi..G......................................:::::::,;;;;:...KKKWWWWWWWWWKWW#######WWWWKKGLGKDGGGGGGLLGGGGGGGGGGGGGGGGGGG *
 *jjt.              f.:::::::::,,,,fEEKKWWWWWKKKKKWWWWWWWWWWW###WW##WKKWWWWWW#WKKKKK;.jt........i.............................:::::::;j;;....:E.KKKWWWWWWWKWW#####W#WWWWKKLLGWEEGGGGGLGGGGGGGGGGGGGGGGGGGG *
 *jjt.             ...:::::::,,,,,;DEEKWWWWWKKKKKWWWWWWWWWWWW####WWWKKKWWWWWWWWKKKKK;.E;.........t.............................:::::ii;;.....D...KKWWWWWWWKWW#####WWEWWWKKGGGEKKGGGGGLGGGGGGGGGGGGGLGGGGGG *
 *fji.             ;.:::::::,,,,,;LEEKKWWWWWKKKKKWWWWWWWWWWWW####KWKKKKWWWWWWWWKKKKKi.D;..........j.............................:::tt;,.....:.....KKWWWWWWKWWWW##WWWGWWWKKGGGGKEGGGGGGGGGGGGGGGGGGGLLGGGGL *
 *fji.            t::::::::,,,,,,;EEEKWWWWWKKKKKKKWWWWWWWWWWW##WKWKKKKKWWWWWWWWKKKKKi:D;............j...........................::LL;,.............KKWWWWWKWWWWWWWWWGWWWKKGGGGKGGGGGGGGGGGGGGGGGGGGLLGGGGL *
 *fjt:            .:::::::,,,,,,,DEEKWWWWWWKKKKKKKWWWWWWWWWWWWKKWKKKKKKWWWWK#WWKKKKWitE;........... ............................:G;;:...............KKKWWKKWWWWWWWWWGWWWKKGGGGWGGGGGGGGGGGGGGGGGGGGGGGGGGL *
 *fjji;:.       .f:::::::,,,,,,,;EEEKWWWWWWKKKKKKWWWWWWWWWWWKKKKKKKKKKKWWKWWWWWKKKKWGKD;........................................L;;..................DKKWKKWWWWWWWWWGWWWKKDGGGKDGGGGGGGGGGGGGGGGGGGGGGGGGG *
 *fjjtii;,:.     :::::::,,,,,,,;EEEKWWWWWWKKKKKKWWWWWWWWWWKKKKKKKKKKKKWWWWWW#WWKKKKWiEj;......................................:i,;....,...............;KKEKWWWWWWWWWGKWWKKDDGGDEGGGDGGGGGDGGGGGGGGGGGGGGGG *
 *fjtiiiii;;:.  j::::::,,,,,,,;;EEEKWWWWW#KKKKKWWWWWWWWWKKKKKKWKKKKKKKWWWWWWWWWKKKKWtEL;:....................................;;;:...,;j................:KEEWWWWWWWWWDDWWKKDDDDDKDDDDDDDDDDDDDDDGGGGGGGGGGG *
 *fjti;;iiii;;,:::::::,,,,,,,,;EEEKWWWWWWWKKKKWWWWWWWWKKKKKKKWKKKKKKKWWWWWWW#W#KKKKWEEii;...................................f;:....,;L...................EEKWWWWWWWWDDWWKKDDDDDKEDDDDDDDDDDDDDDDDDDDDDGGGG *
 *fjt,,,;;;;ii;f::::::,,,,,,,;;EEKWWWWWWWKKKKKWWWKWWKKKKKKKKKKKKKKKKKWWWWWWW#W#KKKKWKEij;:...............................:G;,.....,;f....................:tKKWWWWWWWDDWWKKDDDDDKKDDDDDDDDDDDDDDDDDDDDDDDDD *
 *jjt. ..:,;;;;,::::,,,,,,,,;;GEEWWWWWWWWKKKKWKKWKKKKKKKKKKKKKKKKKKKKWWWWWWW#W#KKKKWEDi;j;............................,Li;L;;;..,;;f........................KKKKWWWKDDWWKKDDDGDKKGGGGGGGGDGDDDDDDDDDDDDDDD *
 *fjt.    .:,,,:::::,,,,,,,;;;EEKWWWWWWWKKKKKKWKKKKKKKKKKKKKKKKKKKKKWKKKWKW##W#KKKKWEti;;G;........................tEEEL;;;;;;;;;;L..........................DKKKKKEDDWWKEDGftiLE;;;;itjLGGGGGGDDDDDDDDDDD *
 *fjt.       .j::::,,,,,,,;;;DEEWWWWWWWWKKKKWKKKKKKKKKKKKKKKKKKKKKKKWKKWWWK##W#KKKKKEii;;;L;...................iDEEEEEEKKi;j;;;;jD.....:......................,KKKKDGGEKKE:::::;E::::::::::,tLGGDDDDDDDDDD *
 *fjt.       .;:::,,,,,,,;;;;EEKWWWWWWWWKWKKKKKKKKKKKKKKKWKKKKKKKKKKWKKWWWW#WW#KKKKKKii;;;;f;.............:tDEEEEEKKKKKKKKEti;;;L...............................EEKf;:iKKE::::::E::::::::::::::ifDDDDDDDDD *
 *fjt:        :::,,,,,,,,;;;DEEWWWWWWWWWEKKKKKKKKKKKKKKKKKKKKKKKKKKWWKKWWWW####KKKKKEiii;;;;f,.........iDEEEEKKKKKKKKKKKKKKKf;iG......i..........................fK::::KKE::::::E::::::::::::::::,tGGDDDDD *
 *fjt:       t:::,,,,,,;;;;iDEKWWWWWWKEKKKKKKKKKKKKKKKKKKKKKKKKKKKKWWKKWWWW####WKKKKLiii;;;;;L,....,Li;EDEEEEKKKKKKKKKKKKKKKKiG......;:...........................:i:::KKE:::::,E,::::::::::::::::::iGDDDD *
 *jjt.       f::,,,,,,,;;;;GEEWWWWKEEKEKKKKKKKKKKKKKKKKWKKKKKKKKKKKWWKWWWWW###WWKKKKiii;;;;;;;G,;L;;iiEEEEEEEKKKKKKKKKKKKKWWKE......;t.........:....................j::KEE:,::,,D,,::::,,,,,,:::::::::tDDD *
 *fjt:.      ,::,,,,,,,;;;;EEWWKEEEEEEKKKKKKKKKKKKKKKKWKKKKKKKKKKKWWKKWWWWW#W#KKKKKKiiiiii;;;;;i;;iiiEEKEEKKWKKKKKKKWKKKKKWWWGi;...;t......,;;;;,....................:,EEE,,,,,,D,,,,,,,,,,,,,,,,::,::::tG *
 *fjt:.     ,::,,,,,,,;;;;DEKEEEEEEEEKKKKKKKKKKKKKKKKKKKKKKKKKKKKKWWWWWWWWW#W#KKKKKKiiiii;;i;;;;;iiiKKKEKKKKWWKWWWWWWKKKKWWWWW;;;:;L.....;;;;;;;;;....................,KEE,,,,,,E,,,,,,,,,,,,,,,,,,,,,,,,; *
 *fjt:.     f:,,,,,,,;;;;jEDEEEEEEEEEKKKKKKKKKKKKKKKKKKKKKKKKKKKKKWWWWWWWW#W##KKKKKKiiiiiiii;i;;iiiEKKKKKKKKWKWWWWWWWWKKKWWWWWKi;;i.....,jEEfGi;;;;;...................EED,,,,,,E,,,,,,,,,,,,,,,,,,,,,,,,, *
 *fjt:.    .f::,,,,,,;;jEEDEEEEEEEEEEKKKKKKKKKKKKKKKWKKKKKKKKKKKKKWWWKWWWWW###KKKKKLiiiiiiiiiiiiiiEEKKKKKKKKWWWWWWWWWWWWKWWWWWWGi;i;,..;jDDDKEGi;;;;;;:................EED,,,,,,D,,,,,,,,,,,,,,,,,,,,,,,,, *
 *fjt:.  .. ;::,,,,,;;EDDEEEEEEEEEEKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKWWKKW#WW####KWKKKiiiiiiiiiiiiijKKKKKKKKKKWWWWWWWWWWWWWWWWWWWWWt;i;;;;i;DDDDDDGi;;;;;;;;:.............EDf;,,,;,G;;;;;;;;;;;;;;;,,,,,,,,,, *
 *fjt:......:,,,,,,;LDDDEEEEEEEEEEEKKKKKKKKKKKKKKKKWKKKKKKKKKKKKKWWWWKWWWW####KKKKKiiiiiiiiiiijKEKKWKKKKKKKWWWWWWWWWWWWWWWWWWWWWWiLiii;i;DEEEEDDE;i;;;;;;;;;:..........EDi,;;;;;L;;;;;;;;;;;;;;;;;;,,,,,,, *
 *fjt:......:,,,,,;EDDDEEKEEEEEEEEEKKKKKKKKKKKKKKKWKKKKKKKKKKKKKKWWWWKKWWW##W#KWKKWEiiiiiijGKKKKKWWKKKKKKKKWWWWWWWWWWWWWWWWWWWWWWKi;iiiiDDEEEEEEDEi;;;;;;;;;;;;;,:.....ED;;;;;;;j;;;;;;;;;;;;;;;;;;;;;;;,, *
 *fjt:.....t,,,,,;DDDDEEEKEEEEEEEEKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKWWWKKKWWWW##WKWKKWKiiiKKKKKKKKKWWKKKKKKKKWWWWWWWWWWWWWWW#WWWWWWWWWiiiiifLEEEEEEEEDi;i;;;;;;;;;;;;.....DD;;;;;;;i;;;;;;;;;;;;;;;;;;;;;;;;; *
 *fjt:.....G,,,,,GDDDEEEEEEEEEEEEKKKKKKKKKKKKKKKKWKKKKKKKKKKKKKKKWWWKKKWWW###WKWKKWKitKKKKKKKKKWKKKKKKKKKKWWWWWWWWWWWWWW###WWWWWWWWEiiiiiiiEEEEEEEEDGiiii;;;;;;;;;.....GD;;;;;;;i;;;;;;;;;;;;;;;;;;;;;;;;; *
 *fjt:.....L,,,,;GDDDEEEEEEEEEEKEKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKWWWWWDGWWW###KKWWKWKKKKKKKKKKKKKKKKKKKKKKKWWWWWWWWWWWWW####WWWWWWWWWiiiiiiiiEEEEEEEEEEDi;i;;;;;;;;.....Lj;;;;;;i;iiiiii;;;;;;ii;;;;;;;;;;; *
 ***********************************************************************************************************************************************************************************************************/

//void _(){
//    string s;
//    cin >> s;
//    int l = -1,r = -1;
//    rep(i,0,26)
//        rep(j,i+1,26)
//            if(s[i] == s[j]){
//                l = i, r = j;
//            }
//    if(r == l+1){
//        print("Impossible");
//        return;
//    }
//    string ans[2];
//    ans[0] = string(13,' ');
//    ans[1] = string(13,' ');
//    int lpos = 12-(r-l-1)/2;
//    int shift = l-lpos;
//    watch(shift);
//    s.erase(s.begin()+r);
//    int nxt = 0;
//    for(int i = 0; i < 13; ++i){
//        ans[0][i] = s[(nxt+shift+26)%26];
//        ++nxt;
//    }
//    for(int i = 12; i >= 0; --i){
//        ans[1][i] = s[(nxt+shift+26)%26];
//        ++nxt;
//    }
//    print(ans[0]);
//    print(ans[1]);
//}
//
#include <iomanip>
#include <vector>
#include <utility>
#include <iostream>
#include <string>
#define REP_INT(i,l,r) for(int i = l; i <= r; ++i)
#define GET_REP_MACRO(_1,_2,_3,_4,NAME,...) NAME
#define rep(...) GET_REP_MACRO(__VA_ARGS__,REP_ANY,REP_INT)(__VA_ARGS__)
#define all(v) (v).begin(), (v).end()
#define sz(v) ll(v.size())
#define watch(x) cerr << (#x) << " = " << x << '\n'
#define T1 template<typename T> static
using namespace std;
typedef long long ll;
T1 ostream& operator<<(ostream& stream, const vector<T>& t);
T1 istream& read(T, T, istream& = cin);
T1 void print(T x, string end = "\n"){
    cout << x << end;
}
void _(){
    string s;
    cin >> s;
    int l = -1,r = -1;
    rep(i,0,26)
        rep(j,i+1,26)
            if(s[i] == s[j]){
                l = i, r = j;
            }
    if(r == l+1){
        print("Impossible");
        return;
    }
    string ans[2];
    ans[0] = string(13,' ');
    ans[1] = string(13,' ');
    int lpos = 12-(r-l-1)/2;
    int shift = l-lpos;
    watch(shift);
    s.erase(s.begin()+r);
    int nxt = 0;
    for(int i = 0; i < 13; ++i){
        ans[0][i] = s[(nxt+shift+26)%26];
        ++nxt;
    }
    for(int i = 12; i >= 0; --i){
        ans[1][i] = s[(nxt+shift+26)%26];
        ++nxt;
    }
    print(ans[0]);
    print(ans[1]);
}
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout << fixed << setprecision(15);
        _();
}

#include <bits/stdc++.h>
using namespace std;

string li1= "", li2 = "";
char r, l;
string s;
int occurs[2800];

void roll() {
    li1.insert(li1.begin(), li2[0]);
    li2.erase(0, 1);
    li2.push_back(li1[li1.size()-1]);
    li1.pop_back();
}

bool visited[28];

bool form(string l1, string l2, string bs) {
    bool on_l1 = true;

    l1.insert(l1.begin(), '.');
    l1.push_back('.');
    l2.insert(l2.begin(), '.');
    l2.push_back('.');

    int start = l1.find(bs[0]);
    if (start > l1.size()) {start = l2.find(bs[0]);on_l1=false;}
    for (int i = 1; i < bs.size(); ++i) {
        if (on_l1) {
            if (l1[start-1] == bs[i]) {
                start=start-1;
            }
            else if (l1[start+1] == bs[i]) {
                start = start+1;
            }
            else if (l2[start-1] == bs[i]) {
                on_l1 = false;
                start=start-1;
            }
            else if (l2[start] == bs[i]) {
                on_l1=false;
            }
            else if (l2[start+1] == bs[i]){
                on_l1=false;
                start=start+1;
            }
            else return false;
        }
        else {
            if (l2[start-1] == bs[i]) {
                start=start-1;
            }
            else if (l2[start+1] == bs[i]) {
                start = start+1;
            }
            else if (l1[start-1] == bs[i]) {
                on_l1 = true;
                start=start-1;
            }
            else if (l1[start] == bs[i]) {
                on_l1=true;
            }
            else if (l1[start+1] == bs[i]){
                on_l1=true;
                start=start+1;
            }
            else return false;
        }
    }
    return true;
}

int main() {
    cin>>s;
    string before_s = s;
    char repeated;
    memset(occurs, 0, sizeof occurs);
    //----Preprocess----
    for (int i = 0; i < s.size(); ++i) {
        occurs[s[i]-20]++;
        if (occurs[s[i]-20] != 1) {
            if (s[i] == s[i-1]) {
            cout << "Impossible";
            return 0;
            }

        repeated = s[i]; r=s[(i-1)%(s.size())];l=s[(i+1)%s.size()]; s.erase(i, 1);
        break;}
    }
    //--------
    for (int i = 0; i < 13; ++i) {
        li1 += s[i];
        li2 += s[25-i];
    }
    while(!form(li1, li2, before_s)) {
        roll();
    }

    cout << li1 << '\n' << li2;

    return 0;
}

#include <bits/stdc++.h>
using namespace std;

template<typename T>
void sci(T& t) {
    cin >> t;
}

template<typename T, typename... Ts>
void sci(T& t, Ts&... ts) {
    sci(t);
    sci(ts...);
};

#define scid(vars...) int vars; sci(vars)
#define scidl(vars...) lint vars; sci(vars)
#define scidd(vars...) double vars; sci(vars)
#define scids(vars...) string vars; sci(vars)

typedef long long lint;

vector<int> ps[256];

string ans[2] = {"", ""};

int main() {
    ios_base::sync_with_stdio(false); cin.tie(0);

    string s;
    sci(s);
    int n = s.length();
    for (int i = 0; i < n; i++) {
        ps[s[i]].push_back(i);
    }

    int x = -1;
    for (int i = 0; i < 256; i++) {
        if (ps[i].size() == 2) {
            x = i;
            break;
        }
    }
    int p1 = ps[x][0];
    int p2 = ps[x][1];
    if (p1 + 1 == p2) {
        cout << "Impossible";
        return 0;
    }
    int d = p2 - p1;

    if (d > 13) {
        rotate(s.begin(), s.begin() + p2, s.end());
        d = 27 - d;
        p1 = n - 1 - p2;
        p2 = 0;
        swap(p1, p2);
    }

    rotate(s.begin(), s.begin() + p1, s.end());

    for (int i = 0; i < 13 - (d + 1)/2; i++) {
        char c = s.back();
        s.pop_back();
        s = c + s;
    }

    int add = 0;
    int cp = 0;
    bool wasx = false;

    for (int i = 0; i < n; i++) {
        if (s[i] == x && wasx) {
            continue;
        }
        wasx |= s[i] == x;
        if (cp < 13) {
            ans[0] += s[(-add + i + n) % n];
        } else {
            ans[1] += s[(-add + i + n) % n];
        }
        cp++;
    }

    reverse(ans[1].begin(), ans[1].end());
    cout << ans[0] << "\n" << ans[1];

    return 0;
}

#include <stdio.h>
#include <string.h>

char data[30];
int cnt[30];
char ans[10][30];
int a, b;
char what;

int main()
{
    //freopen("input.txt", "r", stdin);
    scanf("%s", data+1);
    int i;
    for(i=1; i<=27; i++)
    {
        if(cnt[data[i]-'A']==0) cnt[data[i]-'A']=i;
        else
        {
            if((i-cnt[data[i]-'A']-1)==0)
            {
                printf("Impossible");
                return 0;
            }
            break;
        }
    }
    what=data[i];
    a=cnt[data[i]-'A'];
    b=i;
    int space, place;
    if((b-a+1)%2==0)
    {
        space=(b-a+1)/2;
        place=b-space+1;
    }
    else
    {
        space=(a+26-b)/2;
        place=a-space;
    }
    ans[1][space]=what;

    if(place<1) place+=27;
    for(i=1; i<=13; i++)
    {
        ans[1][i]=data[place];
        place++;
        if(place==28) place=1;
    }

    for(i=13; i>=1; i--)
    {
        if(data[place]==what)
        {
            i++;
        }
        else ans[2][i]=data[place];
        place++;
        if(place==28) place=1;
    }

    for(i=1; i<=13; i++) printf("%c", ans[1][i]);
    printf("\n");
    for(i=1; i<=13; i++) printf("%c", ans[2][i]);
    printf("\n");
}

// In the name of Allah.
// We're nothing and you're everything.
// Ya Ali!

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

const int cols = 13;
char ans[2][cols + 1];
int main(){
    ios::sync_with_stdio(0), cin.tie(0);
    fill(ans[0], ans[2], '.');
    ans[0][cols] = ans[1][cols] = 0;
    string s, bef, mid, aft;
    cin >> s;
    {
        map<char, int> mp;
        for(int i = 0; i < s.size(); i++)
            if(mp[s[i]]){
                bef = s.substr(0, mp[s[i]] - 1);
                mid = s.substr(mp[s[i]] - 1, i - mp[s[i]] + 1);
                aft = s.substr(i + 1);
            }
            else
                mp[s[i]] = i + 1;
    }
    if(mid.size() == 1)
        return cout << "Impossible\n", 0;
    reverse(aft.begin(), aft.end());
    if(bef.size() < aft.size())
        swap(bef, aft);
    int up = cols - (mid.size() + 1) / 2;
    int down = cols - mid.size() / 2;
    reverse(mid.begin() + (mid.size() + 1) / 2, mid.end());
    copy(mid.begin(), mid.begin() + (mid.size() + 1) / 2, ans[0] + up);
    copy(mid.begin() + (mid.size() + 1) / 2, mid.end(), ans[1] + down);
    copy(bef.end() - down, bef.end(), ans[1]);
    reverse(bef.begin(), bef.end() - down);
    copy(bef.begin(), bef.end() - down, ans[0]);
    copy(aft.begin(), aft.end(), ans[0] + (bef.end() - bef.begin() - down));
    cout << ans[0] << '\n' << ans[1] << '\n';
}

#include<cstdio>
int n=27,m=13;
int x,y;
char c[30];
char ans[2][15];
int main(){
	scanf("%s",c);
	for(int i=0;i<n;++i)for(int j=i+1;j<n;++j)if(c[i]==c[j])x=i,y=j;
	if(y==x+1){puts("Impossible");return 0;}
	int l=y-x>>1;
	for(int i=0;i<m;++i)ans[0][i]=ans[1][i]=' ';
	for(int i=0;i<y-x-1-l;++i)ans[0][m-y+x+1+l+i]=c[x+i+1];
	for(int i=0;i<l;++i)ans[1][m-l+i]=c[y-i-1];
	ans[0][m-y+x+1+l-1]=c[x];
	for(int nx=0,ny=m-y+x+1+l-2,i=x-1;~i;--i){
		if(ny<0)++nx,ny=0;
		ans[nx][ny]=c[i];
		if(nx){if(ny<m-1)++ny;else--nx;}
		else{if(ny)--ny;else++nx;}
	}
	for(int nx=1,ny=m-l-1,i=y+1;i<n;++i){
		if(ny<0)--nx,ny=0;
		ans[nx][ny]=c[i];
		if(nx){if(ny)--ny;else--nx;}
		else{if(ny<m-1)++ny;else++nx;}
	}
	puts(ans[0]);puts(ans[1]);
	return 0;
}

#include<bits/stdc++.h>
using namespace std;

int i,j,IN1,IN2;
char grid[2][35];
vector<int> pos[27];

int main()
{
    string s;
    while(cin>>s)
    {
        for(int i=0; i<27; i++)
            pos[i].clear();

        for(i=0; i<=26; i++)
            pos[s[i]-'A'].push_back(i);

        for(i=0; i<=26; i++)
            if(pos[s[i]-'A'].size()>1)
            {
                IN2=pos[s[i]-'A'][1], IN1=pos[s[i]-'A'][0];
                break;
            }

        bool ok=0;

        int mid=IN2-IN1-1;

        if(mid==0)
            return 0*printf("Impossible\n");

        char ch=s[IN2];

        for(i=0; i<=12; i++)
        {
            int x=12-i;
            if(x*2==mid || x*2+1==mid || 2*x+2==mid)
            {

                int col=i+1,row=0,indx=IN1+1, cnt=1;
                grid[0][i]=ch;

                while(cnt<=26)
                {
                    if(indx==27)
                        indx=0;

                    if(col==13)
                        col=12,row=1;
                    else if(col<0)
                        col=0, row=0;

                    if(indx==IN2)
                    {
                        indx++;
                        continue;
                    }

                    grid[row][col]=s[indx], cnt++;

                    col=(row==0)?col+1:col-1;

                    indx++;
                }

                ok=1;

                cout<<grid[0]<<'\n'<<grid[1]<<'\n';
                break;
            }
        }

    }

    return 0;
}
/*
ABCDEFGHIJKLMNOPQRSGTUVWXYZ
ACDEFGHIJKLBMBNOPQRSTUVWXYZ
ZWMFLTCQIAJEVUPODMSGXKHRNYB
ACDEFGHIJKLMBNOPQRSTUVWXYZB
*/

#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>

using namespace std;

vector<int> idx[26];
int cnt[26];
char newstr[26];
char answer[2][13];
int idx0, idx1, idx2;

int abssub(int a, int b) {
    if (a > b) return a - b;
    else return b - a;
}

int convert(int a) {
    if ((a % 26) < 13) return a % 26;
    else return 25 - a;
}

int findOffset() {
    int ret = 0;

    for (ret = 0; ret < 26; ret++) {
        if (abssub(convert(idx0 + ret), convert(idx1 + ret)) <= 1 && abssub(convert(idx0 + ret), convert(idx2 + ret)) <= 1) return ret;
    }

    return ret;
}

int main() {
    string input;
    cin >> input;
    for (int i = 0; i < 27; i++) {
        cnt[input[i] - 'A']++;
        idx[input[i] - 'A'].push_back(i);
    }
    for (int i = 0; i < 26; i++) {
        if (cnt[i] >= 2) {
            for (int j = 0; j < idx[i].size(); j++) {
                for (int k = 0; k < idx[i].size(); k++) {
                    if (abssub(idx[i][j], idx[i][k]) <= 1) continue;
                    int tmp = 0;
                    for (int l = 0; l < 27; l++) {
                        if (l == idx[i][k]) continue;
                        if (l == idx[i][j]) idx0 = tmp;
                        newstr[tmp++] = input[l];
                    }
                    if (idx[i][k] == 0) {
                        idx1 = 0;
                        idx2 = 25;
                    } else if (idx[i][k] == 26) {
                        idx1 = 0;
                        idx2 = 25;
                    } else {
                        idx1 = idx[i][k] - 1;
                        idx2 = idx[i][k];
                    }
                    int offset = findOffset();
                    if (offset >= 26) continue;
                    for (int l = 0; l < 26; l++) {
                        if ((l + offset) % 26 < 13) answer[0][(l + offset) % 26] = newstr[l];
                        else answer[1][25 - (l + offset) % 26] = newstr[l];
                    }
                    for (int l = 0; l < 13; l++) cout << answer[0][l];
                    cout << endl;
                    for (int l = 0; l < 13; l++) cout << answer[1][l];
                    cout << endl;
                    return 0;
                }
            }
        }
    }
    cout << "Impossible" << endl;
}

#include<stdio.h>
#include<iostream>
#include<string.h>
using namespace std;
char s[30];
char a[60];
int vis[30];
int main()
{
    //freopen("in.cpp","r",stdin);
    //freopen("in.cpp","w",stdout);
    while(cin>>s)
    {
        int flag=0;
        for(int i=1;i<27;i++)
        {
            if(s[i]==s[i-1])
            {
                flag=1;
                break;
            }
        }
        if(flag)
        {
            cout<<"Impossible"<<endl;
            continue;
        }
        int l,r;
        memset(vis,-1,sizeof(vis));
        int jj=0;
        for(int i=0;i<27;i++)
        {
            int c=s[i]-'A';
           // cout<<"c="<<c<<endl;
            //cout<<jj<<endl;
            if(jj==1)
            {

                s[i-1]=s[i];
                continue;
            }
            if(vis[c]==-1)
            {
                vis[c]=i;
            }
            else
            {
                l=vis[c];
                r=i;
                jj=1;

            }
        }

        int mid=(r+l+1)/2;
       // printf("r=%d l=%d\n",r,l);
       // cout<<mid<<endl;
        int aa=13-mid;
        for(int i=0;i<26;i++)
        {
            int cur=(i+aa+26)%26;
            //cout<<cur<<endl;
            a[cur]=s[i];
        }
        for(int i=0;i<13;i++)
        {
            cout<<a[i];
        }
        cout<<endl;
        for(int i=25;i>=13;i--)
        {
            cout<<a[i];
        }
        cout<<endl;
    }
}

#include<bits/stdc++.h>
#pragma comment(linker, "/STACK:102400000,102400000")
#define endl '\n'
using namespace std;
typedef long long ll;
const int N = 200000 + 10, inf = 0x3f3f3f3f, Mod = 998244353;
int vis[N];
int main()
{
    string s;
    char ans[2][30];
    int vis[30], l, r;
    while(cin>>s)
    {
        memset(vis, 0, sizeof(vis));
        for(int i = 0; i<s.size(); i++)
        {
            if(!vis[s[i]-'A'])
                vis[s[i]-'A'] = i + 1;
            else l = vis[s[i]-'A'], r = i+1;
        }
      //  cout<<r-l<<endl;
        if(r - l <= 1)
        {
            printf("Impossible\n");
            continue;
        }
        int num = r - l -1;
       //  cout<<num<<endl;
        int id = l;
        int i=0;
        ans[0][12-num/2] = s[l-1];
        for(i = 12-num/2+1; i<=12; i++)
        {
            ans[0][i] = s[id];
        //    cout<<s[id]<<endl;
            id++;
        }
      //  cout<<endl;
        for(i = 12; i>=12-num/2+1 && id<=26; i--)
        {
            ans[1][i] = s[id];
            //   cout<<s[id]<<endl;
            id++;
        }
       // cout<<id<<endl;
      //  cout<<s[id]<<endl;
        if(num&1)
        {
            ans[1][12-num/2] = s[id];
         //   cout<<s[id]<<endl;
            id++;
              id++;
            i--;
        }
        else
        {
            id++;
          //  cout<<s[id]<<endl;
            if(id>26)
                id = 0;
            ans[1][i] = s[id];
           // cout<<s[id]<<endl;
            id++;
            i--;
        }
        for(; i>=0 && id<=26; i--)
        {
            ans[1][i] = s[id];
            //  cout<<s[id]<<endl;
            id++;
        }
        if(i>=0)
        {
            id = 0;
            for(; i>=0; i--)
                ans[1][i] = s[id], id++;
            for(i = 0; i<12-num/2; i++)
            {
                ans[0][i] = s[id];
                id++;
            }
        }
        else
        {
            for(i = 0; i<12-num/2&&id<=26; i++)
            {
                ans[0][i] = s[id];
                id++;

            }
            id=0;
            for(; i<12-num/2&&i>=0; i++)
            {
                ans[0][i] = s[id];
                id++;
            }
        }
        ans[0][13] = ans[1][13] = '\0';
        puts(ans[0]);
        puts(ans[1]);
    }
    return 0;
}

#include <iostream>
#include <vector>
#include <algorithm>
#include <stdio.h>
#include <sstream>
#include <string>
#include <map>
#include <set>
#include <stdlib.h>
#include <cmath>
#include <math.h>
#include <fstream>
#include <bitset>
using namespace std;
string s;
char dp[2][13];
map<char, int> mm;
int main(){
    std::ios::sync_with_stdio(false);
    cin >> s;
    char now;
    int d, ii;
    for (int i=0;i<27;i++){
        char ch = s[i];
        if (!mm.count(ch)){
            mm[ch] = i;
        }
        else{
            now = ch;
            d = i - mm[ch] - 1;
            ii = i + 1;
            break;
        }
    }
    if (d == 0){
        cout << "Impossible" << endl;
        return 0;
    }
    else{
        dp[0][(26 - d - 1) / 2] = now;
    }
    int pos = mm[now] + 1;
    int np = (26 - d - 1) / 2;
    int nnp = np - 1;
    bool change = false;
    while (d > 0){
         if (!change){
            if (np < 12){
                dp[0][np + 1] = s[pos];
                pos ++;
                np ++;
            }
            else{
                change = true;
                dp[1][np] = s[pos];
                np --;
                pos ++;
            }
         }
         else{
            dp[1][np] = s[pos];
            np --;
            pos ++;
         }
         d--;
    }
    bool go = false;
    while (ii < 27){
        if (!go){
            if (np > 0){
                dp[1][np] = s[ii];
                np --;
            }
            else{
                dp[1][np] = s[ii];
                go = true;
            }
        }
        else{
            dp[0][np] = s[ii];
            np ++;
        }
        ii ++;
    }
    pos = mm[now] - 1;
    go = false;
    while (pos >= 0){
        if (nnp < 0){
            nnp = 0;
            go = true;
        }
        if (!go){
            if (nnp > 0){
                dp[0][nnp] = s[pos];
                nnp --;
            }
            else{
                dp[0][nnp] = s[pos];
                go = true;
            }
        }
        else{
            dp[1][nnp] = s[pos];
            nnp ++;
        }
        pos --;
    }
    for (int i=0;i<2;i++){
        for (int j=0;j<13;j++){
            cout << dp[i][j];
        }
        cout << endl;
    }
    return 0;
}

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef long double ld;
typedef pair<ll, ll> par;
typedef vector<par> vpar;
typedef vector<bool> vbool;

#define forn(i, b, n) for (ll i = b; i < n; ++i)
#define rforn(i, b, n) for (int i = b; i >= n; --i)
#define vec vector
#define mp make_pair
#define add push_back
#define del pop_back
#define F first
#define S second
#define pw(x) (1ll << (x))
#define sqr(x) ((x)*(x))
#define all(x) (x).begin(), (x).end()

const ll INF = ll(1e18);
const ll MOD = ll(1e9) + 7;
const ll P = 259;
const ld EPS = 1e-10;

inline void error() {
	cout << "No";
	exit(0);
}

inline ll logn(ll n) {
	ll xx = ll(log2(ld(n)));
	return xx;
}

#define TASK "HashOnSparse"

int source() {
	string s;
	cin >> s;
	ll n = s.size();
	char x = 0;
	forn(i, 1, n) {
		if (s[i] == s[i - 1]) {
			cout << "Impossible";
			return 0;
		}
	}
	vec<bool> count(26);
	forn(i, 0, n) {
		if (count[s[i] - 'A']) x = s[i];
		count[s[i] - 'A'] = 1;
	}
	vec<string> a(2, string(13, 'A'));
	ll l = -1, r = -1;
	forn(i, 0, n) {
		if (s[i] == x) {
			if (l == -1) l = i;
			else r = i;
		}
	}
	ll m = (l + r) / 2;
	ll curl = 0ll;
	ll curr = 0ll;
	for (ll i = m; i > l; --i) {
		a[0][curl] = s[i];
		curl++;
	}
	ll siz = r - l - 1;
	for (ll i = m + 1; i < r; ++i) {
		a[1][curr] = s[i];
		curr++;
	}
	if (siz % 2) {
		a[1][curr] = x;
		curr++;
	}
	else {
		a[0][curl] = x;
		curl++;
	}
	if (n - r <= l) {
		for (ll i = r + 1; i < n; ++i) {
			a[0][curl] = s[i];
			++curl;
		}
		bool rev = 1;
		for (ll i = l - 1; i >= 0; --i) {
			if (rev) {
				a[1][curr] = s[i];
				++curr;
				if (curr == 13) {
					rev = 0;
					curr--;
				}
			}
			else {
				a[0][curr] = s[i];
				curr--;
			}
		}
	}
	else {
		for (ll i = l - 1; i >= 0; --i) {
			a[0][curl] = s[i];
			++curl;
		}
		bool rev = 1;
		forn(i, r + 1, n) {
			if (rev) {
				a[1][curr] = s[i];
				++curr;
				if (curr == 13) {
					rev = 0;
					curr--;
				}
			}
			else {
				a[0][curr] = s[i];
				curr--;
			}
		}
	}
	cout << a[0] << '\n' << a[1];

	return 0;
}

int main() {
#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#else
	//freopen(TASK".in", "r", stdin);
	//freopen(TASK".out", "w", stdout);
#endif
	srand(time(0));
	ios::sync_with_stdio(0);
	source();
	return 0;
}

#include <bits/stdc++.h>

using namespace std;

#define debug(x) cout << #x << " = " << (x) << endl

char ans[2][13];

int main() {
#ifndef LOCAL
#define endl '\n'
  ios_base::sync_with_stdio(false); cin.tie(NULL);
#endif

  string line;
  while (cin >> line) {
    int ok = true;
    vector<int> frec(30);
    frec[line[0] - 'A']++;
    for (int i = 1; i < (int)line.size(); ++i) {
      if (line[i] == line[i - 1])
        ok = false;
      frec[line[i] - 'A']++;
    }
    if (!ok) {
      cout << "Impossible" << endl;
      continue;
    }

    char A = 'A';
    for (int i = 0; i < (int)frec.size(); ++i) {
      if (frec[i] == 2) {
        A = i + 'A';
      }
    }
    int x = -1, y = - 1;
    for (int i = 0; i < (int)line.size(); ++i) {
      if (line[i] == A) {
        if (x == -1) x = i;
        else         y = i;
      }
    }

    memset(ans, -1, sizeof ans);

    int delta = (y - x - 1) / 2;
    int start = 12 - delta;
    int id = x;
    for (int i = start; i < 13; ++i) {
      ans[0][i] = line[id];
      id = (id + 1) % line.size();
    }
    for (int i = 12; i >= 0;) {
      if (line[id] != A) {
        ans[1][i] = line[id];
        i--;
      }
      id = (id + 1) % line.size();
    }
    for (int i = 0; i < start; ++i) {
      ans[0][i] = line[id];
      id = (id + 1) % line.size();
    }
    for (int i = 0; i < 2; ++i) {
      for (int j = 0; j < 13; ++j) {
        cout << ans[i][j];
      }
      cout << endl;
    }
  }
  return 0;
}

#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < n; i++)
using namespace std;
string s,a="";
int i1,i2;
int main()
{
    cin >> s;
    rep(i,s.size())
        for(int j=i+1;j<s.size();j++)
            if(s[i]==s[j]) i1=i,i2=j;
    if(i2-i1==1) { cout << "Impossible\n";return 0; }
    rep(i,s.size()) if(i!=i2) a+=s[i];
    rotate(a.begin(),a.begin()+i1+(i2-i1+1)/2,a.end());
    rep(i,13) cout << a[i];cout << endl;
    for(int i=25;i>12;i--) cout << a[i];cout << endl;
}

#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cmath>
#include<iostream>
#include<algorithm>
#include<queue>
#include<map>
#include<set>
#include<utility>
#define N 200005
#define inf 0x7fffffff
#define INF 0x7fffffffffffffff
#define ll long long
using namespace std;
int ra()
{
    int x=0,f=1; char ch=getchar();
    while (ch<'0' || ch>'9') {if (ch=='-') f=-1; ch=getchar();}
    while (ch>='0' && ch<='9') {x=x*10+ch-'0'; ch=getchar();}
    return x*f;
}
string ch;
int pos[100],next_pos,last_pos,len,orz;
int ans[100][100],cnt;
int main()
{
	cin>>ch;  char chans;
	for (int i=0; i<=26; i++)
	{
		if (pos[ch[i]]) next_pos=i+1,last_pos=pos[ch[i]],chans=ch[i];
		pos[ch[i]]=i+1;
	}
	len=next_pos-last_pos-1;
	if (len==0)
	{
		cout<<"Impossible";
		return 0;
	}
	orz=len/2+(len%2);
	ans[2][13-orz]=ch[last_pos-2];
	ans[1][13-orz+(len%2)]=chans;
	int x=1,y=13-orz+(len%2);
	for (;;)
	{
		++cnt;
		if (y+cnt<=13) ans[1][y+cnt]=ch[last_pos+cnt-1];
		else break;
	}
	int tot=0; cnt--;
	for (;;)
	{
		if (13-tot==13-orz) break;
		else ans[2][13-tot]=ch[last_pos+cnt]; cnt++;
		tot++;
	}
	tot=0;
	for (;;)
	{
		tot--; cnt++;
		if (y+tot>=1) ans[1][y+tot]=ch[last_pos+cnt];
		else
		{
			tot=0;
			for (; last_pos+cnt<=26; cnt++)
				ans[2][++tot]=ch[last_pos+cnt];
			break;
		}
	}
	tot=13-orz,cnt=0;
 	for (;;)
	{
		cnt++; tot--; ///cout<<tot; while (1);
		if (tot>=0 && last_pos-cnt-2>=0) ans[2][tot]=ch[last_pos-cnt-2];
		else
		{
			if (ans[1][1]<(int)'A' || ans[1][1]>(int)'Z')
			{
			tot=0;
			for (;cnt<=last_pos ; cnt++,tot++)
				ans[1][tot]=ch[last_pos-cnt];}
			break;
		}
	}
	for (int i=1; i<=2; i++,cout<<endl)
		for (int j=1; j<=13; j++)
			cout<<(char)ans[i][j];
	return 0;        //mdzz  sb大暴力！！
}
/*ABCDEFGHIJKLMNOPQRSTUVWXYZX*/

#include <bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define rep(i,n) for(int i = 0; i < n; i++)
#define rp(i,a,n) for(int i=a;i<=int(n);i++)
#define all(x) (x).begin(), (x).end()
#define ll long long
#define sc(x) scanf("%d", &x)
#define F first
#define S second
#define fill(a,b) memset(a,b,sizeof a)
#define N 100005
int dr[8] = {1,1,0,-1,-1,-1, 0, 1};
int dc[8] = {0,1,1, 1, 0,-1,-1,-1};
using namespace std;

string s,a="";
int vis[30];
char tmp[4][30];
bool good(char x,char y) {
    rp(i,1,13)
        if(tmp[1][i]==x)
            rep(j,8) if(tmp[ 1+dr[j] ][ i+dc[j] ] == y) return true;
    rp(i,1,13)
        if(tmp[2][i]==x)
            rep(j,8) if(tmp[ 2+dr[j] ][ i+dc[j] ] == y) return true;
    return false;
}
bool ok(string x) {
    memset(tmp,'.',sizeof tmp);
    rp(i,1,13) tmp[1][i]=x[i-1];
    rp(i,1,13) tmp[2][i]=x[26-i];
    rep(i,s.size()) {
        if(i==0){
            if(!good(s[i],s[i+1])) return false;
        }else if(i==s.size()-1){
            if(!good(s[i],s[i-1])) return false;
        }else if(!good(s[i-1],s[i]) || !good(s[i],s[i+1]))
            return false;
    }
    return true;
}
int main()
{
    cin >> s;
    rep(i,s.size()) {
        if(s[i]==s[i-1]) return cout << "Impossible\n",0;
        if(!vis[ s[i]-'A']) a+=s[i];
        vis[ s[i]-'A']=1;
    }
    rep(k,30) {
        rotate(a.begin(),a.begin()+1,a.end());
        if(ok(a)) {
            rep(i,13) cout << a[i];cout << endl;
            rep(i,13) cout << a[25-i];cout << endl;
            return 0;
        }
    }
}

#define _USE_MATH_DEFINES
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <queue>
#include <list>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <complex>
#include <cmath>

using namespace std;

typedef long long int64;
typedef pair<int, int> ii;
const int INF = 1 << 30;

char s[30];
int idx[26];
char ret[2][14];

int main() {
  memset(idx, 255, sizeof(idx));
  scanf("%s", s);
  // reverse(s, s + 27);
  int u = -1, v = -1;
  for (int i = 0; i < 27; ++i) {
    int x = s[i] - 'A';
    if (idx[x] < 0) {
      idx[x] = i;
    } else {
      u = idx[x];
      v = i;
    }
  }
  int len = v - u - 1;
  if (len == 0) {
    puts("Impossible");
    return 0;
  }
  // cout << u << " " << v << " " << len << endl;
  for (int i = 0; i < 2; ++i) {
    for (int j = 0; j < 13; ++j) {
      ret[i][j] = '.';
    }
    ret[0][13] = 0;
  }
  if (u + 1 + len / 2 > 13) {
    reverse(s, s + 27);
    swap(u, v);
    u = 26 - u;
    v = 26 - v;
  }
  ++u;
  // cout << u << " " << v << " " << len << endl;
  for (int i = v; i < 26; ++i) s[i] = s[i + 1];
  // cout << u << " " << len << endl;
  for (int i = 0; i < u + len / 2; ++i) {
    ret[0][12 - i] = s[u + len / 2 - 1 - i];
  }
  // cout << ret[0] << endl;
  for (int i = 0; i < 13; ++i) {
    ret[1][12 - i] = s[u + len / 2 + i];
  }
  for (int i = 0; i < 26 - (13 + u + len / 2); ++i) {
    ret[0][i] = s[u + len / 2 + 13 + i];
  }
  for (int i = 0; i < 2; ++i) {
    puts(ret[i]);
  }
  return 0;
}

#include<bits/stdc++.h>
using namespace std;

#define ls short int
#define ll long long
#define ld long double
#define inf LONG_LONG_MAX
#define ninf LONG_LONG_MIN
//#define mod 1000000007
#define mod 998244353
#define pi 3.14159265358979323846
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
#define s(x) sort(x.begin(),x.end())
#define rs(x) sort(x.rbegin(),x.rend())
#define all(v) v.begin(),v.end()
#define preci(x) fixed<<setprecision(x)
#define deb(x) cout<<#x<<" : "<<x<<endl;
#define deb2(x,y) cout<<#x<<" : "<<x<<"\t"<<#y<<" : "<<y<<endl;
#define deb3(x,y,z) cout<<#x<<" : "<<x<<"\t"<<#y<<" : "<<y<<"\t"<<#z<<" : "<<z<<endl;
#define debv(x) cout<<#x<<": "; for(int zz=0; zz<x.size(); zz++) cout<<x[zz]<<" "; cout<<"\n"

#define N 200005
//vector<bool> visited(N,false);
//vector<ll> adj[N];
//vector<ll> parent(N,-1);
//vector<ll> level(N,0);
ll ans1=ninf;
//vector<ll> vv(N),subsum(N);

ll expo(ll x,ll n,ll M)
{
    if(n==0)
        return 1;
    else if(n%2 == 0)        //n is even
        return  (expo((x*x)%M,n/2,M))%M;
    else                             //n is odd
        return (x*expo((x*x)%M,(n-1)/2,M))%M;
}

//bool sortbysec(pair<ll,ll> p1, pair<ll,ll> p2)
bool sortbysec(pair<pair<ll,ll>,ll> p1, pair<pair<ll,ll>,ll> p2)
{
    if(p1.ff.ff==p2.ff.ff)
        return p1.ff.ss>p2.ff.ss;

    return p1.ff.ff<p2.ff.ff;
}

/*
void dfs(ll v, ll par, ll lev)
{
    //visited[v]=true;
    level[v]=lev;
    dp[v]=1;        //it includes the node itself too

    for(ll j=0;j<adj[v].size();j++)
    {
        //if(!visited[adj[v][j]])
            //dfs(adj[v][j]);
        ll u=adj[v][j];
        if(u==par)
            continue;

        dfs(u,v,lev+1);

        dp[v]+= dp[u];
    }
}*/
/*
ll find(vector<ll> &parent, ll i)
{
    while(parent[i] != i)
    {
        parent[i]=parent[parent[i]];
        i=parent[i];
    }
    return parent[i];
}

void Union(vector<ll> &parent, ll i, ll j)
{
    ll x=find(parent,i);
    ll y=find(parent,j);

    parent[x]=y;
}

ll lpsarray(string st)
{
    ll n=st.length();

    vector<ll> lps(n,0);
    lps[0]=0;

    ll len=0;
    ll i=1;

    while(i<n)
    {
        if(st[i]==st[len])
        {
            len++;
            lps[i]=len;
            i++;
        }
        else
        {
            if(len!=0)
            {
                len=lps[len-1];
            }
            else
            {
                lps[i]=0;
                i++;
            }
        }
    }

    return (lps[n-1]>n/2) ? n/2:lps[n-1];
}

void subtreeSum(ll node, ll par)
{
    subsum[node]=vv[node];

    for(auto it:adj[node])
    {
        if(it==par)
            continue;
        subtreeSum(it,node);
        subsum[node]+= subsum[it];
    }
}*/

ll solve(char cc)
{
    if(cc=='f')
        return 1;
    else if(cc=='e')
        return 2;
    else if(cc=='d')
        return 3;
    else if(cc=='a')
        return 4;
    else if(cc=='b')
        return 5;
    else
        return 6;
}

int main()
{
   // freopen("input.txt", "r", stdin);
   // freopen("output.txt", "w", stdout);

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    ll i,j,k,a,b,c,t,x,y,n,m,z,flag=0,ans=0,sum=0;
    //i,j,k,a,b,c,t,n,m,z,flag=0,ans=0;
    //cin>>t;
    t=1;

    while(t--)
    {
        string st, pt;

        cin>>st;
        n=st.length();

        vector<int> freq(27,0);

        char cc;
        for(i=0;i<n;i++)
        {
            freq[st[i]-65]++;

            if(freq[st[i]-65]==2)
            {
                cc=st[i];
                break;
            }

            //deb(freq[st[i]]);
        }

        x=y=-1;
        for(i=0;i<27;i++)
        {
            if(st[i]==cc)
            {
                if(x==-1)
                    x=i;
                else
                    y=i;
            }
        }

       // deb3(cc,x,y);

        z=y-x;

        if(z==1)
        {
            cout<<"Impossible";
            return 0;
        }

        //vector<char> c1(13);
        //vector<char> c2(13);

        char c1[15], c2[15];

        //deb3(x,y,z);

        if(z%2 == 1)
        {
            z-= 1;
            c1[12-z/2]=cc;
            //c2[12-z/2]=cc;

            //deb(c1[0]);

            i=12-z/2;
            a=x;
            i++;
            a++;

            //deb2(i,a);
            while(i<13)
            {
                c1[i]=st[a];
                a++;
                i++;
            }

            j=12;
            while(a<y)
            {
                c2[j]=st[a];
                a++;
                j--;
            }

            pt="";
            for(k=y+1;k<n;k++)
                pt+= st[k];

            for(k=0;k<x;k++)
              pt+= st[k];

            //deb(pt);

            ll nn=pt.length();
            k=0;

            //deb(j);
            for(c=j;c>=0 && k<nn;c--)
            {
                c2[c]=pt[k];
                k++;
            }
            for(c=0;k<nn;c++)
            {
                c1[c]=pt[k];
                k++;
            }

            for(i=0;i<13;i++)
            {
                cout<<c1[i];
            }
            cout<<"\n";
            for(i=0;i<13;i++)
            {
                cout<<c2[i];
            }
        }
        else
        {
            z-= 1;
            c1[12-z/2]=cc;
            //c2[12-z/2]=cc;

            i=12-z/2;
            a=x;
            i++;
            a++;
            while(i<13)
            {
                c1[i]=st[a];
                a++;
                i++;
            }

            j=12;
            while(a<y)
            {
                c2[j]=st[a];
                a++;
                j--;
            }
            pt="";
            for(k=y+1;k<n;k++)
                pt+= st[k];

            for(k=0;k<x;k++)
              pt+= st[k];

            //deb(pt);

            ll nn=pt.length();
            k=0;

            //deb(j);
            for(c=j;c>=0 && k<nn;c--)
            {
                c2[c]=pt[k];
                k++;
            }
            for(c=0;k<nn;c++)
            {
                c1[c]=pt[k];
                k++;
            }

            //deb(pt);
            for(i=0;i<13;i++)
            {
                cout<<c1[i];
            }
            cout<<"\n";
            for(i=0;i<13;i++)
            {
                cout<<c2[i];
            }
        }
    }

    return 0;

}

#define _CRT_SECURE_NO_DEPRECATE
#pragma comment(linker, "/STACK:200000000")

#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cmath>
#include <algorithm>
#include <functional>
#include <utility>
#include <set>
#include <map>
#include <vector>
#include <string>
#include <queue>
#include <iostream>
#include <sstream>
#include <stack>
#include <limits>
#include <cassert>
#include <ctime>
#include <list>
#include <bitset>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include <iomanip>
#include <random>
#include <fstream>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;

template<typename T> inline T Abs(T a) { return a>0 ? a : -a; }
template<typename T> inline T sqr(T a) { return a*a; }
template<typename T> inline void relaxMin(T &a, T b) { if (b<a) a = b; }
template<typename T> inline void relaxMax(T &a, T b) { if (b>a) a = b; }

#define _(a,val) memset(a,val,sizeof a);
//#define REP(i, a, b) for(int i(a),_bb(b); i < _bb; ++i)
#define REP(i, a, b) for(int i = (a); i < (b); ++i)
#define REPD(i, a, b) for(int i = (b) - 1; i >= a; --i)
#define pb push_back
#define mp make_pair
#define all(a) a.begin(), a.end()

const int INF = (int)(1E9 + 42);
const ll INF64 = (ll)9E18;
//const ll INF64 = (ll)1E18;
//const int INF = INT_MAX/2-1;
const long double EPS = 1E-8;
const long double PI = 3.1415926535897932384626433832795;
#define y1 idfgoseincdjkg
typedef vector<int> vint;
typedef pair<int, int> pii;

#undef assert
int assert(bool expr) { if (!(expr)) { ++*(char*)0; }; return 0; }

char a[2][14];

void solve() {
    string s; cin >> s;
    int n = 27;

    int p1 = -1, p2 = -1;
    for (char ch = 'A'; ch <= 'Z'; ++ch) {
        int p[2];
        int cnt = 0;
        for (int i = 0; i < n; ++i) {
            if (s[i] == ch) {
                p[cnt++] = i;
            }
        }
        if (cnt == 2) {
            p1 = p[0];
            p2 = p[1];
        }
    }
    assert(p1 != -1); assert(p2 != -1);
    int d = abs(p1 - p2);
    if (d == 1) {
        puts("Impossible");
        return;
    }
    int r = 0;
    int c = (d - 1) / 2;
    for (int p = p1; p < p2; ++p) {
        a[r][c] = s[p];
        if (r == 0 && c == 0) {
            r = 1;
        } else {
            if (r == 0) --c;
            else ++c;
        }
    }
    for (int p = p2 + 1; p < n + p1; ++p) {
        a[r][c] = s[p % n];
        if (r == 1 && c == 12) {
            r = 0;
        } else {
            if (r == 0) --c;
            else ++c;
        }
    }
    cout << a[0] << endl;
    cout << a[1] << endl;
}

int main() {
#ifdef acm
    freopen("input.txt", "rt", stdin);
    freopen("output.txt", "wt", stdout);
    freopen("error.txt", "wt", stderr);
#else
    //freopen("polygon.in", "rt", stdin);
    //freopen("polygon.out", "wt", stdout);
#endif
    srand(0xA1B2C3D4);
    //srand(time(0));
    //while (solve());
    solve();

#ifdef acm
    printf("\n\n\n\n\n%.3lf\n", clock()*1e-3);
#endif
    return 0;
}

#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <cstring>
using namespace std;

set<char> seen;

char table[2][13];

int main() {
	string s;
	cin >> s;

	int n = s.size();

	char rep;

	for(int i=0; i<n; i++){
		if( seen.count(s[i]) ){
			rep = s[i];
		}
		seen.insert(s[i]);
	}

	int cnt = 0;
	int posA = -1, posB = -1;
	for(int i=0; i<n; i++){
		if(s[i] == rep && posA == -1){
			posA = i;
		}else if(s[i] == rep && posA != -1){
			posB = i;
			break;
		}
	}

	int len = posB - posA - 1;

	if(len == 0){
		cout << "Impossible" << endl;
		return 0;
	}

	//INSIDE LOOP START HERE
	int pos = 13 - (len/2);

	//PLACE REPEATED LETTER
	table[0][pos-1] = rep;

	//***PUTTING CICLE TO THE RIGHT OF REPEATED LETTER
	int k = posA + 1;
	for(int i=pos; i<13; i++, k++){
		table[0][i] = s[k];
	}

	for(int i=12; k < posB; i--, k++){
		table[1][i] = s[k];
	}
	//***END OF PUTTING CICLE

	k = posA - 1;
	for(int i = pos - 1 - (len%2!=0); i>=0 && k >= 0; i--, k--){
		table[1][i] = s[k];
	}

	if(k >= 0){
		for(int i=0; k>=0; k--, i++){
			table[0][i] = s[k];
		}
	}

	k = posB + 1;
	for(int i = pos - 2; i >= 0 && k<n ; i--, k++){
		table[0][i] = s[k];
	}

	if(k != n){
		for(int i=0; k<n; k++, i++){
			table[1][i] = s[k];
		}
	}

	for(int i=0; i<2; i++){
		for(int j=0; j<13; j++){
			cout << table[i][j];
		}
		cout << endl;
	}

	return 0;
}

#include <iostream>
#include<bits/stdc++.h>
using namespace std;
int x[27];
char ans[2][13];
void p() {
    for(int i =0;i<2;i++){
        for(int j =0;j<13;j++) cout <<ans[i][j];
        cout << endl;
    }
}
int main()
{
    ios_base::sync_with_stdio(false);
    string a;
    cin >> a;
    for(int i =0;i<2;i++){
       for(int j =0;j<26;j++) ans[i][j] = '0';
    }
    memset(x,0,27);
    memset(ans,'0',sizeof ans);
    char dbl;
    int ind = 0;
    int ind1 = 0;
    for(int i =0;i<27;i++){
      x[a[i]-'A']++;
      if(x[a[i]-'A'] ==2) {
        dbl = a[i];
        ind1 = i;
        break;
      }
    }
    for(int i =0;i<27;i++){
      if(a[i] == dbl) {
        ind = i;
        break;
      }
    }
        if(ind1 == ind+1) {
        cout << "Impossible";
        return 0;
    }
   int c = ind;
    for(int i =12 - (ind1-ind-1)/2 ;i<13;i++) {
        ans[0][i] = a[c];
        c++;
    }
    for(int i =12;i>12 - (ind1-ind-1)/2;i--) {
        ans[1][i] = a[c];
        c++;
    }
    if((ind1 - ind+1)%2==1 ) ans[1][12 - (ind1-ind-1)/2] = a[c];
     int ansi;
     if((ind1 - ind+1)%2==1 ) ansi = 12 - (ind1-ind-1)/2-1;
     else ansi = 12 - (ind1-ind-1)/2;
     c = ind1+1;
     bool x =false;
     while(true) {
        if(c==27) c = 0;
        if(ansi ==-1) {
                ansi =0;
                x=true;
        }
        if(!x) {
            if(ans[1][ansi] !='0') break;
            ans[1][ansi] = a[c];
            ansi--;
        }
        else {
            if(ans[0][ansi] !='0') break;
                ans[0][ansi] = a[c];
                ansi++;
        }
         c++;
     }
     p();

    return 0;
}

#pragma comment(linker, "/stack:640000000")
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <iostream>
#include <iomanip>
#include <iterator>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;

const double EPS = 1e-9;
const double PI=acos(-1.0);

#define    READ(f) 	     freopen(f, "r", stdin)
#define    WRITE(f)      freopen(f, "w", stdout)

#define    INF           999999999999999
#define    pii 	         pair<int, int>
#define    ii	         long long int
#define    uii 	         unsigned long long int
#define    ui            unsigned int
#define    bitCheck(a,k) ((bool)(a&(1<<(k))))
#define    bitOff(a,k)   (a&(~(1<<(k))))
#define    bitOn(a,k)    (a|(1<<(k)))
#define    bitFlip(a,k)  (a^(1<<(k)))
#define    iseq(a,b)     (fabs(a-b)<EPS)

template< class T > inline T _abs(T n) { return ((n) < 0 ? -(n) : (n)); }
template< class T > inline T _max(T a, T b) { return (!((a)<(b))?(a):(b)); }
template< class T > inline T _min(T a, T b) { return (((a)<(b))?(a):(b)); }
template< class T > inline T _swap(T &a, T &b) { a=a^b;b=a^b;a=a^b;}
template< class T > inline T gcd(T a, T b) { return (b) == 0 ? (a) : gcd((b), ((a) % (b))); }
template< class T > inline T lcm(T a, T b) { return ((a) / gcd((a), (b)) * (b)); }

///******************DELETE****************

#ifdef rafiul41
     #define debug(args...) {cerr<<"Debug: "; dbg,args; cerr<<endl;}
#else
    #define debug(args...)  // Just strip off all debug tokens
#endif

struct debugger{
    template<typename T> debugger& operator , (const T& v){
        cerr<<v<<" ";
        return *this;
    }
}dbg;

///**************************************************

map<char,int> mp;

char board[3][30];

int main()
{
#ifdef rafiul41

    //READ("in.txt");
    //WRITE("out.txt");

#endif // rafiul41
    string x;
    while(cin>>x)
    {
        int l=x.length();
        vector<char> v;
        int ajob,ind;
        for(int i=0;i<l;i++)
        {
            if(mp.find(x[i])==mp.end())
            {
                mp[x[i]]=i;
                v.push_back(x[i]);
            }
            else
            {
                ajob=i-mp[x[i]];
                ind=mp[x[i]];
            }
        }
        debug(ind,ajob,v.size())
        if(ajob==1)
            printf("Impossible\n");
        else
        {
            bool row=1;
            int col;
            if(ajob%2==0)
                col=ajob/2-1;
            else
                col=ajob/2;
            int dir=1;
            int cc=26;
            while(cc)
            {
                board[row][col]=v[ind];
                ind++;
                ind%=26;
                if(dir==1)
                    col--;
                else
                    col++;
                if(col==-1)
                {
                    row=!row;
                    col++;
                    dir=0;
                }
                if(col==13)
                {
                    row=!row;
                    col--;
                    dir=1;
                }
                cc--;
            }
            for(int i=0;i<2;i++)
            {
                for(int j=0;j<13;j++)
                {
                    printf("%c",board[i][j]);
                }
                printf("\n");
            }
        }
        mp.clear();
    }
    return 0;
}

#include<bits/stdc++.h>
using namespace std;

char result[2][13];

int main() {

	cin.sync_with_stdio(false);
	cout.sync_with_stdio(false);

	string s;
	cin>>s;

	int visited[26] = {0};

	for(int i = 0;i<s.size();i++)
		visited[s[i]-'A']++;

	int flag = 0;

	int counter = 0;
	for(int i = 0;i<26;i++) {
		if(visited[i]>1) {
			flag = 1;
			counter++;
		}
	}

	int found = 0;
	if(flag == 0 || counter>1)
		cout<<"Impossible"<<endl;
	else {

		char c;
		for(int i = 0;i<26;i++) {
			if(visited[i]>1) {
				c = char('A' + i);

				int first = 0;
				while(first<s.size() && s[first]!=c)
					first++;

				int second = first + 1;
				while(second<s.size() && s[second]!=c)
					second++;

				if(second-first ==1)
					break;

				int len = second - first -1;

				found = 1;
				int k = first + 1;
				int b = len/2;

				for(int i= b-1;i>=0;i--)
					result[0][i] = s[k++];

				if(len%2==0) {

					for(int i = 0;i<=b-1;i++)
						result[1][i] = s[k++];

					result[0][b] = s[k++];

					int row = 1;
					int col = b;

					int INC = 1;
					while(k<s.size()) {
						result[row][col] = s[k++];
						col+=INC;
						if(col == 13) {
							col = 12;
							row = 0;
							INC = -1;
						}
					}

					int curr = 0;
					while(curr!=first) {
						result[row][col] = s[curr++];
						col+=INC;
						if(col == 13) {
							col = 12;
							row = 0;
							INC = -1;
						}
					}

				}
				else {

					for(int i = 0;i<=b;i++)
						result[1][i] = s[k++];

					result[0][b] = s[k++];

					int row = 1;
					int col = b+1;

					int INC = 1;
					while(k<s.size()) {
						result[row][col] = s[k++];
						col+=INC;
						if(col == 13) {
							col = 12;
							row = 0;
							INC = -1;
						}
					}

					int curr = 0;
					while(curr!=first) {
						result[row][col] = s[curr++];
						col+=INC;
						if(col == 13) {
							col = 12;
							row = 0;
							INC = -1;
						}
					}

				}

				break;
			}
		}

		if(found) {
			for(int i = 0;i<2;i++) {
				for(int j = 0;j<13;j++)
					cout<<result[i][j];
				cout<<endl;
			}
		}
		else
		{
			cout<<"Impossible"<<endl;
		}

	}

	return 0;
}

#include <bits/stdc++.h>

using namespace std;

#define forn(i, x, n) for (int i = int(x); i <= int(n); ++i)
#define for1(i, n, x) for (int i = int(n); i >= int(x); --i)
#define file ""
#define F first
#define S second
#define pb push_back

typedef long long ll;
typedef pair <ll, ll> PII;
typedef double ld;

const int N = 2e6 + 1;
const ll INF = 2e18;
const int B = 1e9 + 7;

char a[2][13];

int main () {
#ifdef machine42
	freopen (file"in", "r", stdin);
	freopen (file"out", "w", stdout);
#endif
	string s;
	cin >> s;
	map <char, int> prv;
	vector <int> v;
	forn(i, 0, 26) {
		if (prv.count(s[i])) {
			v.pb(prv[s[i]]);
			v.pb(i);
		}
		prv[s[i]] = i;
	}

	if (v[1] - v[0] == 1) {
		cout << "Impossible\n";
		return 0;
	}
	int d = (v[1] - v[0] - 1) / 2;
	a[0][12 - d] = s[v[0]];
	forn(i, 1, d)
		a[0][12 - d + i] = s[v[0] + i];
	forn(i, 1, d)
		a[1][13 - i] = s[v[0] + d + i];
	if ((v[1] - v[0] - 1) % 2 == 1)
		a[1][12 - d] = s[v[1] - 1];

	int r = 0, pos = 12 - d - 1, dir = -1;
	if (pos < 0) pos = 0, r ^= 1, dir *= -1;
	for1(i, v[0] - 1, 0) {
		a[r][pos] = s[i];
		if (pos == 0 && r == 0) r ^= 1, dir *= -1;
		else pos += dir;
	}

	r = 1, pos = 12 - d, dir = -1;
	if (pos < 0) pos = 0, r ^= 1, dir *= -1;
	if ((v[1] - v[0] - 1) % 2 == 1) --pos;
	forn(i, v[1] + 1, 26) {
		a[r][pos] = s[i];
		if (pos == 0 && r == 1) r ^= 1, dir *= -1;
		else pos += dir;
	}

    forn(i, 0, 1) {
    	forn(j, 0, 12) cout << a[i][j];
    	cout << "\n";
    }

	return 0;
}

#include<iostream>
#include<stdio.h>
#include<string.h>
#include<algorithm>
#include<vector>
#define INF 0x3f3f3f3f
using namespace std;
typedef long long LL;
char str[40], ans[2][40], p[40];
int pre[40], sum[40];
int main(){
    scanf("%s", str);
    int L=0, R=0;
    bool mark=true;
    memset(pre, -1, sizeof(pre));
    for(int i=0; i<27; i++){
        int a=str[i]-'A';
        sum[a]++;
        if(pre[a]==-1)
            pre[a]=i;
        else{
            L=pre[a];
            R=i;
            if(R-1==L){
                mark=false;
            }
        }
    }
    int k=0;
    for(int i=0; i<26; i++){
        if(sum[i]==0||sum[i]>2)
            mark=false;
        if(sum[i]==2)
            k++;
    }
    if(k!=1||!mark){
        printf("Impossible\n");
        return 0;
    }
    R=26-R;
    int cnt=0;
    if(L>R){
        int o=0;
        for(int i=26; i>=0; i--){
            p[o++]=str[i];
        }
        for(int i=0; i<27; i++)
            str[i]=p[i];
        swap(L, R);
    }
        int num=R-L;
        if(num&1){
            num=(num/2)+1;
        int i;
        for(i=num; ; i++){
            if(cnt==L)
                break;
            ans[0][i]=str[cnt++];
        }
        int flag=i-1;
        ans[1][i-1]=str[cnt++];
        for(; i<13; i++)
            ans[0][i]=str[cnt++];
        for(int i=12; i>flag; i--){
            ans[1][i]=str[cnt++];
        }
        cnt++;
        for(int i=flag-1; i>=0; i--)
            ans[1][i]=str[cnt++];
        if(num){
            for(int i=0; i<num; i++)
                ans[0][i]=str[cnt++];
        }
        }else{
            num=num/2;
            int i;
            for(i=num; ; i++){
                if(cnt==L)
                    break;
                ans[0][i]=str[cnt++];
            }
            int flag=i;
            ans[1][i]=str[cnt++];
            for(; i<13; i++)
                ans[0][i]=str[cnt++];
            for(int i=12; i>flag; i--){
                ans[1][i]=str[cnt++];
            }
            cnt++;
            for(int i=flag-1; i>=0; i--)
                ans[1][i]=str[cnt++];
            if(num){
                for(int i=0; i<num; i++)
                    ans[0][i]=str[cnt++];
            }

        }
    if(L==0&&R==0){
        cnt=0;
        for(int i=0; i<13; i++)
            ans[0][i]=str[cnt++];
        for(int i=12; i>=0; i--)
            ans[1][i]=str[cnt++];
    }
    for(int i=0; i<2; i++){
        for(int j=0; j<13; j++)
            printf("%c", ans[i][j]);
        printf("\n");
    }
}
//ABCDEFHIGJKLMNOPQRSGTUVWXYZ
//ABCDGFHIJKLMNOPQRSGTUVWXYZ
//GABCDEFHIJKLMNOPQRSTUGVWXYZ

#include <cstdio>
#include <iostream>
#include <cstring>
#include <string>
#define LL long long

using namespace std;

int s3[3][30+300] = { 0 };
string s1;
int cnt[30+300];

int main()
{
    int dis,pos,yuan;
    cin >> s1;
    int len = s1.size();
    string s2 = " ";
    s2 += s1;
    s1 = s2;
    for (int i = 1; i <= len; i++)
    {
        int t = s1[i] - 'A' + 1;
        if (!cnt[t])
            cnt[t] = i;
        else
        {
            if (cnt[t] == i - 1)//连续的则不可能
            {
                puts("Impossible");
                return 0;
            }
            dis = i - cnt[t] + 1;//记录前一个和当前所在的位置的差
            pos = cnt[t];//从前一个位置的开始构造
            yuan = i;
            break;
        }
    }
    int st = (13 - dis/2)+1,now=2;//st是第二行的开始位置
    s3[2][st] = s1[pos]-'A'+1;//now=2表示在搞第二行
    st++, pos++;
    int fx = 1;//这是第二行从左往右
    while (s1[pos] != s1[yuan])
    {
        if (st > 13)//开始搞第二行
        {
            st = 13;
            fx = -1;//第二行是从右往左
            now = 1;//now是当前的行数
        }
        s3[now][st] = s1[pos]-'A'+1;//赋值
        pos++;//搞下一个
        st +=fx;
    }
    if (s1[1] != s1[27])//最后一个字符和第一个相同则不需要填充两边了
    {
        pos++;
        if (pos > 27)//要按照第一行的最右到最左然后从第二行的最左到最右，这样就算又变成第一个，也能继续处理，且答案也是正确的;
            pos = 1;
        s3[now][st] = s1[pos] - 'A' + 1;
        pos++;
        if (pos > 27)
            pos = 1;
        st--;
        while (s1[pos] != s1[yuan])
        {
            if (st < 1)//小于1表示要到第二行了；
            {
                st = 1;
                fx = 1;//方向变成从左到右了；
                now = 2;//第二行继续搞;
            }
            int t = s1[pos] - 'A' + 1;
            s3[now][st] = t;
            pos++;
            if (pos > 27)
                pos = 1;
            st += fx;
        }
    }
    for (int i = 1; i <= 13; i++)
        putchar(char(s3[1][i] + 'A' - 1));
    puts("");
    for (int i = 1;i <= 13;i++)
        putchar(char(s3[2][i] + 'A' - 1));
    puts("");
    return 0;
}

#include<bits/stdc++.h>
using namespace std;

#define IO    ios::sync_with_stdio(false);cin.tie(0);
#define int   long long
// #define endl  '\n'

mt19937 rnd(time(0));

const double eps = 1e-10;
const int inf = 0x3f3f3f3f3f3f3f3fLL;
// const int inf = 2e9;

const int N = 2e5 + 5;
const int MOD = 1e9 + 7;
// const int MOD = 998244353;

int pw(int b, int p){
	b %= MOD;
	int res = 1;

	while(p > 0){
		if(p & 1)
			res = res * b % MOD;
		b = b * b % MOD;
		p >>= 1;
	}
	return res;
}

string s;
string g[2];
const int X[] = {-1, -1, -1, 0, 1, 1, 1, 0};
const int Y[] = {-1,  0,  1, 1, 1, 0, -1, -1};

bool check(int a, int b){
	return (a >= 0 && a < 2 && b >= 0 && b < 13);
}

bool bfs(){
	int x, y;
	for(int i = 0 ; i < 2 ; i++){
		for(int j = 0 ; j < 13 ; j++){
			if(g[i][j] == s[0])
				x = i, y = j;
		}
	}

	// cout << x << ' ' << y << endl;

	for(int i = 1 ; i < s.size() ; i++){
		int flag = 0;
		for(int j = 0 ; j < 8 ; j++){
			int curx = x + X[j];
			int cury = y + Y[j];
			if(check(curx, cury) && g[curx][cury] == s[i]){
				x = curx, y = cury;
				flag = 1;
				break;
			}
		}
		if(!flag) return false;
	}

	return true;
}

void rotate(){
	char u = g[0][12], v = g[1][0];

	for(int j = 12 ; j >= 1 ; j--){
		g[0][j] = g[0][j - 1];
	}
	for(int j = 0 ; j < 12 ; j++){
		g[1][j] = g[1][j + 1];
	}

	g[1][12] = u, g[0][0] = v;
}

int32_t main(){

	IO

	cin >> s;

	vector<bool> vis(26);
	int id, n = s.size();

	for(int i = 0 ; i < n ; i++){
		if(vis[s[i] - 'A']){
			id = i;
			break;
		}
		vis[s[i] - 'A'] = 1;
	}

	string t = "";
	for(int i = 0 ; i < n ; i++){
		if(i == id) continue;
		t += s[i];
	}

	g[0] = t.substr(0, 13);
	g[1] = t.substr(13);
	reverse(g[1].begin(), g[1].end());

	for(int i = 0 ; i < 13 ; i++){
		if(bfs()){
			for(int ii = 0 ; ii < 2 ; ii++){
				cout << g[ii] << endl;
			}
			return 0;
		}

		// for(int ii = 0 ; ii < 2 ; ii++){
		// 	for(int jj = 0 ; jj < 13 ; jj++){
		// 		cout << g[ii][jj] << ' ';
		// 	}
		// 	cout << endl;
		// }
		// cout << endl;

		rotate();
	}

	cout << "Impossible";

	return 0;
}

//khodaya khodet komak kon
#include <bits/stdc++.h>

#define F first
#define S second
#define pb push_back
#define all(x) x.begin(), x.end()
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;

const int N = 200000 + 10;
const ll MOD = 1000000000 + 7;
const ll INF = 1000000010;
const ll LOG = 25;

char s[30];

int32_t main(){
	int a,b;
	cin>>s;
	for(int i = 0;i < 27;i++)for(int j=i+1;j<27;j++){
		if(s[i]==s[j]){
			a=i,b=j;
		  	break;
		}
	}
	if(b==a+1){
		cout<<"Impossible"<<endl;
		return 0;
	}
	for(int i=0,j=a+((b-a)+1)/2;i<13;i++,j++){
		if(j%27==b)j++;
		cout<<s[j%27];
	}
	cout<<endl;
	for(int i=0,j=a+((b-a)-1)/2;i<13;i++,j--){
	    if(j < 0)
	      j = 26;
		cout<<s[j%27];
	}
	return 0;
}

# include <iostream>
# include <algorithm>
# include <map>
# include <vector>
# include <set>
# include <string>
# include <math.h>
# include <queue>
# include <deque>

using namespace std;
const int MAXN = 1e5;
const long long inf = 1e9 + 7;

int main() {
    string s;
    cin >> s;
    bool f = true;
    for (int i = 0; i < 26; i++) if (s[i] == s[i + 1]) f = false;
    if (!f) {
        cout << "Impossible";
        return 0;
    }
    int pos = 0;
    for (int i = 0; i < 26; i++) {
        int cnt = 0;
        for (int j = 0; j < 27; j++) if ((s[j] - 'A') == i) cnt++;
        if (cnt == 2) pos = i;
    }
    int pos1, pos2;
    pos1 = -1;
    for (int i = 0; i < 27; i++) {
        if ((s[i] - 'A') == pos && pos1 == -1) pos1 = i;
        if ((s[i] - 'A') == pos && pos1 != -1) pos2 = i;
    }
    char ans[2][13];
    int del = (pos2 - pos1 - 1) / 2;
    int rad = 0;
    int mes = 12 - del;
    for (int i = 0; i < 26; i++) {
        if ((s[pos1] - 'A') == pos && i != 0) {
            pos1 = (pos1 + 1) % 27;
            i--;
            continue;
        }
        ans[rad][mes] = s[pos1];
        if (rad == 0) {
            pos1 = (pos1 + 1) % 27;
            mes++;
            if (mes == 13) {
                mes = 12;
                rad = 1;
            }
        }
        else {
            pos1 = (pos1 + 1) % 27;
            mes--;
            if (mes == -1) {
                mes = 0;
                rad = 0;
            }
        }
    }
    for (int i = 0; i < 13; i++) cout << ans[0][i];
    cout << endl;
    for (int i = 0; i < 13; i++) cout << ans[1][i];
    return 0;
}

#include "bits/stdc++.h"
#define MAXN 100009
#define INF 1000000007
#define mp(x,y) make_pair(x,y)
#define all(v) v.begin(),v.end()
#define pb(x) push_back(x)
#define wr cout<<"----------------"<<endl;
#define ppb() pop_back()
#define tr(ii,c) for(typeof((c).begin()) ii=(c).begin();ii!=(c).end();ii++)
#define ff first
#define ss second

using namespace std;

typedef long long ll;
typedef pair<int,int> PII;
template<class T>bool umin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
template<class T>bool umax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
int last[MAXN];
char ans[3][MAXN];
int ban[MAXN],pos,vis[MAXN],basla;
string s;
char f(){
	if(pos>=27)
		pos=0;
	if(ban[pos])
		pos++;
	if(pos>=27)
		pos=0;
	return s[pos++];
}
int main(){
	memset(last,-1,sizeof last);
	cin>>s;
	int dis;
	for(int i=0;i<int(s.size());i++){
		if(~last[s[i]-'A']){
			if(last[s[i]-'A']==i-1){
				printf("Impossible\n");
				return 0;
			}
			dis=i-last[s[i]-'A'];
			ban[i]=1;
			basla=last[s[i]-'A'];
		}
		last[s[i]-'A']=i;
	}
	int st=13-(dis-1)/2;
	pos=basla;
	for(int i=st;i<=13;i++)
		ans[2][i]=f();
	for(int i=13;i>=1;i--)
		ans[1][i]=f();
	for(int i=1;i<st;i++)
		ans[2][i]=f();
	for(int i=1;i<=2;i++){
		for(int j=1;j<=13;j++)
			cout<<ans[i][j];
		cout<<endl;
	}
	return 0;
}

#include<bits/stdc++.h>
#define pb push_back
#define pp push_back
#define mp make_pair
#define pii pair<int,int>
#define ll long long
using namespace std;
char ans[3][100];
int cnt[200],adr[200];
char c;
int main()
{
    string s;cin>>s;
    for(int i=0;i<s.size();i++){
        cnt[s[i]]++;
        if(cnt[s[i]]==2){
            c=s[i];
            cnt[s[i]]=i;
            break;
        }
        adr[s[i]]=i;
    }
    int leg=cnt[c]-adr[c];
    if(leg==1)
        return cout<<"Impossible",0;
    int now=0,i=adr[c]+(leg+1)/2-1;
    while(now!=13)
    {
        ans[1][now]=s[i];
        now++;
        i--;
        if(i==-1)
            i=s.size()-1;
    }
    now=0;
    i=adr[c]+(leg+1)/2;
    while(now!=14)
    {
        ans[2][now]=s[i];
        i++;
        now++;
        if(i==s.size())
            i=0;
    }
    /*
    if(leg==26)
        ans[2][12]=c;
    for(int i=0;i<=leg/2;i++)
        ans[1][leg/2-i]=s[adr[c]+i];
    for(int i=leg/2+1;i<leg;i++)
        ans[2][i-leg/2-1]=s[adr[c]+i];
    int i=adr[c]+leg;
    while(i-adr[c]-leg/2-1<13 && i+1!=s.size())
        ans[2][i-adr[c]-leg/2-1]=s[i+1],i++;
    int pre=i;
    while(pre-i+12>=0 && i+1!=s.size())
        ans[1][pre-i+12]=s[i+1],i++;
    i=adr[c]-1;
    pre=adr[c]-1;
    while(pre-i+leg/2+1<13 && i>=0)
        ans[1][pre-i+leg/2+1]=s[i],i--;
    pre=i;
    while(i-pre+12>=0 && i>=0)
        ans[2][i-pre+12]=s[i],i--;
    for(int i=1;i<=2;i++){
        for(int j=0;j<13;j++)
            cout<<ans[i][j];
        cout<<endl;
    }
    */
    for(int i=0;i<13;i++)
        cout<<ans[1][i];
    cout<<endl;
    for(int i=0;i<14;i++)
        if(ans[2][i]!=c)
            cout<<ans[2][i];
}

#include <iostream>
#include <string>
#include <math.h>
#include <fstream>
#include <sstream>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <map>
#include <unordered_set>
#include <set>
#include <stack>
#include <limits>
#include <queue>
#include <list>
#include <cstring>
#include <bitset>

using namespace std;

int main() {

    string s;
    cin >> s;
    int alpha[26] = {0};
    char c;
    for (int i = 0; i < s.length(); i++) {
        alpha[s[i] - 'A']++;
        if (alpha[s[i] - 'A'] == 2) {
            c = s[i];
        }
    }
    int mini = -1;
    int maxi = -1;
    for (int i = 0; i < s.length(); i++) {
        if (s[i] == c) {
            if (mini == - 1) mini = i;
            else maxi = i;
        }
    }

    if (maxi - mini == 1) {
        cout << "Impossible" << endl;
        return 0;
    }
    char res[2][13];
    for (int i = 0; i < 2; i++) {
        for (int j = 0; j < 13; j++) {
            res[i][j] = '.';
        }
    }
    int cnt1 = 0;
    for (int i = 0; i < (maxi - mini - 1) / 2; i++) {
        res[0][(maxi - mini - 1) / 2 - i - 1] = s[mini + i + 1];
        cnt1++;
    }
    int cnt2 = 0;
    for (int i = 0; i < (maxi - mini - 1) / 2 + (maxi - mini - 1) % 2; i++) {
        res[1][(maxi - mini - 1) / 2 - i - 1 + (maxi - mini - 1) % 2] = s[maxi - i - 1];
        cnt2++;
    }

    string ss = "";
    ss += s[maxi];
    for (int i = mini - 1; i >= 0; i--) {
        ss += s[i];
    }

    string sss = "";
    for (int i = maxi + 1; i < s.length(); i++) {
        sss += s[i];
    }
    int cnt = 0;
    int ccnt = 0;
    for (int j = 0; j < 13; j++) {
        if (j < cnt1) cout << res[0][j];
        else {
            if (cnt >= ss.length()) {
                cout << sss[sss.length() - ccnt - 1];
                ccnt++;
            } else {
                cout << ss[cnt];
                cnt++;
            }
        }
    }
    cout << endl;
    ccnt = 0;
    cnt = 0;
    for (int j = 0; j < 13; j++) {
        if (j < cnt2) cout << res[1][j];
        else {
            if (ccnt >= sss.length()) {
                cout << ss[ss.length() - cnt - 1];
                cnt++;
            }
            else {
             cout << sss[ccnt];
             ccnt++;
            }

        }
        //ABCDEFGHIJKLMNOPQRSTUVHWXYZ
    }
    cout << endl;

}

//BISMILLAHIRRAHMANIRRAHIM
/*
 manus tar shopner soman boro
 all my suceesses are dedicated to my parents
 The true test of a man's character is what he does when no one is watching.
 Don't let your dreams be dreams.

 Author :: Shakil Ahmed
.............AUST_CSE27.........
 prob   ::
 Type   ::
 verdict::

*/

#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair

// Macro
#define eps 1e-9
#define pi acos(-1.0)
#define ff first
#define ss second
#define re return
#define QI queue<int>
#define SI stack<int>
#define SZ(x) ((int) (x).size())
#define all(x) (x).begin(), (x).end()
#define sq(a) ((a)*(a))
#define distance(a,b) (sq(a.x-b.x) + sq(a.y-b.y))
#define iseq(a,b) (fabs(a-b)<eps)
#define eq(a,b) iseq(a,b)
#define ms(a,b) memset((a),(b),sizeof(a))
#define G() getchar()
#define MAX3(a,b,c) max(a,max(b,c))
#define II ( { int a ; read(a) ; a; } )
#define LL ( { Long a ; read(a) ; a; } )
#define DD ({double a; scanf("%lf", &a); a;})

double const EPS=3e-8;
using namespace std;

#define FI freopen ("input.txt", "r", stdin)
#define FO freopen ("output.txt", "w", stdout)

typedef long long Long;
typedef long long int64;
typedef unsigned long long ull;
typedef vector<int> vi ;
typedef set<int> si;
typedef vector<Long>vl;
typedef pair<int,int>pii;
typedef pair<string,int>psi;
typedef pair<Long,Long>pll;
typedef pair<double,double>pdd;
typedef vector<pii> vpii;

// For loop

#define forab(i, a, b)	for (__typeof (b) i = (a) ; i <= b ; ++i)
#define rep(i, n)		forab (i, 0, (n) - 1)
#define For(i, n)		forab (i, 1, n)
#define rofba(i, a, b)	for (__typeof (b)i = (b) ; i >= a ; --i)
#define per(i, n)		rofba (i, 0, (n) - 1)
#define rof(i, n)		rofba (i, 1, n)
#define forstl(i, s)	for (__typeof ((s).end ()) i = (s).begin (); i != (s).end (); ++i)

template< class T > T gcd(T a, T b) { return (b != 0 ? gcd<T>(b, a%b) : a); }
template< class T > T lcm(T a, T b) { return (a / gcd<T>(a, b) * b); }
#define __(args...) {dbg,args; cerr<<endl;}
struct debugger{template<typename T> debugger& operator , (const T& v){cerr<<v<<"\t"; return *this; }}dbg;
#define __1D(a,n) rep(i,n) { if(i) printf(" ") ; cout << a[i] ; }
#define __2D(a,r,c,f) forab(i,f,r-!f){forab(j,f,c-!f){if(j!=f)printf(" ");cout<<a[i][j];}cout<<endl;}

template<class A, class B> ostream &operator<<(ostream& o, const pair<A,B>& p){ return o<<"("<<p.ff<<", "<<p.ss<<")";} //Pair print
template<class T> ostream& operator<<(ostream& o, const vector<T>& v){ o<<"[";forstl(it,v)o<<*it<<", ";return o<<"]";} //Vector print
template<class T> ostream& operator<<(ostream& o, const set<T>& v){ o<<"[";forstl(it,v)o<<*it<<", ";return o<<"]";} //Set print

//Fast Reader
template<class T>inline bool read(T &x){int c=getchar();int sgn=1;while(~c&&c<'0'||c>'9'){if(c=='-')sgn=-1;c=getchar();}for(x=0;~c&&'0'<=c&&c<='9';c=getchar())x=x*10+c-'0'; x*=sgn; return ~c;}

//int dx[]={1,0,-1,0};int dy[]={0,1,0,-1}; //4 Direction
//int dx[]={1,1,0,-1,-1,-1,0,1};int dy[]={0,1,1,1,0,-1,-1,-1};//8 direction
//int dx[]={2,1,-1,-2,-2,-1,1,2};int dy[]={1,2,2,1,-1,-2,-2,-1};//Knight Direction
//int dx[]={2,1,-1,-2,-1,1};int dy[]={0,1,1,0,-1,-1}; //Hexagonal Direction

/* **************************************  My code start here ****************************************** */

char ans[ 30 ][ 30 ];
int pos[ 40 ];

int main()
{
   // I will always use scanf and printf
   // May be i won't be a good programmer but i will be a good human being
    char inp[ 30 ];
    scanf("%s",inp);
    int s , l ;
    ms( pos , -1 );
    for( int i = 0 ; i < 27 ; i++ )
    {
        if( pos[ inp[i] - 'A'] != -1 )
        {
            s = pos[ inp[i] - 'A'];
            l = i ;
        }
        else
        {
            pos[ inp[i] - 'A' ] = i ;
        }
    }
    if( l - s - 1 == 0 )
    {
        printf("Impossible\n");
    }
    else
    {
       //printf(" s :: %d l = :: %d" , s , l );

        int middle = l - s - 1 ;
      //  printf(" middhle :: %d" , middle );
        int p = 12 - ( middle / 2 ) ;
       // printf(" p :: %d\n",p);
        ans[0][p] = inp[s];
        int x = 0 , y = p ;
        for( int i = 0 , j = s ; i < 27 ; i++ , j++ )
        {
            if( j == l ) continue;

            if( x == 0 && y<= 12 )
            {
                ans[x][y] = inp[j];
               // printf(" x :: %d y + 1 :: %d c : %c\n",x,y+1,inp[j]);

                y++;
            }
            else if( x == 0 && y == 13 )
            {
                y--;
                x = 1 ;
                ans[x][y] = inp[j];
                y--;
            }
            else if( x == 1 && y == -1)
            {
                y++;
                x = 0;
                ans[x][y] = inp[j];
                y++;
            }
            else
            {
                x = 1 ;
                ans[x][y] = inp[j];
             //   printf("x :: %d y :: %d c :: %c\n",x,y,inp[j]);
                y--;
            }
        }

        x = 0 , y = p ;
        for( int i = s - 1 ; i >= 0 ; i-- )
        {   //printf("i :: %d\n",i);
            if( x == 0 && y - 1>= 0 )
            {
                ans[x][y-1] = inp[i];
                y--;
            }
            else
            {
                x = 1 ;
                ans[x][y] = inp[i];
                y++;
            }
        }
        x = 1 ;
        y = p ;

        for( int i = 0 ; i < 2 ; i++ )
        {
            for( int j = 0 ; j <= 12 ; j++ ) printf("%c",ans[i][j]);
            puts("");
        }

    }

    return 0;
}
/*
ZXZCVBNMLKJHGFDSAQWERTYUIOP
*/

#include<bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<char> vc;
typedef vector<bool> vb;

int mp[300];

int main(){
    ios::sync_with_stdio(false); cin.tie(0);

    string s; cin >> s;
    int l, r;

    for(int i=0; i<=26; i++){
        if(mp[s[i]]){
            l = mp[s[i]];
            r = i+1;
            break;
        }
        mp[s[i]] = i+1;
    }

    if(l+1==r){
        cout << "Impossible\n";
        return 0;
    }

    l--; r--;
    string q, w, t;
    int y = r-l-1;

    q = q+s[l];
    for(int i=1; i<=y/2; i++){
        q = q+s[l+i];
    }

    for(int i=y/2+1; i<=y; i++){
        w = s[l+i]+w;
    }

    for(int i=r+1; i<=26; i++){
        t += s[i];
    }

    for(int i=0; i<=l-1; i++){
        t += s[i];
    }

    string t1, t2;
    t1 = t.substr(0, 12-y/2);
    t2 = t.substr(12-y/2, t.size() - (12-y/2));

    reverse(t1.begin(), t1.end());
    q = t1+q;
    w = t2+w;

    cout << q << '\n' << w << '\n';

    return 0;
}

#include <bits/stdc++.h>
using namespace std;

#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define trav(a, x) for(auto& a : x)
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef long double ld;

const ll big = 1000000007;

string s;
ll X[27];
ll Y[27];
ll nex[27];
ll ind[26];

char ANS[2][13];

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);

    cin >> s;
    for(int x = 0; x < 2; x++){
        for(int y2 = 0; y2 < 13; y2++){
            ll y = y2;
            if(x == 1)y = 12-y2;
            ll i = x*13+y2;
            X[i] = x;
            Y[i] = y;
            nex[i] = (i+1)%26;
        }
    }

    ll start = 0;
    ll diff = 0;
    for(int c1 = 0; c1 < 27; c1++){
        ll a = s[c1]-'A';
        if(ind[a] != 0){
            start = ind[a]-1;
            diff = c1-ind[a];
            break;
        }
        ind[a] = c1+1;
    }
    if(diff == 0){
        cout << "impossible\n";
        return 0;
    }

    X[26] = 1;
    Y[26] = diff/2;
    nex[(diff-1)/2] = 26;
    nex[26] = (diff+1)/2;
    start = (51-diff/2-start)%26;

    for(int c1 = 0; c1 < 27; c1++){
        ANS[X[start]][Y[start]] = s[c1];
        start = nex[start];
    }

    for(int c1 = 0; c1 < 2; c1++){
        for(int c2 = 0; c2 < 13; c2++){
            cout << ANS[c1][c2];
        }cout << "\n";
    }

    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    string s;
    cin>>s;
    string cyc,p1,p2;
    int cou[26];
    memset(cou,0,sizeof(cou));
    int i,n=s.length();

    for(i=1;i<n;i++)
        if(s[i]==s[i-1])
        {
            cout<<"Impossible"<<'\n';
            return 0;
        }

    char spc;
    for(i=0;i<n;i++)
    {
        cou[s[i]-'A']++;
        if(cou[s[i]-'A']==2)
            spc=s[i];
    }
    //cout<<spc<<'\n';
    int cycs1=-1,cyce1=-1;
    for(i=0;i<n;i++)
    {
        if(s[i]==spc && cycs1==-1)
        {
            cycs1=i;
        }
        else if(s[i]==spc)
        {
            cyce1=i;
        }
    }
    //cout<<cycs1<<' '<<cyce1<<'*'<<'\n';
    int lenc=cyce1-cycs1;
    char ans[2][13];
    for(i=0;i<2;i++){
        for(int j=0;j<13;j++)
            ans[i][j]='$';
        }
    int stdis=((lenc+lenc%2))/2;
    stdis--;
    int currind=cycs1;
    for(i=stdis;i>=0;i--)
    {
        ans[0][i]=s[currind];
        currind++;
    }
    currind=cyce1-1;
    for(i=stdis-(lenc%2);i>=0;i--)
    {
        ans[1][i]=s[currind];
        currind--;
    }
     //for(i=0;i<2;i++){
        //for(int j=0;j<13;j++)
        //    cout<<ans[i][j]<<' ';
        //cout<<'\n';
    //}
    //cout<<'\n';
    //cout<<'\n';
    currind=cycs1-1;
    int lenp1,lenp2;
    lenp1=cycs1;
    lenp2=n-cyce1-1;
    int currlen=lenp1;
    //cout<<currlen<<'\n';
    //cout<<'\n';
    //cout<<'\n';
    for(i=stdis+1;i<13;i++)
    {
        if(currlen==0)
            break;
        ans[0][i]=s[currind];
        currind--;
        currlen--;
    }
    //cout<<currind<<' '<<currlen<<'\n';

    for(i=12;i>=(12)-(currlen-1);i--)
    {
        //if(currlen==0)
        //    break;
        ans[1][i]=s[currind];
        currind--;
        //currlen--;
    }

    /*for(i=0;i<2;i++){
        for(int j=0;j<13;j++)
            cout<<ans[i][j]<<' ';
        cout<<'\n';
    }*/

    // cout<<'\n';
    //cout<<'\n';

    currlen=lenp2;
    currind=cyce1+1;
    for(i=stdis+1-(lenc%2);i<13;i++)
    {
        if(currlen==0)
            break;
        ans[1][i]=s[currind];
        currind++;
        currlen--;
    }
    for(i=12;i>=(12)-(currlen-1);i--)
    {
        ans[0][i]=s[currind];
        currind++;
        //currlen--;
    }
    for(i=0;i<2;i++){
        for(int j=0;j<13;j++)
            cout<<ans[i][j];
        cout<<'\n';
    }

    return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define f first
#define s second
#define ll long long
#define mp make_pair
#define MAX 100005
#define mod 100000000
#define pb push_back
#define INF 1000005
#define pii pair<int,bool>

char ans[2][14];
int vis[100];
int main()
{
    string s;
    cin>>s;
    int pos,i;
    char rep;
    for(i=0;i<27;i++)
    {
        if(!vis[s[i]])
            vis[s[i]]=i+1;
        else
        {
            rep=s[i];
            pos=i-vis[s[i]];
        }
    }
    if(pos==0)
    {
        cout<<"Impossible";
        return 0;
    }
    int n=s.size();
    //cout<<rep<<" "<<vis[rep]<<endl;
    int st=13-(vis[rep]+pos/2);
    int j=0;
    for(i=st;i<13;i++)
    {
       ans[0][i]=s[j];
        j++;
    }
    for(i=12;i>=0;)
    {
        if(rep!=s[j]&&j<n)
        { ans[1][i]=s[j];
           i--;
          j++;
        }
        else if(j<n)j++;
        else
        {
            j=0;
            ans[1][i]=s[j];
            j++;
            i--;
        }
    }
    for(i=0;i<st;i++)
    {
        if(j<n)
        { ans[0][i]=s[j];
        j++;
        }
        else
        {
            j=0;
            ans[0][i]=s[j];
            j++;
        }
    }
    for(i=0;i<2;i++)
    {
        for(j=0;j<13;j++)
            cout<<ans[i][j];
        cout<<endl;
    }
    return 0;
}

#include <bits/stdc++.h>
using namespace std;

char s[28];
char ans[2][14];

bool get(int a, int b, int c, int d)
{
	return (a - c) <= 1 && abs(b - d) <= 1;
}

bool check()
{
	int i = 0, j = 0, add = 1;
	while(ans[i][j] != s[0])
	{
		j += add;
		if(j == 13)
		{
			--j;
			add = -1;
			++i;
		}
	}
	bool used[26];
	memset(used, false, sizeof(used));
	int last_i,
		last_j;
	for(int k = 0; k < 27; ++k)
	{
		if(!used[s[k] - 'A'])
		{
			if(ans[i][j] != s[k])
			{
				return false;
			}
			last_i = i;
			last_j = j;
			j += add;
			if(j == 13)
			{
				--j;
				add = -1;
				++i;
			} else if(j == -1)
			{
				++j;
				add = 1;
				--i;
			}
			used[s[k] - 'A'] = true;
		} else
		{
			int new_i = i,
				new_j = j;
			i = last_i;
			j = last_j;
			if(i == 1)
			{
				if((ans[i - 1][j] == s[k]) || (j > 0 && ans[i - 1][j - 1] == s[k] && get(i - 1, j - 1, new_i, new_j)) || (j + 1 < 13 && ans[i - 1][j + 1] == s[k] && get(i - 1, j + 1, new_i, new_j)))
				{

				} else
				{
					return false;
				}
			} else
			{
				if((ans[i + 1][j] == s[k]) || (j > 0 && ans[i + 1][j - 1] == s[k] && get(i + 1, j - 1, new_i, new_j)) || (j + 1 < 13 && ans[i + 1][j + 1] == s[k] && get(i + 1, j + 1, new_i, new_j)))
				{

				} else
				{
					return false;
				}
			}
			i = new_i;
			j = new_j;
		}
	}

	return true;
}

int main (int argc, char *argv[])
{
	//FILE *in = freopen("input.txt", "r", stdin);

	scanf("%s", s);
	for(int i = 0; i < 26; ++i)
	{
		if(s[i] == s[i + 1])
		{
			printf("Impossible");
			return 0;
		}
	}
	bool used[26];
	memset(used, false, sizeof(used));
	for(int i = 0, j = 0, k = 0, add = 1; i < 28; ++i)
	{
		//cout << i << endl;
		if(!used[s[i] - 'A'])
		{
			used[s[i] - 'A'] = true;
			ans[j][k] = s[i];
			k += add;
			if(k == 13)
			{
				--k;
				add = -1;
				++j;
			}
		}
	}
	int cnt = 0;
	while(!check())
	{
		char old_ans[2][14];
		for(int i = 0; i < 2; ++i)
		{
			for(int j = 0; j < 13; ++j)
			{
				old_ans[i][j] = ans[i][j];
			}
		}
		for(int j = 1; j < 13; ++j)
		{
			ans[0][j] = old_ans[0][j - 1];
		}
		ans[1][12] = old_ans[0][12];
		for(int j = 11; j >= 0; --j)
		{
			ans[1][j] = old_ans[1][j + 1];
		}
		ans[0][0] = old_ans[1][0];
	}
	for(int i = 0; i < 2; ++i)
	{
		for(int j = 0; j < 13; ++j)
		{
			printf("%c", ans[i][j]);
		}
		printf("\n");
	}

	return 0;
}

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
#include <unordered_map>
#include <set>
#include <stack>
#include <bitset>
#include <queue>
#include <map>
#include <errno.h>
#include <algorithm>

#define pb push_back
#define mp make_pair

#define x first
#define y second

typedef long long big;

using namespace std;

char a[2][13];

string s;
bool flag = false;
char theOne;

inline bool in(int x, int y) {
    return 0 <= x && x < 2 && 0 <= y && y < 13;
}

void dfs(int dep, int x, int y, bool same) {
    if (flag) {
        return;
    }
    if (dep == 27) {
        flag = true;
        return;
    }

    char c = s[dep];
    for (int xx = 0; xx < 2; xx++) {
        for (int yy = y - 1; yy < y + 2; yy++) {
            if (flag)
                return;
            if (in(xx, yy) && (xx != x || yy != y) && (a[xx][yy] == 0 || (a[xx][yy] == c && !same))) {
                bool newSame = a[xx][yy] == c;
                a[xx][yy] = c;
                dfs(dep + 1, xx, yy, newSame);
                if (flag)
                    return;
                a[xx][yy] = 0;
            }
        }
    }
}

int main() {
    cin >> s;
    int cnt = 0;
    bool vis[26];
    for (int i = 0; i < 27; i++) {
        if (!vis[s[i] - 'A']) {
            vis[s[i] - 'A'] = true;
            cnt++;
        }
    }
    bool can = false;
    for (int i = 0; i < 27; i++) {
        for (int j = i + 2; j < 27; j++)
            if (s[i] == s[j]) {
                can = true;
            }
    }
    if (!can) {
        puts("Impossible");
        return 0;
    }
    int l, r;
    for (int i = 0; i < 27; i++) {
        for (int j = i + 2; j < 27; j++) {
            if (s[i] == s[j]) {
                l = i;
                r = j;
            }
        }
    }
    int len = r - l + 1;
    int k = l + 1;
    if (len & 1) {
        a[0][len / 2 - 1] = s[l];
        for (int i = len / 2 - 1; i >= 0; i--)
            a[0][i] = s[k++];
        for (int i = 0; i < len / 2; i++) {
            a[1][i] = s[k++];
        }
        string rest;
        for (int i = l - 1; i >= 0; i--)
            rest.pb(s[i]);
        for (int i = s.size() - 1; i > r; i--)
            rest.pb(s[i]);
        k = 0;
        for (int i = len / 2; i < 13; i++)
            a[0][i] = rest[k++];
        for (int i = 12; i >= len / 2; i--)
            a[1][i] = rest[k++];
    } else {
        a[0][len / 2 - 1] = s[l];
        for (int i = len / 2 - 2; i >= 0; i--)
            a[0][i] = s[k++];
        for (int i = 0; i < len / 2 - 1; i++) {
            a[1][i] = s[k++];
        }
        string rest;
        for (int i = l - 1; i >= 0; i--)
            rest.pb(s[i]);
        for (int i = s.size() - 1; i > r; i--)
            rest.pb(s[i]);
        k = 0;
        for (int i = len / 2; i < 13; i++)
            a[0][i] = rest[k++];
        for (int i = 12; i >= len / 2 - 1; i--)
            a[1][i] = rest[k++];
    }
    for (int i = 0; i < 2; i++, puts(""))
        for (int j = 0; j < 13; j++)
            printf("%c", a[i][j]);
}

#include <bits/stdc++.h>

using namespace std;
using ll = long long;

string a[2];

void kek() {
    char x = a[0][12], y = a[1][12];
    for (int i = 1; i < 13; ++i) a[0][i] = a[0][i - 1];
    a[0][0] = y;
    for (int i = 11; i >= 0; --i) a[1][i] = a[1][i + 1];
    a[1][12] = x;
}

int main() {
    string s;
    cin >> s;
    int n = 27;
    if (s[0] == s[n - 1]) {
        for (int i = 0; i < n / 2; ++i) cout << s[i];
        cout << '\n';
        for (int i = n - 2; i >= n / 2; --i) cout << s[i];
        return 0;
    }
    int x, y;
    for (int i = 0; i < n - 1; ++i) {
        if (s[i] == s[i + 1]) {
            cout << "Impossible\n";
            return 0;
        }
    }
    for (int i = 0; i < n; ++i) {
        for (int j = i + 1; j < n; ++j) {
            if (s[i] == s[j]) {
                x = i;
                y = j;
                break;
            }
        }
    }
    a[0].resize(13);
    a[1].resize(13);
    for (int i = 0; i < n; ++i) {
        int j = i;
        if (i == y) continue;
        if (i > y) --j;
        a[j / 13][j % 13] = s[i];
    }
    reverse(a[1].begin(), a[1].end());
    int qwe = 33;
    while (qwe--) {
        bool f = true;
        for (int i = 0; i < 2; ++i) {
            for (int j = 0; j < 13; ++j) {
                if (a[i][j] == s[x]) {
                    int r = (i + 1) & 1;
                    char p = s[y - 1];
                    if (i > r && j + 1 < n) {
                        if (a[r][j + 1] == p) f = true;
                    }
                    if (i < r && j - 1 >= 0 && a[r][j - 1] == p) f = true;
                    if (a[r][j] == p) f = true;
                    if (f) break;
                }
            }
        }
        if (f) {
            cout << a[0] << '\n' << a[1];
            return 0;
        } else {
            kek();
        }
    }
    cout << "Impossible\n";
    return 0;
}

#include<cstdio>
#include<iostream>
#include<cstring>
#include<vector>
#include<stack>
#include<cmath>
#include<algorithm>
#include<map>
#include<cstdlib>
int read(){
	char ch=getchar(); int f=1,x=0;
	while(ch<'0'||ch>'9'){
		if(ch=='-') f=-1;
		ch=getchar();
	}
	while(ch>='0'&&ch<='9'){
		x=x*10+ch-'0';
		ch=getchar();
	}
	return f*x;
}
bool b[50];
char s[50],a;
char ans1[50],ans2[50];
int pos2,pos1;
int main(){
	memset(b,false,sizeof(b));
    scanf("%s",s+1);
    for(int i=1;i<=27;i++){
		if(!b[s[i]-'A']) b[s[i]-'A']=true;
		else{
			a=s[i];
			pos2=i;
			break;
		}
    }
    for(int i=1;i<=27;i++){
		if(s[i]==a){
			pos1=i;
			break;
		}
    }
    if(pos2==pos1+1){
		printf("Impossible");
		return 0;
    }
    int jl=(pos2-pos1)/2,Now=pos1-1;
    if((pos2-pos1)%2==1) jl++;
    int Now2=0,ii;
    for(int i=14-jl;i<=13;i++){
		ans1[i]=s[++Now];
    }
    for(ii=13;ii>=14-jl;ii--){
		ans2[ii]=s[++Now];
    }
    Now++;
    if(Now<27){
        for(ii=14-jl-1;ii>=1;ii--){
	    	ans2[ii]=s[++Now];
	    	if(Now==27){
		    	for(int j=ii-1;j>=1;j--){
			    	ans2[j]=s[++Now2];
			    }
		    }
        }
		for(int i=1;i<14-jl;i++){
			ans1[i]=s[++Now];
			if(Now==27){
				for(int j=i+1;j<14-jl;j++){
					ans1[j]=s[++Now2];
				}
				break;
			}
		}
    }
    else{
		for(ii=14-jl-1;ii>=1;ii--){
	    	ans2[ii]=s[++Now2];
        }
		for(int i=1;i<14-jl+1;i++){
		    ans1[i]=s[++Now2];
        }
    }
    for(int i=1;i<=13;i++){
		printf("%c",ans1[i]);
    }
    printf("\n");
    for(int i=1;i<=13;i++){
		printf("%c",ans2[i]);
    }
    return 0;
}

#ifdef LOCAL
#include "/home/dima/seminars/headers/debug.h"
#else
void nop();
#define dbg(...) nop
#define dbgl(...) nop
#endif
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef vector<int> VI;
typedef vector<bool> VB;
typedef vector<VI> VVI;
typedef vector<string> VS;
const int inf = INT_MAX / 2;
const int mod = 1000000007;

int main() {
#ifdef LOCAL
	freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
#endif
	string s;
	cin >> s;
	int n = s.length();
	for (int i = 0; i < n; ++i) {
		auto j = find(s.begin() + i + 1, s.end(), s[i]) - s.begin();
		if (j != n) {
			if (j - i == 1 || j - i == n - 1) {
				printf("Impossible\n");
				break;
			} else {
				string t = s.substr(i) + s.substr(0, i);
				dbg(i, j, s[i], s[j], t);
				VS a(2, string(13, '.'));
				j -= i;
				int k = j / 2;

				a[0][k] = s[i];
				for (int q = 1; q <= k; ++q)
					a[0][k - q] = t[q];
				for (int q = k + 1; q < j; ++q)
					a[1][q - k - 1] = t[q];
				for (int q = j + 1; q - k - 2 < 13; ++q)
					a[1][q - k - 2] = t[q];
				for (int q = n - 1; k + n - q < 13; --q)
					a[0][k + n - q] = t[q];

				cout << a[0] << endl;
				cout << a[1] << endl;
				break;
			}
		}
	}
	return 0;
}

#include <iostream>
#include <string>
using namespace std;
char pat[3][24];
int main(){
    string s;
    cin>>s;
    int a[32]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
    char c='l';
    for(int i=0;i<27;i++){
        a[s[i]-'A']++;
        if(a[s[i]-'A']==2)
            c=s[i];
    }
 //   cout<<c<<endl;
    int k=-1,j=-1;
    for(int i=0;i<27;i++){
        if(s[i]==c){
            if(k==-1)
                k=i;
            else
                j=i;
        }
    }
    if(j-k==1){
        cout<<"Impossible"<<endl;
        return 0;
    }
    int l=(j-k-1)/2;
    int p=k;
    for(int i=13-l-1;i<13;i++){
        pat[1][i]=s[p];
        p++;
    }
    int i=12;
    while(p<27 && i>=0){
        if(s[p]==c)
            p++;
        if(p>=27)
            break;
        pat[2][i]=s[p];
        p++;
        i--;
    }
    if(p>=27){
        int t=0;
        while(i>=0){
            pat[2][i]=s[t];
            i--;
            t++;
        }
        for(i=0;t<27;i++){
            if(pat[1][i]==c)
                break;
            pat[1][i]=s[t];
            t++;
        }
    }
    else{
        i=-1;
        while(p<27){
            i++;
            pat[1][i]=s[p];
            p++;
        }
    }
    for(int i=1;i<=2;i++){
        for(int j=0;j<13;j++)
            cout<<pat[i][j];
        cout<<endl;
    }
    return 0;
}/*
  ABCDEFGHIJKLMNOPQRSTUVWXYZA
  ABCDEFHIGJKLMNOPQRSGTUVWXYZ
  ABCDEFGHIJKLMNOPQRSGTUVWXYZ
  ABCDEFGHIJKLMNOPQRSTUVWXAYZ
*/

#include <bits/stdc++.h>
#define base 1000000007LL
#define ll long long
#define X first
#define Y second
#define mp make_pair
#define pb push_back
#define CLR(a) memset(a,0,sizeof(a))
#define FOR(i,a,b) for(int i=(a),_b=(b); i<=_b; i++)
#define FORE(i,a,b) for(int i=(a),_b=(b); i>=_b; i--)

using namespace std;

typedef pair<int, int> II;
typedef vector<II> vi;

string res[2], s;
int f[30];

int main()
{
    ios::sync_with_stdio(0);
    //freopen("inp.txt", "r", stdin);
    cin >> s;
    FOR(i,0,26) f[s[i]-'A']++;
    char ch;
    FOR(i,0,25)
        if (f[i] > 1) {
            ch = i+'A';
            break;
        }
    int dau = -1;
    int cuoi = -1;
    FOR(i,0,26)
        if (s[i] == ch) {
            if (dau == -1) dau = i;
            else cuoi = i;
        }
    cout << dau << " " << cuoi << endl;
    if (dau == 0 && cuoi == 26) {
        cout << "Impossible";
        return 0;
    }
    if (dau+1 == cuoi) {
        cout << "Impossible";
        return 0;
    }
    res[0].resize(13);
    res[1].resize(13);
    int k = cuoi-dau;
    if (k > 2) k--;
    k/=2;
    int v = 1;
    int nowu = 0;
    int nowv = 12-k;
    res[0][12-k] = ch;
    int now = 1;
    int h = dau;
    while (now <= 25) {
        if (nowu == 0 && nowv == 12) {
            nowu = 1;
            v = -1;
        }
        else if (nowu == 1 && nowv == 0) {
            nowu = 0;
            v = 1;
        }
        else {
            nowv += v;
        }
        h = (h + 1) % 27;
        if (s[h] == ch) h = (h+1) % 27;
        res[nowu][nowv] = s[h];
        //cout << res[0] << endl << res[1] << endl << endl;
        now++;
    }
    cout << res[0] << endl << res[1];
    return 0;
}

/*NAME: SANYAM GARG
INSTITUTION : DELHI TECHNOLOGICAL UNIVERSITY*/
#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<math.h>
#include<bits/stdc++.h>
#include<stack>
#include<queue>
#include<list>
#include<vector>
#include<bitset>
#define mod 1000000007
#define li long long int
#define ll int
#define readi(x) scanf("%d",&x)
#define  reads(x)  scanf("%s",&x)
#define readl(x) scanf("%I64d",&x)
#define rep(i,n) for(i=0;i<n;i++)
#define revp(i,n) for(i=(n-1);i>=0;i--)
#define myrep1(i,a,b) for(i=a;i<=b;i++)
#define myrep2(i,a,b) for(i=b;i>=a;i--)
#define pb push_back
#define fi first
#define sec second
#define MAXN 100000000000000LL
#define MINN -1000000000000
#define pii pair<long long int,long long int>
#define N 200010
#define ddouble long double
using namespace std;
int ct[30];
char c[N];
int main()
{
	ll i,ans=0;
	reads(c);
for(i=0;c[i]!='\0';i++)
{
	ct[c[i]-'A']++;
}
for(i=0;i<26;i++)
{
	if(ct[i]==2)
	{
		break;
	}
}
char mark=(char)(i+'A');
ll val=0,mar=0,mar2=0;
for(i=0;c[i]!='\0';i++)
{
	if(c[i]==mark)
	{
		ans+=(i+1);
		if(i==13)
		mar=1;
		if(i==11)
		mar2=1;
	}
}
//cout<<ans<<"\n";
if((ans==27&&(!mar))||(mar2&&ans==26))
{
	ll cnt=0,flag=0;
	for(i=0;c[i]!='\0';i++)
	{
		if(c[i]!=mark)
		{
			cout<<c[i];
			cnt++;
			if(cnt==13)
		{
			cout<<"\n";
			break;
		}
		}
		else if(c[i]==mark&&flag==0)
		{
			cout<<c[i];
			flag=1;
			cnt++;
			if(cnt==13)
		{
			cout<<"\n";
			break;

		}
		}

	}
	ll temp=i;
	for(i=26;i>temp;i--)
	{
		if(c[i]!=mark)
		{
			cout<<c[i];
		}
		else if(c[i]==mark&&flag==0)
		{
			cout<<c[i];
			flag=1;

		}

	}

}
else
{
	cout<<"Impossible";
}
}

#include <cstdio>
#include <algorithm>
#include <iostream>
#include <cstring>
#include <string>
#include <cmath>
#include <queue>
#include <vector>
using namespace std;
#define N 1010
#define INF 0x3f3f3f3f
char s[50];
bool vis[N];
int tmp[N];
int main()
{
    scanf("%s", s);
    int len = strlen(s);
    memset(vis, 0, sizeof(vis));
    bool f = 1;
    for(int i = 1; i < len; i++) {
        if(s[i] == s[i-1]) f = 0;
    }
    if(!f) puts("Impossible");
    else {
        int num, tmp1, tmp2;
        for(int i = 0; i < len; i++) {
            if(vis[s[i]]) {
                num = i - tmp[s[i]];
                tmp1 = tmp[s[i]];
                tmp2 = i;
            }
            vis[s[i]] = true;
            tmp[s[i]] = i;
        }
        memset(vis, 0, sizeof(vis));
        string s1 = "", s2 = "", s3 = "";
        for(int i = tmp1; i < tmp2; i++) s1 = s1 + s[i];
        for(int i = 0; i < tmp1; i++) s2 = s2 + s[i];
        for(int i = tmp2 + 1; i < len; i++) s3 = s3 + s[i];
        int l1 = s2.length(), l2 = s3.length();
        string s4 = "";
        if(l1 > l2) {
            for(int i = 0; i < (l1 - l2) / 2; i++) s4 += s2[i];
            reverse(s4.begin(), s4.end());
            s2.erase(0, (l1-l2) / 2);
            s3 = s4 + s3;
        } else {
//            printf("tmp : %d, %d\n", tmp1, tmp2);
//            printf("a :%d, b :%d\n", l2 - l1, (l2 - l1) / 2);
            for(int i =  (l2 - 1), j = 0; j < (l2 - l1) / 2; i--, j++) s4 += s3[i];
//            cout << "s4 :" << s4 << endl;
            s3.erase(l2 - l1, (l2 - l1) / 2);
            reverse(s4.begin(), s4.end());
            s2 = s4 + s2;
//            cout << "s4 :" << s4 << endl;
        }
//        cout << "s1 :" << s1 << endl;
//        cout << "s2 :" << s2 << endl;
//        cout << "s3 :" << s3 << endl;
        s1 = s2 + s1 + s3;
        for(int i = 0; i < 26; i++) s[i] = s1[i];
        for(int i = 0; i < 13; i++) printf("%c", s[i]);
        puts("");
        for(int i = 25; i > 12; i--) printf("%c", s[i]);
        puts("");
    }
    return 0;
}

/*
ABCDEFGHGIJKLMNOPQRSTUVWXYZ
*/

#include<bits/stdc++.h>
using namespace std;

const int len=27;
char a[50];
int p1,p2,L,R;

int main(){
    //freopen("input.txt","r",stdin);
    int Case=0;
    while(scanf("%s",a)!=EOF){
        ++Case;//printf("Case #%d:\n",Case);
        int len=strlen(a);
        for(int i=0;i<len;i++)
            for(int j=i+1;j<len;j++)
                if (a[i]==a[j]){
                    p1=i;p2=j;
                    //printf("%c %c\n",a[p1],a[p2]);
                    break;
                }
        //printf("%d %d\n",p1,p2);
        R=(p2-p1)/2;
        if (p1+1==p2||R==13){
            puts("Impossible");
            continue;
        }
        int start=p2-R+1;
        for(int i=start;i<start+13;i++) printf("%c",a[i]);
        puts("");
        for(int i=start-1;i>=0;i--){
            if (i==p1) continue;
            printf("%c",a[i]);
        }
        for(int i=26;i>=start+13;i--) printf("%c",a[i]);
        puts("");
    }
    return 0;
}

#include <bits/stdc++.h>

using namespace std;

#define N 200005
#define xx first
#define yy second
#define LL long long

string s;
int vis[333];

int main(){
        cin>>s;
        char c;
        for(int i=0;i<s.size();i++){
                vis[s[i]]++;
                if(vis[s[i]]==2){
                        c=s[i];
                        break;
                }
        }
        int idx[2],ii=0;
        for(int i=0;i<s.size();i++){
                if(s[i]==c){
                        idx[ii++]=i;
                }
        }
        int x=idx[1]-idx[0];
        if(x==1){
                puts("Impossible");
                return 0;
        }
        x=(idx[0]+idx[1])/2;
        string a="",b="";
        for(int i=x;i>=0&&b.size()<13;i--){
                if(s[i]!=c) b+=s[i];
                s[i]='*';
        }

        //cout<<a<<"\n"<<s<<"\n\n";

        for(int i=x+1;i<s.size()&&a.size()<13;i++){
                a+=s[i];
                s[i]='*';
        }

        //cout<<b<<"\n"<<s<<"\n\n";

        if(s[0]!='*'){
                for(int i=0;s[i]!='*';i++){
                        a+=s[i];
                }
        }
        if(s[s.size()-1]!='*'){
                for(int i=s.size()-1;s[i]!='*';i--){
                        b+=s[i];
                }
        }
        cout<<a<<endl;
        cout<<b<<endl;
}

#include <iostream>
#include <fstream>
#include <map>
#include <cmath>
#include <math.h>
#include <set>
#include <vector>
#include <sstream>
#include <string>
#include <cstring>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <queue>
#include <cstdlib>
#include <iomanip>

typedef long long int lli;
typedef long double ld;
const lli INF = 1e9, MOD = 1e6, MAXN = 15485864; //18
const ld EPS = 0.0000001;
#define forn(a, b) for (lli i = a; i < b; i++)
#define fore(p, a, b) for (lli p = a; p < b; p++)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define pb(a) push_back(a)
#define sz(a) a.size()
#define mp(a, b) make_pair(a, b)
#define f1 first
#define s2 second
#define cotu cout

using namespace std;

lli big_gcd(lli a, lli b, lli &x, lli &y) {
    if (b != 0) {
        lli x1, y1;
        lli g = big_gcd(b, a % b, x1, y1);
        x = y1;
        y = x1 - (a / b) * y1;
        return g;
    }
    else {
        x = 1;
        y = 0;
        return a;
    }
}

lli gcd(lli a, lli b){
    if (b == 0)return a;
    return gcd(b, a % b);
}

lli m, n, x, c, y;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    string s;
    cin >> s;
    map<char, int>m;
    char find;
    for (int i = 0; i < sz(s); i++){
        if (m[s[i]] == 1){
            find = s[i];
        }
        m[s[i]]++;
    }
    char table[2][14];

    for (int i = 0; i < 2; i++){
        for (int j = 0; j < 13; j++){
            table[i][j] = '0';
        }
    }

    for (int i =1; i < sz(s); i++){
        if (s[i-1]==s[i]){
            cout << "Impossible";
            return 0;
        }
    }

    int have = 0;
    bool ok = true;
    //cout << find << "\n";
    vector<char>to_add_f, to_add_s;
    for (int i = 0; i < sz(s); i++){
        if (s[i] != find){
            have++;
            to_add_f.pb(s[i]);
        }
        else break;
    }
        for (int i = have; i < sz(s); i++){
        if (s[i] == find){
            ok = !ok;
        }
        if (ok && s[i] != find){
            have++;
            to_add_s.pb(s[i]);
        }
    }
    int pos_f = (have-1)/2 + 1;
    //cout << sz(to_add_s);
    //cout << pos_f;

    vector<char>mid;
    bool ch = false;
    for (int i = 0; i < sz(s); i++){
        if (s[i] == find){
            ch = !ch;
        }
        if (ch && s[i]!=find){
            mid.pb(s[i]);
        }
    }

    table[0][pos_f - 1] = find;
    int index = 0, index2 = 0;
    ok = false;
    for (int i = pos_f - 2; i >= 0; i--){
        if (!ok){
            table[0][i] = to_add_s[index++];
        }
        if (ok)table[0][i] = to_add_f[index2++];
        if (index >= sz(to_add_s)){
            ok = true;
        }
        if (index2 >= sz(to_add_f) && ok){
            break;
        }
    }
    //return 0;
    for (int i = 0; i < pos_f; i++){
        if (!ok)table[1][i] = to_add_s[index++];
        if (ok)table[1][i] = to_add_f[index2++];
        if (index >= sz(to_add_s)){
            ok = 1;
        }
        if (index2 >= sz(to_add_f) && ok){
            break;
        }
    }
    int in = 0;
    for (int i = pos_f; i < 13; i++){
        table[0][i] = mid[in++];
    }

    for (int i = 12; i >= 0; i--){
        if (table[1][i] == '0') table[1][i] = mid[in++];
        else break;
    }

    for (int i = 0; i < 2; i++){
        for (int j = 0; j < 13; j++){
            cout << table[i][j];
        }
        cout << "\n";
    }

    return 0;
}

#include <cstdio>
#include <algorithm>
#include <iostream>
#include <cstring>
#include <string>
#include <cmath>
#include <queue>
#include <vector>
using namespace std;
#define N 1010
#define INF 0x3f3f3f3f
char s[50];
bool vis[N];
int tmp[N];
int main()
{
    scanf("%s", s);
    int len = strlen(s);
    memset(vis, 0, sizeof(vis));
    bool f = 1;
    for(int i = 1; i < len; i++) {
        if(s[i] == s[i-1]) f = 0;
    }
    if(!f) puts("Impossible");
    else {
        int num, tmp1, tmp2;
        for(int i = 0; i < len; i++) {
            if(vis[s[i]]) {
                num = i - tmp[s[i]];
                tmp1 = tmp[s[i]];
                tmp2 = i;
            }
            vis[s[i]] = true;
            tmp[s[i]] = i;
        }
        memset(vis, 0, sizeof(vis));
        string s1 = "", s2 = "", s3 = "";
        for(int i = tmp1; i < tmp2; i++) s1 = s1 + s[i];
        for(int i = 0; i < tmp1; i++) s2 = s2 + s[i];
        for(int i = tmp2 + 1; i < len; i++) s3 = s3 + s[i];
        int l1 = s2.length(), l2 = s3.length();
        string s4 = "";
        if(l1 > l2) {
//            printf("tmp : %d, %d\n", tmp1, tmp2);
//            printf("a :%d, b :%d\n", l1 - l2, (l1 - l2) / 2);
            for(int i = 0; i < (l1 - l2 + 1) / 2; i++) s4 += s2[i];
//            reverse(s4.begin(), s4.end());
//            cout << "s4 :" << s4 << endl;
            s2.erase(0, (l1 - l2 + 1) / 2);
            s3 = s3 + s4;
        } else {
//            printf("tmp : %d, %d\n", tmp1, tmp2);
//            printf("a :%d, b :%d\n", l2 - l1, (l2 - l1) / 2);
            for(int i = (l2 - 1), j = 0; j < (l2 - l1) / 2; i--, j++) s4 += s3[i];
//            cout << "s4 :" << s4 << endl;
            s3.erase((l2 + l1) / 2, (l2 - l1) / 2);
            reverse(s4.begin(), s4.end());
//            s3.erase(l2 - l1, (l2 - l1) / 2);
            s2 = s4 + s2;
//            cout << "s4 :" << s4 << endl;
        }
//        cout << "s1 :" << s1 << endl;
//        cout << "s2 :" << s2 << endl;
//        cout << "s3 :" << s3 << endl;
        s1 = s2 + s1 + s3;
//        printf("len :%d\n", s1.length());
        for(int i = 0; i < 26; i++) s[i] = s1[i];
        for(int i = 0; i < 13; i++) printf("%c", s[i]);
        puts("");
        for(int i = 25; i > 12; i--) printf("%c", s[i]);
        puts("");
    }
    return 0;
}

/*
ABCDEFGHGIJKLMNOPQRSTUVWXYZ
YOFJVQSWBUZENPCXGQTHMDKAILR
XTSHBGLRJAMDUIPCWYOZVERNKQF
*/

#include <bits/stdc++.h>

using namespace std;

int a[100001];
int n;
string h;

int main () {
	string s;
	string cur = "";
	cin >> s;
	cur += s;
	int o = 0;
	for (int i = 0;i < s.size ();i ++) {
		a[s[i] - 'A' + 1] ++;
		if (s[i] == s[i + 1]) {
			cout << "Impossible";
			return 0;
		}
	}
//	cout << endl << endl;
	char x;
	for (int i = 1;i <= 26;i ++) {
		if (a[(i)] == 2) {
			x = i + 'A' - 1;
			break;
		}
	}
	int id1, id2;
	for (int i = 0;i < s.size ();i ++) {
		if (x == s[i]) {
			id1 = i;
			break;
		}
	}
	for (int i = 0;i < s.size ();i ++) {
		if (x == s[i]) {
			id2 = i;
		}
	}
	int len = (id2 - id1 - 1);
	int qwe = len / 2;
	//cout << x << ' ';
	//cout << id1 << " " << id2 << ' ' << qwe <<  endl;
	for (int i = id1;i < id2;i ++) {
		h += cur[i];
	}
//	cout << h << endl << endl;
	int l = id1 - 1;
	string who = "";
	for (int i = 0;i <= l;i ++) {
		who += cur[i];
	}
	h = who + h;
	who = "";
	for (int i = id2 + 1;i < 27;i ++) {
		who += cur[i];
	}
	h = h + who;
	if (id1 + qwe == 12) {
		who = "";
		for (int i = 0;i < 13;i ++) {
			who += h[i];
		}
		cout << who << endl;
		who = "";
		for (int i = 13;i < 26;i ++) {
			who += h[i];
		}
		reverse (who.begin (), who.end ());
		cout << who;
		return 0;
	}
//	cout << h << endl << endl;
	if (id1 + qwe > 12) {
		who = "";
		for (int i = id1 + qwe - 13;i < id1 + qwe;i ++) {
			who += h[i];
		}
		cout << who << endl;
		who = "";
		for (int i = 0;i < id1 + qwe - 13;i ++) {
			who += h[i];
		}
		cout << who;
		string zz = who;
		who = "";
		reverse (zz.begin (), zz.end ()) ;
		for (int i = 14;i < 26;i ++) {
			who += h[i];
		}
		reverse (who.begin (), who.end ());
		cout << who;
		return 0;
	}
	if (id1 + qwe < 12) {
		who = "";
		for (int i = 0;i <= id1 + qwe;i ++) {
			who += h[i];
		}
		string zz = "";
		for (int i = 25;i > 25 - 12 + id1 + qwe;i --) {
			zz += h[i];
		}
		reverse (zz.begin (), zz.end ());
		cout << zz << who << endl;
		who = "";
		for (int i = id1 + qwe + 1;i <= id1 + qwe + 13;i ++) {
			who += h[i];
		}
		reverse (who.begin (), who.end ());
		cout << who;
		return 0;
	}
	return 0;

}

/*
	���������������������������������������x�����x
���������������������������������������ܣܣ���
�������������������������������������������ܣ�
����������������������������������������������
���������������񡡨������������� ������ ��
��������������������������������������������
���������������������ޡ���������������������
�����������������������ܨ�����������������
��������������������������������������������
��������������������������������������
������������������������������������
��������������������������������������
�������������� ��������

*/
/*
����������������
���������������������
�������������������������
��������� . �ܡ����������
����������ȡ����������
���������������������
��������������������
�����������������������
�����������������������
���������������������������
���������������������
���������������������
������������������������
������������������������

	�� ��������������������������������������
���������������������������������������� ����
��������������������������������������������...
��������������������������������������������
��������������������������������������������.
��������������������������������������
�����������������񡡡������������� ��
�������������������������{������������
�����������������������^�m�a����������
�������������������|�z�z���z�z�|����
����������������������������������
����������������������������������
����������������������������������
�����������������z�����|�|�|�����z����

	�ةЩةУ����ܣߣ�����
�ЩةЩب�����������������
�ةЩأ��ܡ�����������������
�ЩبM������������������������
�ةШ������������������񡡡���
�Щب�����������������������������
�ب������������������ܣߣߣߣ�
�Ш�������������������������������
�ب���������������������������
�������������������������������}�{
������������������������������������
������������������������������������ ��
�ب����������������������������������� ��
�Щ���������������������������������������
�ة���������������������������������������
�� �M������ �M�����������������ܡ������� �M
��/�ߣߣߣ����������M��������������������
�ЩةЩةЩأ� ���� �� ������������������ ��
�ةЩةЩةЩ� �ܣߣߣߣܡ������� �������ܩ� ����
���������W�i�i�i�i�i�i�i�i�ܡ��� �M�� ������������
�������d�p�p�p�p�p�p�p�p������������������

�q-�r���q-�r�q---�r�q-�r�������q-�r�������q---�r�q�r
�����������������q--�s���������������������������q-�r������
�����t-�s�������t-�r����������������������������������������
�����q-�r�������q-�s�������t--�r�����t--�r��������������
�����������������t--�r���������������������������t-�s���t�s
�t-�s���t-�s�t---�s�t----�s�t----�s�t---�s ��
����������������������������������������������
�j�T�T�j�X�T�r�T�m�T�r�T�j�T���U�T�T�p�T�r�X���X�m�r�X��
�d�T�T�g�U���U�t�T�a�U�U�U�����U�����U���U�t�T�U���U�t�T
�d�T�T�g�U���U�t�T�a�a�U�U�U�U�U�����U���U�X���d�T�g�X��
�m�T�T�p�t�T�a�X�T�r�U�U�d�s�t�p�T�T�p�T�m�t�T�t�T�a�t�T
�T�T�T�j�T�T�s�U���U�U�U�U�����U���X�a�r���T�T�T�p�T�T�T
���T�T�p�T�T���U���U�U�m�m�T���U���U���U�����U���U�� �U��
�T�T�T�m�T�T�T�t�T�a�p�T�T�T���U�t�a���t�a�t�a���U ���^�s
������������������������������������������������������������
�ЩةЩ�-����-��-������-��-�������-�ȡ�
�ةЩة��С���-��-�����򡡩��������𩸩Щ���
-��-��������������������-��-�ء�--��--
�񩦡𩦩�����-��-�������𡡡��񡡣���������

�q�T�T�T�T�T�T�r
�U��� �� �ܡ� �U����������
�U�������t�e���������
�U������ ����� ��
�U�������q�e �������
�U����� ��/ �U���������
�t�T�T�T�T�T�T�s ���������
~����ߡ�*��~���*��~�
��*��~����ߡ�*��~�����
��������������������������������������
�����������v
��������������
���������������������v
���������v��������������
�������������Ϩ���������
�����������v�����v?����
���v�ߨ����������v
�������������������v������������
���������v�ߨ��������v����������
�����������������������v������
�������������������������v��
���������������������������v
�����������������������������v
�������������������������������v
������������������������������������������������������
��㡤��㣮��?���㡤�㣮��?���㡤
��?���㡤��㣮��?���㡤�㣮��?��
����?���㡤��㣮��?������?
__������ __������������?���㡤��
�����n���㡤���n���n���㣮��?��
���������������������������㣮��
�਀�n�������n�����n���n��?���
������������������������������

..�ࡣo����+��?''o?''o�s��o����+��?''o?''o��
�X--�[�X�T-�Y�X-�[�q-�T�r�X�T-�[�����V�[
���V-�_���V�[���^-�_���W�T�s���X�Y���X-�a��
���^-�[�����\�`�X-�[���^-�[����������������
���X-�_�����������������q�T�_����������������
�\�_�����\�_�����^-�_�\�t�T�s�\�_�\�`�^-�T�_
�ࡣo����+��?''o?''o�s��o����+��?''o?''o��
������������������������������������������������������������
�X�T�T�[�X�[���������������X�[�X�[
�^�[�X�a�U�U�X�T�j�j�j�T�[�U�^�a�d�T�j�j�[
�X�a�^�[�U�^�g�U�U�U�U�d�g�^�[�X�g�U�U�U�U
�^�T�T�a�^�T�m�T�m�T�m�T�a���^�a�^�T�m�T�a

	����������������������������������������������
����������������������������������������������
����������������������������������������������
�������������������������������������������� ��
����������������������������������������������

��������������������������������������������������������
��M ���� �� ���񡡡����� �� ����M ����M
<�� �� ��> ���������������� �� �� ������
�� �� �� �� �� �M�������M�� ��������������
������������������������������������������������
 �q�r���������������q�r����
����������������������������
�q�ة�-------�ةبr
��������������������������������
��������������������������������
�����񡡡������������񡡩�
���𡡡��t�ЩЩШs������
�����������t-�s������������
�t--�У�---�ϩ�--�s
�� ���q�r���������q�r��������
�� ���t��----�بs
��������������������������������������������
����..���������������������������ܡ�����
�����������������������������ܡ�������
���������ܣߣߣߣߣߣߣߣߣߣ���������
��..�������������������������������ܡ�
��..�ܣ��ܣ��ܣ��ܣ��ܣ��ܣ��ܣ��ܣ�����
�������������񡡡��������񡡡���������
������������"����������"��������
���񡡣�����������������������������
��������������������������������
�������t�����������������������s
��������������������������
�����������񡡡�������������
��������������������������������������������������������

�������������������
�������������������
�������������������
���������������������
�������������������������
���������������������������
�����������������������������
���������񡡡������񡡡��������
���������������𡡡������������
�������򡡡����������򡡡������
���������������񡡡������������
�����������������������������
���������������������������
�������������������

*/

/*
			  ********
               ************
               ####....#.
             #..###.....##....
             ###.......######              ###                 ###           ###           ###
                ...........               #...#               #...#         #...#         #...#
               ##*#######                 #.#.#               #.#.#         #.#.#         #.#.#
            ####*******######             #.#.#               #.#.#         #.#.#         #.#.#
           ...#***.****.*###....          #...#               #...#         #...#         #...#
           ....**********##.....           ###                 ###           ###           ###
           ....****    *****....
             ####        ####
           ######        ######
##############################################################              ##################################
#...#......#.##...#......#.##...#......#.##------------------#              #...#......#.##------------------#
###########################################------------------#              ###############------------------#
#..#....#....##..#....#....##..#....#....#####################              #..#....#....#####################
##########################################    #----------#                  ##############    #----------#
#.....#......##.....#......##.....#......#    #----------#                  #.....#......#    #----------#
##########################################    #----------#                  ##############    #----------#
#.#..#....#..##.#..#....#..##.#..#....#..#    #----------#                  #.#..#....#..#    #----------#
##########################################    ############                  ##############    ############
*/
#include <iostream>
#include <sstream>
#include <fstream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <utility>
#include <bitset>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstdio>
#include <cstring>
#include <climits>
#include <string.h>
#include <stdio.h>
#define LL long long
#define pii pair<int,int>
#define piii pair<int, pii >
#define REP(i,n) for (int (i)=0;(i)<(n);(i)++)
#define vi vector<int>
#define vpi vector< pii >
#define INF 2147483647
#define pb push_back
#define mp make_pair
using namespace std;
const int dx[]={0,1,-1,1,-1};
const int dy[]={1,0,0,1,1};
char ans[2][13];
pair<int,int> Prev(pair<int,int> a){
	if (a==make_pair(0,0)) return mp(1,0);
	if (a==make_pair(1,12)) return mp(0,12);
	if (a.first==0) return make_pair(0,a.second-1);
	return make_pair(1,a.second+1);
}
pair<int,int> Next(pair<int,int> a){
	if (a==make_pair(0,12)) return mp(1,12);
	if (a==make_pair(1,0)) return mp(0,0);
	if (a.first==1) return make_pair(1,a.second-1);
	return make_pair(0,a.second+1);
}
bool adj(pii a,pii b){
	for (int i=0;i<5;i++){
		pii buff=mp(a.first+dx[i],a.second+dy[i]);
		if (buff==b) return true;
	}
	return false;
}
bool isadj(pair<int,int> a,int t){
	pair<int,int> buff=a;
	for (int i=0;i<t;i++){
		a=Next(a);
	}
//	cout<<a.first<<' '<<a.second<<endl;
//	cout<<buff.first<<' '<<buff.second<<endl;
	return adj(a,buff);
}
int main(){
	string c;
	cin>>c;
	int la,lb;
	bool flag=false;
	for (int i=0;i<27;i++){
		if (flag) break;
		for (int j=i+2;j<27;j++){
			if (c[i]==c[j]){
				flag=true;
				la=i;
				lb=j;break;
			}
		}
	}
	if (!flag) {
		cout<<"Impossible"<<endl;
		return 0;
	}
	int diff=lb-la;
	//cout<<diff<<endl;
	int di,dj;
	flag=false;
	for (int i=0;i<2;i++){
		if (flag) break;
		for (int j=0;j<13;j++){
			if (isadj(make_pair(i,j),diff-1)){
				di=i,dj=j;
				flag=true;
				break;
			}
		}
	}
	if (!flag) cout<<"ERROR";
	ans[di][dj]=c[la];
	pii now=make_pair(di,dj);
	for (int i=la-1;i>=0;i--){
		now=Prev(now);
		ans[now.first][now.second]=c[i];
	}
	now=make_pair(di,dj);
	for (int i=la+1;i<27;i++){
		if (i==lb) continue;
		now=Next(now);
		ans[now.first][now.second]=c[i];
	}
	for (int i=0;i<2;i++){
		for (int j=0;j<13;j++){
			cout<<ans[i][j];
		}
		cout<<endl;
	}
	return 0;
}

#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <cstdio>
#include <string>
#include <stdlib.h>
#include <set>
#include <vector>
#include <list>
#include <algorithm>
#include <regex>
#include <math.h>
#include <map>
#include <iterator>
#include <limits>
#include <numeric>
#include <bitset>
#include <unordered_map>
#include <unordered_set>
#include <iomanip>
#include <queue>
#include <deque>
#include <stack>
#include <array>
#include <valarray>
#include <complex>

using namespace std;

typedef array<int, 2> hv;
typedef int integer;
#define int long long
#define double long double
#define make(type, x) type x; cin>>x
#define make2(type, x, y) type x, y; cin>>x>>y
#define make3(type, x, y, z) type x, y, z; cin>>x>>y>>z
#define make4(type, x, y, z, q) type x, y, z, q; cin>>x>>y>>z>>q
#define ALL(x) (x).begin(), (x).end()
#define FORIT(p) for(auto it = p.begin(); it != p.end(); it++)
#define FOR(b) for(int i = 0; i <(b); i++)
#define VI vector<int>
#define VVI vector<vector<int>>
#define PII pair<int, int>
#define PPII pair<PII, int>

vector<vector<char>> a(2, vector<char>(13));
vector<bool> was(26);
string s;
vector<PII> g = { {1,0}, {1,1}, {1,-1}, {0,1}, {0,-1}, {-1,1}, {-1,0}, {-1, -1} };

bool doit() {
	int pos = 0;
	while (pos < s.length() && s[pos] != a[0][0]) pos++;
	if (pos == s.length()) return false;
	int tempPos = pos + 1;
	int stI = 0, stJ = 0;
	for (; tempPos  < s.length(); tempPos++) {
		bool t = false;
		for (int q = 0; q < g.size(); q++) {
			int i = stI + g[q].first;
			int j = stJ + g[q].second;
			if (i < 0 || i > 1 || j < 0 || j > 12) continue;
			if (a[i][j] == s[tempPos]) {
				t = true;
				stI = i;
				stJ = j;
				break;
			}
		}
		if (t) continue;
		t = false;
		for (int q = 0; q < g.size(); q++) {
			int i = stI + g[q].first;
			int j = stJ + g[q].second;
			if (i < 0 || i > 1 || j < 0 || j > 12) continue;
			if (a[i][j] == 0) {
				t = true;
				a[i][j] = s[tempPos];
				stI = i;
				stJ = j;
				break;
			}
		}
		if (!t) return false;
	}
	tempPos = 0;
	for (; tempPos < pos; tempPos++) {
		bool t = false;
		for (int q = 0; q < g.size(); q++) {
			int i = stI + g[q].first;
			int j = stJ + g[q].second;
			if (i < 0 || i > 1 || j < 0 || j > 12) continue;
			if (a[i][j] == s[tempPos]) {
				t = true;
				stI = i;
				stJ = j;
				break;
			}
		}
		if (t) continue;
		t = false;
		for (int q = 0; q < g.size(); q++) {
			int i = stI + g[q].first;
			int j = stJ + g[q].second;
			if (i < 0 || i > 1 || j < 0 || j > 12) continue;
			if (a[i][j] == 0) {
				t = true;
				a[i][j] = s[tempPos];
				stI = i;
				stJ = j;
				break;
			}
		}
		if (!t) return false;
	}
	return true;
}

void cleans() {
	FOR(13) a[0][i] = 0;
	FOR(13) a[1][i] = 0;
}

void Solve() {
	cin >> s;
	cleans();
	was.clear();
	for (int i1 = 0; i1 < 26; i1++) {
		for (int i2 = 0; i2 < 26; i2++) {
			if (i2 == i1) continue;
			for (int i3 = 0; i3 < 26; i3++) {
				if (i1 == i3 || i2 == i3) continue;
				for (int i4 = 0; i4 < 26; i4++) {
					if (i4 == i3 || i4 == i2 || i4 == i1) continue;
					cleans();
					a[0][0] = 'A' + i1;
					a[1][0] = 'A' + i2;
					a[0][12] = 'A' + i3;
					a[1][12] = 'A' + i4;
					if (doit()) {
						FOR(13) cout << a[0][i];
						cout << endl;
						FOR(13) cout << a[1][i];
						return;
					}

				}
			}
		}
	}
	cout << "Impossible";
}

integer main() {
	ios_base::sync_with_stdio(0);
	cin.tie();
#if  _DEBUG
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	Solve();
	while (!cin.eof()) {
		string s = "_";
		do getline(cin, s);
		while (!cin.eof() && !s.empty());
		if (cin.eof()) return 0;
		FOR(3) cout << endl;
		Solve();
	}
#else
	Solve();
#endif
	return 0;
}

#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<map>
using namespace std;
char ss[111],a[111][111];
map<char,int>f;
int main()
{
	int i,j,s,e,n,temp;
	scanf("%s",ss+1);
	for(i=1;i<=27;i++) {
		if(f[ss[i]]) {
			s=f[ss[i]];
			e=i;
			break;
		}
		else f[ss[i]]=i;
	}
	temp=s;
	n=(e-s-1)/2;
	for(i=13-n;i<=13;i++) {
		if(s==e) s++;
		if(s>27) s=1;
		a[1][i]=ss[s++];
	}
	for(i=13;i;i--) {
		if(s==e) s++;
		if(s>27) s=1;
		a[2][i]=ss[s++];
	}
	for(i=1;i<temp;i++) {
		if(s==e) s++;
		if(s>27) s=1;
		a[1][i]=ss[s++];
	}
	if(n) {
		for(i=1;i<=2;i++) {
			for(j=1;j<=13;j++)
			printf("%c",a[i][j]);
			printf("\n");
		}
	}
	else printf("Impossible\n");
	return 0;
}

#include <bits/stdc++.h>
using namespace std;

int main() {
#ifndef ONLINE_JUDGE
	freopen("in.txt", "r", stdin);
#endif
	string s;
	int l, r;
	cin >> s;
	for (int i = 0; i < 27; ++i) {
		for (int j = i + 1; j < 27; ++j) {
			if (s[i] == s[j]) {
				l = i, r = j;
				break;
			}
		}
	}
	if (r == l + 1) {
		puts("Impossible");
		return 0;
	}
	char ans[26];
	int part1 = (r - l - 1) / 2, part2 = (r - l) / 2;
	int start = 12 - part1;
	for (int i = 12 - part1; i < 13 + part2; ++i) {
		ans[i] = s[l++];
	}
	l = (l + 1) % 26;
	for (int i = (13 + part2) % 26; i != start;
			i = (i + 1) % 26, l = (l + 1) % 27) {
		ans[i] = s[l];
	}
	for (int i = 0; i < 13; ++i)
		cout << ans[i];
	putchar('\n');
	for (int i = 25; i > 12; --i)
		cout << ans[i];
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define pb emplace_back
#define pob pop_back()
#define ff first
#define ss second
typedef long long int ll;
#define vll vector<ll>
#define vpll vector<pair<ll,ll>>
#define vvll vector<vector<ll>>
#define vcc vector<char>
#define vss vector<string>
#define bs binary_search
#define lb lower_bound
#define ub upper_bound
#define test ll t; cin>>t; while(t--)
main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n,i,j,k,ig;
    string s;
    cin>>s;
    map<ll,ll>mp;
    for(i=0;s[i]!='\0';i++)
    {
        if(mp[s[i]]==0)
        mp[s[i]]=i+1;
        else
        {
            n=i+1-mp[s[i]]+1; j=mp[s[i]]-1; ig=i; break;
        }
    }
    if(n>2)
    {
        ll p=13-n/2+1,p1;
        p1=p;
        vcc a(27);
        for(i=j;i<27&&p<27;i++)
        if(i==ig)continue;
        else
        a[p++]=s[i];
        if(p<27)
        {
            for(i=0;p<27;i++)
            if(i==ig)continue;
            else
            a[p++]=s[i];
            for(j=0;j<p1;j++)
            a[j]=s[i++];
        }
        else
        {
            for(p=1;p<p1&&i<27;p++)
            a[p]=s[i++];
            for(i=0;i<j;i++)
            a[p++]=s[i];
        }
        for(i=1;i<=13;i++)
        cout<<a[i];
        cout<<"\n";
        for(i=26;i>13;i--)
        cout<<a[i];
    }
    else
    cout<<"Impossible\n";
}

/*
 * source.cpp
 *
 *  Created on: Aug 4, 2016
 *      Author: joseph darani
 */

#include<iostream>
#include<string.h>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<cmath>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<unordered_map>
#include<unordered_set>
#include<bitset>
#include <numeric>
using namespace std;

#define iOS ios_base::sync_with_stdio(false)
#define P(x) cout<<#x<<" = { "<<x<<" }\n"
#define All(a) (a).begin(), (a).end()
#define _2d(a,row,col,type) type**a=new type*[row]; for (int i=0;i<row;i++) a[i]=new type[col];
#define lp(i,n) for(int i=0;i<int(n);i++)
#define rep(i, j, n) for (int i=j, i<n; i++)
#define lpr(i,n) for(int i=n-1;i>=0;i--)
#define loopi(i,a,n) for(int i=int(a);i<int(n);i++)
#define clr(a, n) memset(a, n, sizeof(a));
#define scn(a,n) rep(i,n) cin>>a[i];
#define scn2(a,row,col) rep(i,row) rep(j,col) cin>>a[i][j];
#define prn(a,n) rep(i,n-1) cout<<a[i]<<" "; cout<<a[n-1]<<endl;
#define prn2(a,row,col) rep(i,row){rep(j,col-1) cout<<a[i][j]<<" "; cout<<a[i][col-1]<<endl;}
#define rdi(x) scanf("%d",&(x))
#define rdk(x,y) scanf("%d%d",&(x),&(y))
#define rdl(x) scanf("%I64d",&(x))
#define rdll(x,y) scanf("%I64d%I64d",&(x),&(y))
#define mp(a, b) make_pair(a, b)
#define pb(a) push_back(a)
#define Odd(x) x%2!=0
#define Even(x) x%2==0
#define Pi 3.1415926535897932384626433832795
#define INF 2000000000 // 2 billion
#define OO 0x7fffffff
#define maxL (10000000>>5)+1
#define GET(x) (mark[x>>5]>>(x&31)&1)
#define SET(x) (mark[x>>5] |= 1<<(x&31))
#define mod 1000000007
typedef long long ll;
typedef unsigned long ul;
typedef unsigned long long ull;
typedef long double ld;
typedef vector<int> vi;
typedef vector<long> vl;
typedef vector<ll> vll;
typedef vector<double> vd;
typedef vector<string> vs;
typedef pair<int, int> ii;
typedef pair<int, string> is;
typedef vector<ii> vii;

//int dx[] = {1,-1,0,0} , dy[] = {0,0,1,-1}; // 4 Direction
//int dx[] = {1,-1,0,0,1,1,-1,-1} , dy[] = {0,0,1,-1,1,-1,1,-1};  // 8 Direction
// int dx[] = {1,-1,1,-1,2,2,-2,-2} , dy[] = {2,2,-2,-2,1,-1,1,-1}; // Knight Direction
// int dx[] = {2,-2,1,1,-1,-1} , dy[] = {0,0,1,-1,1,-1}; // Hexagonal Direction

/*#define maX 100000+1
int se[maX]= {0};

 bool prime[maX];
void SieveOfEratosthenes(int n)
 {
     // Create a boolean array "prime[0..n]" and initialize
     // all entries it as true. A value in prime[i] will
     // finally be false if i is Not a prime, else true.

     memset(prime, true, sizeof(prime));

     for (int p=2; p*p<=n; p++)
     {
         // If prime[p] is not changed, then it is a prime
         if (prime[p] == true)
         {
             // Update all multiples of p
             for (int i=p*2; i<=n; i += p)
                 prime[i] = false;
         }
     }

     // Print all prime numbers
     for (int p=2; p<=n; p++)
        if (prime[p])
           cout << p << " ";
 }

*/
/*while(l!=r)
 {
 int mid=(l+r+1)/2;

 if(s=="<")
 r=mid-1;
 else
 l=mid;
 }*/

bool is_prime(long long x) {
	if (x == 1)
		return false;
	for (int i = 2; i * i <= x; i++)
		if (x % i == 0)
			return false;
	return true;

}

bool is_palindrome(string s1) {
	int l = s1.length();
	for (int i = 0; i < l / 2; i++)
		if (s1[i] != s1[l - i - 1])
			return false;

	return true;
}

ull C(ll n, ll k) {
	if (k == 0) return 1;

	return (n * C(n - 1, k - 1)) / k;
}

ll modular_pow(ll base, ll exponent, int modulus) {
	ll result = 1;
	while (exponent > 0) {
		if (exponent % 2 == 1)
			result = (result * base) % modulus;
		exponent = exponent >> 1;
		base = (base * base) % modulus;
	}
	return result;
}

long long binaryToDec(string number) {
	long long result = 0, pow = 1;
	for (int i = number.length() - 1; i >= 0; --i, pow <<= 1)
		result = (result + (number[i] - '0') * pow) % 1000003;

	return result;
}

long long binaryToDec2(string number) {
	long long result = 0, pow = 1;
	int l=number.length();
	for (int i =0; i <l; ++i, pow <<= 1)
		result = (result + (number[i] - '0') * pow) % 1000003;

	return result;
}

string decimalToBin(int number)
{
    if ( number == 0 ) return "0";
    if ( number == 1 ) return "1";

    if ( number % 2 == 0 )
        return decimalToBin(number / 2) + "0";
    else
        return decimalToBin(number / 2) + "1";
}
ull GCD(ull a, ull b) {
	return b == 0 ? a : GCD(b, a % b);
}

int cntMask(int mask) {
	int ret = 0;
	while (mask) {
		if (mask % 2)
			ret++;
		mask /= 2;
	}
	return ret;
}
int getBit(int mask, int i) {
	return ((mask >> i) & 1) == 1;
}
int setBit(int mask, int i, int value = 1) {
	return (value) ? mask | (1 << i) : (mask & ~(1 << i));
}

ull mystoi(string s) {
	ull ans = 0;
	ull po = 1;
	for (int i = s.length() - 1; i >= 0; i--) {
		ans += (s[i] - '0') * po;
		po *= 10;
	}

	return ans;

}

string conv(int i) {
	string t = "";
	while (i) {
		t += '0' + (i % 10);
		i /= 10;
	}
	//reverse(All(t));
	return t;
}

bool hasZero(int i) {
	if (i == 0)
		return true;
	while (i) {
		if (i % 10 == 0)
			return true;
		i /= 10;
	}
	return false;
}

bool isSortedAc(int a[], int n) {
	lp(i,n-1)
		if (a[i] > a[i + 1])
			return false;

	return true;
}

bool isSortedDec(int a[], int n) {
	lp(i,n-1)
		if (a[i] < a[i + 1])
			return false;

	return true;
}

bool cmp(ull i,ull j)
{
	return i>j;
}

void A()
{
	string st;
	int n;
	cin>>n;
	cin>>st;

	int ans=0;
	lp(i,st.length())
	{
		//cout<<"1"<<endl;
		if(st[i]=='<')ans++;

		else break;
	}

	for(int i=st.length()-1;i>=0;i--)
	{
		//cout<<'2'<<endl;

		if(st[i]=='>')ans++;
		else break;
	}

	cout<<ans<<endl;
	return ;
}

void B()
{

	string s;
	cin>>s;

	ull ans=0;
	ull n;
	int e;
	for(e=s.length()-1;e>=0;e--)
	{
		if((s[e]-'0')>=0 || (s[e]-'0')<=9)break;
	}
	string t=s.substr(0,e);
	//cout<<t<<endl;
	n=mystoi(t);

	ull tem=n/2;
	char c=s[s.length()-1];

	//cout<<tem<<endl;
	if(n%2)
	{
		if(tem%2==0)
		{

			ans+=tem*6;
			ans+=n-1;
		}
		else
		{
			//cout<<tem<<endl;
         ans+=(tem-1)*6;
		 ans+=n-3;
		}

	}

	else
	{
		if(tem%2==1)
		{
			ans+=tem*6;
			ans+=n-1;
		}
		else
		{
         ans+=(tem-1)*6;
		 ans+=n-3;
		}

	}

				if(c=='f')ans++;
			if(c=='e')ans+=2;
			if(c=='d')ans+=3;
			if(c=='a')ans+=4;
			if(c=='b')ans+=5;
			if(c=='c')ans+=6;
	cout<<ans<<endl;

	return ;
}

void C()
{
	string s;
	cin>>s;
	int len=s.length();
	map<char ,int> mp;
	char target;
	lp(i,len-1)
	{

		if(s[i]==s[i+1])
		{
			cout<<"Impossible"<<endl;
			return ;
		}
	}
	lp(i,len)
	{
		mp[s[i]]++;
		if(mp[s[i]]==2)
		{target=s[i];
		break;
		}
	}

	char a[3][15];

	lp(i,2)
		lp(j,13)a[i][j]='*';

	int idx=s.find(target);
	int is=idx;

	int idx2=0;
	for(int i=len-1;i>=0;i--)
	{
		if(s[i]==target)
		{
			idx2=i;
			break;
		}
	}

	int dis=idx2-idx-1;
	dis/=2;

	//cout<<idx<<" "<<idx2<<endl;
	//cout<<"d "<<dis<<endl;

	int p=12-dis;
	//cout<<"p "<<p<<endl;
	for(int i=p;i<13;i++)
		a[0][i]=s[is++];

	for(int i=12;i>p-(dis%2);i--)
		a[1][i]=s[is++];

	int o=idx;
	int t=12-idx2;

	int last;
	for(int i=0;i<13;i++)
	{
		if(a[1][i]!='*')
		{
			last=i;
			break;
		}
	}

		is=idx2+1;
		int l=0;

		bool ef=false;
		for(int i=last-1;i>=0;i--)
		{if(is==len){ ef=true; l=i;  break;}
			a[1][i]=s[is++];
		}

		if(ef)
		{
			is=0;
			for(int i=l;i>=0;i--)
				a[1][i]=s[is++];

			for(int i=0;is<len;i++)
				a[0][i]=s[is++];

		}

		else{ for(int i=0;is<len;i++)a[0][i]=s[is++];

		is=0;
		if(a[0][0]=='*')
			lp(i,idx)
			a[0][i]=s[is++];

		}

	lp(i,13)cout<<a[0][i];
	cout<<endl;
	lp(i,13)
		cout<<a[1][i];

	cout<<endl;

	return ;

}

int main(){

	C();
	//system("pause");
	return 0;
}

/*

                   _ooOoo_
                  o8888888o
                  88" . "88
                  (| -_- |)
                  O\  =  /O
               ____/`---'\____
             .'  \|     |//  `.
            /  \|||  :  |||//  \
           /  _||||| -:- |||||-  \
           |   | \\  -  /// |   |
           | \_|  ''\---/''  |   |
           \  .-\__  `-`  ___/-. /
         ___`. .'  /--.--\  `. . __
      ."" '<  `.___\_<|>_/___.'  >'"".
     | | :  `- \`.;`\ _ /`;.`/ - ` : | |
     \  \ `-.   \_ __\ /__ _/   .-` /  /
======`-.____`-.___\_____/___.-`____.-'======
                   `=---='
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
			      INFERNO
*/

#pragma comment(linker, "/STACK:1024000000,1024000000")
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define MP(A, B) make_pair(A, B)
#define pb push_back
#define gcd __gcd
#define foreach(it,a) for(__typeof((a).begin()) it=(a).begin();it!=(a).end();it++)
#define rep(i, a, b) for(int i = a; i < b; i++)
#define per(i, a, b) for(int i = a; i > b; i--)
typedef long long ll;
typedef unsigned long long ulls;
typedef unsigned int uint;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vii;
typedef map<int, int> mii;
typedef map<string, int> msi;
typedef map<pii, int> mpi;
const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3fLL;
const int MOD = 1e9 + 7;
const double pi = acos(-1.0);
const double eps = 1e-6;
const int maxn = 1e3 + 5;
const int maxm = 1e6 + 5;
const int dx[] = {-1, 0, 1, 0, -1, -1, 1, 1};
const int dy[] = {0, 1, 0, -1, 1, -1, 1, -1};
inline int scan(int &a) { return scanf("%d", &a); }
inline int scan(int &a, int &b) { return scanf("%d%d", &a, &b); }
inline int scan(int &a, int &b, int &c) { return scanf("%d%d%d", &a, &b, &c); }
inline int scan(ll &a) { return scanf("%I64d", &a); }
inline int scan(ll &a, ll &b) { return scanf("%I64d%I64d", &a, &b); }
inline int scan(ll &a, ll &b, ll &c) { return scanf("%I64d%I64d%I64d", &a, &b, &c); }
inline int scan(double &a) { return scanf("%lf", &a); }
inline int scan(double &a, double &b) { return scanf("%lf%lf", &a, &b); }
inline int scan(double &a, double &b, double &c) { return scanf("%lf%lf%lf", &a, &b, &c); }
inline int scan(char &a) { return scanf("%c", &a); }
inline int scan(char *a) { return scanf("%s", a); }
template<class T> inline void mem(T &A, int x) { memset(A, x, sizeof(A)); }
template<class T0, class T1> inline void mem(T0 &A0, T1 &A1, int x) { mem(A0, x), mem(A1, x); }
template<class T0, class T1, class T2> inline void mem(T0 &A0, T1 &A1, T2 &A2, int x) { mem(A0, x), mem(A1, x), mem(A2, x); }
template<class T0, class T1, class T2, class T3> inline void mem(T0 &A0, T1 &A1, T2 &A2, T3 &A3, int x) { mem(A0, x), mem(A1, x), mem(A2, x), mem(A3, x); }
template<class T0, class T1, class T2, class T3, class T4> inline void mem(T0 &A0, T1 &A1, T2 &A2, T3 &A3, T4 &A4, int x) { mem(A0, x), mem(A1, x), mem(A2, x), mem(A3, x), mem(A4, x); }
template<class T0, class T1, class T2, class T3, class T4, class T5> inline void mem(T0 &A0, T1 &A1, T2 &A2, T3 &A3, T4 &A4, T5 &A5, int x) { mem(A0, x), mem(A1, x), mem(A2, x), mem(A3, x), mem(A4, x), mem(A5, x); }
template<class T0, class T1, class T2, class T3, class T4, class T5, class T6> inline void mem(T0 &A0, T1 &A1, T2 &A2, T3 &A3, T4 &A4, T5 &A5, T6 &A6, int x) { mem(A0, x), mem(A1, x), mem(A2, x), mem(A3, x), mem(A4, x), mem(A5, x), mem(A6, x); }
template<class T> inline T min(T a, T b, T c) { return min(min(a, b), c); }
template<class T> inline T max(T a, T b, T c) { return max(max(a, b), c); }
template<class T> inline T min(T a, T b, T c, T d) { return min(min(a, b), min(c, d)); }
template<class T> inline T max(T a, T b, T c, T d) { return max(max(a, b), max(c, d)); }
template<class T> inline T min(T a, T b, T c, T d, T e) { return min(min(min(a,b),min(c,d)),e); }
template<class T> inline T max(T a, T b, T c, T d, T e) { return max(max(max(a,b),max(c,d)),e); }
int cnt[26];
char s[30];
char out[2][13];
int main()
{
    #ifndef ONLINE_JUDGE
        freopen("in.txt", "r", stdin);
        freopen("out.txt", "w", stdout);
        long _begin_time = clock();
    #endif

    scan(s); rep(i, 0, 27) cnt[s[i] - 'A']++;
    char c; rep(i, 0, 26) if(cnt[i] == 2) c = i + 'A';
    int l = -1, r = -1;
    rep(i, 0, 27) if(s[i] == c) {
        if(l == -1) l = i;
        else r = i;
    }
    if(l == r - 1) return 0 * puts("Impossible");
    else
    {
        int pos = (l + r) / 2;
        int i, j;
        for(i = 12, j = pos; j >= l; j--, i--) out[0][i] = s[j];
        for(i = 12, j = pos + 1; j < r; j++, i--) out[1][i] = s[j];
        j = l - 1;
        for(; i >= 0; i--, j--) out[1][i] = s[(j + 27) % 27];
        for(i = 0; out[0][i] != c; i++, j--) out[0][i] = s[(j + 27) % 27];
    }
    rep(i, 0, 2)
    {
        rep(j, 0, 13) printf("%c", out[i][j]);
        printf("\n");
    }

    #ifndef ONLINE_JUDGE
        long _end_time = clock();
        printf("time = %ld ms\n", _end_time - _begin_time);
    #endif

    return 0;
}

#include<bits/stdc++.h>

using namespace std;
typedef double DB;
typedef long long LL;
typedef long long int ll;
typedef unsigned long long int ULL;
const int INF = 0x3f3f3f3f;
const LL LINF = 2e18;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define repu(i, a, b) for(int i = (a); i < (b); i++)
#define repf(i, a, b) for(int i = (a); i <= (b); i++)
#define repd(i, a, b) for(int i = (a); i >= (b); i--)
#define MEM(x,i) memset((x),(i),sizeof(x))
const double PI = acos(-1.0);
const double E = exp(1);
const double EPS = 1e-8;
const long long  mod = 1e4+7;
const int maxn=2e5+5;
void pre(){
     freopen("in.txt", "r", stdin);
     freopen("out.txt", "w", stdout);
}

int alp[30]={0};
char mp[30][30]={0};
int main(void){
	string str;
	cin>>str;
	char key;
	int dis=0;
	rep(i,str.size()){
		if(!alp[str[i]-'A'])
		alp[str[i]-'A']=i+1;
		else{
			key=str[i];
			dis=(i-alp[str[i]-'A'])/2+(i-alp[str[i]-'A'])%2;
			//cout<<dis<<endl;
			if(dis==0){
				puts("Impossible");
				return 0;
			}else{
				mp[0][12-dis]=key;
			}
		}
	}
	int ok=0;
	int bg=dis;
	int cur=0;
	int wd=0;
	rep(i,str.size()){
		if(key==str[i]){
			if(ok){
			 ok=0;
			 wd=i+1;
			 break;
		}
			ok=1;
		}
		if(ok){
			if(bg==13&&cur==0){
				cur++;
			}else if(bg==0&&cur==1){
				cur--;
			}
			if(cur==0)
			mp[cur][bg++]=str[i];
			else
			mp[cur][--bg]=str[i];
		}
	}
	cur=0;
	bg=dis;
	repu(i,wd,str.size()){
		if(bg==0&&cur==0){
			cur++;
		}else if(bg==13&&cur==1){
				cur--;
			}
		if(cur==0)
		mp[cur][--bg]=str[i];
		else
		mp[cur][bg++]=str[i];
	}
	rep(i,str.size()){
		if(str[i]==key)  break;
		if(bg==0&&cur==0){
			cur++;
		}else if(bg==13&&cur==1){
				cur--;
			}
		if(cur==0)
		mp[cur][--bg]=str[i];
		else
		mp[cur][bg++]=str[i];
	}
	rep(i,2){
		rep(j,13){
			cout<<mp[i][j];
		}
		puts("");
	}
	return 0;
}

#include <iostream>
#include <string>
#include <cmath>
#include <cstdio>
#include <map>
#include <queue>
#include <vector>
#include <algorithm>
#define For(i,n) for(i=0;i<n;i++)
#define Fr(i,a,n) for(i=a;i<n;i++)
#define F(i,n) for(i=1;i<=n;i++)
#define LL long long
#define Vi vector<int>
#define Mi map<int>
#define MI map<int,int>
#define Forn(i,a,n) for(i=n;i>=a;i--)
#define pb push_back
#define N 100007
#define M 1007
using namespace std;
struct vt {

	int x, y;
};
int a[N], b[N], A[M][M];
bool f[N], cl[M][M];
vector<int> g[M];
map<string, string> mp;
int main() {
	int i, j, k = 0, l, n, m;
	string  s2;
	char s1[200];
	char s[200];
	char ba;
	cin >> s1;

	for (i = 0; i < 25; i++) {
		if (s1[i] == s1[i + 1]) {
			cout << "Impossible"; return 0;
		}
		for (j = i + 2; j < 27; j++) {
			if (s1[j] == s1[i]) {
				string sa[5][50];
				int tar = 0;
				int ys = (26-j+i)/2;
				sa[0][ys] = s1[i];
				int x = i, y = j;
				char sar[100];
				int r = 0;
				for (int eu = j + 1; eu < 27; eu++) {
					sar[r] = s1[eu]; r++;
				}
				for (int eu = 0; eu < i; eu++) {
					sar[r] = s1[eu]; r++;
				}
				for (int eu = j-1; eu>i; eu--) {
					sar[r] = s1[eu]; r++;
				}

				int w = 0;
				for (int eu = ys - 1; eu >= 0; eu--) {
					sa[0][eu] = sar[w]; w++;
				}
				for (int eu = 0; eu < 13; eu++) {
					sa[1][eu] = sar[w]; w++;
				}
				for (int eu = 12; eu > ys; eu--) {
					sa[0][eu] = sar[w]; w++;
				}
				for (int eu = 0; eu < 13; eu++) {
					cout << sa[0][eu];
				}
				cout << endl;
				for (int eu = 0; eu < 13; eu++) {
					cout << sa[1][eu];
				}
				cout << endl; return 0;
			}
		}
	}

	return 0;

}

#include <iostream>

int help[32];

int main()
{
	char str[32];

	std::cin >> str;

	for (int i = 0; i < 26; ++i)
	{
		if (str[i] == str[i + 1])
		{
			std::cout << "Impossible";

			return 0;
		}
	}

	for (int i = 0; i < 27; ++i)
	{
		++help[str[i] - 'A'];
	}

	char t;

	for (int i = 0; i < 26; ++i)
	{
		if (help[i] == 2)
		{
			t = 'A' + i;

			break;
		}
	}

	int pos1 = -1, pos2 = 0;

	for (int i = 0; i < 27; ++i)
	{
		if (t == str[i])
		{
			if (pos1 == -1)
				pos1 = i;
			else
				pos2 = i;
		}
	}

	for (int i = pos2; i < 26; ++i)
	{
		str[i] = str[i + 1];
	}

	char row1[32];
	char row2[32];

	int startIndex;

	int offset = (pos2 - pos1) / 2;

	if (offset == 13)
		startIndex = 0;
	else
		startIndex = 12 - offset;

	int curIndexOfStr = pos1;

	for (int i = startIndex; i < 13; ++i)
	{
		if (curIndexOfStr == 26)
			curIndexOfStr = 0;

		row1[i] = str[curIndexOfStr++];
	}

	for (int i = 12; i >= 0; --i)
	{
		if (curIndexOfStr == 26)
			curIndexOfStr = 0;

		row2[i] = str[curIndexOfStr++];
	}

	for (int i = 0; i < startIndex; ++i)
	{
		if (curIndexOfStr == 26)
			curIndexOfStr = 0;

		row1[i] = str[curIndexOfStr++];
	}

	row1[13] = '\0';
	row2[13] = '\0';

	std::cout << row1 << std::endl;
	std::cout << row2 << std::endl;

	return 0;
}

#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
const int MAX_N=27;
char s[MAX_N];
int a[MAX_N];
char ans[2][13];
int main()
{
	//freopen("input.txt","r",stdin);
	//freopen("output.txt","w",stdout);
	int x=0,d=0,p;
	for (int i=0;i<MAX_N;i++)
	{
		cin>>s[i];
		a[s[i]-'A']++;
		if (a[s[i]-'A']==2)
			x=s[i]-'A';
	}
	for (int i=0;i<MAX_N;i++)
	{
		if (s[i]-'A'==x)
		{
			p=i;
			for (int j=i+1;j<MAX_N;j++)
			{
				if (s[j]-'A'==x)
					break;
				d++;
			}
			break;
		}
	}
	if (d==0)
	{
		cout<<"Impossible";
		return 0;
	}
	int y=12-d/2,b=p;
	for (p;p<MAX_N;p++)
	{
		if (y==13)
		{
			y=12;
			for (p;p<MAX_N;p++)
			{
				if (s[p]-'A'!=x)
				{
					ans[1][y]=s[p];
					y--;
					if (y==-1)
					{
						y=0;
						for (p=p+1;p<MAX_N;p++)
						{
							if (s[p]-'A'!=x)
							{
								ans[0][y]=s[p];
								y++;
							}
						}
						break;
					}
				}
			}
			break;
		}
		ans[0][y]=s[p];
		y++;
	}
	y=12-d/2;
	for (p=b-1;p>=0;p--)
	{
		y--;
		if (y==-1)
		{
			y=0;
			for (p;p<MAX_N;p++)
			{
				ans[1][y]=s[p];
				y++;
				if (y==13)
				{
					y=12;
					for (p=p+1;p<MAX_N;p++)
					{
						ans[0][y]=s[p];
						y--;
					}
					break;
				}
			}
			break;
		}
		ans[0][y]=s[p];
	}
	for (int i=0;i<2;i++)
	{
		for (int j=0;j<13;j++)
			cout<<ans[i][j];
		cout<<endl;
	}
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    string s;
    cin>>s;
    string cyc,p1,p2;
    int cou[26];
    memset(cou,0,sizeof(cou));
    int i,n=s.length();

    for(i=1;i<n;i++)
        if(s[i]==s[i-1])
        {
            cout<<"Impossible"<<'\n';
            return 0;
        }

    char spc;
    for(i=0;i<n;i++)
    {
        cou[s[i]-'A']++;
        if(cou[s[i]-'A']==2)
            spc=s[i];
    }
    //cout<<spc<<'\n';
    int cycs1=-1,cyce1=-1;
    for(i=0;i<n;i++)
    {
        if(s[i]==spc && cycs1==-1)
        {
            cycs1=i;
        }
        else if(s[i]==spc)
        {
            cyce1=i;
        }
    }
    //cout<<cycs1<<' '<<cyce1<<'*'<<'\n';
    int lenc=cyce1-cycs1;
    char ans[2][13];
    for(i=0;i<2;i++){
        for(int j=0;j<13;j++)
            ans[i][j]='$';
        }
    int stdis=((lenc+lenc%2))/2;
    stdis--;
    int currind=cycs1;
    for(i=stdis;i>=0;i--)
    {
        ans[0][i]=s[currind];
        currind++;
    }
    currind=cyce1-1;
    for(i=stdis-(lenc%2);i>=0;i--)
    {
        ans[1][i]=s[currind];
        currind--;
    }
     //for(i=0;i<2;i++){
        //for(int j=0;j<13;j++)
        //    cout<<ans[i][j]<<' ';
        //cout<<'\n';
    //}
    //cout<<'\n';
    //cout<<'\n';
    currind=cycs1-1;
    int lenp1,lenp2;
    lenp1=cycs1;
    lenp2=n-cyce1-1;
    int currlen=lenp1;
    //cout<<currlen<<'\n';
    //cout<<'\n';
    //cout<<'\n';
    for(i=stdis+1;i<13;i++)
    {
        if(currlen==0)
            break;
        ans[0][i]=s[currind];
        currind--;
        currlen--;
    }
    //cout<<currind<<' '<<currlen<<'\n';

    for(i=12;i>=(12)-(currlen-1);i--)
    {
        //if(currlen==0)
        //    break;
        ans[1][i]=s[currind];
        currind--;
        //currlen--;
    }

    /*for(i=0;i<2;i++){
        for(int j=0;j<13;j++)
            cout<<ans[i][j]<<' ';
        cout<<'\n';
    }*/

    // cout<<'\n';
    //cout<<'\n';

    currlen=lenp2;
    currind=cyce1+1;
    for(i=stdis+1-(lenc%2);i<13;i++)
    {
        if(currlen==0)
            break;
        ans[1][i]=s[currind];
        currind++;
        currlen--;
    }
    for(i=12;i>=(12)-(currlen-1);i--)
    {
        ans[0][i]=s[currind];
        currind++;
        currlen--;
    }
    for(i=0;i<2;i++){
        for(int j=0;j<13;j++)
            cout<<ans[i][j]<<' ';
        cout<<'\n';
    }

    return 0;
}

#include <bits/stdc++.h>
using namespace std;

typedef long long LL;
typedef pair<int, int> II;

const int N = 50;
char S[N], T[2][N];
bool fre[N];
II pos[N];

bool Adjacent(II a, II b) {
    return a != b && abs(a.first - b.first) <= 1 && abs(a.second - b.second) <= 1;
}

bool Check(int x, int y) {
    bool ans = false; memset(fre, true, sizeof fre);
    for (int i = 1, d = 1; i <= 27; ++i) {
        if (fre[S[i] - 'A'] == false) {
            if (Adjacent(pos[S[i] - 'A'], II(x, y))) ans = true;
            continue;
        }
        T[x][y] = S[i];
        pos[S[i] - 'A'] = II(x, y);
        fre[S[i] - 'A'] = false;
        y += d;
        if (y == 14) {
            x ^= 1; y = 13;
            d = -d;
        }
    }
    return ans;
}

int main() {
    #ifdef LOCAL
        freopen("Data.inp", "r", stdin);
        freopen("Data.out", "w", stdout);
    #endif

    scanf("%s", S + 1);
    for (int i = 1; i <= 25; ++i) if (S[i] == S[i + 1]) {
        puts("Impossible");
        return 0;
    }
    for (int x = 0; x < 2; ++x) for (int y = 1; y <= 26; ++y) {
        if (Check(x, y)) {
            puts(T[0] + 1);
            puts(T[1] + 1);
            return 0;
        }
    }
    puts("Impossible");
    return 0;
}

#include <bits/stdc++.h>

#define fi first
#define se second
#define sc scanf
#define pr printf
#define pb push_back
#define mp make_pair
#define fin(s) freopen( s, "r", stdin );
#define fout(s) freopen( s, "w", stdout );

const int N = 200200;

using namespace std;

string s, t = "";
char c[26];
int in[200];

int main()
{
    //fin("input.txt");
    //fout("output.txt");
    ios_base::sync_with_stdio(0);
    cin >> s;
    int st1,
        st2;
    for(int i = 1; i < s.size(); i++){
        if(s[i] == s[i - 1]){
            cout << "Impossible" << endl;
            return 0;
        }
    }
    for(int i = 0; i < s.size(); i++){
        if(in[s[i]]){
            int j = in[s[i]] - 1;
            st1 = j;
            st2 = 12 - (i - j - 1) / 2;
        }
        else{
            in[s[i]] = i + 1;
            t += s[i];
        }
    }
    for(int i = 0; i < 26; i++)
        c[(st1 + i) % 26] = t[(st2 + i) % 26];
    for(int i = 0; i < 13; i++)
        cout << c[i];
    cout << endl;
    for(int i = 25; i >= 13; i--)
        cout << c[i];
}

#include <bits/stdc++.h>
using namespace std;
#define PB push_back
#define ZERO (1e-10)
#define INF (1<<29)
#define CL(A,I) (memset(A,I,sizeof(A)))
#define DEB printf("DEB!\n");
#define D(X) cout<<"  "<<#X": "<<X<<endl;
#define EQ(A,B) (A+ZERO>B&&A-ZERO<B)
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef pair<int,int> ii;
typedef vector<ii> vii;
#define IN(n) int n;scanf("%d",&n);
#define FOR(i, m, n) for (int i(m); i < n; i++)
#define REP(i, n) FOR(i, 0, n)
#define F(n) REP(i, n)
#define FF(n) REP(j, n)
#define FT(m, n) FOR(k, m, n)
#define aa first
#define bb second
void ga(int N,int *A){F(N)scanf("%d",A+i);}
#define in(X,Y) (~X&&~Y&&X<2&&Y<13)
#define pc(C) putchar(C)
char s[666],r[2][16];
int sx[]={1,1,1,0,0,-1,-1,-1},sy[]={1,0,-1,1,-1,1,0,-1},K[256],J;
bool dfs(int u,int x,int y){
    if((!r[x][y]&&u==J))return 0;
    if(!s[u+1]){
        F(2){
            FF(13)if(r[i][j])pc(r[i][j]);
                  else pc(66);
            pc(10);
        }
        return 1;
    }
    int X,Y,c=0;
    if(!r[x][y])r[x][y]=s[u],c=1;
    F(8){
        X=x+sx[i],Y=y+sy[i];
        if(in(X,Y)&&(!r[X][Y]||r[X][Y]==s[u+1])&&dfs(u+1,x+sx[i],y+sy[i]))return 1;
    }
    if(c)r[x][y]=0;
    return 0;
}
int main(void){
    scanf("%s",s);
    F(27)if(K[int(s[i])]++)J=i;
    F(7)if(dfs(0,0,i))return 0;
    puts("Impossible");
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
//#define DEBUG
#define ll long long
#define INF 0x3f3f3f3f
#define INF16 16000000000000000LL
#define INF18 1000000000000000000LL
#define pii pair<int,int>
#define F first
#define S second
#define mp make_pair
#define pb push_back
#define mod9 (int)(1e7 + 9)
#define mod7 (int)(1e7 + 7)
#define eps 1e-9
#define mse(x , y) memset(x , y , sizeof(x))
#define ALL(x) x.begin(),x.end()
#define RALL(x) x.rbegin(),x.rend()
#define IOS do { ios::sync_with_stdio(0);cin.tie(0); } while (0)

inline ll rit(){
	int key = 1;
	char c = getchar();
	while(!isdigit(c)){
		if(c == '-') key = -1;
		c = getchar();
	}

	ll x = 0;
	while(isdigit(c)){
		x = x * 10 + c - '0';
		c = getchar();
	}
	return x * key;
}

/*********default*********/

int vis[30];
int main(){
	string s;
	cin >> s;
	int pos , st , en;
	mse(vis , INF);
	for(int i = 0; i < s.length(); i++){
		if(vis[s[i] - 'A'] != INF){
			st = vis[s[i] - 'A'];
			en = i;
			pos = i - vis[s[i] - 'A'];
			break;
		}
		vis[s[i] - 'A'] = min(vis[s[i] - 'A'] , i);
	}

	pos = 12 - pos / 2;
	if(en - st == 1) printf("Impossible\n");
	else{
		for(int i = en + pos; i >= en; i--) cout << s[i];
		for(int i = st + 1; i <= st + 12 - pos; i++) cout << s[i];
		cout << endl;
		for(int i = en + pos + 1; i < s.length(); i++) cout << s[i];
		for(int i = 0; i < st; i++) cout << s[i];
		for(int i = en - 1; i >= st + 12 - pos + 1; i--) cout << s[i];
		cout << endl;
	}

	return 0;
}

#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cmath>
#include<iostream>
#include<algorithm>
#include<queue>
#include<map>
#include<set>
#include<utility>
#define N 200005
#define inf 0x7fffffff
#define INF 0x7fffffffffffffff
#define ll long long
using namespace std;
int ra()
{
    int x=0,f=1; char ch=getchar();
    while (ch<'0' || ch>'9') {if (ch=='-') f=-1; ch=getchar();}
    while (ch>='0' && ch<='9') {x=x*10+ch-'0'; ch=getchar();}
    return x*f;
}
string ch;
int pos[100],next_pos,last_pos,len,orz;
int ans[100][100],cnt;
int main()
{
	cin>>ch;  char chans;
	for (int i=0; i<=26; i++)
	{
		if (pos[ch[i]]) next_pos=i+1,last_pos=pos[ch[i]],chans=ch[i];
		pos[ch[i]]=i+1;
	}
	len=next_pos-last_pos-1;
	if (len==0)
	{
		cout<<"Impossible";
		return 0;
	}
	orz=len/2+(len%2);
	ans[2][13-orz]=ch[last_pos-2];
	ans[1][13-orz+(len%2)]=chans;
	int x=1,y=13-orz+(len%2);
	for (;;)
	{
		++cnt;
		if (y+cnt<=13) ans[1][y+cnt]=ch[last_pos+cnt-1];
		else break;
	}
	int tot=0; cnt--;
	for (;;)
	{
		if (13-tot==13-orz) break;
		else ans[2][13-tot]=ch[last_pos+cnt]; cnt++;
		tot++;
	}
	tot=0;
	for (;;)
	{
		tot--; cnt++;
		if (y+tot>=1) ans[1][y+tot]=ch[last_pos+cnt];
		else
		{
			tot=0;
			for (; last_pos+cnt<=26; cnt++)
				ans[2][++tot]=ch[last_pos+cnt];
			break;
		}
	}
	tot=13-orz,cnt=0;
 	for (;;)
	{
		cnt++; tot--; //cout<<tot; while (1);
		if (last_pos-cnt-2>=0) ans[2][tot]=ch[last_pos-cnt-2];
		else
		{
			tot=0;
			for (;cnt<=last_pos; cnt++)
				ans[1][tot]=ch[last_pos-cnt];
			break;
		}
	}
	for (int i=1; i<=2; i++,cout<<endl)
		for (int j=1; j<=13; j++)
			cout<<(char)ans[i][j];
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define int long long
#define ld long double
const int N=2e5+10;
const int mod=1e9+7;
vector<int>a(N);
int xx,yy;
bool check(int t)
{
    int x=(xx+t)%26; int y=(yy+t)%26;
    if(y>12) y-=25;
    return (y>=x and x<=y+1);
    if(x>12) x-=25;
    return (y>=x and x<=y+1);
    return 0;
}

int32_t main()
{
   string s; cin>>s;
   for(int i=0;i<27;i++)
   {
      for(int j=i+1;j<27;j++) if(s[i]==s[j]) {  xx=i; yy=j;    }
   }
  s.erase(s.begin()+yy); yy--;
  int rotatex=0;
  while(!check(rotatex) and rotatex<70)
  {
      int temp=s[25];
      for(int i=25;i>0;i--) s[i]=s[i-1];
      s[0]=temp;
      rotatex++;
  }
  if(rotatex>=70) cout<<"NO"<<endl;
   for(int i=0;i<13;i++) cout<<s[i]; cout<<endl;
   for(int i=25;i>=13;i--) cout<<s[i]; cout<<endl;
  return 0;
}

#include<cstdio>
#include<iostream>
#include<cstring>
#include<vector>
#include<stack>
#include<cmath>
#include<algorithm>
#include<map>
#include<cstdlib>
int read(){
	char ch=getchar(); int f=1,x=0;
	while(ch<'0'||ch>'9'){
		if(ch=='-') f=-1;
		ch=getchar();
	}
	while(ch>='0'&&ch<='9'){
		x=x*10+ch-'0';
		ch=getchar();
	}
	return f*x;
}
bool b[50];
char s[50],a,ans1[50],ans2[50];
int pos1,pos2,now1,now2,jl;
int main(){
	memset(b,false,sizeof(b));
    scanf("%s",s+1);
    for(int i=1;i<=27;i++){
		if(!b[s[i]-'A']) b[s[i]-'A']=true;
		else{
			a=s[i];
			pos2=i;
			break;
		}
    }
    for(int i=1;i<=27;i++){
		if(s[i]==a){
			pos1=i;
			break;
		}
    }
    if(pos2==pos1+1){
		printf("Impossible");
		return 0;
    }
    now1=pos1-1; now2=0;
    jl=(pos2-pos1)/2;
    if((pos2-pos1)%2==1) jl++;
    for(int i=14-jl;i<=13;i++){
		ans1[i]=s[++now1];
    }
    for(int i=13;i>14-jl;i--){
		ans2[i]=s[++now1];
    }
    now1++;
    int j,k=0;
	for(j=14-jl;j>=1;j--){
		if(now1==27) break;
		ans2[j]=s[++now1];
    }
	for(j;j>=1;j--){
		ans2[j]=s[++now2];
	}
    for(k=1;k<14-jl;k++){
		if(now1==27) break;
		ans1[k]=s[++now1];
    }
    for(k;k<14-jl;k++){
		ans1[k]=s[++now2];
    }
    for(int i=1;i<=13;i++){
		printf("%c",ans1[i]);
    }
    printf("\n");
    for(int i=1;i<=13;i++){
		printf("%c",ans2[i]);
    }
    return 0;
}

#include <string>
#include <iostream>
#include <map>
using namespace std;

int main() {
	// your code goes here
//	freopen ("in.txt", "r", stdin);
	string s;
	cin>>s;
	char rep = 0;
	map <char, int> vis;
	for (int i=0; i<26; i++) {
		if (s[i] == s[i+1]) {
			cout<<"Impossible\n";
			return 0;
		}
		if (vis.count (s[i]) > 0) rep = s[i];
		vis [s[i]] = 1;
	}
	if (rep == 0) rep = s[26];
	int beg = -1, end = -1;
	for (int i=0; i<27; i++) {
		if (s[i] == rep) {
			if (beg == -1) beg = i;
			else end = i;
		}
	}
//	cout<<beg<<" "<<end<<endl;
	int tot_cnt = 1;
	char grid[2][13];
	int diff = end - beg;
	grid[0][ 12 - ((diff - 1) / 2)] = rep;

	int it = beg;
	int i = 0, j = 12 - ((diff - 1) / 2);
	while (j + 1 < 13) {
		j++;
		it++;
		grid[i][j] = s[it];
		tot_cnt++;
	}
	it++;
	i++;
	while (it < end) {
		grid[i][j] = s[it];
		tot_cnt++;
		it++;
		j--;
	}
	i = 0;
	j = 12 - ((diff - 1) / 2);
	it++;
	while (j >= 1) {
		j--;
		grid[i][j] = s[it];
		tot_cnt++;
		it++;
		if (it == 27) it = 0;
	}
	i++;

	while (tot_cnt < 26) {
		grid[i][j] = s[it];
		tot_cnt++;
		it++;
		if (it == 27) it = 0;
		j++;
	}

	// print
	for (int i=0; i < 2; i++) {
		for (int j=0; j<13; j++) {
			cout<<grid[i][j];
		}
		cout<<endl;
	}
	return 0;
}

#include <bits/stdc++.h>
using namespace std;
void def1(){
#define elf else if
#define sz size()
#define lth length()
#define pb push_back
#define beg begin()
#define end end()
}
void def2(){
#define ld long double
#define ll long long
#define rbeg rbegin()
#define rbeg rbegin()
#define rend rend()
#define sp setprecision(10) << fixed
#define one first
#define too second
#define ss stringstream
#define umap unordered_map
#define res top << endl << low; break;
}

int main(){

    string s; cin >> s;

    for(int i = 0; i < 25; ++i)
        if(s[i] == s[i + 1]){
            cout << "Impossible";
            return 0;
        }

    umap<char, int> repet;
    char seek, prev;
    for(int i = 0; i < 27; ++i){
        repet[s[i]] ++;
        if(repet[s[i]] == 2){
            seek = s[i];
            prev = s[i - 1];
            s.erase(i, 1);
            break;
        }
    }

    for(int i = 0; i < 26; ++i){
        string top = s.substr(0, 13);
        string low = s.substr(13, 13);
        reverse(low.beg, low.end);

        int l_prev = low.find(prev),
            t_prev = top.find(prev),
            l_seek = low.find(seek),
            t_seek = top.find(seek),
            np = string::npos;

        if((t_prev == l_seek || t_prev == (l_seek - 1))
            && (t_prev > -1 && l_seek > -1))
            {cout << res;}
        elf((l_prev == t_seek || l_prev == (t_seek + 1))
            && (l_prev > -1 && t_seek > -1))
            {cout << res;}

        rotate(s.rbeg, s.rbeg + 1, s.rend);
    }
}

#include <bits/stdc++.h>
#define For(i,a,b) for(int i=a;i<=b;i++)
#define Ford(i,a,b) for(int i=a;i>=b;i--)
#define dream_hyojooslh

using namespace std;
char nnn[3][200];
int last[255],pos,kc;
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    //freopen("dream_hyojooslh.inp","r",stdin);
    int n;
    string s;
    cin>>s;
    n=s.length();
    s="n"+s;
    For(i,1,n) {
        if (last[int(s[i])]!=0) {
            pos=last[int(s[i])];
            kc=i-pos-1;
        }
        last[int(s[i])]=i;
    }
    if (kc==0) {
        cout<<"Impossible"<<endl;
        return 0;
    }
    int ll=0;
    if (kc%2==0) {
        int t=(26-kc)/2;
        int t1=t;
        //cout<<t<<endl;
        if (pos-1>t1) {
            int pp=pos-t1+1;
            Ford(i,pp,1) {
                ++ll;
                nnn[1][i]=s[ll];
            }
            For(i,1,t1) {
                ++ll;
                nnn[2][i]=s[ll];
            }
        } else
        {
            int pp=t1-pos+2;
            For(i,pp,t1) {
                ++ll;
                nnn[2][i]=s[ll];
            }
        }
        For(i,t,13) {
            ++ll;
            nnn[1][i]=s[ll];
        }
        Ford(i,13,t1+1) {
            ++ll;
            nnn[2][i]=s[ll];
        }
        Ford(i,t1,1) {
            ++ll;
            nnn[1][i]=s[ll];
        }
        int nn=0;
        For(i,ll+1,27) {
            ++nn;
            nnn[2][nn]=s[i];
        }
    } else
    {
        int t=(26-kc+1)/2;
        int t1=t-1;
        if (pos>t1) {
            int pp=pos-t1-1;
            Ford(i,pp,1) {
                ++ll;
                nnn[1][i]=s[ll];
            }
            For(i,1,t1) {
                ++ll;
                nnn[2][i]=s[ll];
            }
        } else
        {
            int pp=t1-pos+2;
            For(i,pp,t1) {
                ++ll;
                nnn[2][i]=s[ll];
            }
        }
        For(i,t,13) {
            ++ll;
            nnn[1][i]=s[ll];
        }
        Ford(i,13,t1+1) {
            ++ll;
            nnn[2][i]=s[ll];
        }
        Ford(i,t,1) {
            ++ll;
            nnn[1][i]=s[ll];
        }
        int nn=0;
        For(i,ll+1,27) {
            ++nn;
            nnn[2][nn]=s[i];
        }
    }
    For(i,1,2) {
        For(j,1,13) cout<<nnn[i][j];
        cout<<endl;
    }
}

#include <iostream>
#include <string>
#include <cmath>
#include <cstdio>
#include <map>
#include <queue>
#include <vector>
#include <algorithm>
#define For(i,n) for(i=0;i<n;i++)
#define Fr(i,a,n) for(i=a;i<n;i++)
#define F(i,n) for(i=1;i<=n;i++)
#define LL long long
#define Vi vector<int>
#define Mi map<int>
#define MI map<int,int>
#define Forn(i,a,n) for(i=n;i>=a;i--)
#define pb push_back
#define N 100007
#define M 1007
using namespace std;
struct vt {

	int x, y;
};
int a[N], b[N], A[M][M];
bool f[N], cl[M][M];
vector<int> g[M];
map<string, string> mp;
int main() {
	int i, j, k = 0, l, n, m;
	string  s2;
	char s1[200];
	char s[200];
	char ba;
	cin >> s1;

	for (i = 0; i < 25; i++) {
		if (s1[i] == s1[i + 1]) {
			cout << "Impossible"; return 0;
		}
		for (j = i + 2; j < 27; j++) {
			if (s1[j] == s1[i]) {
				string sa[5][50];
				int tar = 0;
				if (j % 2 == i % 2) {
					tar = 1;
				}
				else {
					tar = 2;
				}
				int ys = (j-i)/2+tar;
				sa[0][ys] = s1[i];
				int x = i, y = j;
				char sar[100];
				int r = 0;
				for (int eu = j + 1; eu < 27; eu++) {
					sar[r] = s1[eu]; r++;
				}
				int q = 24;
				for (int eu = i + 1; eu < j; eu++) {
					sar[q] = s1[eu]; q--;
				}
				for (int eu = 0; eu < i; eu++) {
					sar[r] = s1[eu]; r++;
				}

				int w = 0;
				for (int eu = ys - 1; eu >= 0; eu--) {
					sa[0][eu] = sar[w]; w++;
				}
				for (int eu = 0; eu < 13; eu++) {
					sa[1][eu] = sar[w]; w++;
				}
				for (int eu = 12; eu > ys; eu--) {
					sa[0][eu] = sar[w]; w++;
				}
				for (int eu = 0; eu < 13; eu++) {
					cout << sa[0][eu];
				}
				cout << endl;
				for (int eu = 0; eu < 13; eu++) {
					cout << sa[1][eu];
				}
				cout << endl; return 0;
			}
		}
	}

	return 0;

}

#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<map>
#define ll long long
#define For(i,a,b) for (int i=a;i<=b;i++)
#define Rep(i,a,b) for (int i=b;i>=a;i--)
using namespace std;

inline int read(){
	int x=0,f=1;char ch=getchar();
	while (ch<'0'||ch>'9'){ if (ch=='-') f=-1;ch=getchar(); }
	while (ch>='0'&&ch<='9'){ x=x*10+ch-'0';ch=getchar(); }
	return x*f;
}

int n,m,now;
char s[107],f[2][107];
void check(int &x){ x++;if (x==now) x++;if (x>n) x=1; }

int main(){
	scanf("%s",s+1);
	n=27;m=13;
	For(i,1,n) For(j,i+2,n){
		if (s[i]==s[j]){
			int lastx=m-(j-i-1)/2,k=i;now=j;
			f[1][lastx]=s[k];
			For(x,lastx+1,m) check(k),f[1][x]=s[k];
			Rep(x,1,m) check(k),f[2][x]=s[k];
			For(x,1,lastx-1) check(k),f[1][x]=s[k];
			For(i,1,2){ For(j,1,m) printf("%c",f[i][j]);if (i==1) printf("\n"); }
			return 0;
		}
	}
	printf("Impossible\n");
}

#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define se second
#define fs first
#define LL long long
#define lson l,m,rt<<1
#define rson m+1,r,rt<<1|1
typedef pair<int,int> P;
const double eps=1e-9;
const int maxn=200100;
const int mod=1e9+7;
const int INF=1e9;

vector<int> v[30];
string s;
int a[30];

int main()
{
	cin>>s;
	for(int i=0;i<27;i++) v[s[i]-'A'].pb(i);
	int flag=0,pos,pre;
	for(int i=0;i<27;i++)
	{
		if(v[i].size()<=1) continue;
		for(int j=1;j<v[i].size();j++)
		{
			if(v[i][j]-v[i][j-1]!=1)
			{
				flag=1;
				pre=v[i][j-1];
				pos=v[i][j];
				break;
			}
		}
	}
	if(!flag) cout<<"Impossible"<<endl;
	else
	{
		int k=pos-pre;
		if(k%2)
		{
			k/=2;
			k++;
			for(int i=13-k+1;i<=13;i++) a[i]=pre++;
			k--;
			for(int i=26;i>=26-k+1;i--) a[i]=pre++;
			int j=26-k;
			for(j=26-k;j>=14;j--)
			{
				++pos;
				if(pos>26) break;
				a[j]=pos;
			}
			if(pos>26)
			{
				int m=0;
				if(j>=14)
				{
					while(j>=14) a[j--]=m++;
				}
				j=1;
				while(j<13-k) a[j++]=m++;
			}
			else if(j<14)
			{
				j=1;
				pos++;
				while(pos<=26) a[j++]=pos++;
				int m=0;
				while(j<13-k) a[j++]=m++;
			}
		}
		else
		{
			k/=2;
			for(int i=13-k+1;i<=13;i++) a[i]=pre++;
			for(int i=26;i>=26-k+1;i--) a[i]=pre++;
			int j=26-k;
			for(j=26-k;j>=14;j--)
			{
				++pos;
				if(pos>26) break;
				a[j]=pos;
			}
			if(pos>26)
			{
				int m=0;
				if(j>=14)
				{
					j--;
					while(j>=14) a[j--]=m++;
				}
				j=1;
				while(j<=13-k) a[j++]=m++;
			}
			else if(j<14)
			{
				j=1;
				pos++;
				while(pos<=26) a[j++]=pos++;
				int m=0;
				while(j<=13-k) a[j++]=m++;
			}
		}
		for(int i=1;i<=13;i++) cout<<s[a[i]];
		cout<<endl;
		for(int i=14;i<=26;i++) cout<<s[a[i]];
		cout<<endl;
	}
	return 0;
}

#include <bits/stdc++.h>

using namespace std;

const int N = 100050;
typedef long long ll;

string s;
char ans[2][30];

int main()
{
    ios::sync_with_stdio(0);
    cin >> s;
    int n = 27;
    int st, en;
    for (int i = 0; i < n; i++)
        for (int j = i + 1; j < n; j++)
            if (s[i] == s[j]) {
                st = i;
                en = j;
            }
    int d = en - st;
    if (d == 1)
        return cout << "Impossible", 0;
    s.erase(en, 1);
    n--;
    int x = 0, y = n / 2 - d / 2;
    s = s.substr(st) + s.substr(0, st);
    int dy = 1;
    for (int i = 0; i < 26; i++) {
        ans[x][y] = s[i];
        y += dy;
        if (y == 13) {
            y = 12;
            dy = -dy;
            x = 1 - x;
        }
        if (y == -1) {
            y = 0;
            dy = -dy;
            x = 1 - x;
        }
    }
    for (int i = 0; i < 2; i++) {
        for (int j = 0; j < 13; j++)
            cout << ans[i][j];
        cout << endl;
    }
    return 0;
}

#include<bits/stdc++.h>
#pragma comment(linker, "/STACK:102400000,102400000")
#define endl '\n'
using namespace std;
typedef long long ll;
const int N = 200000 + 10, inf = 0x3f3f3f3f, Mod = 998244353;
int vis[N];
int main()
{
    string s;
    char ans[2][30];
    int vis[30], l, r;
    while(cin>>s)
    {
        memset(vis, 0, sizeof(vis));
        for(int i = 0; i<s.size(); i++)
        {
            if(!vis[s[i]-'A'])
                vis[s[i]-'A'] = i + 1;
            else l = vis[s[i]-'A'], r = i+1;
        }
        if(r - l <= 2)
        {
            printf("Impossible\n");
            continue;
        }
        int num = r - l -1;
       //  cout<<num<<endl;
        int id = l;
        int i=0;
        ans[0][12-num/2] = s[l-1];
        for(i = 12-num/2+1; i<=12; i++)
        {
            ans[0][i] = s[id];
        //    cout<<s[id]<<endl;
            id++;
        }
      //  cout<<endl;
        for(i = 12; i>=12-num/2+1 && id<=26; i--)
        {
            ans[1][i] = s[id];
            //   cout<<s[id]<<endl;
            id++;
        }
       // cout<<id<<endl;
      //  cout<<s[id]<<endl;
        if(num&1)
        {
            ans[1][12-num/2] = s[id];
         //   cout<<s[id]<<endl;
            id++;
              id++;
            i--;
        }
        else
        {
            id++;
          //  cout<<s[id]<<endl;
            if(id>26)
                id = 0;
            ans[1][i] = s[id];
           // cout<<s[id]<<endl;
            id++;
            i--;
        }
        for(; i>=0 && id<=26; i--)
        {
            ans[1][i] = s[id];
            //  cout<<s[id]<<endl;
            id++;
        }
        if(i>=0)
        {
            id = 0;
            for(; i>=0; i--)
                ans[1][i] = s[id], id++;
            for(i = 0; i<12-num/2; i++)
            {
                ans[0][i] = s[id];
                id++;
            }
        }
        else
        {
            for(i = 0; i<12-num/2&&id<=26; i++)
            {
                ans[0][i] = s[id];
                id++;

            }
            id=0;
            for(; i<12-num/2&&i>=0; i++)
            {
                ans[0][i] = s[id];
                id++;
            }
        }
        ans[0][13] = ans[1][13] = '\0';
        puts(ans[0]);
        puts(ans[1]);
    }
    return 0;
}

#include <iostream>
#include <cstdlib>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <fstream>
#include <numeric>
#include <iomanip>
#include <bitset>
#include <list>
#include <stdexcept>
#include <functional>
#include <utility>
#include <ctime>

typedef long double ld;
typedef long long ll;
using namespace std;
const ll MX=2e5+9;
const ld pi = acos(-1);
const ll mod = 1e9+7;
bool cmp ( int a,int b ) { return a>b; }

ll po ( ll a , ll b )
{
    if ( b==0 ) { return 1; }
    ll x = po ( a , b/2 );
    x *= x%mod;
    if ( b%2 ) { x*=a%mod; }
    return x%mod;
}

int gcd (  int a , int b )
{
    return ( b==0 ? a : gcd( b , a%b ) );
}
int dx[]={ 0 , 0 , -1 , 1 , 1 , -1 , -1 , 1 };
int dy[]={ 1 , -1 , 0 , 0 , 1 , -1 , 1 , -1 };

string v[10];
bool vis[MX];
string s;

bool can( int x , int y,  int c )
{
    //cout<<x<<" "<<y<<" "<<c<<endl;
    if ( x>=0 && y>=0 && x<2 && y<13 && v[x][y]==s[c] ) { return 1; } return 0;
}

void p( string q[10] )
{
    for ( int i=0 ; i<2 ; i++ )
    {
        for (int j=0 ; j<13 ; j++)
        {
            cout<<q[i][j];
        }
        cout<<endl;
    }
    cout<<endl;
    //exit(0);

}

void dfs( int x , int y , int px , int py , int c=1 )
{
    if ( c==26 )
    {
        for ( int i=0 ; i<2 ; i++ )
    {
        for (int j=0 ; j<13 ; j++)
        {
            cout<<v[i][j];
        }
        cout<<endl;
    }
    cout<<endl;
    exit(0);
    }
    //cout<<c<<endl;

    for ( int i=0 ; i<8 ; i++ )
    {
        int nx = dx[i]+x;
        int ny = dy[i]+y;
        if ( px == nx && py == ny ) { continue; }
        if ( can( nx , ny , c ) )
        {
            //cout<<nx<<" "<<ny<<endl;
            dfs( nx , ny , x , y , c+1 );
            return ;
        }
    }
}

ll get ( string &x )
{
    ll c=0;
    ll l = x.length()-1;
    for ( int i=0 ;i<l ; i++ )
    {
         c = c*10 + x[i]-'0';
    }
    return c;
}
void go( )
{
    char temp;
    for ( int i=0 ;i <13 ; i++ )
    {
        if ( i )
        {
            char k=v[0][i];
            v[0][i] = temp;
            temp = k;
        }
        else
        {
            temp = v[0][i];
        }
    }

    for ( int i=12 ; i>=0 ; i-- )
    {
        char k = v[1][i];
        v[1][i] = temp;
        temp = k;
    }

    v[0][0] = temp;

}

int main()
{
    //string s;
    cin>>s;
    int l = s.length();
    //s += "&";
    int q=0;
    char temp;
    int r,c;
    for ( int i=0 ; i<l ;i++ )
    {
        if ( !vis[ s[i]-'A' ] )
        {
            if ( v[q].size()==13 ) { q++; }
            v[q].push_back( s[i] );
            vis[ s[i]-'A' ]=1;
        }
        else
        {
            temp = s[i];
        }
    }

    reverse( v[1].begin() , v[1].end() );

    bool ok=0;

    //cout<<temp<<endl;

    for ( int i=0 ; i<2 ; i++ )
    {
        for (int j=0 ; j<v[i].size() ; j++)
        {
            if ( v[i][j]==temp ) { r=i; c=j; ok=1; break; }
        }
        if ( ok ) { break; }
    }

    //cout<<"**"<<r<<" "<<c<<endl;

    /*for ( int i=0 ; i<2 ; i++ )
    {
        for (int j=0 ; j<13 ; j++)
        {
            cout<<v[i][j];
        }
        cout<<endl;
    }*/

    //p( v );
    dfs( 0 , 0 , -1 , -1 );
    //return 0;

    for ( int i=0 ; i<2 ; i++ )
    {
        for ( int j=0 ; j<v[i].size() ; j++ )
        {
            go(  );
            //p( v );
            if ( i==r && j==c ) { continue; }
            for ( int k=0 ; k<2 ; k++ )
            {
                for ( int z=0 ; z<13 ; z++ )
                {
                    if ( v[k][z]==s[0] ) { dfs( k , z , -1 , -1 ); break; }
                }
            }
        }
    }

    cout<<"Impossible";

    return 0;
}

#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<utility>
#include<set>
#include<queue>

const int maxn = 200000;
const int INF = 1e9;
using namespace std;
int main(){
	char x[100];
	char y[100];
	char matrix[10][100];
	int flag[100];
	int posl,posr;
	int pos=1;
	memset(flag,0,sizeof(flag));
	memset(matrix,0,sizeof(matrix));
	for (int i = 1;i <= 27;++i){
		cin >> x[i];
		if (flag[x[i]-'A']){
			posl = flag[x[i]-'A'];
			posr = i;
		}
		flag[x[i]-'A']= i;
	}
	if (posr-posl == 1){
		cout << "Impossible";
	}
	else{
		if (posl+posr <= 27){
			for (int i = posr;i <= 26;++i){
				x[i] = x[i+1];
			}
			int t = posl + (posr-posl)/2;
//			cout << t << endl;
			for (int i = 1;i <= t;++i){
				matrix[1][13-t+i]=x[i];
			}
			for (int i = 13;i >= 1;--i){
				matrix[2][i] = x[t+14-i];
			}
			for (int i = 1;i <= 13-t;++i){
				matrix[1][i] = x[i+13+t];
			}
		}
		else{
			for (int i = 1;i <= 27;++i){
				y[i] = x[28-i];
			}
			for (int i = 1;i <= 27;++i){
				x[i] = y[i];
			}
			posr = 28-posl;
			for (int i = posr;i <= 26;++i){
				x[i] = x[i+1];
			}
			int t = posl + (posr-posl)/2;
//			cout << t << endl;
			for (int i = 1;i <= t;++i){
				matrix[1][13-t+i]=x[i];
			}
			for (int i = 13;i >= 1;--i){
				matrix[2][i] = x[t+14-i];
			}
			for (int i = 1;i <= 13-t;++i){
				matrix[1][i] = x[i+13+t];
			}
		}
	}
	for (int i = 1;i <= 13;++i){
		cout << matrix[1][i];
	}
	cout << endl;
	for (int i = 1;i <= 13;++i){
		cout << matrix[2][i];
	}
	return 0;
}

#include <bits/stdc++.h>
#define f(a,b,c) for(int a=b;a<c;a++)

#define fr(a,b,c) for(int a=b;a>=c;a--)
using namespace std;

string rotateS(string s){
	string r="";
	f(i,0,26){
		r+=s[i+1];
	}
	r+=s[0];
	return r;
}
void elim (string s){
	bitset<26> mkd;
	mkd.reset();
	string r="",r2="";
	int cnt=0;
	f(i,0,27){
		if(mkd[s[i]-'A']==0){r+=s[i];cnt++;}
		if(cnt==13){swap(r,r2);cnt=0;}
		mkd[s[i]-'A']=1;
	}	reverse(r2.begin(),r2.end());
	cout<<r<<endl<<r2<<endl;
}
int main(){
	string s;
	cin>>s;bool k=0;
	int mkd[26];
	memset(mkd,-1,sizeof mkd);int r=26;
	f(i,0,26){
		if(s[i]==s[i+1])k=true;
		if(~mkd[s[i]-'A'])r=i;
		else mkd[s[i]-'A']=i;
	}
	if(k)puts("Impossible");
	else {
		int offset=r-mkd[s[r]-'A'];
		offset/=2;
		int R=mkd[s[r]-'A'],Rt=12-offset;
		R=(26+R-Rt)%26;
		while(R--)s=rotateS(s);
		elim(s);
	}
}

#include <iostream>
#include <cstring>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <string>
#include <map>
#include <stack>
#include <queue>
#include <vector>
#define inf 0x3f3f3f3f
#define met(a,b) memset(a,b,sizeof a)
typedef long long ll;
using namespace std;
const int N = 205;
const int M = 24005;
int  n=0,m,k,l;
string str,s,a="",b="",c="",d="";
int vis[N];
int main() {
    cin>>str;
    vector<int>p;
    for(int i=0; i<str.size(); i++) {
        vis[str[i]]++;
    }
    for(int i=0; i<str.size(); i++) {
        if(vis[str[i]]==2) {
            s[0]=str[i];
            p.push_back(i);
        }
    }
    if(p.size()>2||p[1]-p[0]==1) {
        puts("Impossible");
        exit(0);
    }
    bool Find=false;
    for(int i=0; i<str.size(); i++) {
        if(Find&&str[i]==s[0])break;
        if(!Find&&str[i]==s[0])Find=true;
        else if(Find)a+=str[i];
    }
    if(str[0]!=s[0]&&str[str.size()-1]!=s[0]) {
        for(int i=a.size()/2-1; i>=0; i--)b+=a[i];
        for(int i=a.size()/2; i<a.size(); i++)c+=a[i];
        //cout<<b<<" "<<c<<endl;
        for(k=p[0];k>=0&&b.size()<13;k--)b+=str[k];
        for(;k>=0;k--)c+=str[k];
        for(int i=str.size()-1;b.size()<13;i--)b+=str[i];
        for(int i=p[1]+1;c.size()<13;i++)c+=str[i];
        cout<<b<<endl<<c<<endl;
    } else if(str[0]==s[0]&&str[str.size()-1]!=s[0]){
        for(int i=a.size()/2-1; i>=0; i--)b+=a[i];
        for(int i=a.size()/2; i<a.size(); i++)c+=a[i];
        for(k=p[1];b.size()<13;k++)b+=str[k];
        for(int i=str.size()-1;c.size()<13;i--)c+=str[i];
        cout<<b<<endl<<c<<endl;
    } else if(str[0]!=s[0]&&str[str.size()-1]==s[0]){
        for(int i=a.size()/2-1; i>=0; i--)b+=a[i];
        for(int i=a.size()/2; i<a.size(); i++)c+=a[i];
        for(k=p[0];b.size()<13;k--)b+=str[k];
        for(int i=0;c.size()<13;i++)c+=str[i];
        cout<<b<<endl<<c<<endl;
    }else if(str[0]==s[0]&&str[str.size()-1]==s[0]){
        for(int i=0;i<13;i++)b+=str[i];
        for(int i=str.size()-2;c.size()<13;i--)c+=str[i];
        cout<<b<<endl<<c<<endl;
    }
        return 0;
}

/*  Made by
    Akylbek Aitkali */
#include <cstring>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <queue>
#include <cstdlib>
#include <ctime>
#include <cassert>

#define pii pair<int, ll>

#define pb push_back

#define mp make_pair

using namespace std;

typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;

const int N = 1e2 + 30;
const int TMXN = 1e5 * 8 + 1;
const ll INF = 1e9 + 7;
const ll INFL = 1e18;

string s;
int x;
int id[N];
char a[3][N], k;

int main() {
    cin >> s;
    for (int i = 1; i < 27; i++) {
        if (s[i] == s[i - 1]) {
            cout << "Impossible";
            return 0;
        }
        if (id[s[i]]) {
            x = i - id[s[i]] - 1;
            k = s[i];
        } else {
            id[s[i]] = i;
        }
    }
    a[1][13 - (x / 2)] = k;
    int cur = 0;
    for (int i = 13 - (x / 2) + 1; i <= 13; i++) {
        cur++;
        a[1][i] = s[id[k] + cur];
    }
    for (int i = 13; i >= 13 - ((x + 1) / 2) + 1; i--) {
        cur++;
        a[2][i] = s[id[k] + cur];
    }
    cur++;
    for (int i = 13 - ((x + 1) / 2); i >= 1; i--) {
        cur++;
        if (id[k] + cur < 27) {
            a[2][i] = s[id[k] + cur];
        }
    }
    cur = 0;
    for (int i = 13 - (x / 2) - 1; i >= 1; i--) {
        cur++;
        a[1][i] = s[id[k] - cur];
    }
    for (int i = 1; i <= 2; i++) {
        for (int j = 1; j <= 13; j++) {
            cout << a[i][j];
        }
        cout << '\n';
    }
    return 0;
}

#include <bits/stdc++.h>
#define FI first
#define SE second
using namespace std;
using LL = long long;
using PII = pair<int, int>;

int vis[26];
char ans[2][13];

int main() {
	int n = 27;
	string s; cin>>s;
	char piv;
	for (auto c: s) {
		if (vis[c-'A']) { piv=c; break; }
		vis[c-'A'] = 1;
	}
	int x=-1, y;
	for (int i=0;i<27;i++) {
		if (s[i]==piv) {
			if (x==-1) x = i;
			else y = i;
		}
	}
	rotate(s.begin(), s.begin()+x, s.end());
	y -= x, x = 0;
	if (y==1 || y==26) return !printf("Impossible\n");
	int right = y>>1, pos = 12 - right;
	ans[0][pos] = piv;
	int u = 1;
	for (int i=pos+1;i<13;i++) ans[0][i] = s[u++];
	for (int i=12;i>=0 && u<y;i--) ans[1][i] = s[u++];
	u++;
	for (int i=pos-1;i>=0;i--) ans[0][i] = s[u++];
	for (int i=0;i<13 && u<n;i++) ans[1][i] = s[u++];

	for (int i=0;i<13;i++) printf("%c", ans[0][i]);
	puts("");
	for (int i=0;i<13;i++) printf("%c", ans[1][i]);
	puts("");
}

#include <cstdio>
int hash[28], pos1, pos2;
char str[28], ans[2][28];
void fill(int n, int m, int now, int dir)
{
	if (now == pos2)
		fill(n, m, now + 1, dir);
	else
	{
		ans[n][m] = str[now];
		if (dir == 1)
		{
			if (m == 12)
			{
				dir = -1;
				n = 1 - n;
			}
			else
				m++;
		}
		else
		{
			if (m == 0)
			{
				dir = 1;
				n = 1 - n;
			}
			else
				m--;
		}
		now++;
		now %= 27;
		if (now == pos1)
			return;
		//	printf("%d %d\n", n, m);
		fill(n, m, now, dir);
	}
}
int main()
{
	gets(str);
	for (int i = 0; i < 27; i++)
		hash[str[i] - 'A']++;
	for (int i = 0; i < 27; i++)
		if (hash[str[i] - 'A'] == 2)
		{
			pos1 = i;
			break;
		}
	for (int i = 26; i >= 0; i--)
		if (hash[str[i] - 'A'] == 2)
		{
			pos2 = i;
			break;
		}
	if (pos2 - pos1 == 1)
	{
		printf("Impossible\n");
		return 0;
	}
	fill(0, (pos2 - pos1) / 2, pos1, -1);
	puts(ans[0]);
	puts(ans[1]);
	return 0;
}

#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<map>
#define ll long long
#define For(i,a,b) for (int i=a;i<=b;i++)
#define Rep(i,a,b) for (int i=b;i>=a;i--)
using namespace std;

inline int read(){
	int x=0,f=1;char ch=getchar();
	while (ch<'0'||ch>'9'){ if (ch=='-') f=-1;ch=getchar(); }
	while (ch>='0'&&ch<='9'){ x=x*10+ch-'0';ch=getchar(); }
	return x*f;
}

int n,m,a[107],f[2][107],now;
char s[107];
void check(int &x){ x++;if (x==now) x++;if (x>n) x=1; }

int main(){
	scanf("%s",s);
	n=strlen(s);
	For(i,1,n) a[i]=s[i-1]-'A'+1;
	m=13;
	For(i,1,n) For(j,i+2,n){
		if (a[i]==a[j]){
			int lastx=m-(j-i-1)/2,k=i;now=j;
			f[1][lastx]=a[k];
			For(x,lastx+1,m) check(k),f[1][x]=a[k];
			Rep(x,1,m) check(k),f[2][x]=a[k];
			For(x,1,lastx-1) check(k),f[1][x]=a[k];
			For(i,1,2){ For(j,1,m) printf("%c",f[i][j]+'A'-1);if (i==1) printf("\n"); }
			return 0;
		}
	}
	printf("Impossible\n");
}

#include <bits/stdc++.h>

/*
ABCDEFGHIJKLMNOPQRSGTUVWXYZ
ABCDEFGHIJKLMNOPQRSTGUVWXYZ
*/

using namespace std;
typedef long long ll;

int ind[30];
char a[2][26];
int main()
{

    string str; cin >> str;
    int fx, sx;

    for (int i = 0; i < str.size(); ++ i)
        if (ind[str[i] - 'A'])
            fx = ind[str[i] - 'A'],
            sx = i;
        else
            ind[str[i] - 'A'] = i;

    char s = str[sx];

    if ((fx - sx == 1) || (fx - sx == -1))
    {
        cout << "Impossible";
        return 0;
    }
    int j = (abs(sx - fx) + 1) / 2 - 1;

    for (int i = 0; i <= j; ++ i)
        a[0][j - i] = str[fx + i];
    for (int i = 0; i < j; ++ i)
        a[1][i] = str[fx + j + i + 1];
    if ((sx - fx) % 2 == 0)
    {
        a[1][j] = str[2 * j + fx + 1];
    }
    int start;

    if ((sx - fx) % 2)
        start = j;
    else
        start = j + 1;

    //cout << start << endl;
    for (; start < 13; ++ start)
        if ((fx - sx) % 2)
            a[1][start] = str[(sx + start - j + 1) % 27];
        else
            a[1][start] = str[(sx + start - j) % 27];

    for (start = 12; start > j; -- start)
    {
        if ((fx - sx) % 2)
            a[0][start] = str[(sx + 12 - j + 12 - start + 2) % 27];
        else
            a[0][start] = str[(sx + 12 - j + 12 - start + 1) % 27];
    }

    for (int i = 0; i < 2; ++ i)
    {
        for (int j = 0; j < 26; ++ j)
            cout << a[i][j];
        cout << endl;
    }

}

#pragma GCC optimize ("Ofast")
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <algorithm>
#include <math.h>
#include <map>
#include <queue>
#include <set>

using namespace std;

int32_t main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    string s;
    cin>>s;
    vector <vector <char> > a(2,vector <char> (14));
    vector <int> used(26);
    for (int i = 0;i < 13;i++)
        {
            if (used[s[i]-'A']) {
                cout<<"Impossible";
                return 0;
            }
            ++used[s[i]-'A'];
            a[0][i] = s[i];
        }
        int p1 = 12;
    for (int i = 13;i < 27;i++)
    {
        if (used[s[i]-'A']) {
            if (a[0][p1-1]!=s[i] && a[0][p1]!=s[i] && a[0][p1+1]!=s[i]) {
                cout<<"Impossible";
                return 0;
            }
        }
        else {
        ++used[s[i]-'A'];
        a[1][p1] = s[i];
        --p1;
    }
    }
    for (int i = 0;i < 2;i++)
    {
        for (int j = 0;j < 13;j++)
        {
            cout<<a[i][j];
        }
        cout<<'\n';
    }
}

#include <bits/stdc++.h>

#define endl "\n"
#define ll long long
#define ld long double
#define ull unsigned long long
#define vi vector<int>
#define pb push_back
using namespace std;

string s, sstring;
int pos1Double, pos2Double;
char d1, d2;

void findDouble(){
	int ALPH[26];
	bool ok = true;
	for (int i = 0; i < 26; i++)
		ALPH[i] = -1;
	for (int i = 0; i < 27 && ok; i++){
		if (ALPH[s[i] - 'A'] == -1)
			ALPH[s[i] - 'A'] = i;
		else{
			pos1Double = ALPH[s[i] - 'A'];
			pos2Double = i;
			ok = false;
		}
	}
}

void generateSString(){
	sstring = s;
	d1 = s[pos1Double];
	sstring.erase(pos2Double, 1);
	if (pos2Double == 26)
		pos2Double = 25;
	d2 = sstring[pos2Double];
//	cout << "d1 = " << d1 << " d2 = " << d2 << endl;

}

void rotate(){
	if (abs(sstring.find(d1) - (25 - sstring.find(d2))) < 2)
		return;
	else{
		cout << sstring.find(d1) << ' ' << (25 - sstring.find(d2)) << ' ' << sstring << endl;
		char t1;
		t1 = sstring[25];
		for (int i = 25; i > 0; i--){
			sstring[i] = sstring[i - 1];
		}
		sstring[0] = t1;
		rotate();
	}
}

int main () {
	cin >> s;
	findDouble();
	if (pos1Double == pos2Double - 1){
		cout << "Impossible";
		return 0;
	}
	generateSString();
	rotate();
	for (int i = 0; i < 13; i++)
		cout << sstring[i];
	cout << endl;
	for (int i = 25; i > 12; i--)
		cout << sstring[i];
	return 0;
}

#include <bits/stdc++.h>
using namespace std;

string s;
char res[3][15];
map<char,int> letters;
int between, firstOcc , secondOcc , ix ,iy ;
pair<int,int> indexCarry;

pair<int,int> getNextIndex(int i , int j){
    if(i == 2){
        j--;
        if(j == 0){
            i = 1;
            j = 1;
        }
    }else{
        j++;
    }
    return {i,j};
}
int main()
{

  //  freopen("omar.in","r",stdin);
    cin>>s;
    for(int i = 1 ; i < 27 ; ++i){
        if(s[i] == s[i-1]){
            cout<<"Impossible"<<endl;
            exit(0);
        }
    }
    for(int i = 0 ; i < (int)s.size() ; ++i){
        if(letters.find(s[i]) == letters.end()){
            letters[s[i]] = i;
        }else{
            firstOcc = letters[s[i]];
            secondOcc = i;
            between = secondOcc - firstOcc - 1;
            break;
        }
    }
    int ptr = between/2;
    int last = 13;
    while(ptr){
        res[2][last] = s[ptr + firstOcc];
        last--;
        ptr--;
    }
    res[2][last] = s[firstOcc];
    ix = 2;
    iy = last-1;
    ptr = firstOcc + (between/2) + 1;
    last = 13;
    while(ptr < secondOcc){
        res[1][last] = s[ptr];
        last--;
        ptr++;
    }
    ptr = firstOcc - 1;
    while(ptr >= 0){
        res[ix][iy] = s[ptr];
        indexCarry = getNextIndex(ix,iy);
        ix = indexCarry.first;
        iy = indexCarry.second;
        ptr--;
    }
    ptr = s.size()-1;
    while(ptr >secondOcc){
        res[ix][iy] = s[ptr];
        indexCarry = getNextIndex(ix,iy);
        ix = indexCarry.first;
        iy = indexCarry.second;
        ptr--;
    }
    for(int i = 1 ; i <= 2 ; ++i){
        for(int j = 1 ; j <= 13 ; ++j){
            cout<<res[i][j];
        }
        cout<<endl;
    }
    return 0;
}

#include <bits/stdc++.h>
#define inf 4611686018427387904
using namespace std;

string s;
vector <char> ans[2];
int apr[26];
int range = 0, pos;

void solve1()
{
  int first = pos + range - 13 + 1;
  for (int i = first; i < first + 13; ++i)
    ans[0].push_back(s[i]);
  for (int i = 0; i < first; ++i)
    ans[1].push_back(s[first - i - 1]);
  for (int i = 26; first <= 13; --i, ++first)
    if (s[i] != s[pos]) ans[1].push_back(s[i]);
}

void solve2()
{
  int first = pos + range - 13 + 1;
  for (int i = 26; i > 26 + first; --i)
    ans[0].push_back(s[i]);
  for (int i = 0; i < 13; ++i)
    ans[0].push_back(s[i]);
  for (int i = 26 + first; ans[1].size() < 13; --i)
    if (s[i] != s[pos]) ans[1].push_back(s[i]);
}

int main()
{
  #ifndef ONLINE_JUDGE
  freopen("inp.txt", "r", stdin);
  #endif // ONLINE_JUDGE
  cin >> s;
  for (int i = 0; i < s.size(); ++i)
  {
    if (apr[s[i] - 'A'])
    {
      range = i - apr[s[i] - 'A'];
      pos = apr[s[i] - 'A'];
      break;
    }
    apr[s[i] - 'A'] = i;
  }
  if (range < 2)
  {
    cout << "Impossible";
    return 0;
  }
  range = (range - 1)/2;
  if (pos + range >= 12) solve1();
  else solve2();
  for (int i = 0; i < 2; ++i, cout << endl)
    for (int j = 0; j < 13; ++j)
      cout << ans[i][j];
}

#define _CRT_SECURE_NO_WARNINGS
#include <cstdio>
#include <vector>
#include <algorithm>
#include <iostream>
#include<string>
#include <sstream>
#include<map>
using namespace std;
int main()
{
	map<char, int> m; int pos1, pos2, pos3, p2, p1; char c;
	string s; cin >> s;
	for (int i = 0; i < 27; i++)
	{
		if (m.find(s[i]) != m.end())
			pos1 = m[s[i]], pos2 = i, c = s[i];
		m[s[i]] = i;
	}
	if (pos2 - pos1 < 3)
		return puts("Impossible"), 0;
	vector<vector<char>> ans(2, vector<char>(13));
	pos3 = 12 - (pos2 - pos1) / 2;
	ans[0][pos3] = c;
	p2 = pos3 + 1; p1 = pos3 - 1;
	int cnt = pos2 - pos1 -1, x = 0, t2 = pos1 + 1, ch = 1, t1 = pos1-1;
	while (cnt)
	{
		cnt--;
		ans[x][p2] = s[t2];
		++t2;
		p2 += ch;
		if (p2 == 13)
			ch = -1, x=1, p2=12;
	}
	cnt = pos1;
	while (cnt)
	{
		--cnt;
		ans[x][p2] = s[t1];
		--t1;
		p2 += ch;
		if (p2 == -1)
			ch = 1, x = 0, p2 = 0;
	}
	cnt = s.size() - 1 - pos2; x = 0; p2 = pos3 - 1; t2 = pos2 + 1; ch = -1;
	while (cnt)
	{
		--cnt;
		ans[x][p2] = s[t2];
		++t2;
		p2 += ch;
		if (p2 == -1)
			ch = 1, x = 1, p2 = 0;
	}
	for (int i = 0; i < 2; i++)
	{
		for (int j = 0; j < 13; j++)
			cout << ans[i][j];
		cout << endl;
	}
}

// Don't use ceiling, return wrong ans
/*
Author : deepak2015
Plagiarism is bad.
*/
#include <bits/stdc++.h>
using namespace std;

#define MOD 1000000007
#define epsilon 0.000000000001
#define PI 3.1415926535897932
#define I_MAX 9223372036854775807
#define I_MIN -9223372036854775807
#define ll long long
#define endl "\n"

#define mset(arr,x) memset(arr,x,sizeof(arr))
#define rep(i,s,e) for(i=s;i<=e;i++)
#define rrep(i,s,e) for(i=s;i>=e;i--)
#define min(a,b) ((a)<(b)?(a):(b))
#define max(a,b) ((a)>(b)?(a):(b))

// Useful STL commands:
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define all(c) c.begin(),c.end()
#define tr(c,it) for(auto it=c.begin();it!=c.end();++it)
#define trrev(c,it) for(auto it=c.rbegin();it!=c.rend();++it)

#define DEBUG
#ifdef DEBUG
#define trace1(x)                    cerr << #x << ": " << x << endl;
#define trace2(x, y)                 cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
#define trace3(x, y, z)              cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
#define trace4(a, b, c, d)           cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
#else
#define trace1(x)
#define trace2(x, y)
#define trace3(x, y, z)
#define trace4(a, b, c, d)
#endif

// scanf and printf
#define si(a)			scanf("%d", &a)
#define sl(a)			scanf("%lld", &a)
#define pi(a)			printf("%d", a)
#define pl(a)			printf("%lld", a)
#define pn 				printf("\n")

ll gcd(ll a, ll b)
{
    if( (a == 0) || (b == 0) )
        return a + b;
    return gcd(b, a % b);
}
ll pow_mod(ll a, ll b)
{
    ll res = 1;
    while(b)
    {
        if(b & 1)
            res = (res * a);
        a = (a * a);
        b >>= 1;
    }
    return res;
}
bool isPrime(ll a)
{
    for(int i=3; (i*i)<=a; i+=2)
    {
        if( (a%i)==0 )
            return false;
    }
    if( ( a!=2 ) && ( (a%2)==0 ) )
        return false;
    return true;
}
string con_ll_to_str( int a )
{
    stringstream mystr;
    mystr << a;
    return mystr.str();
}
ll con_str_to_ll( string st )
{
    ll numb = 0;
    int len = st.size(), i, j = 0;
    rrep(i, len-1, 0)
    {
       numb += ( pow_mod(10, j) * ( st[i] - '0' ) );
       j++;
    }
    return numb;
}
// map : log2(N) find, count, etc
/*
struct comp
{
    inline bool operator()(const pair<pair<ll, int>, bool>& pa1, const pair<pair<ll, int>, bool>& pa2) const
    {
        if (pa1.f.f == pa2.f.f)
            return pa1.f.s < pa2.f.s;
        return pa1.f.f < pa2.f.f;
    }
};
*/
// bitset<99999000000000>& c = *(new bitset<99999000000000>());   // For O(1) lookup the max bitset space required.
// Don't use map in qsort comp, instead store value in vector in form of pair. It is because it takes n*log(n)*log(n) time that increases the complexity.
// cout << fixed << setprecision(12) << ans;  // For 12 decimal places after the number.
// vector iterators can only be compared.

vector< int > vc[30];
char dp[3][30];
int main()
{
    #ifndef  ONLINE_JUDGE
      freopen("input.txt","r",stdin);
    #endif

    ios_base::sync_with_stdio(false);
    cin.tie(0);

    ll N, ans, i, j, kk, ind;
    string st, st2;

    cin >> st;
    rep(i, 0, (int)st.length()-2)
    {
        if( st[i]==st[i+1] )
        {
            cout << "Impossible";
            return 0;
        }
        vc[ st[i]-'A' ].pb( i );
    }
    rep(i, 0, 25)
    {
        if( vc[i].size()==2 )
        {
            ind = i;
            break;
        }
    }
    ll opop = ( vc[ st[ind]-'A' ][1] - vc[ st[ind]-'A' ][0] + 1 ) / 2;
    j = vc[ st[ind]-'A' ][1];
    rrep(i, opop, 1)
    {
        dp[1][i] = st[j--];
    }
    i = 1;
    while(j>vc[ st[ind]-'A' ][0])
    {
        dp[2][i++] = st[j--];
    }
    j = vc[ st[ind]-'A' ][1] + 1;
    rep(kk, j, 26)
    {
        st2.pb( st[kk] );
    }
    rep(kk, 0, vc[ st[ind]-'A' ][0] - 1)
    {
        st2.pb( st[kk] );
    }
    kk = 0;
    while(i<=13)
    {
        dp[2][i++] = st2[kk++];
    }
    i = 13;
    while( i>opop )
    {
        dp[1][i--] = st2[kk++];
    }

    rep(i, 1, 2)
    {
        rep(j, 1, 13)
          cout << dp[i][j];
        cout << endl;
    }

    return 0;
}

#include <bits/stdc++.h>
#define base 1000000007LL
#define ll long long
#define X first
#define Y second
#define mp make_pair
#define pb push_back
#define CLR(a) memset(a,0,sizeof(a))
#define FOR(i,a,b) for(int i=(a),_b=(b); i<=_b; i++)
#define FORE(i,a,b) for(int i=(a),_b=(b); i>=_b; i--)

using namespace std;

typedef pair<int, int> II;
typedef vector<II> vi;

string res[2], s;
int f[30];

int main()
{
    ios::sync_with_stdio(0);
    //freopen("inp.txt", "r", stdin);
    cin >> s;
    FOR(i,0,26) f[s[i]-'A']++;
    char ch;
    FOR(i,0,25)
        if (f[i] > 1) {
            ch = i+'A';
            break;
        }
    int dau = -1;
    int cuoi = -1;
    FOR(i,0,26)
        if (s[i] == ch) {
            if (dau == -1) dau = i;
            else cuoi = i;
        }
    cout << dau << " " << cuoi << endl;
    if (dau == 0 && cuoi == 26) {
        cout << "Impossible";
        return 0;
    }
    if (dau+1 == cuoi) {
        cout << "Impossible";
        return 0;
    }
    res[0].resize(13);
    res[1].resize(13);
    int k = cuoi-dau;
    if (k > 2) k--;
    k/=2;
    int v = 1;
    int nowu = 0;
    int nowv = 12-k;
    res[0][12-k] = ch;
    int now = 1;
    int h = dau;
    while (now <= 25) {
        if (nowu == 0 && nowv == 12) {
            nowu = 1;
            v = -1;
        }
        else if (nowu == 1 && nowv == 0) {
            nowu = 0;
            v = 1;
        }
        else {
            nowv += v;
        }
        h = (h + 1) % 27;
        if (s[h] == ch) h = (h+1) % 27;
        res[nowu][nowv] = s[h];
        cout << res[0] << endl << res[1] << endl << endl;
        now++;
    }
    cout << res[0] << endl << res[1];
    return 0;
}

#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <random>
#include <iomanip>

using namespace std;

//defines
typedef long long ll;
typedef long double ld;
#define TIME clock() * 1.0 / CLOCKS_PER_SEC

//permanent constants
const ld pi = acos(-1.0);
const int day[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
const int digarr[10] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
const int dx[4] = {-1, 0, 1, 0};
const int dy[4] = {0, 1, 0, -1};
const int dxo[8] = {-1, -1, -1, 0, 1, 1, 1, 0};
const int dyo[8] = {-1, 0, 1, 1, 1, 0, -1, -1};
const int alf = 26;
const int dig = 10;
const int two = 2;
const int th = 3;
const ll prost = 239;
const ll bt = 31;
const ld eps = 1e-8;
const ll INF = (ll)(1e18 + 239);
const int BIG = (int)(1e9 + 239);
const int MOD = 998244353; //1e9 + 7;
const ll MOD2 = (ll)MOD * (ll)MOD;

//random
mt19937_64 rnd(239); //(chrono::high_resolution_clock::now().time_since_epoch().count());

//constants
const int M = (int)(2e5 + 239);
const int N = (int)(2e3 + 239);
const int L = 20;
const int T = (1 << 19);
const int B = (int)(trunc(sqrt(M)) + 1);
const int X = 1e4 + 239;

int main()
{
#ifdef ONPC
    freopen("input.txt", "r", stdin);
#endif
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    int n = 27;
    string s;
    cin >> s;
    for (int i = 0; i < n; i++)
        for (int j = i + 1; j < n; j++)
            if (s[i] == s[j])
            {
                if (j == i + 1)
                {
                    cout << "Impossible";
                    return 0;
                }
                if (j == n - 1 && i == 0)
                {
                    cout << "Impossible";
                    return 0;
                }
                string s1 = "";
                for (int x = i + 1; x < j; x++)
                    s1 += s[x];
                string s2 = "";
                for (int x = j + 1; x != i; x = (x + 1) % n)
                    s2 += s[x];
                vector<string> ans(2);
                for (int d = 0; d < 2; d++)
                    for (int x = 0; x < 13; x++)
                        ans[d] += " ";
                int num = (int)s1.size() + 1;
                int p = (num + 1) / 2;
                p--;
                ans[0][p] = s[i];
                int l = p;
                for (int x = p - 1; x >= 0; x--)
                    ans[0][x] = s1[p - 1 - x];
                for (int x = 0; x < (int)s1.size() - p; x++)
                    ans[1][x] = s1[p + x];
                p = (int)s1.size() - p;
                for (int x = p; x < 13; x++)
                    ans[1][x] = s2[x - p];
                for (int x = 12; x > l; x--)
                    ans[0][x] = s2[(int)s2.size() + l - x];
                cout << ans[0] << "\n" << ans[1] << "\n";
                return 0;
            }
    return 0;
}

#include<cstdio>
#include<iostream>
#include<cstring>
#include<vector>
#include<stack>
#include<cmath>
#include<algorithm>
#include<map>
#include<cstdlib>
int read(){
	char ch=getchar(); int f=1,x=0;
	while(ch<'0'||ch>'9'){
		if(ch=='-') f=-1;
		ch=getchar();
	}
	while(ch>='0'&&ch<='9'){
		x=x*10+ch-'0';
		ch=getchar();
	}
	return f*x;
}
bool b[50];
char s[50],a;
char ans1[50],ans2[50];
int pos2,pos1;
int main(){
	memset(b,false,sizeof(b));
    scanf("%s",s+1);
    for(int i=1;i<=27;i++){
		if(!b[s[i]-'A']) b[s[i]-'A']=true;
		else{
			a=s[i];
			pos2=i;
			break;
		}
    }
    for(int i=1;i<=27;i++){
		if(s[i]==a){
			pos1=i;
			break;
		}
    }
    if(pos2==pos1+1){
		printf("Impossible");
		return 0;
    }
    int jl=(pos2-pos1)/2,Now=pos1-1;
    if((pos2-pos1)%2==1) jl++;
    int Now2=0;
    for(int i=14-jl;i<=13;i++){
		ans1[i]=s[++Now];
    }
    for(int i=13;i>=14-jl;i--){
		ans2[i]=s[++Now];
    }
    for(int i=14-jl;i>=1;i--){
		ans2[i]=s[++Now];
		if(Now==27){
			for(int j=i-1;j>=1;j--){
				ans2[j]=s[++Now2];
			}
		}
    }
    if(Now<27){
		for(int i=1;i<14-jl;i++){
			ans1[i]=s[++Now];
			if(Now==27){
				for(int j=i;j<14-jl;j++){
					ans1[j]=s[++Now2];
				}
				break;
			}
		}
    }
    else{
		for(int i=1;i<pos1;i++){
		    ans1[i]=s[++Now2];
    }
    }
    for(int i=1;i<=13;i++){
		printf("%c",ans1[i]);
    }
    printf("\n");
    for(int i=1;i<=13;i++){
		printf("%c",ans2[i]);
    }
    return 0;
}

#pragma GCC optimize ("Ofast")
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <algorithm>
#include <math.h>
#include <map>
#include <queue>
#include <set>

using namespace std;

int32_t main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    string s;
    cin>>s;
    for (int i1 = 0;i1 < 2;i1++) {
        for (int j1 = 0;j1 < 13;j1++) {
    vector <vector <char> > a(2,vector <char> (14));
    vector <int> used(26);
    int smesh1 = i1;
    int smesh2 = j1;
    int kol = 0;
    int prev_smesh1 = -1;
    int prev_smesh2 = -1;
    for (int i = 0;i < 13;i++)
        {
            if (used[s[i]-'A']) {
                if (a[!smesh1][smesh2]!=s[i] && a[!prev_smesh1][prev_smesh2]!=s[i]) ++kol;
                continue;
            }
            ++used[s[i]-'A'];
            a[smesh1][smesh2] = s[i];
            prev_smesh1 = smesh1;
            prev_smesh2 = smesh2;
            smesh2+=(i1!=smesh1 ? -1 : 1);
            if (smesh2==13) {
                smesh1 = (!smesh1);
                smesh2 = 12;
        }
        else if (smesh2 < 0) {
            smesh1 = (!smesh1);
            smesh2 = 0;
        }
        }
        int p1 = 12;
    for (int i = 13;i < 27;i++)
    {
        if (used[s[i]-'A']) {
                if (a[!smesh1][smesh2]!=s[i] && a[!prev_smesh1][prev_smesh2]!=s[i]) ++kol;
                continue;
            }
            ++used[s[i]-'A'];
            a[smesh1][smesh2] = s[i];
            prev_smesh1 = smesh1;
            prev_smesh2 = smesh2;
            smesh2+=(i1!=smesh1 ? -1 : 1);
            if (smesh2==13) {
                smesh1 = (!smesh1);
                smesh2 = 12;
        }
        else if (smesh2 < 0) {
            smesh1 = (!smesh1);
            smesh2 = 0;
        }
        }
     //   cout<<kol<<'\n';
    if (kol==0) {
    for (int i = 0;i < 2;i++)
    {
        for (int j = 0;j < 13;j++)
        {
            cout<<a[i][j];
        }
        cout<<'\n';
    }
    return 0;
}
}
}
cout<<"Impossible";
}

#include<stdio.h>
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define MAX 1000001
#define ll long long
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vi vector<int>
#define vii vector<pii>
#define vll vector<pll>
const int mod=1e9+7;
char a[MAX];
int bb[MAX];
char b[2][MAX];
int main()
{
	scanf("%s",a+1);
	int i,j;
	for(i=1;a[i];i++)
			if(bb[a[i]-'A'])
				break;
			else
				bb[a[i]-'A']=i;
	int anss=a[i]-'A';
	if(i!=bb[anss]+1)
	{
		int id=i;
		int tem=(id-bb[anss])/2;
		i=bb[anss];
		for(j=13-tem;j<=13;j++)
			b[0][j]=a[i++];
		j=13;
		while(i<=27&&j>=1)
			if(a[i]-'A'!=anss)
				b[1][j--]=a[i++];
			else
				i++;
		j=1;
		while(i<=27)
			if(a[i]-'A'!=anss)
				b[0][j++]=a[i++];
			else
				i++;
		i=bb[anss]-1;
		for(j=13-tem-1;j>=1&&i>=1;j--)
			b[0][j]=a[i--];
		for(j=1;i>=1;j++)
			b[1][j]=a[i--];
		b[0][28]='\0';
		b[1][28]='\0';
		printf("%s\n%s\n",b[0]+1,b[1]+1);
	}
	else
	{
		printf("Impossible\n");
	}
}

#include<bits/stdc++.h>
using namespace std;                                                            //        ███        ▄▄▄▄███▄▄▄▄
                                                                                //    ▀█████████▄  ▄██▀▀▀███▀▀▀██▄
#define pb push_back                                                            //       ▀███▀▀██  ███   ███   ███
#define mp make_pair                                                            //        ███   ▀  ███   ███   ███                                                                              //        ███      ███   ███   ███
#define sqr(a) ((a) * (a))                                                      //        ███      ███   ███   ███
#define io() ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);   //        ███      ███   ███   ███
#define co() cout.precision(10);                                                //       ▄████▀     ▀█   ███   █▀
#define F for(li i=0;i<n;i++)
#define fo(i,n) for(i=0;i<n;i++)
#define ne cout<<"\n";
#define test int t;cin>>t;while(t--)

typedef long long li;
typedef long double ld;

const li mod = 1000000007;

li mul(li a,li b) {
    return (1LL * a * b) % mod;
}

li add(li a,li b) {
    li s = (a+b);
    if (s>=mod) s-=mod;
    return s;
}

li sub(li a,li b) {
    li s = (a+mod-b);
    if (s>=mod) s-=mod;
    return s;
}

li po(li a,li deg)
{
    if (deg==0) return 1;
    if (deg%2==1) return mul(a, po(a, deg-1));
    li t = po(a, deg/2);
    return mul(t, t);
}

li inv(li n)
{
    return po(n,mod-2);
}

bool isPrime(li n)
{
    if (n <= 1)  return false;
    if (n <= 3)  return true;
    if (n%2 == 0 || n%3 == 0) return false;
    for (li i=5; i*i<=n; i=i+6)
        if(n%i == 0 || n%(i+2) == 0)
           return false;

    return true;
}

int main()
{
    io();co();
    string s;
    cin>>s;
    li i;
    fo(i,s.length()-1)
    {
        if(s[i]==s[i+1])
        {
            cout<<"Impossible\n";
            return 0;
        }
    }
    li a[26]={0},b=0,c=0,d=0;
    i=0;
    fo(i,s.length())
    {
        a[s[i]-65]++;
        if(a[s[i]-65]==2)
        d=s[i];
    }
    i=0;
    fo(i,s.length())
    {
        if(s[i]==d && b==0)
        b=i;
        else if(s[i]==d)
        c=i;
    }
    //cout<<b<<" "<<c;ne;
    li ans=c-b-1;
    string str="",st="",ss="";
    str=str+s[b];
    ans=ans/2;
    for(i=1;i<=ans;i++)
    str+=s[b+i];
    for(i=ans+1;i<=ans*2;i++)
    st=s[b+i]+st;
    for(i=c+1;i<s[i];i++)
    ss=ss+s[i];
    for(i=0;i<b;i++)
    ss=ss+s[i];
    //cout<<st<<" "<<str<<" "<<ss<<" ";
    string sa="",sb="";
    sa=ss.substr(0,12-ans);
    sb=ss.substr(12-ans,ss.length()-(12-ans));
    reverse(sa.begin(),sa.end());
    //reverse(sb.begin(),sb.end());
    str=sa+str;
    st=sb+st;
    cout<<str<<"\n";
    cout<<st;
}

#include<stdio.h>
#include<iostream>
#include<string.h>
using namespace std;
char a[1500];
char ans[2][30];
int vis[30];
int tmp;
int Slove(int r,int c)
{
    memset(ans,' ',sizeof(ans));
    int x=r,y=c;
    int flag=0;
    int i=0;
    while(1)
    {
        if(i>=27)return 1;
        if(a[i]-'A'==tmp&&flag==1)
        {
            flag++;
            if(x==1)
            {
                if(ans[x-1][y]-'A'==tmp||ans[x-1][y+1]-'A'==tmp)
                {
                    i++;
                    continue;
                }
                else return 0;
            }
            else return 0;
        }
        if(a[i]-'A'==tmp&&flag==0)flag++;
        ans[x][y]=a[i];
        i++;
        if(x==0)
        {
            y++;
            if(y==13)y=12,x++;
        }
        else
        {
            y--;
            if(y<0)y=0,x--;
        }
    }
}
int main()
{
    while(~scanf("%s",a))
    {
        memset(vis,0,sizeof(vis));
        int n=strlen(a);
        for(int i=0;i<n;i++)
        {
            vis[a[i]-'A']++;
        }
        for(int i=0;i<26;i++)
        {
            if(vis[i]==2)tmp=i;
        }
        int flag=0;
        int flag2=0;
        for(int i=0;i<n-1;i++)
        {
            if(a[i]==a[i+1])
            {
                flag2=1;
                printf("Impossible\n");
                break;
            }
        }
        if(flag2==1)continue;
        for(int c=0;c<13;c++)
        {
            int tt=Slove(0,c);
            if(tt==1)
            {
                flag=1;
                for(int i=0;i<2;i++)
                {
                    for(int j=0;j<13;j++)
                    {
                        printf("%c",ans[i][j]);
                    }
                    printf("\n");
                }
            }
        }
        if(flag==0)
        {
            printf("Impossible\n");
        }
    }
}

/*
 * source.cpp
 *
 *  Created on: Aug 4, 2016
 *      Author: joseph darani
 */

#include<iostream>
#include<string.h>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<cmath>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<unordered_map>
#include<unordered_set>
#include<bitset>
#include <numeric>
using namespace std;

#define iOS ios_base::sync_with_stdio(false)
#define P(x) cout<<#x<<" = { "<<x<<" }\n"
#define All(a) (a).begin(), (a).end()
#define _2d(a,row,col,type) type**a=new type*[row]; for (int i=0;i<row;i++) a[i]=new type[col];
#define lp(i,n) for(int i=0;i<int(n);i++)
#define rep(i, j, n) for (int i=j, i<n; i++)
#define lpr(i,n) for(int i=n-1;i>=0;i--)
#define loopi(i,a,n) for(int i=int(a);i<int(n);i++)
#define clr(a, n) memset(a, n, sizeof(a));
#define scn(a,n) rep(i,n) cin>>a[i];
#define scn2(a,row,col) rep(i,row) rep(j,col) cin>>a[i][j];
#define prn(a,n) rep(i,n-1) cout<<a[i]<<" "; cout<<a[n-1]<<endl;
#define prn2(a,row,col) rep(i,row){rep(j,col-1) cout<<a[i][j]<<" "; cout<<a[i][col-1]<<endl;}
#define rdi(x) scanf("%d",&(x))
#define rdk(x,y) scanf("%d%d",&(x),&(y))
#define rdl(x) scanf("%I64d",&(x))
#define rdll(x,y) scanf("%I64d%I64d",&(x),&(y))
#define mp(a, b) make_pair(a, b)
#define pb(a) push_back(a)
#define Odd(x) x%2!=0
#define Even(x) x%2==0
#define Pi 3.1415926535897932384626433832795
#define INF 2000000000 // 2 billion
#define OO 0x7fffffff
#define maxL (10000000>>5)+1
#define GET(x) (mark[x>>5]>>(x&31)&1)
#define SET(x) (mark[x>>5] |= 1<<(x&31))
#define mod 1000000007
typedef long long ll;
typedef unsigned long ul;
typedef unsigned long long ull;
typedef long double ld;
typedef vector<int> vi;
typedef vector<long> vl;
typedef vector<ll> vll;
typedef vector<double> vd;
typedef vector<string> vs;
typedef pair<int, int> ii;
typedef pair<int, string> is;
typedef vector<ii> vii;

//int dx[] = {1,-1,0,0} , dy[] = {0,0,1,-1}; // 4 Direction
//int dx[] = {1,-1,0,0,1,1,-1,-1} , dy[] = {0,0,1,-1,1,-1,1,-1};  // 8 Direction
// int dx[] = {1,-1,1,-1,2,2,-2,-2} , dy[] = {2,2,-2,-2,1,-1,1,-1}; // Knight Direction
// int dx[] = {2,-2,1,1,-1,-1} , dy[] = {0,0,1,-1,1,-1}; // Hexagonal Direction

/*#define maX 100000+1
int se[maX]= {0};

 bool prime[maX];
void SieveOfEratosthenes(int n)
 {
     // Create a boolean array "prime[0..n]" and initialize
     // all entries it as true. A value in prime[i] will
     // finally be false if i is Not a prime, else true.

     memset(prime, true, sizeof(prime));

     for (int p=2; p*p<=n; p++)
     {
         // If prime[p] is not changed, then it is a prime
         if (prime[p] == true)
         {
             // Update all multiples of p
             for (int i=p*2; i<=n; i += p)
                 prime[i] = false;
         }
     }

     // Print all prime numbers
     for (int p=2; p<=n; p++)
        if (prime[p])
           cout << p << " ";
 }

*/
/*while(l!=r)
 {
 int mid=(l+r+1)/2;

 if(s=="<")
 r=mid-1;
 else
 l=mid;
 }*/

bool is_prime(long long x) {
	if (x == 1)
		return false;
	for (int i = 2; i * i <= x; i++)
		if (x % i == 0)
			return false;
	return true;

}

bool is_palindrome(string s1) {
	int l = s1.length();
	for (int i = 0; i < l / 2; i++)
		if (s1[i] != s1[l - i - 1])
			return false;

	return true;
}

ull C(ll n, ll k) {
	if (k == 0) return 1;

	return (n * C(n - 1, k - 1)) / k;
}

ll modular_pow(ll base, ll exponent, int modulus) {
	ll result = 1;
	while (exponent > 0) {
		if (exponent % 2 == 1)
			result = (result * base) % modulus;
		exponent = exponent >> 1;
		base = (base * base) % modulus;
	}
	return result;
}

long long binaryToDec(string number) {
	long long result = 0, pow = 1;
	for (int i = number.length() - 1; i >= 0; --i, pow <<= 1)
		result = (result + (number[i] - '0') * pow) % 1000003;

	return result;
}

long long binaryToDec2(string number) {
	long long result = 0, pow = 1;
	int l=number.length();
	for (int i =0; i <l; ++i, pow <<= 1)
		result = (result + (number[i] - '0') * pow) % 1000003;

	return result;
}

string decimalToBin(int number)
{
    if ( number == 0 ) return "0";
    if ( number == 1 ) return "1";

    if ( number % 2 == 0 )
        return decimalToBin(number / 2) + "0";
    else
        return decimalToBin(number / 2) + "1";
}
ull GCD(ull a, ull b) {
	return b == 0 ? a : GCD(b, a % b);
}

int cntMask(int mask) {
	int ret = 0;
	while (mask) {
		if (mask % 2)
			ret++;
		mask /= 2;
	}
	return ret;
}
int getBit(int mask, int i) {
	return ((mask >> i) & 1) == 1;
}
int setBit(int mask, int i, int value = 1) {
	return (value) ? mask | (1 << i) : (mask & ~(1 << i));
}

ull mystoi(string s) {
	ull ans = 0;
	ull po = 1;
	for (int i = s.length() - 1; i >= 0; i--) {
		ans += (s[i] - '0') * po;
		po *= 10;
	}

	return ans;

}

string conv(int i) {
	string t = "";
	while (i) {
		t += '0' + (i % 10);
		i /= 10;
	}
	//reverse(All(t));
	return t;
}

bool hasZero(int i) {
	if (i == 0)
		return true;
	while (i) {
		if (i % 10 == 0)
			return true;
		i /= 10;
	}
	return false;
}

bool isSortedAc(int a[], int n) {
	lp(i,n-1)
		if (a[i] > a[i + 1])
			return false;

	return true;
}

bool isSortedDec(int a[], int n) {
	lp(i,n-1)
		if (a[i] < a[i + 1])
			return false;

	return true;
}

bool cmp(ull i,ull j)
{
	return i>j;
}

void C()
{
	string s;
	cin>>s;
	int len=s.length();
	map<char ,int> mp;
	char target;
	lp(i,len-1)
	{

		if(s[i]==s[i+1])
		{
			cout<<"Impossible"<<endl;
			return ;
		}
	}
	lp(i,len)
	{
		mp[s[i]]++;
		if(mp[s[i]]==2)
		{target=s[i];
		break;
		}
	}

	char a[3][15];

	lp(i,2)
		lp(j,13)a[i][j]='*';

	int idx=s.find(target);
	int is=idx;

	int idx2=0;
	for(int i=len-1;i>=0;i--)
	{
		if(s[i]==target)
		{
			idx2=i;
			break;
		}
	}

	int dis=idx2-idx-1;
	int y=dis;
	dis/=2;

	//cout<<idx<<" "<<idx2<<endl;
	//cout<<"d "<<dis<<endl;

	int p=12-dis;
	//cout<<"p "<<p<<endl;
	for(int i=p;i<13;i++)
		a[0][i]=s[is++];

   // cout<<p<<endl;

	for(int i=12;i> p -(y%2==1);i--)
		a[1][i]=s[is++];

	int o=idx;
	int t=12-idx2;

	int last;
	for(int i=0;i<13;i++)
	{
		if(a[1][i]!='*')
		{
			last=i;
			break;
		}
	}

	is++;
	for(int i=last-1;i>=0;i--)
	{
		if(is>=len)is=0;
		a[1][i]=s[is++];
	}

	if(is>=len)is=0;
	for(int i=0;i<idx;i++)a[0][i]=s[min(is++,len-1)];

	lp(i,13)cout<<a[0][i];
	cout<<endl;
	lp(i,13)
		cout<<a[1][i];

	cout<<endl;

	return ;

}

int main(){

	C();
	//system("pause");
	return 0;
}

/*

                   _ooOoo_
                  o8888888o
                  88" . "88
                  (| -_- |)
                  O\  =  /O
               ____/`---'\____
             .'  \|     |//  `.
            /  \|||  :  |||//  \
           /  _||||| -:- |||||-  \
           |   | \\  -  /// |   |
           | \_|  ''\---/''  |   |
           \  .-\__  `-`  ___/-. /
         ___`. .'  /--.--\  `. . __
      ."" '<  `.___\_<|>_/___.'  >'"".
     | | :  `- \`.;`\ _ /`;.`/ - ` : | |
     \  \ `-.   \_ __\ /__ _/   .-` /  /
======`-.____`-.___\_____/___.-`____.-'======
                   `=---='
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
			      INFERNO
*/

#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <queue>
#include <stack>
#include <string.h>
#include <iomanip>
#include <math.h>

#include <bitset>
#include <set>

using namespace std;

#define SIZE 1000
#define MAX_N 5005
#define INF 0x3f3f3f3f
#define MOD 7
#define MAX_THREE(a, b, c) max(max(a,b),c)
#define MIN_THREE(a, b, c) min(min(a,b),c)

#define RULER 0.57721566490153286060651209

char str[30];
int p[30];

int main() {

    int t1, t2, size, a;
    char ans1[30], ans2[30];
    scanf("%s", str);

    size = strlen(str);

    for (int i = 0; i < size; i++) {
        if (p[str[i] - 'A'] == 0) {
            p[str[i] - 'A'] = i;
        }else{
            t1 = p[str[i] - 'A'];
            t2 = i;
            break;
        }
    }

    a = (t2 - t1) / 2;
    if (a == 0) {
        printf("Impossible\n");
    }else{
        if (!t2 - t1 & 1) {
            a--;
        }
        for (int i = 0; i < 13; i++) {
            ans1[i] = '0';
            ans2[i] = '0';
        }

        for (int i = 0; i < a + 1; i++) {
            ans1[12 - a + i] = str[t1 + i];
        }
        for (int i = 0; i < a + !(t2 - t1 & 1); i++) {
            ans2[12 - i] = str[t1 + i + a + 1];
        }

        for (int i = 0; i < 13 - a; i++) {
            ans1[12 - a - i] = str[t2 + i];
        }

        for (int i = 0; i < 13 - a - !(t2 - t1 & 1); i++) {
            ans2[i] = str[(t2 + 13 - a + i) % 27];
        }
        printf("%s\n%s\n", ans1, ans2);
    }

    return 0;
}

/*************************************************************************
    > File Name: test.cpp
    > Author: Akira
    > Mail: qaq.febr2.qaq@gmail.com
 ************************************************************************/

#include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <cstdlib>
#include <algorithm>
#include <queue>
#include <stack>
#include <map>
#include <cmath>
#include <vector>
#include <set>
#include <list>
#include <ctime>
typedef long long LL;
typedef unsigned long long ULL;
typedef long double LD;
#define MST(a,b) memset(a,b,sizeof(a))
#define CLR(a) MST(a,0)
#define Sqr(a) ((a)*(a))
using namespace std;

#define MaxN 100000
#define MaxM MaxN*10
#define INF 0x3f3f3f3f
#define bug cout<<88888888<<endl;
#define MIN(x,y) (x<y?x:y)
#define MAX(x,y) (x>y?x:y)

map<char,int> M;
int main()
{
    char str[27];
    while(~scanf("%s", str))
    {
        M.clear();
        int flag = 0;
        int op;
        int pos = 0;
        for(int i=0;i<27;i++)
        {
            if(M[str[i]] == 0)
            {
                M[str[i]] = i+1;
                //op[pos++] = str[i];
            }
            else{
                op = i+1;
                int x = i+1 - M[str[i]];
                if(x != 13){
                    flag = 1;
                    //cout << x << endl;
                    break;
                }
            }
            if(str[i] == str[i-1])
            {
                flag = 1;
                break;
            }
        }

        if(flag) {
            cout << "Impossible\n";
            continue;
        }
      //  cout << op << endl;
        int cnt = 0;
        for(int i=25;i>=op;i--)
        {
            cnt++;
            cout << str[i];
        }
        for(int i = op-14;cnt<13;i++)
        {
            cnt++;
            cout << str[i];
        }
        cnt = 1;
        cout << endl;
        if( str[26] == str[op-1])
        {
            //bug;
            for(int i=12;i>=0;i--)
            {
                cout << str[i];
            }
            cout << endl;
            continue;
        }
        cout << str[26];
        if( str[0] == str[op-14])
        {
            //bug;
            for(int i=1;i<13;i++)
            {
                cout << str[i];
            }
            cout << endl;
            continue;
        }
        for(int i=0;i<op-14;i++)
        {
            cnt++;
            cout << str[i];
        }
        //cout << endl;
        for(int i=op-2;cnt<13;i--)
        {
            cnt++;
            cout << str[i];
        }
        cout << endl;

    }
  //  system("pause");
}

#define __USE_MINGW_ANSI_STDIO 0
#include <bits/stdc++.h>
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl '\n'
#define ff first
#define ss second
#define mod 1000000007
#define pb push_back
#define mp make_pair
#define int long long
#define all(a) a.begin(), a.end()
#define inf (1LL<<61)
#define print_time cerr << "Time elapsed: " << 1000.0 * clock() / CLOCKS_PER_SEC << "ms\n";
#define ull unsigned long long
#define debug1(x) cerr << #x << ": " << x <<'\n'
#define debug2(x, y) cerr << #x << ": " << x << '\t' << #y << ": " << y <<'\n'
#define debug3(x, y, z) cerr << #x << ": " << x << '\t' << #y << ": " << y << '\t' << #z << ": " << z <<'\n'
using namespace std;
int dx[]={1,0,-1,0};int dy[]={0,1,0,-1}; //4 Direction
//int dx[]={1,1,0,-1,-1,-1,0,1};int dy[]={0,1,1,1,0,-1,-1,-1};//8 direction
int gcd(int x,int y)
{
    if(y==0)
	return x;
    else
	return gcd(y,x%y);
}
int expo(int n,int m,int p)   //modULAR EXPONENTIATION
{
    int r=1;
    n=n%p;
    while(m>0)
    {
	if(m%2)
	    r=(r*n)%p;
	n=(n*n)%p;
	m=m/2;
    }
    return r%p;
}
bool isPrime(int n)
{
    // Corner cases
    if (n <= 1)  return false;
    if (n <= 3)  return true;

    // This is checked so that we can skip
    // middle five numbers in below loop
    if (n%2 == 0 || n%3 == 0) return false;

    for (int i=5; i*i<=n; i=i+6)
	if (n%i == 0 || n%(i+2) == 0)
	   return false;

    return true;
}
vector<int> z_function(string s) {
    int n = (int) s.length();
    vector<int> z(n);
    for (int i = 1, l = 0, r = 0; i < n; ++i) {
	if (i <= r)
	    z[i] = min (r - i + 1, z[i - l]);
	while (i + z[i] < n && s[z[i]] == s[i + z[i]])
	    ++z[i];
	if (i + z[i] - 1 > r)
	    l = i, r = i + z[i] - 1;
    }
    return z;
}
int32_t main()
{
   IOS;
   #ifndef ONLINE_JUDGE
   freopen("input.txt","r",stdin);
   freopen("output.txt","w",stdout);
   #endif
   /********************* Code starts here ***********************/
   string s;
   cin>>s;
   bool ok=true;
   int c[26]={0},k;
   for(int i=0;i<27;i++)
   {
   	if(i+1<s.size()&&s[i]==s[i+1])
   		ok=false;
   	c[s[i]-'A']++;
   	if(c[s[i]-'A']==2)
   		k=s[i]-'A';
   }
   if(!ok)
   {
   	cout<<"Impossible"<<endl;
   	return 0;
   }

   char a[2][14];
   int x=-1,y;
   for(int i=0;i<s.size();i++)
   {
   	if(s[i]-'A'==k)
   	{
   		if(x!=-1)
   			y=i;
   		else
   			x=i;
   	}
   }
  // debug2(x,y);
   int d=y-x-1;
  // d-=1;
   d=d/2;
   // debug1(d);
   a[0][d]=s[x];
   int j=x,i=0,l=0,D=d;
   d--;
   j++;
   int o=D;
  // debug1(s);
   while(j!=y)
   {
   	//debug3(d,l,i);
   	//cout<<d<<endl;
   	if(d==-1){
   		//cout<<d<<endl;
   		d=0;i++,l=1;
   	}
   	a[i][d]=s[j];
   	j++;
   	if(l==0)
   		d--;
   	else
   		d++;
   }
   d=D;
   l=0;
   d++;

   int I=0;
  // debug1(s);
   for(int i=x-1;i>=0;i--)
   {
   	//debug3(I,d,i);
   	a[I][d]=s[i];
   	if(l==0)
   		d++;
   	if(d==13)
   	{
   		l=1;
   		I=1;
   		//d=12;
   	}
   	if(l==1)
   		d--;
   }

     d=D;
     int co=0;
     l=0,I=0;

     while(co!=(y-x))
     {
     	//debug3(co,d,I);
     	if(l==0)
   		d--;
   	if(d==-1)
   	{
   		l=1;
   		I=1;
   		//d=12;
   	}
   	if(l==1)
   		d++;
   	co++;
     }
    //debug1(d);
   for(int i=y+1;i<27;i++)
   {

   	a[I][d]=s[i];
   	if(l==1)
   		d++;
   	if(l==0)
   		d--;
   	if(d==-1)
   	{
   		l=1;
   		I=1;
   		d=0;
   	}
   	if(d==13)
   	{
   		d=12;
   		I=0;
   		l=0;
   	}

   }
   for(int i=0;i<2;i++)
   {
   	for(int j=0;j<13;j++)
   	{
   		cout<<a[i][j];
   	}
   	cout<<endl;
   }
}

#include<bits/stdc++.h>
using namespace std;

const int len=27;
char a[50];
int p1,p2,L,R;

int main(){
    //freopen("input.txt","r",stdin);
    int Case=0;
    while(scanf("%s",a)!=EOF){
        ++Case;//printf("Case #%d:\n",Case);
        int len=strlen(a);
        for(int i=0;i<len;i++)
            for(int j=i+1;j<len;j++)
                if (a[i]==a[j]){
                    p1=i;p2=j;
                    //printf("%c %c\n",a[p1],a[p2]);
                    break;
                }
        //printf("%d %d\n",p1,p2);
        R=(p2-p1-1)/2;
        if (p1+1==p2){
            puts("Impossible");
            continue;
        }
        if (p1==0&&p2==26){
            for(int i=0;i<13;i++) printf("%c",a[i]);puts("");
            for(int i=25;i>=13;i--) printf("%c",a[i]);puts("");
            continue;
        }
        int start=p2-R;
        for(int i=start;i<start+13;i++) printf("%c",a[i]);
        puts("");
        for(int i=start-1;i>=0;i--){
            if (i==p1) continue;
            printf("%c",a[i]);
        }
        for(int i=26;i>=start+13;i--) printf("%c",a[i]);
        puts("");
    }
    return 0;
}

#include<bits/stdc++.h>
#define LL long long
#define fi first
#define se second
#define mk make_pair
#define pii pair<int,int>
#define ull unsigned long long
using namespace std;

const int N=1e6+7;
const int M=100+7;
const int inf=0x3f3f3f3f;
const LL INF=0x3f3f3f3f3f3f3f3f;
const int mod=1e9 + 9;

char s[30], deg[30], c, ans[2][30];
map<char, bool> mp;
int main() {
    scanf("%s", s);
    int n = strlen(s);
    for(int i = 0; i < n - 1; i++) {
        if(s[i] == s[i + 1]) {
            puts("Impossible");
            return 0;
        }
    }
    for(int i = 0; i < n; i++) {
        if(mp[s[i]]) {
            c = s[i];
        }
        mp[s[i]] = true;
    }
    bool flag = false;
    for(int i = 0; i < 13; i++) {
        if(s[i] == c) {
            flag = true;
        }
    }

    if(!flag) {
        reverse(s, s + n);
    }

    int pos1, pos2;
    for(int i = 0; i < n; i++) {
        if(s[i] == c) {
            pos1 = i;
            break;
        }
    }
    for(int i = n - 1; i >= 0; i--) {
        if(s[i] == c) {
            pos2 = i;
            break;
        }
    }
    int cnt = pos2 - pos1 - 1;
    ans[0][13] = ans[1][13] = '\0';
    if(cnt % 2 == 0) {
        int pos = 12 - cnt / 2, now = 0, start = pos - pos1 + 1;
        for(int i = start; i <= pos; i++)
            ans[1][i] = s[now++];
        for(int i = pos; i < 13; i++)
            ans[0][i] = s[now++];
        for(int i = 12; i > pos; i--)
            ans[1][i] = s[now++];
        for(int i = pos; i >= 0; i--)
            ans[0][i] = s[now++];
        for(int i = 0; i < start; i++)
            ans[1][i] = s[now++];
        puts(ans[0]);
        puts(ans[1]);
    } else {
        puts("Impossible");
    }

    return 0;
}
/*
STUVWXYZABCDEFGHIAJKLMNOPQR
*/

#include <iostream>
using namespace std;

#define per(i, a, b) for(int (i) = (a); (i) < (b); (i) += 1)
#define Per(i, a, b) for((i) = (a); (i) < (b); (i) += 1)
#define rep(i, a, b) for(int (i) = (a); (i) > (b); (i) -= 1)
#define Rep(i, a, b) for((i) = (a); (i) > (b); (i) -= 1)
#define abs(a) ((a) < 0 ? -(a) : (a))
#define min(a, b) ((a) < (b) ? (a) : (b))
#define ol cout << endl
#define o(a) cout << (a)
#define o_(a) cout << (a) << " "
#define oo(a) cout << (a) << endl
#define g(a) cin >> (a);

char ch(string str, int i) {
	while(i < 0)
		i += 27;
	i %= 27;
	return str[i];
}

string spin(string s) {
	s = s[s.size() - 1] + s.substr(0, s.size() -1);
	return s;
}

int main() {
	string s;
	cin >> s;

	int i, j;
	Per(i, 0, s.size()) {
		bool flag = false;
		Per(j, 0, s.size())
			if(s[i] == s[j] && i != j) {
				flag = true;
				break;
			}
		if(flag)
			break;
	}

	if(abs(i - j) == 1) {
		cout << "Impossible" << endl;
		return 0;
	}

	oo(s[i]);

	int m = i + j;
	m /= 2;

	string out;
	if((i + j) % 2 == 1) {
		per(i, m - 12, m + 1)
			out += ch(s, i);
		rep(i, m + 14, m)
			if(ch(s, i) != ch(s, j))
				out += ch(s, i);
	} else {
		per(i, m - 13, m)
			out += ch(s, i);
		rep(i, m + 13, m - 1)
			if(ch(s, i) != ch(s, j))
				out += ch(s, i);
	}

	per(i, 0, out.size())
		i == 12 ? oo(out[i]) : o(out[i]);

	ol;

	return 0;
}

#include <bits/stdc++.h>

using namespace std;

#define N 200005
#define xx first
#define yy second
#define LL long long

string s,a,b;
int t[333];
int c;

int main(){
        cin>>s;
        for(int i=0;i<s[i];i++){
                t[s[i]]++;
                if(t[s[i]]==2){
                        c=s[i];
                }
        }
        a="";
        b="";
        int i=0;
        for(i=0;i<13;i++){
                a+=s[i];
        }
        for(;s[i];i++){
                b+=s[i];
        }
        int is=0;
        for(i=0;i<13;i++){
             if(a[i]==c&&b[i]==c){
                is=1;
                break;
             }
        }
        if(is==0){
                reverse(b.begin(),b.end());
                for(int i=0;i<13;i++){
                     if(a[i]==c&&b[i]==c){
                        is=1;
                        break;
                        }
                }
        }
        if(is==0){
                printf("Impossible\n");
        }
        else{
                cout<<a<<"\n";
                for(i=0;i<b.size();i++){
                        if(b[i]!=c) printf("%c",b[i]);
                }
        }

}

#include <bits/stdc++.h>
using namespace std;

char s[28];
char ans[2][14];

bool check()
{
	int i = 0, j = 0, add = 1;
	while(ans[i][j] != s[0])
	{
		j += add;
		if(j == 13)
		{
			--j;
			add = -1;
			++i;
		}
	}
	bool used[26];
	memset(used, false, sizeof(used));
	int last_i,
		last_j;
	for(int k = 0; k < 27; ++k)
	{
		if(!used[s[k] - 'A'])
		{
			if(ans[i][j] != s[k])
			{
				return false;
			}
			last_i = i;
			last_j = j;
			j += add;
			if(j == 13)
			{
				--j;
				add = -1;
				++i;
			} else if(j == -1)
			{
				++j;
				add = 1;
				--i;
			}
			used[s[k] - 'A'] = true;
		} else
		{
			int new_i = i,
				new_j = j;
			i = last_i;
			j = last_j;
			if(i == 1)
			{
				if((ans[i - 1][j] == s[k]) || (j > 0 && ans[i - 1][j - 1] == s[k]) || (j + 1 < 13 && ans[i - 1][j + 1] == s[k]))
				{

				} else
				{
					return false;
				}
			} else
			{
				if((ans[i + 1][j] == s[k]) || (j > 0 && ans[i + 1][j - 1] == s[k]) || (j + 1 < 13 && ans[i + 1][j + 1] == s[k]))
				{

				} else
				{
					return false;
				}
			}
			i = new_i;
			j = new_j;
		}
	}

	return true;
}

int main (int argc, char *argv[])
{
	//FILE *in = freopen("input.txt", "r", stdin);

	scanf("%s", s);
	for(int i = 0; i < 26; ++i)
	{
		if(s[i] == s[i + 1])
		{
			printf("Impossible");
			return 0;
		}
	}
	bool used[26];
	memset(used, false, sizeof(used));
	for(int i = 0, j = 0, k = 0, add = 1; i < 28; ++i)
	{
		//cout << i << endl;
		if(!used[s[i] - 'A'])
		{
			used[s[i] - 'A'] = true;
			ans[j][k] = s[i];
			k += add;
			if(k == 13)
			{
				--k;
				add = -1;
				++j;
			}
		}
	}
	int cnt = 0;
	while(!check())
	{
		char old_ans[2][14];
		for(int i = 0; i < 2; ++i)
		{
			for(int j = 0; j < 13; ++j)
			{
				old_ans[i][j] = ans[i][j];
			}
		}
		for(int j = 1; j < 13; ++j)
		{
			ans[0][j] = old_ans[0][j - 1];
		}
		ans[1][12] = old_ans[0][12];
		for(int j = 11; j >= 0; --j)
		{
			ans[1][j] = old_ans[1][j + 1];
		}
		ans[0][0] = old_ans[1][0];
	}
	for(int i = 0; i < 2; ++i)
	{
		for(int j = 0; j < 13; ++j)
		{
			printf("%c", ans[i][j]);
		}
		printf("\n");
	}

	return 0;
}

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef long double ld;
typedef pair<ll, ll> par;
typedef vector<par> vpar;
typedef vector<bool> vbool;

#define forn(i, b, n) for (ll i = b; i < n; ++i)
#define rforn(i, b, n) for (int i = b; i >= n; --i)
#define vec vector
#define mp make_pair
#define add push_back
#define del pop_back
#define F first
#define S second
#define pw(x) (1ll << (x))
#define sqr(x) ((x)*(x))
#define all(x) (x).begin(), (x).end()

const ll INF = ll(1e18);
const ll MOD = ll(1e9) + 7;
const ll P = 259;
const ld EPS = 1e-10;

inline void error() {
	cout << "No";
	exit(0);
}

inline ll logn(ll n) {
	ll xx = ll(log2(ld(n)));
	return xx;
}

#define TASK "HashOnSparse"

int source() {
	string s;
	cin >> s;
	ll n = s.size();
	char x = 0;
	forn(i, 1, n) {
		if (s[i] == s[i - 1]) {
			cout << "Impossible";
			return 0;
		}
	}
	vec<bool> count(26);
	forn(i, 0, n) {
		if (count[s[i] - 'A']) x = s[i];
		count[s[i] - 'A'] = 1;
	}
	vec<string> a(2, string(13, 'A'));
	ll l = -1, r = -1;
	forn(i, 0, n) {
		if (s[i] == x) {
			if (l == -1) l = i;
			else r = i;
		}
	}
	ll m = (l + r) / 2;
	ll curl = 0ll;
	ll curr = 0ll;
	for(ll i = m; i > l; --i) {
		a[0][curl] = s[i];
		curl++;
	}
	ll siz = r - l - 1;
	for (ll i = m + 1; i < r; ++i) {
		a[1][curr] = s[i];
		curr++;
	}
	if (siz % 2) {
		a[1][curr] = x;
		curr++;
	} else {
		a[0][curl] = x;
		curl++;
	}
	if (n - r < l) {
		for (ll i = n - 1; i > r; --i) {
			a[0][curl] = s[i];
			++curl;
		}
		bool rev = 1;
		forn(i, 0, l) {
			if (rev) {
				a[1][curr] = s[i];
				++curr;
				if (curr == 13) {
					rev = 0;
					curr--;
				}
			} else {
				a[0][curr] = s[i];
				curr--;
			}
		}
	} else {
		for (ll i = l -1; i >= 0; --i) {
			a[0][curl] = s[i];
			++curl;
		}
		bool rev = 1;
		forn(i, r + 1, n) {
			if (rev) {
				a[1][curr] = s[i];
				++curr;
				if (curr == 13) {
					rev = 0;
					curr--;
				}
			} else {
				a[0][curr] = s[i];
				curr--;
			}
		}
	}
	cout << a[0] << '\n' << a[1];

	return 0;
}

int main() {
#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#else
	//freopen(TASK".in", "r", stdin);
	//freopen(TASK".out", "w", stdout);
#endif
	srand(time(0));
	ios::sync_with_stdio(0);
	source();
	return 0;
}

#include<cstdio>
#include<cstdlib>
#include<algorithm>
#include<cstring>
#include<vector>
#include<queue>
#include<cmath>
#define ll long long
#define ld long double
#define pb push_back
#define mp make_pair
using namespace std;
const int maxn= 5e5;
struct node{
	int x,y;
}M[8];
node nex[100][100];
char ans[100][100];
char s[100];
int num[100];
char X;
int i,j;
int idx(char c){
	return c-'A';
}
bool out(int x,int y){
	return x<1||x>2||y<1||y>13;
}
bool ok(int x,int y){
	node p= (node){x,y};
	int i= 1,bl= 0,xx,yy;
	do{
		ans[p.x][p.y]= s[i];
		if (s[i]==X) bl= 1;
		i++;
		if (s[i]==X&&bl){
			xx= p.x;
			yy= p.y;
			i++;
		}
		p= nex[p.x][p.y];
	}while (p.x!=x||p.y!=y);
	for (i= 0;i<8;i++){
		int s= xx+M[i].x;
		int t= yy+M[i].y;
		if (out(s,t)) continue;
		if (ans[s][t]==X) return 1;
	}return 0;
}
int main()
{
#ifndef ONLINE_JUDGE
	freopen("1.in","r",stdin);
	freopen("1.out","w",stdout);
#endif
	M[0]= (node){-1,-1};
	M[1]= (node){-1,0};
	M[2]= (node){-1,1};
	M[3]= (node){0,1};
	M[4]= (node){1,1};
	M[5]= (node){1,0};
	M[6]= (node){1,-1};
	M[7]= (node){0,-1};
	scanf("%s",s+1);
	for (i= 1;i<=27;i++){
		num[idx(s[i])]++;
		if (num[idx(s[i])]==2)
			X= s[i];
	}
	for (i= 1;i<=13;i++){
		nex[1][i]= (node){1,i+1};
		nex[2][i]= (node){2,i-1};
	}
	nex[1][13]= (node){2,13};
	nex[2][1]= (node){1,1};
	for (i= 1;i<=2;i++)
		for (j= 1;j<=13;j++)
			if (ok(i,j)){
				printf("%s\n%s",ans[1]+1,ans[2]+1);
				return 0;
			}
	printf("Impossible");
	return 0;
}

#include <bits/stdc++.h>
using namespace std;

int mark[100];

int main(){
    int n=27;
    string s;   cin>>s;
    int l,r=0;
    for(int i=1;i<n;i++){
        if(mark[s[i]])l=mark[s[i]]-1,r=i;
        mark[s[i-1]]=i;
    }
    if(!r)return cout<<"Impossible\n",0;

    if(r!=n-1)rotate(&s[r],&s[r+1],&s[n]);
    rotate(&s[0] , &s[(13-l-(r-l)/2+52-2)%26],&s[26]);
    for(int i=0;i<13;i++)cout<<s[i];cout<<'\n';
    for(int i=0;i<13;i++)cout<<s[25-i];cout<<'\n';
	return 0;
}

//#include <bits/stdc++.h>
#include <cctype>
#include <cfloat>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <string>
#include <sstream>
#include <algorithm>
#include <complex>
#include <deque>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <vector>
#include <utility>
#include <bitset>

#define IOS std::ios::sync_with_stdio(false); std::cin.tie(nullptr); std::cout.tie(nullptr);
// #define __DEBUG__
#ifdef __DEBUG__
	#define DEBUG(...) printf(__VA_ARGS__)
#else
	#define DEBUG(...)
#endif
#define filename ""
#define setfile() freopen(filename".in", "r", stdin); freopen(filename".out", "w", stdout);

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int > Pii;

const double pi = acos(-1.0);
const int INF = INT_MAX;
const int MAX_N = 50005;

template <typename T>
inline T sqr(T a) { return a * a;};

string s;
char gid[2][27];
int cnt[27], dis, l, r;
char ch;

int main(int argc, char const *argv[])
{
	cin >> s;
	for (int i = 0; i < s.size(); ++i) {
		if (cnt[s[i] - 'A']) {
			l = cnt[s[i] - 'A'];
			r = i;
			ch = s[i];
		} else
			cnt[s[i] - 'A'] = i;
	}
	if (r - l == 1) {
		cout << "Impossible" << endl;
	} else {
		int dis = r - l;
		for (int i = 0; i <= dis / 2; ++i)
			gid[0][dis / 2 - i] = s[i + l];
		for (int i = dis / 2 + 1; i < dis; ++i)
			gid[1][i - dis / 2 - 1] = s[i + l];

		for (int i = dis / 2 + 1; i <= 13 && l + dis / 2 - i >= 0; ++i)
			gid[0][i] = s[l + dis / 2 - i];
		int it = 26;
		for (int i = l + dis / 2 + 1; i < 13; ++i)
			gid[0][i] = s[it--];

		for (int i = 12; it > r; --i)
			gid[1][i] = s[it--];

		// cout << gid[0] << endl;
		// cout << gid[1] << endl;
		for (int i = 0; i < 2; ++i) {
			for (int j = 0; j < 13; ++j)
				cout << gid[i][j];
			cout << endl;
		}
	}
	return 0;
}

#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<utility>
#include<set>
#include<queue>

const int maxn = 200000;
const int INF = 1e9;
using namespace std;
int main(){
	char x[100];
	char y[100];
	char matrix[10][100];
	int flag[100];
	int posl,posr;
	int pos=1;
	memset(flag,0,sizeof(flag));
	memset(matrix,0,sizeof(matrix));
	for (int i = 1;i <= 27;++i){
		cin >> x[i];
		if (flag[x[i]-'A']){
			posl = flag[x[i]-'A'];
			posr = i;
		}
		flag[x[i]-'A']= i;
	}
	if (posr-posl == 1){
		cout << "Impossible";
	}
	else{
		if (posl+posr <= 27){
			for (int i = posr;i <= 26;++i){
				x[i] = x[i+1];
			}
			int t = posl + (posr-posl)/2;
//			cout << t << endl;
			for (int i = 1;i <= t;++i){
				matrix[1][13-t+i]=x[i];
			}
			for (int i = 13;i >= 1;--i){
				matrix[2][i] = x[t+14-i];
			}
			for (int i = 1;i <= 13-t;++i){
				matrix[1][i] = x[i+13+t];
			}
		}
		else{
			for (int i = 1;i <= 27;++i){
				y[i] = x[28-i];
			}
			for (int i = 1;i <= 27;++i){
				x[i] = y[i];
			}
			posr = 28-posl;
			for (int i = posr;i <= 26;++i){
				x[i] = x[i+1];
			}
			int t = posl + (posr-posl)/2;
//			cout << t << endl;
			for (int i = 1;i <= t;++i){
				matrix[1][13-t+i]=x[i];
			}
			for (int i = 13;i >= 1;--i){
				matrix[2][i] = x[t+14-i];
			}
			for (int i = 1;i <= 13-t;++i){
				matrix[1][i] = x[i+13+t];
			}
		}
	}
	for (int i = 1;i <= 13;++i){
		cout << matrix[1][i];
	}
	cout << endl;
	for (int i = 1;i <= 13;++i){
		cout << matrix[2][i];
	}
	return 0;
}

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>
using namespace __gnu_pbds;
using namespace std;
#define getbit(n, i) (((n) & (1LL << (i))) != 0)
#define setbit0(n, i) ((n) & (~(1LL << (i))))
#define setbit1(n, i) ((n) | (1LL << (i)))
#define togglebit(n, i) ((n) ^ (1LL << (i)))
char gap = 32;
template < typename T >
ostream& operator<<(ostream &os, const vector < T > &v) {
  os << '{';
  for (const auto &x: v) os << gap << x;
  return os << '}';
}
template < typename A, typename B >
ostream& operator<<(ostream &os, const pair < A, B > &p) {
  return os << '(' << p.first << gap << p.second << ')';
}

template < class T >
void read(T &x) {
  char c;
  for (c = getchar(); c < '0' || c > '9'; c = getchar());
  for (x = 0; c <= '9' && c >= '0'; c = getchar()) x = x * 10 + (c & 15);
}
#define ll long long
#define lll __int128_t
#define pb push_back
#define mp make_pair
typedef pair < int, int > ii;
typedef vector < ii > vii;
typedef vector < ll > vl;
typedef vector < int > vi;
typedef vector < vi > vvi;
typedef tree <
int,
null_type,
less < int >,
rb_tree_tag,
tree_order_statistics_node_update >
ordered_set;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
ll hashPrime = 1610612741;
ll cnt[26];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  ll i,j,k,l,n,m;
  string s;
  cin>>s;
  deque<char>ans1,ans2;
  for(auto x:s)cnt[x-'A']++;
  char des;
  ll ini=-1,fina=-1;
  for(i=0;i<26;i++){
    if(cnt[i]!=1){
      des=i+'A';
    }
  }
  ll curr=0;
  for(auto x:s){
    if(x==des){
      if(ini==-1){
        ini=curr;
      }
      fina=curr;
    }
    curr++;
  }
  if(fina-ini==1){
    cout<<"Impossible\n";
  }
  else{
    ll cini=ini,cfina=fina;
    ans1.pb(des);
    ll bal=(fina-ini)/2;
    ll rem=fina-ini-1-bal;
    for(i=0;i<bal;i++){
      ans1.push_front(s[++ini]);
    }
    for(i=0;i<rem;i++){
      ans2.push_back(s[++ini]);
    }
    for(i=cini-1;i>=0;i--){
      ans1.pb(s[i]);
    }
    for(i=cfina+1;i<s.size();i++)
      ans2.pb(s[i]);
    for(auto x:ans1)cout<<x;
    cout<<'\n';
    for(auto x:ans2)cout<<x;
    cout<<'\n';
  }
}

#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>

using namespace std;

vector<int> idx[26];
int cnt[26];
char answer[2][13];

int abssub(int a, int b) {
    if (a > b) return a - b;
    else return b - a;
}

int main() {
    string input;
    cin >> input;
    for (int i = 0; i < 27; i++) {
        cnt[input[i] - 'A']++;
        idx[input[i] - 'A'].push_back(i);
    }
    for (int i = 0; i < 26; i++) {
        if (cnt[i] >= 2) {
            for (int j = 0; j < idx[i].size(); j++) {
                for (int k = j + 1; k < idx[i].size(); k++) {
                    if (idx[i][j] == idx[i][k] + 1 || idx[i][j] == idx[i][k] - 1) continue;
                    int offset;
                    for (offset = 0; offset < 26; offset++) {
                        int first, second;
                        if ((idx[i][j] + offset) % 26 < 13) first = idx[i][j] + offset;
                        else /*if (idx[i][j] + offset < 26)*/ first = 25 - idx[i][j] - offset;
                        //else first = 0;
                        if ((idx[i][k] + offset) % 26 < 13) second = (idx[i][k] + offset) % 26;
                        else /*if (idx[i][k] + offset < 26)*/ second = 25 - (idx[i][k] + offset) % 26;
                        //else second = 0;
                        if (idx[i][k] == 26) {
                            if ((idx[i][k] + offset - 1) % 26 < 13) second = (idx[i][k] + offset - 1) % 26;
                            else second = 25 - (idx[i][k] + offset - 1) % 26;
                        }
                        if (abssub(first, second) <= 1) {
                            bool flag= true;
                            int tmp = offset;
                            for (int l = 0; l < 27; l++) {
                                if (l == idx[i][k]) {
                                    flag = false;
                                    continue;
                                }
                                tmp %= 26;
                                if (tmp < 13) answer[0][tmp] = input[l];
                                else answer[1][25 - tmp] = input[l];
                                tmp++;
                            }
                            for (int l = 0; l < 13; l++) cout << answer[0][l];
                            cout << endl;
                            for (int l = 0; l < 13; l++) cout << answer[1][l];
                            cout << endl;
                            return 0;
                        }
                    }
                }
            }
        }
    }
    cout << "Impossible" << endl;
}

#include <bits/stdc++.h>
using namespace std;

string s;
char res[3][15];
map<char,int> letters;
int between, firstOcc , secondOcc , ix ,iy ;
pair<int,int> indexCarry;

pair<int,int> getNextIndex(int i , int j){
    if(i == 2){
        j--;
        if(j == 0){
            i = 1;
            j = 1;
        }
    }else{
        j++;
    }
    return {i,j};
}
int main()
{

    //freopen("omar.in","r",stdin);
    cin>>s;
    for(int i = 1 ; i < 27 ; ++i){
        if(s[i] == s[i-1]){
            cout<<"Impossible"<<endl;
            exit(0);
        }
    }
    for(int i = 0 ; i < (int)s.size() ; ++i){
        if(letters.find(s[i]) == letters.end()){
            letters[s[i]] = i;
        }else{
            firstOcc = letters[s[i]];
            secondOcc = i;
            between = secondOcc - firstOcc - 1;
            break;
        }
    }
    int ptr = between/2;
    int last = 13;
    while(ptr){
        res[2][last] = s[ptr + firstOcc];
        last--;
        ptr--;
    }
    res[2][last] = s[firstOcc];
    ix = 2;
    iy = last-1;
    ptr = firstOcc + (between/2) + 1;
    last = 13;
    while(ptr < secondOcc){
        res[1][last] = s[ptr];
        last--;
        ptr++;
    }
    ptr = firstOcc - 1;
    while(ptr >= 0){
        res[ix][iy] = s[ptr];
        indexCarry = getNextIndex(ix,iy);
        ix = indexCarry.first;
        iy = indexCarry.second;
        ptr--;
    }
    ptr = secondOcc + 1;
    while(ptr < s.size()){
        res[ix][iy] = s[ptr];
        indexCarry = getNextIndex(ix,iy);
        ix = indexCarry.first;
        iy = indexCarry.second;
        ptr++;
    }
    for(int i = 1 ; i <= 2 ; ++i){
        for(int j = 1 ; j <= 13 ; ++j){
            cout<<res[i][j];
        }
        cout<<endl;
    }
    return 0;
}

///Fahim Ahmed :: Dhaka Residential Model College
#pragma comment(linker, "/STACK:16777216") ///Increases Stack size
#include <bits/stdc++.h>
using namespace std;
#define li long long int
#define rl(n) scanf("%I64d", &n)
#define rll(m,n) scanf("%I64d %I64d", &m, &n)
#define rlll(m,n,o) scanf("%I64d %I64d %I64d", &m, &n, &o)
#define ri(n) scanf("%d", &n)
#define rc(n) scanf("%c", &n)
#define rs(n) gets(s)
#define rst(n) getline(cin,n)
#define rfile(a) freopen(a, "r", stdin)
#define wfile(a) freopen(a, "w", stdout)
#define pi acos(-1.00)
#define pb push_back
#define mp make_pair
#define Pr printf
#define For(i,a,b) for(int i = a; i < b; i++)
#define MOD 1000003
#define eps 1e-9
#define ru(n) scanf("%llu",&n)
#define ruuu(m,n,o) scanf("%llu %llu %llu", &m, &n, &o)
#define ui unsigned long long int

typedef long long int ll;
template <typename t1> t1 gcd(t1 a, t1 b) { return b == 0 ? a : gcd(b, a % b); }
template <typename t1> t1 lcm(t1 a, t1 b) { return a * (b / gcd(a, b)); }
///SIMPLE ITERATIVE GCD///
/*
int gcd ( int a, int b ) {
    while ( !b ) {
        a = a % b;
        swap ( a, b );
    }
    return a;
}
*/

template <typename t1> bool check (t1 i, t1 k){return i&((t1)1<<k);}
template <typename t1> t1 On(t1 i, t1 k) { return i|((t1)1 << k);}
template <typename t1> t1 Off(t1 i, t1 k) {return (i-((check(i,k))<<k) );}

///section real number comparison
/*
Some more Real Number Techniques:
to compare between double a and double b
if(a == b) -> if(fabs(a-b)<eps)
if(a > b) -> if((a-b) >= eps)
if(a >= b) -> if((a-b) >= eps || fabs(a-b) < eps)
*/

///section binary search

//gives the lowest index of the key
//if key is not found then returns the higher index of the segment it could've fit in
//if return value > hi; the key was not found and is expected to be fit on the segment from [hi to infinity]
template <typename t1> int c_lower_bound(vector<t1> arr, int lo, int hi, t1 key)
{
    int mid;
    while(lo <= hi)
    {
        mid = (lo+hi)/2;
//        cout<<lo<<" "<<mid<<" " <<hi<<endl;
        if(arr[mid] == key)
        {
            hi = mid-1;
        }
        else if(arr[mid] > key)
        {
            hi = mid-1;
        }
        else if(arr[mid] < key)
        {
            lo = mid + 1;
        }
    }
//    if(arr[hi+1] == key)
        return (hi+1);
//    else return -1;
}

//gives the highest index of the key
//if key is not found then returns the lower index of the segment it could've fit in
///may return negative value
//if return value < lo; the key was not found and is expected to be fit on the segment from [-infinity to low]
template <typename t1> int c_upper_bound(vector<t1> arr, int lo, int hi, t1 key)
{
    int mid;
    while(lo <= hi)
    {
        mid = (lo+hi)/2;
//        cout<<lo<<" "<<mid<<" " <<hi<<endl;
        if(arr[mid] == key)
        {
            lo = mid+1;
        }
        else if(arr[mid] > key)
        {
            hi = mid-1;
        }
        else if(arr[mid] < key)
        {
            lo = mid + 1;
        }
    }
//    if(arr[lo-1] == key)
        return (lo-1);
//    else return lo-1;
}

template <typename t1> int c_binary_search(vector<t1> arr, int lo, int hi, t1 key)
{
    int mid;
    while(lo <= hi)
    {
        mid = (lo+hi)/2;
//        cout<<lo<<" "<<mid<<" " <<hi<<endl;
        if(fabs(arr[mid] - key) < eps)
        {
            return mid;
        }
        else if(arr[mid] > key)
        {
            hi = mid-1;
        }
        else if(arr[mid] < key)
        {
            lo = mid + 1;
        }
    }
    return -1;
}
///Geometry formula 1
double rad_to_deg(double x)
{
    return x*(180.0/pi);
}
double deg_to_rad(double x)
{
    return x*(pi/180.0);
}
vector<double> tri_angle(double a,double b, double c)
{
    double A,B,C;
    A = acos(((b*b+c*c-a*a)/(2*b*c)));
    B = acos(((a*a+c*c-b*b)/(2*a*c)));
    C = pi-A-B;
    double arr[] = {rad_to_deg(A),rad_to_deg(B),rad_to_deg(C)};
    //copy an array into a vector
    vector<double> ret (arr, arr + sizeof(arr) / sizeof(double));
    return ret;
}
double tri_area(double a, double b, double c)
{
    double p = (a+b+c)/2.0;
    double area = p*(p-a)*(p-b)*(p-c);
    return sqrt(area);
}
double circle_area(double r)
{
    return pi*r*r;
}
double circle_peripheri(double r)
{
    return 2.0*pi*r;
}
struct pts{
    double x,y;
    pts(){}
    pts(double xx,double yy)
    {
        x = xx;
        y=yy;
    }
    bool operator < (const pts& ot) const{
        if(this->y > ot.y) return true;
        else if(this-> y == ot.y)
        {
            return (this->x < ot.x);
        }
        else return false;
    }
    double distance(pts ot)
    {
        return sqrt((x-ot.x)*(x-ot.x) + (y-ot.y)*(y-ot.y));
    }
};

struct line {
    double a, b, c;
    line() {}
    line( pts p1, pts p2 ) {
        a = p1. y - p2. y;
        b = p2. x - p1. x;
        c = p1. x * p2. y - p2. x * p1. y;
    }
    line(double aa,double bb, double cc)
    {
        a = aa;
        b=bb;
        c=cc;
    }
    pts intersection(line l2)
    {
        line l1(a,b,c);
        double y = (l2.a*l1.c - l1.a*l2.c);
        y/=(l1.a*l2.b-l2.a*l1.b);
        double x = (-1*l1.c-l1.b*y);
        x/=l1.a;
        pts ret(x,y);
        return ret;
    }
};
vector<line> tangent_eq(pts a, pts b, double r)
{
    double dx = a.x-b.x;
    double dy = b.y-a.y;
    double m1 = 2*dy*dx + sqrt(4*dy*dy*dx*dx + 4*(r*r - dx*dx)*(dy*dy - r*r));
    double m2 = 2*dy*dx - sqrt(4*dy*dy*dx*dx + 4*(r*r - dx*dx)*(dy*dy - r*r));
    m1/=(2*(r*r-dx*dx));
    m2/=(2*(r*r-dx*dx));
    double c1 = a.y - m1*a.x;
    double c2 = a.y - m2*a.x;
    line la(m1,-1,c1),l2(m2,-1,c2);
    vector<line> ret;
    ret.pb(la); ret.pb(l2);
    return ret;
}
line perpendicular(line aa, pts bb)
{
    line la(aa.b,-1*aa.a,(aa.a*bb.y - aa.b*bb.x));
    return la;
}

double tri_area_pts(pts a, pts b, pts c)
{
    double x = a.distance(b);
    double y = b.distance(c);
    double z = c.distance(a);
    return tri_area(x,y,z);
}

vector<double> triangle_sides_to_angles(double a,double b, double c)
{

}

//convert int to string
/*
stringstream ss;
int p = 123;
ss << p;
string newst;
ss >> newst;
ss.clear(); //reset the stream
*/

///Number System, Base Conversion
//int char_to_val(char a)
//{
//    if(a >= 'A' && a <= 'F') return (int)a-55;
//    ///A = ASCII 65; but signifies 10 in hexadecimal
//    else if(a >= '0' && a <= '9') return (int) a - 48;
//    else return -1;
//}
//char val_to_char(int a)
//{
//    if(a >=0 && a <= 9) return (char)('0'+a);
//    else if(a >= 10 && a <= 15) return (char) (a+55);
//}

///palindrome generator
//generate palindrome in between 0 to 99999999999(10^11)

/*
vector<string> palindrome_list[19];
//koto tomo palindrome last i digit er palindrome series e ase oita bolbe
vector<int> serial_map(19);
void palindrome_gen()
{
    serial_map[0]=0;
    for(int i = 1; i <= 1; i++)
    {
        for(char j = '0'; j <= '9'; j++)
        {
            string ss;
            ss = ss+j;
            palindrome_list[i].push_back(ss);
        }
        serial_map[1]=9;
    }
    for(int i = 2; i <= 2; i++)
    {
        for(char j = '0'; j <= '9'; j++)
        {
            string ss;
            ss = ss+j+j;
            palindrome_list[i].push_back(ss);
        }
        serial_map[2]=18;
    }
    for(int i = 3; i <= 11; i++)
    {
        li ctr = 0;
        for(int j = 0; j < 10; j++)
        {
            string bs = palindrome_list[2][j];
            int rst = i-2;
            int ln = palindrome_list[rst].size();
            for(int k = 0; k < ln; k++)
            {
                string temp = bs;
                temp.insert(1,palindrome_list[rst][k]);
                palindrome_list[i].push_back(temp);
                ctr++;
            }
        }
        serial_map[i] = serial_map[i-1]+ctr;
//        cout<<serial_map[i]<<endl;
    }

}

*/
//vector<li> palindromes[16];
//li base,lim,prev;
//int tens[] = {1,10,100,1000,10000,100000,1000000,10000000,100000000,1000000000};
//int slmap[] = {0,10,19,109,199,1099,1999,10999,19999,109999,199999,1099999};
//vector<int> serial_map(slmap, slmap + sizeof(slmap) / sizeof(int));
//void num_palindrome_gen()
//{
//    for(int i = 0; i <= 9; i++)
//    {
//        palindromes[1].pb(i);
//    }
//    for(int i = 0,digit= 1; i <= 5; i++,digit++)
//    {
//        base = 1*tens[i];
//        int even_ind = 2 * digit;
//        int odd_ind  = even_ind + 1,
//        lim = base*10-1;
//        for(int j=base; j <= lim; j++)
//        {
//            int rev_sum=0;
//            int tempp = j;
//            for(int k = 1; k <= digit; k++)
//            {
//                int rem = tempp%10;
//                rev_sum = rev_sum*10 + rem;
//                tempp/=10;
//            }
//            li odd_pal,even_pal;
//            odd_pal = even_pal = j;
//            for(int k = 0; k <= 9; k++)
//            {
//                odd_pal=even_pal*10+k;
//                odd_pal*=tens[digit];
//                odd_pal+=rev_sum;
//                palindromes[odd_ind].pb(odd_pal);
//            }
//            even_pal*=tens[digit];
//            even_pal+=rev_sum;
//            palindromes[even_ind].pb(even_pal);
//        }
//
//    }
//}

////returns nth palindrome integer, works upto 10^11
//li nth_palindrome(int n)
//{
//    int box_no = c_lower_bound(serial_map,0,11,n);
//    int exact_ind = n-serial_map[box_no-1];
//    return palindromes[box_no][exact_ind-1];
//}

///Info section
//string to char array
/* char arr[] = string_name.c_str();*/
//char array to string
/*string string_name(arr);*/
//fastest way to print c++ string
/* puts(str.c_str()) or printf("%s\n", str.c_str());*/

map<char, vector<int> > pos;
int main()
{
    string s;
    cin>>s;
    char doubly;
    for(int i = 0; i < 27; i++)
    {
        pos[s[i]].push_back(i);
        if(pos[s[i]].size() == 2)
        {
            doubly=s[i];
        }
    }
    if(abs(pos[doubly][1] - (pos[doubly][0])) == 1)
    {
        cout<<"Impossible\n";
//        cout<<(27-pos[doubly][1])<<" "<<pos[doubly][0]<<endl;
        return 0;
    }
    else{
        int mid_pos = pos[doubly][0];
        int last_ln = 27-pos[doubly][1]-1;
        int mid_ind = (mid_pos + last_ln)/2;

        char arr[3][15];
        for(int i =0; i < 2; i++)
        {
            for(int j = 0; j < 13; j++)
            {
                arr[i][j] = '_';
            }
        }
        arr[0][13] = arr[1][13] = '\0';
        arr[0][mid_ind] = doubly;
        int lst = mid_pos;
        int i,j;
        for(j = mid_ind-1; j >=0 && lst>=1;j--)
        {
            arr[0][j] = s[--lst];
        }
        bool to=0;
        if(lst != 0)
        {
            to=1;
            for(j = 0;j<=12 && lst>=1; j++)
            {
                arr[1][j]=s[--lst];
            }
        }
        int between = pos[doubly][1] - 1 - pos[doubly][0];
        if(between % 2 == 0)
        {
            int lst=mid_pos;
            for(j = mid_ind+1; j <= 12; j++)
            {
                arr[1][j]=s[++lst];
            }
            for(j=12;j>mid_ind;j--)
            {
                arr[0][j]=s[++lst];
            }
            lst++;
            for(j=mid_ind;j>=0;j--)
            {
                arr[1][j]=s[++lst];
            }
            if(lst != 26)
            {
                for(j=0;j<=12 && lst+1 <=26;j++)
                {
                    arr[0][j]=s[++lst];
                }
            }
        }
        else{
            int lst=mid_pos;
            for(j = mid_ind; j <= 12; j++)
            {
                arr[1][j]=s[++lst];
            }
            for(j=12;j>mid_ind;j--)
            {
                arr[0][j]=s[++lst];
            }
            lst++;
            for(j=mid_ind-1;j>=0;j--)
            {
                arr[1][j]=s[++lst];
            }
            if(lst != 26)
            {
                for(j=0;j<=12 && lst+1 <=26;j++)
                {
                    arr[0][j]=s[++lst];
                }
            }
        }
        puts(arr[0]);
        puts(arr[1]);
    }

}

#include <iostream>
#include <bits/stdc++.h>

using namespace std;

string s;

char ans[2][13];

bool dfs(int i, int j, int cnt)
{
    if (cnt == 27) return true;
    if (ans[i][j] != s[cnt - 1]) return false;
    if (i && ans[i - 1][j] == s[cnt]) return dfs(i - 1, j, cnt + 1);
    if (i && j && ans[i - 1][j - 1] == s[cnt]) return dfs(i - 1, j - 1, cnt + 1);
    if (i && j < 12 && ans[i - 1][j + 1] == s[cnt]) return dfs(i - 1, j + 1, cnt + 1);
    if (j && ans[i][j - 1] == s[cnt]) return dfs(i, j - 1, cnt + 1);
    if (j < 12 && ans[i][j + 1] == s[cnt]) return dfs(i, j + 1, cnt + 1);
    if (!i && ans[i + 1][j] == s[cnt]) return (i + 1, j, cnt + 1);
    if (!i && j && ans[i + 1][j - 1] == s[cnt]) return (i + 1, j - 1, cnt + 1);
    if (!i && j < 12 && ans[i + 1][j + 1] == s[cnt]) return (i + 1, j + 1, cnt + 1);

}

void rotate()
{
    char a(ans[1][0]), b(ans[0][12]);
    for (int i(12); i; --i)
        ans[0][i] = ans[0][i - 1];
    for (int i(0); i < 12; ++i)
        ans[1][i] = ans[1][i + 1];
    ans[0][0] = a;
    ans[1][12] = b;
}

bool was[26];

int main()
{
    freopen("input.txt", "r", stdin);
    cin >> s;
    for (int i(0); i < 26; ++i)
        if (s[i] == s[i + 1])
        {
            cout << "Impossible";
            return 0;
        }
    string k;
    for (int i(0); i < s.size(); ++i)
        if (!was[s[i] - 'A'])
        {
            was[s[i] - 'A'] = true;
            k += s[i];
        }
    for (int i(0); i < 13; ++i)
        ans[0][i] = k[i];
    for (int i(13); i < 26; ++i)
        ans[1][26 - i - 1] = k[i];
    for (int cnt(0); cnt < 30; ++cnt)
    {
        rotate();
        bool flag(false);
        for (int i(0); i < 26; ++i)
            if (dfs(i / 13, i % 13, 1))
                flag = true;
        if (flag)
        {
            for (int i(0); i < 13; ++i)
                cout << ans[0][i];
            cout << endl;
            for (int i(0); i < 13; ++i)
                cout << ans[1][i];
            return 0;
        }
    }
    cout << "Impossible";
}

// rc.cpp
//

#include <assert.h>
#include <time.h>
#include <math.h>
#include <string.h>

#include <iterator>
#include <fstream>
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <list>
#include <stack>
#include <queue>
#include <algorithm>
#include <numeric>
#include <functional>

using namespace std;

#define PI 3.1415926535897932384626433832795
#define EPS 1E-7

typedef unsigned char uchar;
typedef unsigned int uint;
typedef unsigned long long uint64;
typedef long long sint64;

char s[28];

uint q[26];

void rot(uint x)
{
	for (uint i = 0; i < x; ++i)
	{
		char g = s[0];
		for (uint j = 1; j < 26; ++j)
			s[j - 1] = s[j];
		s[25] = g;
	}
}

int main(int argc, char* argv[])
{
	cin >> s;

	uint v[2];

	for (uint i = 0; i < 27; ++i)
	{
		uint ix = s[i] - 'A';
		if (q[ix])
		{
			v[0] = q[ix] - 1;
			v[1] = i;
		}
		else
			q[ix] = i + 1;
	}

	if (v[1] - v[0] == 1)
		cout << "Impossible\n";
	else
	{
		uint d = 13 - (v[1] - v[0] + 1) / 2;
		strcpy(s + v[1], s + v[1] + 1);

		if (d < v[0])
			rot(v[0] - d);
		else
			rot(d + v[0] + 1);

		char g = s[13];
		s[13] = 0;
		cout << s << endl;
		s[13] = g;
		reverse(s + 13, s + 26);
		cout << s + 13 << endl;
	}

	return 0;
}

#include<cstdio>
#include<iostream>
#include<cstring>
using namespace std;
char s[30];
int main(){
    scanf("%s",s);
    int a=0,b=0;
    for(int i=0;s[i]&&!a;i++){
            for(int j=i+1;s[j];j++){
                if(s[i]==s[j])
                    a=i,b=j;
            }
    }
    if(a+1==b){ printf("Impossible\n"); return 0; }
    for(int i=0,j=a+(b-a+1)/2;i<13;i++,j++){
        if(j==b) j++;
        printf("%c",s[j]);

    }
    printf("\n");
    for(int i=0,j=a+(b-a-1)/2;i<13;i++,j--){
        printf("%c",s[(j%27+27)%27]);
    }
    return 0;
}

#include <bits/stdc++.h>

using namespace std;

#define ALL(x) begin(x), end(x)

typedef long long ll;
typedef pair<int, int> ipair;

//const int INF = (int)1.1e9;

int main() {
    #ifndef MY
    // freopen("cards.in", "r", stdin);
    // freopen("cards.out", "w", stdout);
    cin.tie(0);
    #endif
    ios_base::sync_with_stdio(0);

    string s;
    cin >> s;
    int n = 27;
    assert(s.length() == 27);

    int ei, ej;
    for (int i = 0; i < n; ++i) {
        for (int j = i + 1; j < n; ++j) {
            if (s[i] == s[j]) {
                ei = i;
                ej = j;
                break;
            }
        }
    }

    string t = s.substr(0, ej) + s.substr(ej + 1);
    if (ei + ej == 25 || ei + ej == 24) {
        string t2 = t.substr(13);
        reverse(ALL(t2));
        cout << t.substr(0, 13) << "\n" << t2 << "\n";
    } else if (ei + 2 == ej || ei + 3 == ej) {
        string q[2] = {};
        for (int i = 0; i < n; ++i) {
            q[(i + i / 2) % 2] += t[i];
        }
        cout << q[0] << "\n" << q[1] << "\n";
    } else {
        cout << "Impossible\n";
    }
}

#include <stdio.h>
#include <string.h>

char data[30];
int cnt[30];
char ans[10][30];
int a, b;
char what;

int main()
{
    freopen("input.txt", "r", stdin);
    scanf("%s", data+1);
    int i;
    for(i=1; i<=27; i++)
    {
        if(cnt[data[i]-'A']==0) cnt[data[i]-'A']=i;
        else
        {
            if((i-cnt[data[i]-'A']-1)%2!=0||(i-cnt[data[i]-'A']-1)==0)
            {
                printf("Impossible");
                return 0;
            }
            break;
        }
    }
    what=data[i];
    a=cnt[data[i]-'A'];
    b=i;
    int space=(b-a+1)/2;
    ans[1][space]=what;

    int place=b-space+1;
    if(place<1) place+=27;
    for(i=1; i<=13; i++)
    {
        ans[1][i]=data[place];
        place++;
        if(place==28) place=1;
    }

    for(i=13; i>=1; i--)
    {
        if(place==a)
        {
            i++;
        }
        else ans[2][i]=data[place];
        place++;
        if(place==28) place=1;
    }

    for(i=1; i<=13; i++) printf("%c", ans[1][i]);
    printf("\n");
    for(i=1; i<=13; i++) printf("%c", ans[2][i]);
    printf("\n");
}

#include <iostream>
#include <map>
#include <queue>
#include <string>
#include <vector>
#include <algorithm>

#define SQR(a) ((a)*(a))
using namespace std;
typedef long long long64;

bool top_cmp(pair<long64, long64> a, pair<long64, long64> b) {
    return a.second - a.first < b.second - b.first;
}

int main() {
#ifdef ONLINE_JUDGE_OFF
    freopen("circles.in", "r", stdin);
    freopen("circles.out", "w", stdout);
#endif
    string a;
    cin >> a;
    a = a + a + a;

    for (int i = 0; i < 30; i++) {
        string b = a.substr(i, 27);
        string top = b.substr(0, 13);
        string bottom;
        reverse(top.begin(), top.end());
        top += "#";
        bool ok = false;

        if (top[1] == b[13]) {
            ok = true;
        } else {
            bottom.push_back(b[13]);
        }

        for (int j = 1; j < 13; j++) {
            if (!ok && (top[j] == b[13 + j] || top[j + 1] == b[13 + j])) {
                ok = true;
            } else {
                bottom.push_back(b[13 + j]);
            }
        }

        bottom.push_back(b[26]);

        if (ok) {
            cout << top.substr(0, 13) << endl;
            cout << bottom << endl;
            exit(0);
        }
    }
    cout << "Impossible" << endl;
}

#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <vector>
#include <string>
#include <set>
#include <algorithm>
#include <string.h>
#include <queue>
#include <stack>
#include <map>
#include <math.h>
using namespace std;
#define abs(a) ((a > 0)? (a):(-(a)))
#define max(a,b) (((a)>(b))?(a):(b))
#define min(a,b) (((a)<(b))?(a):(b))

int D[26];
int main(){
	string str;
	cin >> str;
	memset(D, -1 , 26*sizeof(int));
	int f,s;
	char c;
	char A[2][13];
	for(int i = 0; i < str.length();i++){
		int ind = str[i] - 'A';
		if(D[ind] > -1){
			f = D[ind];
			s = i;
			break;
		}
		D[ind] = i;
	}
	int dist = s - f - 1;
	if( dist == 0){
		cout<<"Impossible";
		return 0;
	}

	if(dist %2 ==0){
		int p = f;
		for( int i =  12 - dist/2; i < 13; i++){
			A[0][i] = str[p];
			p++;
			p = p % 27;
		}
		for( int i =  12; i >= 13 - dist/2;i--){
			if(p == s)
				p++;
			A[1][i] = str[p];
			p++;
			p = p % 27;
		}
		for( int i =  12 - dist/2 - 1; i >= 0;i--){
			if(p == s)
				p++;
			A[0][i] = str[p];
			p++;
			p = p % 27;
		}
		for(int i = 0; i < 13 - dist/2 ; i++){
			A[1][i] = str[p];
			p++;
			p = p % 27;
				if(p == s)
				p++;
		}

	}
	else{
		int p = f;
		for( int i =  12 - dist/2; i < 13; i++){
			A[0][i] = str[p];
			p++;
			p = p % 27;
		}
		for( int i =  12; i >= 12 - dist/2;i--){
			if(p == s)
				p++;
			A[1][i] = str[p];
			p++;
			p = p % 27;
		}
		for( int i =  12 - dist/2 - 1; i >= 0;i--){
			if(p == s)
				p++;
			A[0][i] = str[p];
			p++;
			p = p % 27;
		}
		for(int i = 0; i < 13 - dist/2 - 1; i++){
			if(p == s)
				p++;
			A[1][i] = str[p];
			p++;
			p = p % 27;
		}
	}
	for(int i = 0; i < 2;i++){
		for(int j = 0; j < 13; j++){
			cout <<A[i][j];
		}
		cout<< endl;
	}

}

#include <iostream>
#include <string>
using namespace std;

#define forsn(i, s, n) for (int i = (s); i < (int) (n); i++)
#define forn(i, n) forsn(i, 0, n)

string path, res1, res2;
int start, finish;

string reverse(string x) {
	string r = "";
	forn(i, x.length()) r = x[i] + r;
	return r;
}

void getPos() {
	forn(i, path.length()) {
		forsn(j, i + 1, path.length()) {
			if (path[i] == path[j]) {
				start = i;
				finish = j;
			}
		}
	}
}

void killFinish() {
	string x = "";
	forn(i, path.length()) if (i != finish) x += path[i];
	path = x;
}

int main() {
	cin >> path;
	getPos();
	killFinish();

	if (start == finish - 1) {
		cout << "Impossible" << endl;
	} else {
		res2 = path.substr((start + finish) / 2 + 1, 26 - (start + finish) / 2 + 1);
		res1 = path.substr(0, (start + finish) / 2 + 1);
		res2 = reverse(res2);
		res1 = res2.substr(0, (int) res2.length() - 13) + res1;
		res2 = res2.substr((int) res2.length() - 13, res2.length());

		cout << res1 << endl << res2 << endl;
	}
}

#pragma GCC optimize ("Ofast")
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <algorithm>
#include <math.h>
#include <map>
#include <queue>
#include <set>

using namespace std;

int32_t main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    string s;
    cin>>s;
    vector <vector <char> > a(2,vector <char> (14));
    vector <int> used(26);
    for (int i = 0;i < 13;i++)
        {
            if (used[s[i]-'A']) {
                cout<<"Impossible";
                return 0;
            }
            ++used[s[i]-'A'];
            a[0][i] = s[i];
        }
        int p1 = 12;
    for (int i = 13;i < 27;i++)
    {
        if (used[s[i]-'A']) {
            if (a[0][p1-1]!=s[i] && a[0][p1]!=s[i] && a[0][p1+1]!=s[i]) {
                cout<<"Impossible";
                return 0;
            }
        }
        else {
        ++used[s[i]-'A'];
        a[1][p1] = s[i];
        --p1;
    }
    }
    for (int i = 0;i < 2;i++)
    {
        for (int j = 0;j < 13;j++)
        {
            cout<<a[i][j];
        }
        cout<<'\n';
    }
}

#include <iostream>
#include <vector>
#include <algorithm>
#include <stdio.h>
#include <sstream>
#include <string>
#include <map>
#include <set>
#include <stdlib.h>
#include <cmath>
#include <math.h>
#include <fstream>
#include <bitset>
using namespace std;
string s;
char dp[2][13];
map<char, int> mm;
int main(){
    std::ios::sync_with_stdio(false);
    cin >> s;
    char now;
    int d, ii;
    for (int i=0;i<27;i++){
        char ch = s[i];
        if (!mm.count(ch)){
            mm[ch] = i;
        }
        else{
            now = ch;
            d = i - mm[ch] - 1;
            ii = i + 1;
            break;
        }
    }
    if (d == 0){
        cout << "Impossible" << endl;
    }
    else{
        dp[0][(26 - d - 1) / 2] = now;
    }
    int pos = mm[now] + 1;
    int np = (26 - d - 1) / 2;
    int nnp = np - 1;
    bool change = false;
    while (d > 0){
         if (!change){
            if (np < 12){
                dp[0][np + 1] = s[pos];
                pos ++;
                np ++;
            }
            else{
                change = true;
                dp[1][np] = s[pos];
                np --;
                pos ++;
            }
         }
         else{
            dp[1][np] = s[pos];
            np --;
            pos ++;
         }
         d--;
    }
    bool go = false;
    while (ii < 27){
        if (!go){
            if (np > 0){
                dp[1][np] = s[ii];
                np --;
            }
            else{
                dp[1][np] = s[ii];
                go = true;
            }
        }
        else{
            dp[0][np] = s[ii];
            np ++;
        }
        ii ++;
    }
    pos = mm[now] - 1;
    go = false;
    while (pos >= 0){
        if (!go){
            if (nnp > 0){
                dp[0][nnp] = s[pos];
                nnp --;
            }
            else{
                dp[0][nnp] = s[pos];
                go = true;
            }
        }
        else{
            dp[1][nnp] = s[pos];
        }
        pos --;
    }
    for (int i=0;i<2;i++){
        for (int j=0;j<13;j++){
            cout << dp[i][j];
        }
        cout << endl;
    }
    return 0;
}

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
#include <unordered_map>
#include <set>
#include <stack>
#include <bitset>
#include <queue>
#include <map>
#include <errno.h>
#include <algorithm>

#define pb push_back
#define mp make_pair

#define x first
#define y second

typedef long long big;

using namespace std;

char a[2][13];

string s;
bool flag = false;
char theOne;

inline bool in(int x, int y) {
    return 0 <= x && x < 2 && 0 <= y && y < 13;
}

void dfs(int dep, int x, int y, bool same) {
    if (flag) {
        return;
    }
    if (dep == 27) {
        flag = true;
        return;
    }

    char c = s[dep];
    for (int xx = 0; xx < 2; xx++) {
        for (int yy = y - 1; yy < y + 2; yy++) {
            if (flag)
                return ;
            if (in(xx, yy) && (xx != x || yy != y) && (a[xx][yy] == 0 || (a[xx][yy] == c && !same))) {
                bool newSame = a[xx][yy] == c;
                a[xx][yy] = c;
                dfs(dep + 1, xx, yy, newSame);
                if (flag)
                    return ;
                a[xx][yy] = 0;
            }
        }
    }
}

int main() {
    cin >> s;
    for (int i = 0; i < 27; i++) {
        for (int j = i + 1; j < 27; j++)
            if (s[i] == s[j]) {
                theOne = s[i];
                if (j - i == 1) {
                    puts("Impossible");
                    return 0;
                }
            }
    }
    for (int i = 0; i < 2; i++) {
        for (int j = 0; j < 13; j++) {
            if (flag) {
                break;
            }
            memset(a, 0, sizeof(a));
            a[i][j] = s[0];
            dfs(1, i, j, false);
        }
    }
    if (!flag) {
        puts("Impossible");
    } else {
        for (int i = 0; i < 2; i++, puts("")) {
            for (int j = 0; j < 13; j++) {
                printf("%c", a[i][j]);
            }
        }
    }
}

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main()
{
	string line;
	getline(cin, line);
	vector<char> v;
	char special;
	int index, index2;
	for(char c : line)
	{
		auto a = find(v.begin(), v.end(),c);
		if(a!=v.end())
		{
			special=c;
			index=a-v.begin();
			index2=v.size();
			if(v[v.size()-1]==c)
			{
				cout<<"Impossible"<<endl;
				return 0;
			}
		}
		else
			v.push_back(c);
	}
	char res[2][26];
	int index3=(index2-index-1)/2;
	res[0][index3]=v[index];
	for(int i = 1; i <= index; i++)
	{
		if(index3+i<13)
			res[0][index3+i]=v[index-i];
		else if(12-(index3+i-13) >=0)
			res[1][12-(index3+i-13)]=v[index-i];
		else
			res[0][-1-(12-(index3+i-13))]=v[index-i];
	}
	for(int i = 1; i < v.size()-index; i++)
	{
		if(index3-i>=0)
			res[0][index3-i]=v[index+i];
		else if(-1-(index3-i) <13)
			res[1][-1-(index3-i)]=v[index+i];
		else
			res[0][12-(13-(-1-(index3-i)))]=v[index+i];
	}
	for(int i = 0; i <2; i++)
	{
		for(int j = 0; j < 13;j++)
			cout<<res[i][j];
		cout<<endl;
	}
	}

#pragma comment(linker, "/STACK:1024000000,1024000000")
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define MP(A, B) make_pair(A, B)
#define pb push_back
#define gcd __gcd
#define foreach(it,a) for(__typeof((a).begin()) it=(a).begin();it!=(a).end();it++)
#define rep(i, a, b) for(int i = a; i < b; i++)
#define per(i, a, b) for(int i = a; i > b; i--)
typedef long long ll;
typedef unsigned long long ulls;
typedef unsigned int uint;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vii;
typedef map<int, int> mii;
typedef map<string, int> msi;
typedef map<pii, int> mpi;
const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3fLL;
const int MOD = 1e9 + 7;
const double pi = acos(-1.0);
const double eps = 1e-6;
const int maxn = 1e3 + 5;
const int maxm = 1e6 + 5;
const int dx[] = {-1, 0, 1, 0, -1, -1, 1, 1};
const int dy[] = {0, 1, 0, -1, 1, -1, 1, -1};
inline int scan(int &a) { return scanf("%d", &a); }
inline int scan(int &a, int &b) { return scanf("%d%d", &a, &b); }
inline int scan(int &a, int &b, int &c) { return scanf("%d%d%d", &a, &b, &c); }
inline int scan(ll &a) { return scanf("%I64d", &a); }
inline int scan(ll &a, ll &b) { return scanf("%I64d%I64d", &a, &b); }
inline int scan(ll &a, ll &b, ll &c) { return scanf("%I64d%I64d%I64d", &a, &b, &c); }
inline int scan(double &a) { return scanf("%lf", &a); }
inline int scan(double &a, double &b) { return scanf("%lf%lf", &a, &b); }
inline int scan(double &a, double &b, double &c) { return scanf("%lf%lf%lf", &a, &b, &c); }
inline int scan(char &a) { return scanf("%c", &a); }
inline int scan(char *a) { return scanf("%s", a); }
template<class T> inline void mem(T &A, int x) { memset(A, x, sizeof(A)); }
template<class T0, class T1> inline void mem(T0 &A0, T1 &A1, int x) { mem(A0, x), mem(A1, x); }
template<class T0, class T1, class T2> inline void mem(T0 &A0, T1 &A1, T2 &A2, int x) { mem(A0, x), mem(A1, x), mem(A2, x); }
template<class T0, class T1, class T2, class T3> inline void mem(T0 &A0, T1 &A1, T2 &A2, T3 &A3, int x) { mem(A0, x), mem(A1, x), mem(A2, x), mem(A3, x); }
template<class T0, class T1, class T2, class T3, class T4> inline void mem(T0 &A0, T1 &A1, T2 &A2, T3 &A3, T4 &A4, int x) { mem(A0, x), mem(A1, x), mem(A2, x), mem(A3, x), mem(A4, x); }
template<class T0, class T1, class T2, class T3, class T4, class T5> inline void mem(T0 &A0, T1 &A1, T2 &A2, T3 &A3, T4 &A4, T5 &A5, int x) { mem(A0, x), mem(A1, x), mem(A2, x), mem(A3, x), mem(A4, x), mem(A5, x); }
template<class T0, class T1, class T2, class T3, class T4, class T5, class T6> inline void mem(T0 &A0, T1 &A1, T2 &A2, T3 &A3, T4 &A4, T5 &A5, T6 &A6, int x) { mem(A0, x), mem(A1, x), mem(A2, x), mem(A3, x), mem(A4, x), mem(A5, x), mem(A6, x); }
template<class T> inline T min(T a, T b, T c) { return min(min(a, b), c); }
template<class T> inline T max(T a, T b, T c) { return max(max(a, b), c); }
template<class T> inline T min(T a, T b, T c, T d) { return min(min(a, b), min(c, d)); }
template<class T> inline T max(T a, T b, T c, T d) { return max(max(a, b), max(c, d)); }
template<class T> inline T min(T a, T b, T c, T d, T e) { return min(min(min(a,b),min(c,d)),e); }
template<class T> inline T max(T a, T b, T c, T d, T e) { return max(max(max(a,b),max(c,d)),e); }
int cnt[26];
char s[30];
char out[2][13];
int main()
{
    #ifndef ONLINE_JUDGE
        freopen("in.txt", "r", stdin);
        // freopen("out.txt", "w", stdout);
        long _begin_time = clock();
    #endif

    scan(s); rep(i, 0, 27) cnt[s[i] - 'A']++;
    char c; rep(i, 0, 26) if(cnt[i] == 2) c = i + 'A';
    int l = -1, r = -1;
    rep(i, 0, 27) if(s[i] == c) {
        if(l == -1) l = i;
        else r = i;
    }
    if(l == r) return 0 * puts("-1");
    else
    {
        int tmp = r - l - 1;
        int add = tmp >> 1;
        for(int i = 12, j = l + add; i > 12 - add; i--, j--) out[0][i] = s[j];
        for(int i = 12, j = l + add + 1; j < r; i--, j++) out[1][i] = s[j];

        int j = 12 - add + 1, step = -1, k = 0;
        for(int i = r; i < 27; i++)
        {
            j += step;
            out[k][j] = s[i];
            if(k == 1) step = 1;
            else if(j == 0) step = 0, k = 1;
        }
        j++;
        for(int i = 0; i < l; i++) out[1][j++] = s[i];
    }
    rep(i, 0, 2) { rep(j, 0, 13) { printf("%c", out[i][j]); }printf("\n"); }

    #ifndef ONLINE_JUDGE
        long _end_time = clock();
        printf("time = %ld ms\n", _end_time - _begin_time);
    #endif

    return 0;
}

#include<stdio.h>
#include<iostream>
#include<string.h>
using namespace std;
char a[1500];
char ans[2][30];
int vis[30];
int tmp;
int Slove(int r,int c)
{
    memset(ans,' ',sizeof(ans));
    int x=r,y=c;
    int flag=0;
    int i=0;
    while(1)
    {
        if(i>=27)return 1;
        if(a[i]-'A'==tmp&&flag==1)
        {
            flag++;
            if(x==1)
            {
                if(ans[x-1][y]-'A'==tmp||ans[x-1][y+1]-'A'==tmp)
                {
                    i++;
                    continue;
                }
                else return 0;
            }
            else return 0;
        }
        if(a[i]-'A'==tmp&&flag==0)flag++;
        ans[x][y]=a[i];
        i++;
        if(x==0)
        {
            y++;
            if(y==13)y=12,x++;
        }
        else
        {
            y--;
            if(y<0)y=0,x--;
        }
    }
}
int main()
{
    while(~scanf("%s",a))
    {
        memset(vis,0,sizeof(vis));
        int n=strlen(a);
        for(int i=0;i<n;i++)
        {
            vis[a[i]-'A']++;
        }
        for(int i=0;i<26;i++)
        {
            if(vis[i]==2)tmp=i;
        }
        int flag=0;
        int flag2=0;
        for(int i=0;i<n-1;i++)
        {
            if(a[i]==a[i+1])
            {
                flag2=1;
                printf("Impossible\n");
                break;
            }
        }
        if(flag2==1)continue;
        for(int c=0;c<13;c++)
        {
            int tt=Slove(0,c);
            if(tt==1)
            {
                flag=1;
                for(int i=0;i<2;i++)
                {
                    for(int j=0;j<13;j++)
                    {
                        printf("%c",ans[i][j]);
                    }
                    printf("\n");
                }
            }
        }
        if(flag==0)
        {
            printf("Impossible\n");
        }
    }
}