#include <bits/stdc++.h>
using namespace std;
const int N = 1000070;
string s[N];
bool check(int i, int m) {
  string aux;
  for (int j = 0; j < m; j++) {
    aux += s[i][j];
  }
  if (aux <= s[i + 1]) {
    return true;
  } else {
    return false;
  }
}
int bb(int i) {
  if (s[i] <= s[i + 1]) return s[i].size();
  int l = 0, r = s[i].size();
  int m = 0;
  while (l < r) {
    m = (l + r + 1) / 2;
    if (check(i, m)) {
      l = m;
    } else {
      r = m - 1;
    }
  }
  if (check(i, l + 1))
    return l + 1;
  else if (check(i, l))
    return l;
  else
    return l - 1;
}
int chopchop;
int main(int argc, char const *argv[]) {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    cin >> s[i];
  }
  for (int i = n - 2; i >= 0; i--) {
    chopchop = bb(i);
    string aux;
    for (int j = 0; j < chopchop; j++) {
      aux += s[i][j];
    }
    s[i] = aux;
  }
  for (int i = 0; i < n; i++) {
    cout << s[i] << endl;
  }
  return 0;
}
