#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  vector<string> s;
  cin >> n;
  s.resize(n);
  vector<int> ans(n);
  for (int i = 0; i < n; i++) {
    cin >> s[i];
    ans[i] = s[i].size();
  }
  int it = -1;
  for (int i = n - 1; i > 0; i--) {
    it = -1;
    for (int j = 0; j < min(s[i - 1].size(), s[i].size()); j++) {
      if (!(s[i][j] >= s[i - 1][j])) {
        it = j;
        break;
      }
      if (!(s[i][j] <= s[i - 1][j])) {
        it = (int)s[i - 1].size();
        break;
      }
    }
    if (it == -1) it = s[i].size();
    for (int j = s[i - 1].size() - 1; j >= it; j--) s[i - 1].pop_back();
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < s[i].size(); j++) cout << s[i][j];
    cout << endl;
  }
}
