#include <bits/stdc++.h>
using namespace std;
const int maxn = 500001;
struct Cloud_of_Hashtags {
  string a[maxn];
  int N;
  void init() {
    scanf("%d", &N);
    for (int i = 1; i <= N; i++) cin >> a[i];
  }
  int get(int id) {
    int nid = id + 1, i = 1;
    while (1) {
      if (a[id][i] == 0) return 0;
      if (a[nid][i] == 0) return i;
      if (a[id][i] > a[nid][i]) return i;
      if (a[id][i] < a[nid][i]) return 0;
      i++;
    }
  }
  void work() {
    for (int i = N - 1, pos; i >= 1; i--) {
      pos = get(i);
      if (pos != 0) a[i].erase(pos, a[i].length());
    }
    for (int i = 1; i <= N; i++) cout << a[i] << endl;
  }
} sol;
int main() {
  sol.init();
  sol.work();
  return 0;
}
