#include <bits/stdc++.h>
using namespace std;
bool gr(string a, string b) {
  int n = min(a.size(), b.size());
  for (int i = 0; i < n; i++) {
    if (a[i] > b[i]) {
      return true;
    } else if (a[i] < b[i]) {
      return false;
    }
  }
  if (a.size() >= b.size())
    return true;
  else
    return false;
}
int main() {
  int n;
  cin >> n;
  vector<string> A(n);
  for (int i = 0; i < n; i++) {
    cin >> A[i];
  }
  for (int i = n - 1; i >= 1; i--) {
    string a = A[i];
    string am1 = A[i - 1];
    int greater = gr(a, am1);
    if (greater)
      continue;
    else {
      int asz = a.size(), am1sz = am1.size();
      int sz = min(asz, am1sz);
      int j;
      for (j = 0; j < sz; j++) {
        if (a[j] != am1[j]) break;
      }
      am1.erase(am1.begin() + j, am1.end());
      A[i - 1] = am1;
    }
  }
  for (int i = 0; i < n; i++) {
    cout << A[i] << endl;
  }
}
