#include <bits/stdc++.h>
using namespace std;
template <typename T>
void trace(T a) {
  cout << a << "\n";
};
template <typename T, typename... Args>
void trace(T a, Args... args) {
  cout << a << " ";
  trace(args...);
}
int n;
vector<string> a;
int nd[500010];
int main() {
  cin >> n;
  string x;
  for (int i = 0; i < n; i++) {
    cin >> x;
    a.push_back(x);
    nd[i] = (int)x.size();
  }
  for (int i = n - 2; i >= 0; i--) {
    int j = 1;
    for (; j < min(nd[i], nd[i + 1]); j++) {
      if (a[i][j] < a[i + 1][j]) break;
      if (a[i][j] > a[i + 1][j]) {
        nd[i] = j;
      }
    }
    if (j == nd[i + 1]) nd[i] = min(nd[i], nd[i + 1]);
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < min(nd[i], (int)a[i].size()); j++) cout << a[i][j];
    cout << "\n";
  }
  return 0;
}
