#include <bits/stdc++.h>
using namespace std;
char str[500005];
string get(string s, int remove) {
  int n = (int)s.size();
  return s.substr(0, n - remove);
}
int main() {
  int n;
  scanf("%d", &n);
  vector<string> v;
  for (int i = (int)0; i <= (int)n - 1; ++i) {
    scanf("%s", str);
    v.push_back(str);
  }
  for (int i = (int)n - 2; i >= (int)0; --i) {
    if (v[i] > v[i + 1]) {
      string s = v[i];
      int l = 0, r = (int)v[i].size() + 1;
      while (r - l > 1) {
        int mid = (r + l) >> 1;
        string S = get(v[i], mid);
        if (S <= v[i + 1])
          r = mid, s = S;
        else
          l = mid;
      }
      v[i] = s;
    }
  }
  for (int i = (int)0; i <= (int)n - 1; ++i) puts(v[i].c_str());
}
