#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, i, j, a, b;
  cin >> n;
  vector<string> v(n);
  for (i = 0; i < n; i++) cin >> v[i];
  for (i = n - 2; i >= 0; i--) {
    string x;
    if (v[i] <= v[i + 1]) continue;
    a = v[i].size();
    b = v[i + 1].size();
    for (j = 0; j < a && j < b; j++) {
      if (v[i][j] != v[i + 1][j]) break;
      x += v[i][j];
    }
    v[i] = x;
  }
  for (i = 0; i < n; i++) cout << v[i] << endl;
  return 0;
}
