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.lang.reflect.Array;
import java.math.BigInteger;
import java.util.*;

public class CodeForces {
    private final BufferedReader reader;
    private final PrintWriter writer;
    private StringTokenizer tokenizer;

    private void solve() {
        String in = next();
        boolean isHere[] = new boolean[26];
        int start, end;
        start = end = -1;
        for (int i = 0; i < in.length(); i++) {
            if (isHere[in.charAt(i) - 'A']) {
                end = i;
                start = in.indexOf(in.charAt(i));
            } else {
                isHere[in.charAt(i) - 'A'] = true;
            }
        }
        if (end - start == 1) {
            writer.print("Impossible");
        } else {
            int diff = end - start - 1;
            int count1 = diff / 2;
            int count2 = diff % 2 == 0 ? count1 : count1 + 1;
            StringBuilder r1 = new StringBuilder(in.substring(start + 1, start + count1 + 1));
            StringBuilder r2 = new StringBuilder(in.substring(start + count1 + 1, end));
            StringBuilder res1 = new StringBuilder(in.substring((Math.max(0, start - (13 - count1 - 1))), start + 1));
            res1.append(r1);
            StringBuilder res2 = new StringBuilder(in.substring(end + 1, Math.min(27, end + (13 - count2) + 1)));
            res2.reverse();
            r2.reverse();
            res2.append(r2);
            if (res1.length() < 13) {
                res1.insert(0, in.substring(end + (13 - count2) + 1, 27));
            } else {
                StringBuilder temp = new StringBuilder(in.substring(0, start - (13 - count1 - 1)));
                temp.reverse();
                res2.insert(0, temp);
            }
            writer.println(res1);
            writer.println(res2);
        }
    }

    public static void main(String[] args) {
        new CodeForces(System.in, System.out);
    }

    private CodeForces(InputStream inputStream, OutputStream outputStream) {
        this.reader = new BufferedReader(new InputStreamReader(inputStream));
        this.writer = new PrintWriter(outputStream);
        solve();
        writer.close();
    }

    private String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            tokenizer = new StringTokenizer(readLine());
        }
        return tokenizer.nextToken();
    }

    private String readLine() {
        String line;
        try {
            line = reader.readLine();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
        return line;
    }

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

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

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

    public boolean hasNext() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            String line = readLine();
            if (line == null) {
                return false;
            }
            tokenizer = new StringTokenizer(line);
        }
        return true;
    }

    public BigInteger nextBigInteger() {
        return new BigInteger(next());
    }

    public static int upperBinarySearch(int[] array, int start, int finish, int key) {
        int low = 0;
        int high = array.length - 1;
        if (high < 0) return -1;
        while (low < high) {
            int mid = (low + high + 1) >>> 1;
            if (array[mid] <= key) low = mid;
            else high = mid - 1;
        }
        if (array[low] != key) {
            if (array[low] < key) low++;
            low = -(low + 1);
        }
        return low;
    }
}