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