#include <bits/stdc++.h>
using namespace std;
string s[500001];
int main() {
  long long n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> s[i];
  }
  for (int i = n - 2; i >= 0; i--) {
    if (s[i] > s[i + 1]) {
      string s1 = "";
      int j = 0;
      while (s[i][j] == s[i + 1][j] && s[i + 1].size() > j) {
        s1 += s[i][j];
        j++;
      }
      s[i] = s1;
    }
  }
  for (int i = 0; i < n; i++) {
    cout << s[i] << endl;
  }
  return 0;
}
