#include <bits/stdc++.h>
using namespace std;
long long fpow(long long a, int b, int mod) {
  long long res = 1;
  for (; b > 0; b >>= 1) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
  }
  return res % mod;
}
const int mod = 1e9 + 7;
const int N = 5e5 + 100;
inline int read() {
  static char buf[1000000], *p1 = buf, *p2 = buf;
  register int x = false;
  register char ch =
      p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1000000, stdin), p1 == p2)
          ? EOF
          : *p1++;
  ;
  register bool sgn = false;
  while (ch != '-' && (ch < '0' || ch > '9'))
    ch = p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1000000, stdin), p1 == p2)
             ? EOF
             : *p1++;
  ;
  if (ch == '-')
    sgn = true,
    ch = p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1000000, stdin), p1 == p2)
             ? EOF
             : *p1++;
  ;
  while (ch >= '0' && ch <= '9')
    x = (x << 1) + (x << 3) + (ch ^ 48),
    ch = p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1000000, stdin), p1 == p2)
             ? EOF
             : *p1++;
  ;
  return sgn ? -x : x;
}
string s[N];
char x[N];
int L[N];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    scanf("%s", x);
    s[i] = x;
    L[i] = strlen(x);
  }
  for (int i = n - 1; i >= 1; i--) {
    int flag = -1, u = 0;
    for (int j = 1; j < L[i + 1]; j++) {
      if (s[i + 1][j] < s[i][j]) {
        flag = j;
        break;
      } else if (s[i + 1][j] > s[i][j])
        u = 1;
    }
    if (u == 1) continue;
    if (flag == -1) {
      if (L[i] > L[i + 1]) L[i] = L[i + 1];
    } else
      L[i] = flag;
  }
  for (int i = 1; i <= n; i++, cout << endl) {
    for (int j = 0; j < L[i]; j++) {
      printf("%c", s[i][j]);
    }
  }
  return 0;
}
