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NIRFPL
DSJEWKMUZYAHO
 Impossible
 UVWXYZABCDEFG
TSRQPONMLKJIH
 LMNOPQRSTUVWY
KJIHGFEDCBAZX
 SHBGLRJAMDUIP
TXFQKNEVZOYWC
 OURNQJWMIXCLG
HPTYBFAZKEVDS
 BETRFOVLPCMWK
NIZJYQDUGSXAH
 BUVTYZFQSNRIW
HDMEPCAKLJGXO
 QWERTYUIOPASD
MNBVCXZLKJHGF
 OWJXRKHZDNGLS
UPFCVBQTYIEMA
 QGZEMFKWLUHOV
BANDRYIPCTJXS
 NMGIFDZKBCVRY
JPQUEHXSAOWTL
 Impossible
 XCDSLTYWJIGUB
EOKRAQMVZFNHP
 PQRSTUVWXYZAB
ONMLKJIHGFEDC
 CPFJBHINOWVLA
EXKDSQYZRMUTG
 TGDEJHCBKRWLY
UZXIPMVQANOSF
 KFYAMVOHUJLED
SBTQIPGRNXZWC
 Impossible
 DTJLGRFUXQSOZ
HIBNAPCWKYVME

/******************************************[ author : SATISH_S    ]*********************************************************************/

#include<bits/stdc++.h>

using namespace                        std;

#define int                            long long
#define ul                             unsigned long long
#define pi                             pair<int,int>
#define pq                             priority_queue
#define For(it,x)                      for(auto it=(x).begin();it!=(x).end();it++)
#define pushb                          push_back
#define PI                             3.14159265
#define popb                           pop_back
#define endl                           '\n'
#define  min_pq(T)                     pq<T,vector<T>,greater<T>>
#define  max_pq(T)                     pq<T,vector<T>>
#define found(a,b)                     a.find(b)!=a.end()

template<typename T>
T min(T a,T b,T c)                    {return min(a,min(b,c));}
template<typename T>
T max(T a,T b,T c)                    {return max(a,max(b,c));}
template<typename T>
T max(T a,T b,T c,T d)                {return max(a,max(b,max(c,d)));}


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

#define op(mp)                        mp.reserve(1024); mp.max_load_factor(0.25);


/*#####################################################################################################################################*/
template<typename T>
void read(vector<T>&arr,int N)        {arr.clear();	arr.resize(N);for(int i=0;i<N;i++)cin>>arr[i];}

template<typename T>
void read(vector<pair<T,T>>&arr,int N)
                                      {arr.clear();arr.resize(N);for(int i=0;i<(int)arr.size();i++)cin>>arr[i].first>>arr[i].second;}

template<typename T>
void read(vector<vector<T>>&arr,int N,int M)
                                      {arr.clear();arr.resize(N,vector<T>(M));for(int i=0;i<N;i++){for(int j=0;j<M;j++)cin>>arr[i][j];}}

/*###################################################################################################################################*/

#ifndef Debuger
#define n_l '\n'
#define print(...) cout << "[" << #__VA_ARGS__ << "]: "; cout << to_string(__VA_ARGS__) << endl

template<typename T, size_t N>
int SIZE(const T (&t)[N]) { return N; }

template<typename T>
                                     int SIZE(const T &t) { return t.size(); }

string to_string(const string s, int x1 = 0, int x2 = 1e9) {
                                     return '"' + ((x1 < s.size()) ? s.substr(x1, x2 - x1 + 1) : "") + '"';
                                     }

string to_string(const char *s)      { return to_string((string) s); }

string to_string(const bool b)       { return (b ? "true" : "false"); }

string to_string(const char c)       { return string({c}); }

template<size_t N>
string to_string(const bitset<N> &b, int x1 = 0, int x2 = 1e9) {
                                    string t = "";
                                    for (int __iii__ = min(x1, SIZE(b)), __jjj__ = min(x2, SIZE(b) - 1);
                                         __iii__ <= __jjj__; ++__iii__) { t += b[__iii__] + '0'; }
                                    return '"' + t + '"';}

template<typename A, typename... C>
                                    string to_string(const A (&v), int x1 = 0, int x2 = 1e9, C... coords);

int l_v_l_v_l = 0, t_a_b_s = 0;

