s = io.read() t = {} for i = 1, 13 do a = string.sub(s, i, i) if(t[a] == nil) then t[a] = 1 else t[a] = t[a] + 1 end end tgt = nil imp = false for k, v in pairs(t) do if(v == 1) then if(tgt == nil) then tgt = k else imp = true end elseif(2 < v) then imp = true end end if(imp) then print("Impossible") else print(tgt) end