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.util.*;
import java.io.*;
import java.lang.*;


public class Codeforcecontest {

	int arr[];
	int prep[];
	int n,m,min;

	public Codeforcecontest(int n,int m)
	{
		arr = new int[n];
		prep = new int[m];

		this.n = n; 
		this.m = m;
		min = Integer.MAX_VALUE;
	}

	public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		Scanner s = new Scanner(System.in);
		String str = s.next();
		char arr[][] = new char[2][13];
		for(int i=0;i<2;i++)
			for(int j=0;j<13;j++)
				arr[i][j] = '!';
		boolean flag = true;
		char ax[] = str.toCharArray();
		HashMap<Character, Integer>map = new HashMap<>();
		char two='-';
		for(int i=0;i<27;i++)
		{
			if(map.containsKey(ax[i]))
				two = ax[i];
			else
				map.put(ax[i], 1);
		}
		
		int index1=-1,index2 = -1;
		for(int i=0;i<27;i++)
		{
			if(ax[i]==two)
			{
				if(index1==-1)
					index1=i;
				else
					index2 = i;
			}
		}
		
		if(index2-index1==1)
			System.out.println("Impossible");
		else
		{
			HashMap<Character, Integer>check = new HashMap<>();
			int indi = 0;//2 row
			int i=0,j=0;
			int diff = index2 - index1;
			diff/=2;
			int mid  = (index1 + index2)/2;
			
			for(i = mid;i>=index1+1;i--)
			{
				arr[1][indi] = ax[i];
				check.put(ax[i], 1);
				indi++;
			}
			
		//	arr[0][indi] = two;
			int indi2 = 0; // first row
			for( i=mid+1;i<=index2-1;i++)
			{
				arr[0][indi2] = ax[i];
				check.put(ax[i],1);
				indi2++;
			}
			arr[0][indi2] = two;
			indi2++;
			int multi = 1;
			int start = 0;
			for(i = index1-1;i>=0;i--)
			{
				if(indi2>=13)
				{
					indi2 = 12;
					start=1;
					multi *=-1;
				}
				
				arr[start][indi2] = ax[i];
				indi2+=multi;
			}
			
			start = 1;
			multi = 1;
			for(i = index2+1;i<27;i++)
			{
				if(indi>=13)
				{
					indi = 12;
					start = 0;
					multi *=-1;
				}
				arr[start][indi] = ax[i];
				indi+=multi;
			}
			
			for( i=0;i<2;i++)
			{
				for( j=0;j<13;j++)
				{
					System.out.print(arr[i][j]+"");
				}
				System.out.println();
			}
			
		}
		
	}

}