template<typename A, typename B>
string to_string(const pair<A, B> &p) {
                                    l_v_l_v_l++;
                                    string res = "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
                                    l_v_l_v_l--;
                                    return res;}

template<typename A, typename... C>
string to_string(const A (&v), int x1, int x2, C... coords) {
                                    int rnk = rank<A>::value;
                                    string tab(t_a_b_s, ' ');
                                    string res = "";
                                    bool first = true;
                                    if (l_v_l_v_l == 0) res += n_l;
                                    res += tab + "[";
                                    x1 = min(x1, SIZE(v)), x2 = min(x2, SIZE(v));
                                    auto l = begin(v);
                                    advance(l, x1);
                                    auto r = l;
                                    advance(r, (x2 - x1) + (x2 < SIZE(v)));
                                    for (auto e = l; e != r; e = next(e)) {
                                        if (!first) { res += ", "; }
                                        first = false;
                                        l_v_l_v_l++;
                                        if (e != l) {
                                            if (rnk > 1) {
                                                res += n_l;
                                                t_a_b_s = l_v_l_v_l;
                                            };
                                        }
                                        else { t_a_b_s = 0; }
                                        res += to_string(*e, coords...);
                                        l_v_l_v_l--;
                                    }
                                    res += "]";
                                    if (l_v_l_v_l == 0) res += n_l;
                                    return res;
}

void printm() { ; }

template<typename Heads, typename... Tails>
                                    void printm(Heads H, Tails... T) {
                                        cout << to_string(H) << " | ";
                                        printm(T...);}

#define printm(...) cout << "[" << #__VA_ARGS__ << "]: "; printm(__VA_ARGS__); cout << endl
#endif


/*####################################################################################################################################*/


/*########################################### [ DATA STRUCTURE ] #####################################################################*/


bool lexi(string&s1,string &s2)     {
    int I=s1.size(),J=s2.size(),i=0,j=0;
    while(i<I and j<J){
        if(s1[i]>s2[j])
            return true;
        if(s1[i]<s2[j])
            return false;
        i++;j++;
    }
    if(I>=J)  //strictly smaller
        return true;
    return false;
}


struct kmp{
    string s;
    vector<int>lps;
    int M;
    void init(string &pat){
        s=pat;
        M=s.size();
        lps.resize(M);
        build();
    }
    void build(){
        int i=0,j=1;
        while(j<M){
            if(s[i]==s[j]){
                lps[j]=i+1;
                i++;
                j++;
            }
            else{
                while(i>0){
                    i=lps[i-1];
                    if(s[i]==s[j]){
                        lps[j]=i+1;
                        i+=1;
                        break;
                    }
                }
                j++;
            }
        }
    }

    bool search(string &S){
        int j=0;
        for(int i=0;i<(int)S.size();i++){
            if(S[i]==s[j]){
                j++;
            }
            else{
                while(j>0){
                    j=lps[j-1];
                    if(S[i]==s[j]){
                        j+=1;
                        break;
                    }
                }
            }

            if(j==M){
                return true;
            }
        }
        return false;
    }
};


