#include <bits/stdc++.h>
using namespace std;
int n;
const int MAXN = 500010;
char s[MAXN];
vector<char> g[MAXN];
int d[MAXN];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%s", s + 1);
    int j = strlen(s + 1);
    for (int k = 1; k <= j; k++) g[i].push_back(s[k]);
  }
  d[n] = g[n].size();
  for (int i = n - 1; i; i--) {
    int j = 0;
    for (; g[i][j] == g[i + 1][j] && j < g[i].size() && j < d[i + 1]; j++)
      ;
    if (j < g[i].size() && j < d[i + 1]) {
      if (g[i][j] < g[i + 1][j]) d[i] = g[i].size();
      if (g[i][j] > g[i + 1][j]) d[i] = j;
    } else
      d[i] = min((int)g[i].size(), j);
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < d[i]; j++) putchar(g[i][j]);
    putchar(10);
  }
}
