#include <bits/stdc++.h>
using namespace std;
vector<char> vec[500005];
int res[500005];
int main() {
  int n;
  cin >> n;
  getchar();
  for (int i = 0; i < n; i++) {
    char x;
    while (scanf("%c", &x) && (x != '\n')) {
      vec[i].push_back(x);
    }
  }
  for (int i = n - 1; i > 0; i--) {
    int tmp1 = vec[i].size();
    int tmp2 = vec[i - 1].size();
    for (int j = 1; j < min(tmp1, tmp2); j++) {
      if (vec[i][j] < vec[i - 1][j]) {
        vec[i - 1][j] = '\n';
        break;
      } else if (vec[i][j] > vec[i - 1][j]) {
        break;
      }
      if (j == tmp1 - 1 && tmp2 > tmp1) {
        vec[i - 1][j + 1] = '\n';
      }
    }
  }
  for (int i = 0; i < n; i++) {
    int tmp = vec[i].size();
    for (int j = 0; j < tmp; j++) {
      if (vec[i][j] == '\n') break;
      printf("%c", vec[i][j]);
    }
    printf("\n");
  }
  cin >> n;
  return 0;
}
