#include <bits/stdc++.h>
using namespace std;
const int N = 1111111;
vector<char> a[N], ans[N];
char b[N], c[N];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%s", b);
    for (int j = 0; b[j]; j++) {
      a[i].push_back(b[j]);
    }
  }
  memset(c, 127, sizeof(c));
  int zun = N;
  for (int i = n - 1; ~i; i--) {
    int flag = 1, j;
    for (j = 0; j < a[i].size(); j++) {
      if (flag && (a[i][j] > c[j] || i < n - 1 && j == zun)) break;
      if (a[i][j] < c[j]) flag = 0;
      ans[i].push_back(c[j] = a[i][j]);
    }
    zun = j;
  }
  for (int i = 0; i < n; i++) {
    ans[i].push_back(0);
    printf("%s\n", ans[i].begin());
  }
  return 0;
}
