#include <bits/stdc++.h>
using namespace std;
const int UNDEF = -1;
const int INF = 1e18;
template <typename T>
inline bool chkmax(T &aa, T bb) {
  return aa < bb ? aa = bb, true : false;
}
template <typename T>
inline bool chkmin(T &aa, T bb) {
  return aa > bb ? aa = bb, true : false;
}
const int mn = 5e5 + 4;
string vs[mn];
int vslen[mn];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> vs[i];
    vslen[i] = vs[i].length();
  }
  for (int i = n - 2; i >= 0; i--) {
    bool is_smaller = false;
    int largerdiff = -1;
    int mx = min(vslen[i], vslen[i + 1]);
    for (int x = 0; x < mx; x++) {
      if (vs[i][x] < vs[i + 1][x]) {
        is_smaller = true;
        break;
      } else if (vs[i][x] > vs[i + 1][x]) {
        largerdiff = x;
        break;
      }
    }
    if (is_smaller) continue;
    if (largerdiff != -1) {
      vslen[i] = largerdiff;
    }
    chkmin(vslen[i], vslen[i + 1]);
  }
  for (int i = 0; i < n; i++) {
    cout << vs[i].substr(0, vslen[i]) << "\n";
  }
}
