package m.shin; import java.util.ArrayList; import java.util.Scanner; public class Con587 { public static void main(String[] args) { Scanner s = new Scanner(System.in); String str = s.next(); s.close(); ArrayList delete = new ArrayList<>(); boolean ft = false; String ans = ""; for(int i = 0;i < 6;i++){ String c = str.substring(0, 1); str = str.replaceFirst(c, ""); if(delete.contains(c)){ break; }else{ delete.add(c); } if(str.indexOf(c) == -1 && !ft){ ft = true; ans = c; continue; }else if(str.indexOf(c) == -1 && ft){ System.out.println("Impossible"); break; } str = str.replaceFirst(c, ""); } if(ft){ System.out.println(ans); }else{ System.out.println("Impossible"); } } }