#include <bits/stdc++.h>
using namespace std;
int n;
string buf[550000];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) cin >> buf[i];
  for (int i = n - 1; i >= 1; i--) {
    int j = 0;
    while (buf[i + 1][j] == buf[i][j]) j++;
    if (buf[i + 1][j] < buf[i][j]) buf[i] = buf[i].substr(0, j);
  }
  for (int i = 1; i <= n; i++) cout << buf[i] << endl;
  return 0;
}
