#include <bits/stdc++.h>
using namespace std;
int n;
vector<string> s;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  s.resize(n);
  for (int i = 0; i < n; i++) cin >> s[i];
  for (int i = n - 1; i > 0; i--) {
    int l = 1, r = min(s[i].length(), s[i - 1].length());
    if (s[i - 1].compare(s[i]) < 0) continue;
    while (l < r) {
      int mid = l + r + 1 >> 1;
      if (s[i - 1].compare(0, mid, s[i]) <= 0)
        l = mid;
      else
        r = mid - 1;
    }
    s[i - 1] = s[i - 1].substr(0, l);
  }
  for (int i = 0; i < n; i++) cout << s[i] << endl;
}
