Problem: Let’s define a grid to be a set of tiles with 2 rows and 13 columns. Each tile has an English letter written in it. The letters don't have to be unique: there might be two or more tiles with the same letter written on them. Here is an example of a grid:
    
    
    ABCDEFGHIJKLM  
    NOPQRSTUVWXYZ

We say that two tiles are adjacent if they share a side or a corner. In the example grid above, the tile with the letter 'A' is adjacent only to the tiles with letters 'B', 'N', and 'O'. A tile is not adjacent to itself.

A sequence of tiles is called a path if each tile in the sequence is adjacent to the tile which follows it (except for the last tile in the sequence, which of course has no successor). In this example, "ABC" is a path, and so is "KXWIHIJK". "MAB" is not a path because 'M' is not adjacent to 'A'. A single tile can be used more than once by a path (though the tile cannot occupy two consecutive places in the path because no tile is adjacent to itself).

You’re given a string s which consists of 27 upper-case English letters. Each English letter occurs at least once in s. Find a grid that contains a path whose tiles, viewed in the order that the path visits them, form the string s. If there’s no solution, print "Impossible" (without the quotes).

Input

The only line of the input contains the string s, consisting of 27 upper-case English letters. Each English letter occurs at least once in s.

Output

Output two lines, each consisting of 13 upper-case English characters, representing the rows of the grid. If there are multiple solutions, print any of them. If there is no solution print "Impossible".

Examples

Input

ABCDEFGHIJKLMNOPQRSGTUVWXYZ


Output

YXWVUTGHIJKLM
ZABCDEFSRQPON


Input

BUVTYZFQSNRIWOXXGJLKACPEMDH


Output

Impossible

Solution (in JAVA):

Solution:
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());
        }
    }

}