/*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/

struct uf {
    vector< int > par, size;

    void init(int N) {
        par.resize(N, -1);
        size.resize(N, 1);
    }

    int root(int a) {
        if (par[a] == -1)
            return a;
        return par[a] = root(par[a]);
    }

    void unite(int a, int b) {
        a = root(a);
        b = root(b);
        if (a == b) //same parent do nothing
            return;
        if (size[a] < size[b]) {
            par[a] = b;
            size[b] += size[a];
        } else {
            par[b] = a;
            size[a] += size[b];
        }
    }

    bool same(int a, int b) {
        if (root(a) == root(b))
            return true;

        return false;
    }
};

/*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/

struct seg_tree {
    vector<int> make;
    int siz;
    vector<int> arr;
    vector<int>lazy;

    void init(vector<int> &a, bool max, bool range) {
        arr.clear();
        make.clear();
        arr = a;
        siz = arr.size();
        make.resize(4 * siz);
        if (max)
            build_max(0, 0, siz - 1);
        else if (range) {
            //lazy.resize(4*siz);
            build_range(0, 0, siz - 1);
        }
    }

    int get_max(int L, int R) {
        return Get_max(0, 0, siz - 1, L, R);
    }

    void update_max(int index, int val) {
        Update_max(0, 0, siz - 1, index, val);
        return;
    }

    int get_sum(int L, int R) {
        return Get_sum(0, 0, siz - 1, L, R);
    }

    void update_range(int index, int add) {
        Update_range(0, 0, siz - 1, index, add);
        return;
    }

    void update_interval(int l,int r,int value){
        Update_interval(0,0,siz-1,l,r,value);
    }

    void Update_interval(int ind,int L,int R,int Left,int Right,int value){

        if(lazy[ind]!=0){
            make[ind]+=(R-L+1)*lazy[ind];
            if(L!=R){
                lazy[2*ind+1] += lazy[ind];
                lazy[2*ind+2] += lazy[ind];
            }
            lazy[ind]=0;
        }

        if(L>Right or R<Left)
           return;

       if(Left<=L and R<=Right){
           make[ind]+=(R-L+1)*value;
           if(L!=R){
               lazy[2*ind+1]=value;
               lazy[2*ind+2]=value;
           }
           return;
       }

       int mid=(L+R)/2;
       Update_interval(2*ind+1,L,mid,Left,Right,value);
       Update_interval(2*ind+2,mid+1,R,Left,Right,value);
       make[ind]=make[2*ind+1]+make[2*ind+2];

    }


    int build_range(int ind, int L, int R) {
        if (L == R) {
            make[ind] = arr[L];
            return make[ind];
        } else {
            int mid = (L + R) / 2;
            int a = build_range(2 * ind + 1, L, mid);
            int b = build_range(2 * ind + 2, mid + 1, R);
            make[ind] = a + b;
            return make[ind];
        }
    }

    int Get_sum(int ind, int L, int R, int Left, int Right) {

        /*
         if(lazy[ind]!=0) {
            make[ind]+=(R-L+1)*lazy[ind];
            if(L!=R){
                lazy[2*ind+1]=lazy[ind];
                lazy[2*ind+2]=lazy[ind];
            }
            lazy[ind]=0;
         }

         */


        if (L > Right or R < Left)
            return 0;
        if (Left <= L and R <= Right)
            return make[ind];
        int mid = (L + R) / 2;
        int a = Get_sum(2 * ind + 1, L, mid, Left, Right);
        int b = Get_sum(2 * ind + 2, mid + 1, R, Left, Right);
        return a + b;
    }


    void Update_range(int ind, int L, int R, int index, int add) {
        if (L == R) {
            make[ind] = add;
            arr[index] = add;
        } else {
            int mid = (L + R) / 2;
            if (L <= index and index <= R) {
                Update_range(2 * ind + 1, L, mid, index, add);
            } else {
                Update_range(2 * ind + 2, mid + 1, R, index, add);
            }
            make[ind] = make[2 * ind + 1] + make[2 * ind + 2];
        }
    }


    int build_max(int ind, int L, int R) {
        if (L == R) {
            make[ind] = arr[L];
            return make[ind];
        } else {
            int mid = (L + R) / 2;
            return make[ind] = max(build_max(2 * ind + 1, L, mid), build_max(2 * ind + 2, mid + 1, R));
        }
    }


    int Get_max(int ind, int L, int R, int Left, int Right) {

        if (R < Left or L > Right)
            return -1e15;

        if (Left <= L and R <= Right)
            return make[ind];

        int mid = (L + R) / 2;
        return max(Get_max(2 * ind + 1, L, mid, Left, Right), Get_max(2 * ind + 2, mid + 1, R, Left, Right));
    }


    int Update_max(int ind, int L, int R, int index, int val) {

        if (L == R) {
            arr[index] = val;
            make[ind] = val;
            return val;
        } else {
            int mid = (L + R) / 2;
            if (L <= index and index <= mid) {
                make[ind] = Update_max(2 * ind + 1, L, mid, index, val);
            } else {
                make[ind] = Update_max(2 * ind + 2, mid + 1, R, index, val);
            }
            make[ind] = max(make[2 * ind + 1], make[2 * ind + 2]);
            return make[ind];
        }
    }


};


/*######################################################################################################################################*/

static bool comp(pi& a,pi& b){
    if(a.first<b.first)
        return true;
    if(a.first==b.first){
        if(a.second<b.second)
            return true;
    }
    return false;
}

