package net.ipipip0129.yukicoder.no587; import java.util.*; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); //文字列ソート処理 List piece_list = Arrays.asList(scan.nextLine().split("")); Collections.sort(piece_list); String piece = ""; for (String tile : piece_list) piece += tile; // テキスト終了用 0x03 付与 piece += String.valueOf((char) 0x03); scan.close(); char missing = 0x00; boolean isError = false; while (piece.length() != 0 && !isError){ char c_pair = 0x00; for (int i = 0; i < piece.length() ; i++){ if (i == 0) c_pair = piece.charAt(i); else { if (c_pair != piece.charAt(i)) { if (i == 1){ if (missing == 0x00) { missing = c_pair; }else { isError = true; } } else if(3 <= i){ isError = true; } piece = piece.replaceAll(String.valueOf(c_pair), ""); break; } } } //残テキストが0x03のみなら終了 if (piece.charAt(0) == 0x03) { break; } } if (isError || missing == 0x00) { System.out.println("Impossible"); }else { System.out.println(missing); } } }