import tables, sets let S = stdin.readLine var Sct = initCountTable[char]() dic, Sst = initSet[char]() flg: bool for s in ('a' .. 'm'): dic.incl s for s in S: Sst.incl s Sct.inc s for s in ('a' .. 'm'): var Sct2 = Sct Sst2 = Sst Sct2.inc s Sst2.incl s if Sst2 == dic and Sct2.largest.val >= 2: flg = true echo s if not flg: echo "Impossible"