#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string str[n];
  for (int i = 0; i < n; i++) cin >> str[i];
  for (int i = n - 1; i >= 1; i--) {
    for (int j = 0; j < str[i - 1].size(); j++)
      if (str[i][j] > str[i - 1][j])
        break;
      else if (str[i][j] < str[i - 1][j]) {
        string tmp = str[i - 1];
        str[i - 1].clear();
        for (int m = 0; m < j; m++) str[i - 1] += tmp[m];
      }
  }
  for (int i = 0; i < n; i++) {
    cout << str[i] << endl;
  }
}
