#include <bits/stdc++.h>
using namespace std::chrono;
using namespace std;
const long long int mod = 998244353;
const int inf = 1e9 + 7;
long long int f(long long int x, long long int n) {
  long long int r = 1;
  while (n > 0) {
    if (n % 2 == 1) r = (r * x) % mod;
    x = (x * x) % mod;
    n /= 2;
  }
  return r;
}
long long int fac[400010], invf[400010];
void buildfactorial() {
  fac[0] = 1;
  fac[1] = 1;
  for (int i = 2; i < 400010; i++)
    fac[i] = ((long long int)i * fac[i - 1]) % mod;
  for (int i = 0; i < 400010; ++i) {
    invf[i] = f(fac[i], mod - 2);
  }
}
long long int C(int n, int r) {
  if (n < r) return 0;
  return (((fac[n] * invf[r]) % mod) * invf[n - r]) % mod;
}
long double dist(long double x1, long double y1, long double x2,
                 long double y2) {
  return sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
}
struct node {
  int v, d, p;
};
void solve() {
  int n;
  cin >> n;
  string s[n];
  for (int i = 0; i < n; ++i) cin >> s[i];
  for (int i = n - 2; i >= 0; --i) {
    string t = "";
    for (int j = 0; j < min(s[i].length(), s[i + 1].length()); ++j) {
      if (s[i][j] > s[i + 1][j])
        break;
      else if (s[i][j] < s[i + 1][j]) {
        t = s[i];
        break;
      }
      t += s[i][j];
    }
    s[i] = t;
  }
  for (int i = 0; i < n; ++i) cout << s[i] << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  t = 1;
  while (t--) solve();
}
