#include <bits/stdc++.h>
using namespace std;
const int N = 523456;
const int inf = (int)1e9 + 7;
int n;
string a[N];
int main() {
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
  }
  for (int i = n - 1; i >= 1; --i) {
    int ptr = 0;
    while (true) {
      if (a[i + 1][ptr] > a[i][ptr]) {
        ptr = (int)a[i].size() - 1;
        break;
      }
      if (a[i][ptr] <= a[i + 1][ptr]) {
        ++ptr;
      }
      if (a[i][ptr] > a[i + 1][ptr]) {
        --ptr;
        break;
      }
    }
    a[i] = a[i].substr(0, ptr + 1);
  }
  for (int i = 1; i <= n; ++i) {
    cout << a[i] << "\n";
  }
  return 0;
}
