import java.util.*; public class Main { static HashSet used = new HashSet<>(); static int[] base; static int[] lefts; static int[] rights; static int n; public static void main(String[] args) { Scanner sc = new Scanner(System.in); n = sc.nextInt(); base = new int[n]; lefts = new int[n]; rights = new int[n]; for (int i = 0; i < n; i++) { base[i] = getNum(sc.next().toCharArray()); } check(0); System.out.println("Impossible"); } static void check(int idx) { if (idx == n) { output(); System.exit(0); } lefts[idx] = base[idx] / (54 * 54); rights[idx] = base[idx] % (54 * 54); if (!used.contains(lefts[idx]) && !used.contains(rights[idx])) { used.add(lefts[idx]); used.add(rights[idx]); check(idx + 1); used.remove(lefts[idx]); used.remove(rights[idx]); } lefts[idx] = base[idx] / 54; rights[idx] = base[idx] % 54; if (!used.contains(lefts[idx]) && !used.contains(rights[idx])) { used.add(lefts[idx]); used.add(rights[idx]); check(idx + 1); used.remove(lefts[idx]); used.remove(rights[idx]); } } static void output() { StringBuilder sb = new StringBuilder(); for (int i = 0; i < n; i++) { sb.append(getStr(lefts[i])).append(" ").append(getStr(rights[i])).append("\n"); } System.out.print(sb); } static String getStr(int x) { StringBuilder sb = new StringBuilder(); if (x < 54) { sb.append(getChar(x)); } else { sb.append(getChar(x / 54)).append(getChar(x % 54)); } return sb.toString(); } static char getChar(int x) { if (x <= 26) { return (char)(x + 'A' - 1); } else { return (char)(x - 27 + 'a' - 1); } } static int getNum(char[] arr) { int value = 0; for (char c : arr) { value *= 54; value += getNum(c); } return value; } static int getNum(char c) { if (c <= 'Z') { return c - 'A' + 1; } else { return 27 + c - 'a' + 1; } } }