#include <bits/stdc++.h>
using namespace std;
const int N = 500010;
int n;
int len[N];
string s[N], a[N];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) cin >> s[i];
  a[n] = s[n];
  for (int i = n - 1, j, sz; i; --i) {
    if (s[i] > a[i + 1]) {
      for (j = 0, sz = a[i + 1].length(); j < sz; ++j) {
        if (s[i][j] > a[i + 1][j])
          break;
        else
          a[i] += s[i][j];
      }
    } else
      a[i] = s[i];
  }
  for (int i = 1, j; i <= n; ++i) cout << a[i] << endl;
}
