#include <bits/stdc++.h>
using namespace std;
const int maxn(5e5 + 5);
char tags[maxn << 2], *head[maxn];
int main() {
  int n;
  while (~scanf("%d", &n)) {
    for (int i = 0, l = 0; i < n; i++, l++) {
      head[i] = tags + l;
      scanf("%s", head[i]);
      while (tags[l]) l++;
    }
    for (int i = n - 2, j; i >= 0; i--) {
      for (j = 0; head[i][j] && head[i + 1][j]; j++)
        if (head[i][j] != head[i + 1][j]) break;
      if (head[i][j] > head[i + 1][j]) head[i][j] = '\0';
    }
    for (int i = 0; i < n; i++) puts(head[i]);
  }
  return 0;
}
