import java.util.Scanner; // No.587 七対子 public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String haipai = sc.next(); StringBuilder machi = new StringBuilder(); for(int i = 0; i < 13; i++) { String pai = haipai.substring(i, i + 1); if(count(pai, haipai) == 2) { continue; } else if(count(pai, haipai) == 1) { machi.append(pai); if(machi.length() != 1) { machi = new StringBuilder("Impossible"); break; } } else { machi = new StringBuilder("Impossible"); break; } } System.out.println(machi); } public static int count(String pai, String haipai) { int index = 0; int count = 0; while(true) { index = haipai.indexOf(pai, index) + 1; if(index == 0) { break; } count++; } return count; } }