#include <bits/stdc++.h>
using namespace std;
int n, where[501000];
string t[501000], g;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) cin >> t[i];
  where[n] = (int)t[n].size() - 1;
  for (int i = n - 1; i >= 1; i--) {
    if (t[i + 1] >= t[i]) {
      where[i] = (int)t[i].size() - 1;
      continue;
    }
    int sz, wh;
    sz = min((int)t[i].size() - 1, min((int)t[i + 1].size() - 1, where[i + 1]));
    wh = sz + 1;
    for (int j = 0; j <= sz; j++) {
      if (t[i][j] > t[i + 1][j]) {
        wh = j;
        break;
      }
    }
    int siz;
    siz = t[i].size() - 1;
    g.clear();
    for (int j = 0; j < wh; j++) g.push_back(t[i][j]);
    t[i] = g;
    where[i] = wh - 1;
  }
  for (int i = 1; i <= n; i++) cout << t[i] << endl;
}
