#include using namespace std; const int N = 1e5 + 5; string ans[N]; set sk; int n; int main() { ios::sync_with_stdio(false); cin.tie(0); cin >> n; bool im = false; for (int i = 0; i < n; i++) { string u; cin >> u; bool f = false; for (int j = 1; j < 3; j++) { string s = u.substr(0, j); string t = u.substr(j); if (!sk.count(s) && !sk.count(t)) { sk.insert(s); sk.insert(t); ans[i] = s + " " + t; f = true; break; } } if (!f) { im = true; } } if (im) { cout << "Impossible\n"; } else { for (int i = 0; i < n; i++) { cout << ans[i] << '\n'; } } return 0; }