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.Random;
import java.util.StringTokenizer;

public class C_special3
{
    public static final Random RANDOM = new Random(System.currentTimeMillis());
    private static BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));
    private static StringTokenizer stringTokenizer = null;
    private static PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));

    private static String next() throws IOException
    {
        while ((stringTokenizer == null) || (!stringTokenizer.hasMoreTokens()))
        {
            stringTokenizer = new StringTokenizer(bufferedReader.readLine());
        }
        return stringTokenizer.nextToken();
    }

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

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

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

    public static String nextLine() throws IOException
    {
        return bufferedReader.readLine();
    }

    public static void close()
    {
        out.close();
    }

    public static final long[] POWER2 = generatePOWER2();

    public static long[] generatePOWER2()
    {
        long[] result = new long[63];
        for (int x = 0; x < result.length; x++)
        {
            result[x] = 1L << x;
        }
        return result;
    }

    public static class Tuple2<T0, T1>
    {
        public final T0 v0;
        public final T1 v1;

        public Tuple2(T0 v0, T1 v1)
        {
            this.v0 = v0;
            this.v1 = v1;
        }
    }

    public static class Tuple2Comparable<T0 extends Comparable<? super T0>, T1 extends Comparable<? super T1>> extends Tuple2<T0, T1> implements Comparable<Tuple2Comparable<T0, T1>>
    {
        public Tuple2Comparable(T0 v0, T1 v1)
        {
            super(v0, v1);
        }

        @Override
        public int compareTo(Tuple2Comparable<T0, T1> that)
        {
            int result = this.v0.compareTo(that.v0);
            if (result == 0)
            {
                result = this.v1.compareTo(that.v1);
            }
            return result;
        }
    }

    public static void main(String[] args)
    {
        try
        {
            solve();
        } catch (IOException exception)
        {
            exception.printStackTrace();
        }
        close();
    }

    public static final Tuple2<Integer, Integer> indicesDouble(String s)
    {
        Tuple2<Integer, Integer> result = null;
        for (int secondDouble = 0; secondDouble < s.length(); secondDouble++)
        {
            for (int firstDouble = 0; firstDouble < secondDouble; firstDouble++)
            {
                if (s.charAt(secondDouble) == s.charAt(firstDouble))
                {
                    result = new Tuple2<>(firstDouble, secondDouble);
                }
            }
        }
        return result;
    }

    public static String reverse(String s)
    {
        String result = "";
        for (int index = s.length() - 1; index >= 0; index--)
        {
            result += s.charAt(index);
        }
        return result;
    }

    public static Tuple2<Integer, Integer> next(Tuple2<Integer, Integer> position)
    {
        int row = position.v0;
        int column = position.v1;
        if (row == 0)
        {
            if (column == 0)
            {
                row = 1;
            }
            else
            {
                column -= 1;
            }
        }
        else
        {
            if (column == 12)
            {
                row = 0;
            }
            else
            {
                column += 1;
            }
        }
        return new Tuple2<>(row, column);
    }

    public static char[][] solve(String s)
    {
        char[][] result;
        Tuple2<Integer, Integer> indicesDouble = indicesDouble(s);
        int firstDouble = indicesDouble.v0;
        int secondDouble = indicesDouble.v1;
        int distance = secondDouble - firstDouble;
        if (distance == 1)
        {
            result = null;
        }
        else
        {
            result = new char[2][13];
            Tuple2<Integer, Integer> position = new Tuple2<>(0, (distance - 1) / 2);
            for (int index = firstDouble; index < firstDouble + s.length(); index++)
            {
                int row = position.v0;
                int column = position.v1;
                if (index != secondDouble)
                {
                    result[row][column] = s.charAt(index % s.length());
                    position = next(position);
                }
            }
        }
        return result;
    }

    public static String print(char[][] grid)
    {
        String result;
        if (grid == null)
        {
            result = "Impossible";
        }
        else
        {
            result = "";
            for (int indexRow = 0; indexRow < 2; indexRow++)
            {
                for (int indexColumn = 0; indexColumn < 13; indexColumn++)
                {
                    result += grid[indexRow][indexColumn];
                }
                result += "\n";
            }
        }
        return result;
    }

    public static void solve() throws IOException
    {
        String s = next();
        out.print(print(solve(s)));
    }
}