#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  vector<string> words(n);
  for (int i = 0; i < (int)n; i++) cin >> words[i];
  for (int i = n - 2; i >= 0; i--)
    if (words[i + 1] < words[i]) {
      int diff = 0;
      for (; words[i][diff] <= words[i + 1][diff]; diff++)
        ;
      while (words[i].size() > diff) words[i].pop_back();
    }
  for (int i = 0; i < (int)n; i++) cout << words[i] << '\n';
}
