#include <bits/stdc++.h>
using namespace std;
string str[500010];
int main() {
  int n, i, j;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> str[i];
  }
  for (i = n - 1; i >= 1; i--) {
    if (str[i - 1] <= str[i]) continue;
    for (j = 1; j < str[i].size() && j < str[i - 1].size(); j++) {
      if (str[i - 1][j] > str[i][j]) break;
    }
    str[i - 1].erase(j, str[i - 1].size() - j);
  }
  for (i = 0; i < n; i++) cout << str[i] << endl;
  return 0;
}
