#include <bits/stdc++.h>
using namespace std;
int n;
string s[500005];
int len[500005];
int main() {
  while (~scanf("%d", &n)) {
    for (int i = 1; i <= n; i++) cin >> s[i];
    for (int i = n; i >= 2; i--) {
      if (s[i] < s[i - 1]) {
        for (int j = 0; j < s[i - 1].size(); j++) {
          if (s[i - 1][j] > s[i][j]) {
            len[i - 1] = j;
            break;
          }
        }
        string tmp;
        for (int j = 0; j < len[i - 1]; j++) tmp += s[i - 1][j];
        s[i - 1] = tmp;
      }
    }
    for (int i = 1; i <= n; i++) {
      cout << s[i] << endl;
    }
  }
  return 0;
}
