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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

import java.io.*;
import java.util.*;
import static java.lang.Math.*;

public class Main {
    FastScanner in;
    PrintWriter out;

    static final String FILE = "";

    String temp;
    int povt;
    char c;

    boolean gen(int v) {
        StringBuffer[] buffers = new StringBuffer[2];
        for (int i = 0; i < 2; i++) {
            buffers[i] = new StringBuffer();
            buffers[i].setLength(13);
        }

        int cur = 0;
        for (int i = v; i < 13; i++) {
            if (cur == povt)
                return false;
            buffers[0].setCharAt(i, temp.charAt(cur++));
        }
        for (int i = 12; i >= 0; i--) {
            if (cur == povt) {
                if (buffers[0].charAt(i) == c || (i + 1 < 13 && buffers[0].charAt(i + 1) == c)) {

                } else {
                    return false;
                }
                cur++;
                i++;
            } else {
                buffers[1].setCharAt(i, temp.charAt(cur++));
            }
        }

        if (cur == povt) {
            if (buffers[0].charAt(0) == c) {

            } else {
                return false;
            }
            cur++;
        } else if (cur < povt) {
            return false;
        }

        for (int i = 0; i < v; i++) {
            if (cur == povt)
                return false;
            buffers[0].setCharAt(i, temp.charAt(cur++));
        }


        out.println(buffers[0]);
        out.println(buffers[1]);
        return true;
    }

    void test() {
        int n = 100;
        for (int i = 0; i < n; i++) {
            StringBuffer buffer = new StringBuffer();

        }
    }

    void solve() {
        temp = in.next();
        Set<Character> set = new TreeSet<>();
        for (int i = 0; i < 27; i++) {
            if (i > 0 && temp.charAt(i) == temp.charAt(i - 1)) {
                out.print("Impossible");
                return;
            }
            if (set.contains(temp.charAt(i))) {
                povt = i;
                c = temp.charAt(i);
                break;
            }
            set.add(temp.charAt(i));
        }

        for (int i = 0; i < 13; i++) {
            if (gen(i))
                return;
        }

        temp = new StringBuffer(temp).reverse().toString();
        set = new TreeSet<>();
        for (int i = 0; i < 27; i++) {
            if (i > 0 && temp.charAt(i) == temp.charAt(i - 1)) {
                out.print("Impossible");
                return;
            }
            if (set.contains(temp.charAt(i))) {
                povt = i;
                c = temp.charAt(i);
                break;
            }
            set.add(temp.charAt(i));
        }

        for (int i = 0; i < 13; i++) {
            if (gen(i))
                return;
        }

        set = new TreeSet<>();
        for (int i = 26; i >= 0; i--) {
            if (set.contains(temp.charAt(i))) {
                povt = i;
                c = temp.charAt(i);
                break;
            }
            set.add(temp.charAt(i));
        }

        for (int i = 0; i < 13; i++) {
            if (gen(i))
                return;
        }

        out.print("Impossible");
    }

    public void run() {
        if (FILE.equals("")) {
            in = new FastScanner(System.in);
            out = new PrintWriter(System.out);
        } else {
            try {
                in = new FastScanner(new FileInputStream(FILE +
                        ".in"));
                out = new PrintWriter(new FileOutputStream(FILE +
                        ".out"));
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }
        }
        solve();
        out.close();
    }

    public static void main(String[] args) {
        (new Main()).run();
    }

    class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        public FastScanner(InputStream is) {
            br = new BufferedReader(new InputStreamReader(is));
        }

        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        public String nextLine() {
            st = null;
            try {
                return br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
                return null;
            }
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public float nextFloat() {
            return Float.parseFloat(next());
        }
    }

}