#include <bits/stdc++.h>
using namespace std;
vector<int> v[500004];
int n, i, j, nr, nr1, ap[500004];
char s[500004];
int main() {
  scanf("%d\n", &n);
  for (i = 1; i <= n; i++) {
    gets(s);
    ap[i] = strlen(s);
    for (j = 0; j <= (ap[i] - 1); j++) v[i].push_back(s[j] - '#');
  }
  for (i = (n - 1); i >= 1; i--) {
    nr = ap[i];
    nr1 = ap[i + 1];
    j = 0;
    while (j <= (nr - 1) && j <= (nr1 - 1)) {
      if (v[i][j] > v[i + 1][j])
        break;
      else if (v[i][j] < v[i + 1][j]) {
        j = nr;
        break;
      }
      j++;
    }
    ap[i] = j;
  }
  for (i = 1; i <= n; i++) {
    for (j = 0; j <= (ap[i] - 1); j++) printf("%c", char(v[i][j] + '#'));
    printf("\n");
  }
  return 0;
}
