#include <bits/stdc++.h>
using namespace std;
int lcp(string a, string b) {
  for (int j = 0; j < a.size(); j++)
    if (j == b.size() || a[j] > b[j]) return j;
}
int main(int argc, char const *argv[]) {
  int n;
  cin >> n;
  string str[n];
  for (int i = 0; i < n; i++) cin >> str[i];
  for (int i = n - 2; i >= 0; i--) {
    if (str[i] <= str[i + 1]) continue;
    str[i] = str[i].substr(0, lcp(str[i], str[i + 1]));
  }
  for (int i = 0; i < n; i++) cout << str[i] << endl;
}
