from collections import * from itertools import * from functools import * from heapq import * import sys,math input = sys.stdin.readline N = int(input()) U = [input()[:-1] for _ in range(N)] if N > 26: print('Impossible') exit() for i in range(1<>j)&1: s = u[:2] t = u[2:] else: s = u[:1] t = u[1:] if (called[s]|called[t]): flg = True break else: called[s] = True called[t] = True S.append(s) T.append(t) if flg: continue for s,t in zip(S,T): print(s,t) exit() print('Impossible')