// Arup Guha
// 4/17/2015
// Solution to 2012 NCPC Problem I: Infiltration

import java.util.*;

public class infiltration {

	final public static String[] WORDS = {"be","our","rum","will","dead","hook",
							"ship","blood","sable","avenge","parrot","captain"};

	final public static String TOOMANY = "TOOMANY";

	public static void main(String[] args) {

		// Read in the line.
		Scanner stdin = new Scanner(System.in);
		String line = stdin.nextLine();

		int lineMask = getMask(line);

		// Tokenize.
		StringTokenizer tok = new StringTokenizer(line);
		String[] cipherWords = new String[tok.countTokens()];
		for (int i=0; i<cipherWords.length; i++)
			cipherWords[i] = tok.nextToken();

		String plain = null;

		// Try each subset of words.
		for (int mask=1; mask<(1<<WORDS.length); mask++) {

			// Determine the mask for this subset.
			int wordMask = 0;
			for (int i=0; i<WORDS.length; i++)
				if ((mask & (1 << i)) > 0)
					wordMask = wordMask | getMask(WORDS[i]);

			// These must match exactly.
			if (Integer.bitCount(wordMask) != Integer.bitCount(lineMask)) continue;

			// Try solving this.
			String cur = trySol(mask, line, cipherWords);

			// Too many solutions.
			if (cur != null && cur.equals(TOOMANY)) {
				plain = TOOMANY;
				break;
			}

			// Adjust our answer for the first solution.
			if (plain == null && cur != null) plain = cur;

			// See if we have too many solutions.
			if (cur != null && plain != null && !cur.equals(plain)) {
				plain = TOOMANY;
				break;
			}
		}

		// Output solution.
		if (plain == null || plain.equals(TOOMANY)) System.out.println("Impossible");
		else System.out.println(plain);
	}

	// Returns a mask storing the set of covered characters in s that are lowercase letters.
	public static int getMask(String s) {
		int mask = 0;
		for (int i=0; i<s.length(); i++)
			if (Character.isLowerCase(s.charAt(i)))
				mask = mask | (1 << (s.charAt(i)-'a'));
		return mask;
	}

	public static String trySol(int mask, String line, String[] list) {

		// Keep track of what we've matched in words.
		boolean[] used = new boolean[list.length];

		// Keep track of what letters are mapped to what so far.
		char[] sub = new char[26];
		Arrays.fill(sub, ' ');

		// Store all solutions here.
		ArrayList<String> allSols = new ArrayList<String>();

		// Initial recursive call.
		trySolRec(mask, sub, list, used, allSols);

		// No answers.
		if (allSols.size() == 0) return null;

		// We had more than one mapping. See if these are unique at all.
		if (allSols.size() > 1) {
			for (int i=1; i<allSols.size(); i++)
				if (!allSols.get(i).equals(allSols.get(0)))
					return TOOMANY;
		}

		// Execute substitution in line and return.
		return substitute(line, sub);
	}

	public static void trySolRec(int mask, char[] sub, String[] list, boolean[] used, ArrayList<String> mappings) {

		// We've mapped everything add to our list.
		if (mask == 0) {
			mappings.add(new String(sub));
			return;
		}

		// To reduce run time, go from biggest words to smallest.
		int itemVal = Integer.highestOneBit(mask);
		int itemLoc = getLoc(itemVal);

		// So we can recover the original.
		char[] thissub = Arrays.copyOf(sub, 26);

		// Try subbing for each ciphertext word.
		for (int i=0; i<list.length; i++) {

			// Not valid.
			if (used[i] || list[i].length() != WORDS[itemLoc].length()) continue;

			// Substitution causes a conflict.
			if (conflict(sub, list[i], WORDS[itemLoc])) continue;

			// Add it to our list.
			addSub(sub, list[i], WORDS[itemLoc]);
			used[i] = true;

			// Explore this branch.
			trySolRec(mask-itemVal, sub, list, used, mappings);

			// Restore state for next substitution.
			used[i] = false;
			sub = thissub;
		}
	}

	// There has to be a better way to do this...
	public static int getLoc(int pow2) {
		int ans = 0;
		while (pow2 > 1) {
			ans++;
			pow2 = (pow2 >> 1);
		}
		return ans;
	}

	// Catches conflicts, doesn't make any changes to sub.
	public static boolean conflict(char[] sub, String oldStr, String newStr) {
		char[] tmp = Arrays.copyOf(sub, 26);
		for (int i=0; i<oldStr.length(); i++) {
			if (tmp[oldStr.charAt(i)-'a'] != ' ' && tmp[oldStr.charAt(i)-'a'] != newStr.charAt(i))
				return true;
			else
				tmp[oldStr.charAt(i)-'a'] = newStr.charAt(i);
		}
		return false;
	}

	// Pre-condition: safe to add this substition. Does the substitution oldStr -> newStr.
	public static void addSub(char[] sub, String oldStr, String newStr) {
		for (int i=0; i<oldStr.length(); i++)
			sub[oldStr.charAt(i)-'a'] = newStr.charAt(i);
	}

	public static String substitute(String line, char[] sub) {

		// Do manually, sub out all lowercase letters.
		char[] res = new char[line.length()];
		for (int i=0; i<line.length(); i++) {
			if (Character.isLowerCase(line.charAt(i)))
				res[i] = sub[line.charAt(i)-'a'];
			else
				res[i] = line.charAt(i);
		}

		// Here is our answer.
		return new String(res);
	}
}