#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e5 + 10;
string str[maxn];
int num[maxn];
int main() {
  int n, maxx, flag;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    cin >> str[i];
    num[i] = str[i].size();
  }
  for (int i = n; i > 1; i--) {
    flag = 0;
    for (int j = 1; j < min(num[i], num[i - 1]); j++) {
      int pos1 = str[i][j] - 'a';
      int pos2 = str[i - 1][j] - 'a';
      if (pos1 < pos2 && flag == 0) {
        num[i - 1] = j;
        break;
      } else if (pos1 > pos2) {
        flag = 1;
      }
    }
    if (flag == 0 && num[i - 1] > num[i]) num[i - 1] = num[i];
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < num[i]; j++) {
      printf("%c", str[i][j]);
    }
    printf("\n");
  }
  return 0;
}