int lcm(int a,int b){

    return (a*b)/__gcd(a,b);
}


/*############################################## [ END ] ###############################################################################*/

static bool comp1(vector<int>& a,vector<int>& b){

    if(a[0]<b[0])
        return true;
    if(a[0]==b[0] and a[1]>b[1])
        return true;
    return false;
}

/*############################################## [SOLVE] ###############################################################################*/
// clear before use

int Max=1e17,Min=-1e17;
int N,M,K,D;
int mod=1e9+7;int P=97;
//vector<int>arr,brr;
vector<string>ss={"*************","*************"};
string s;


void flip(){

    vector<char>corner={ss[0][0],ss[0][12],ss[1][0],ss[1][12]};

    for(int i=12;i>0;i--)
        ss[0][i]=ss[0][i-1];

    for(int i=0;i<12;i++)
        ss[1][i]=ss[1][i+1];

    ss[0][0]=corner[2];
    ss[1][12]=corner[1];
}

bool check(int ind,int x,int y){

    if(ind==27)
        return true;

    if(ind==0){
        for(int i=0;i<2;i++){
            for(int j=0;j<13;j++){
                if(ss[i][j]==s[ind]){
                    return check(ind+1,i,j);
                }
            }
        }
        return false;
    }

    if(x+1<2){
        if(ss[x+1][y]==s[ind])
            return check(ind+1,x+1,y);

        if(y-1>=0 and ss[x+1][y-1]==s[ind])
            return check(ind+1,x+1,y-1);

        if(y+1<13 and ss[x+1][y+1]==s[ind])
            return check(ind+1,x+1,y+1);
    }

    if(x-1>=0){

        if(ss[x-1][y]==s[ind])
            return check(ind+1,x-1,y);

        if(y-1>=0 and ss[x-1][y-1]==s[ind])
            return check(ind+1,x-1,y-1);

        if(y+1<13 and ss[x-1][y+1]==s[ind])
            return check(ind+1,x-1,y+1);

    }

    if(y+1<13 and ss[x][y+1]==s[ind])
        return check(ind+1,x,y+1);
    if(y-1>=0 and ss[x][y-1]==s[ind])
        return check(ind+1,x,y-1);

    return false;


}

void solve(){

    cin>>s;
    vector<bool>used(26);
    int I=0,J=0;
    for(int i=0;i<27;i++){
        if(i+1<27 and s[i]==s[i+1]){
            cout<<"Impossible"<<endl;
            return;
        }
        if(used[s[i]-'A']==false){
            used[s[i]-'A']=true;
            ss[I][J++]=s[i];
            if(J==13){
                I=1;
                J=0;
            }
        }
    }

    reverse(ss[1].begin(),ss[1].end());





   while(true){

        if(check(0,-1,-1)){
            for(int i=0;i<2;i++){
                for(int j=0;j<13;j++)
                    cout<<ss[i][j];
                cout<<endl;
            }
            return;
        }
        print(ss);
        flip();
    }



}

/*############################################### [ MAIN ]  #############################################################################*/

signed main() {

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

    auto start_time = chrono::high_resolution_clock::now();


    bool test =       0               ;


    if (!test) solve();
    else {
        long long tt;
        cin >> tt;
        while (tt--)solve();
    }


    auto end_time = chrono::high_resolution_clock::now();

#ifndef ONLINE_JUDGE
    double time_taken = chrono::duration_cast< chrono::nanoseconds >(end_time - start_time).count();
    time_taken *= 1e-9;
    cout << endl<<endl<< "{ time taken by program :" << fixed << time_taken << setprecision(9) << " sec }";
#endif
    return 0;
}


/*###########################################[ EXTRA ] #################################################################################*/
//#define deb(x) cout<<#x<<" is "<<x<<endl;
/*void prims(vector<vector<int>>&arr,int start){

	if(v[start]==true)
		return;

	int mini=1e8;
	int nstart=-1;
	v[start]=true;
	for(auto it:arr[start]){
		if(v[it]==false and mini>w[{start,it}]){
			nstart=it;
			mini=w[{start,it}];
		}
	}
	if(nstart!=-1)
		prims(arr,nstart);
}
*/
