#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline void read(T& x) {
  T s = 0, w = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') w = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    s = (s << 1) + (s << 3) + (ch ^ 48), ch = getchar();
  }
  x = w * s;
}
template <typename T>
inline void write(T x) {
  if (x < 0) x = ~x + 1, putchar('-');
  if (x > 9) write(x / 10);
  putchar(x % 10 + '0');
}
string st[500010];
int n;
int check(string st1, string st2) {
  int len = 0;
  while (len < st1.size() || len < st2.size()) {
    if (st1[len] < st2[len]) return 0;
    if (st1[len] > st2[len]) return len;
    len++;
  }
  return 0;
}
int main() {
  read(n);
  for (int i = 1; i <= n; i++) cin >> st[i];
  for (int i = n - 1; i >= 1; i--) {
    int x = check(st[i], st[i + 1]);
    if (x > 0) st[i] = st[i].substr(0, x);
  }
  for (int i = 1; i <= n; i++) cout << st[i], puts("");
  return 0;
}
