#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<string> tags(n);
  vector<int> lens(n);
  for (int i = 0; i < n; i++) {
    cin >> tags[i];
    lens[i] = tags[i].length();
  }
  for (int i = n - 2; i >= 0; i--) {
    for (int j = 1; j < lens[i] || j < lens[i + 1]; j++) {
      if (j == lens[i]) break;
      if (j == lens[i + 1] || tags[i][j] > tags[i + 1][j]) {
        lens[i] = j;
        break;
      }
      if (tags[i][j] < tags[i + 1][j]) break;
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < lens[i]; j++) {
      cout << tags[i][j];
    }
    cout << "\n";
  }
  return 0;
}
