S = input().strip() target_chars = 'abcdefghijklm' current_counts = {c: 0 for c in target_chars} for c in S: current_counts[c] += 1 candidates = [] for char_to_add in target_chars: new_counts = current_counts.copy() new_counts[char_to_add] += 1 valid = True count_of_twos = 0 for c in target_chars: cnt = new_counts[c] if cnt < 1 or cnt >= 3: valid = False break if cnt == 2: count_of_twos += 1 if valid and count_of_twos == 1: candidates.append(char_to_add) if not candidates: print("Impossible") else: print('\n'.join(sorted(candidates)))