#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m, k, z;
  cin >> n;
  string a[n], x;
  for (int i = 0; i < n; ++i) {
    cin >> x;
    a[i] = x;
  }
  for (int i = n - 2; i >= 0; --i) {
    if (a[i + 1].size() == 1) {
      a[i].resize(1);
      continue;
    }
    z = 1;
    bool f = 0;
    while (a[i][z] <= a[i + 1][z] && z < a[i + 1].size()) {
      if (a[i][z] < a[i + 1][z]) {
        f = 1;
      }
      z++;
    }
    if (f == 1) {
      continue;
    }
    a[i].resize(z);
  }
  for (int i = 0; i < n; ++i) {
    cout << a[i] << '\n';
  }
  return 0;
}
