#include <bits/stdc++.h>
using namespace std;
pair<int, int> p1;
map<string, int> ma;
long long int ans, n, i, j, c;
int main() {
  string st;
  vector<string> s;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> st;
    s.push_back(st);
  }
  for (i = n - 2; i >= 0; i--) {
    c = 0;
    for (j = 0; j < s[i].size() && j < s[i + 1].size(); j++) {
      if (s[i][j] > s[i + 1][j]) {
        ans += s[i].size() - j;
        s[i].erase(j, s[i].size() - j);
        break;
      } else if (s[i][j] == s[i + 1][j]) {
        c++;
      } else {
        break;
      }
    }
    if (c == s[i + 1].size()) {
      ans += s[i].size() - j;
      s[i].erase(j, s[i].size() - j);
    }
  }
  for (i = 0; i < n; i++) cout << s[i] << endl;
  return 0;
}
