// tested by Hightail - https://github.com/dj3500/hightail import std.stdio, std.string, std.conv, std.algorithm; import std.range, std.array, std.math, std.typecons, std.container, core.bitop; import std.datetime, std.bigint; void main() { string s = readln.chomp; auto cnt = new int[](13); foreach (ch ; s) { if (ch - 'a' >= 13) continue; cnt[ch - 'a']++; } if (cnt.all!"a == 1") { foreach (i ; 0 .. 13) { writeln(('a' + i).to!char); } return; } if (cnt.reduce!max > 2) { writeln("Impossible"); return; } int z, o, t; foreach (i ; 0 .. 13) { if (cnt[i] == 0) z++; if (cnt[i] == 1) o++; if (cnt[i] == 2) t++; } if (z == 1 && t == 1 && o == 11) { foreach (i ; 0 .. 13) { if (cnt[i] == 0) { writeln(('a' + i).to!char); return; } } } else if (o == 13) { foreach (i ; 0 .. 13) { writeln(('a' + i).to!char); return; } } else { writeln("Impossible"); } } void scan(T...)(ref T args) { string[] line = readln.split; foreach (ref arg; args) { arg = line.front.to!(typeof(arg)); line.popFront(); } assert(line.empty); } void fillAll(R, T)(ref R arr, T value) { static if (is(typeof(arr[] = value))) { arr[] = value; } else { foreach (ref e; arr) { fillAll(e, value); } } }