#include <bits/stdc++.h>
using namespace std;
int n;
string ss[500010];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> ss[i];
  for (int i = n - 1; i >= 1; i--) {
    int flag = 0, Size1 = ss[i].length(), Size2 = ss[i + 1].length();
    for (int j = 0; j < Size1 && j < Size2; j++) {
      if (ss[i][j] < ss[i + 1][j]) {
        flag = 1;
        break;
      } else if (ss[i][j] > ss[i + 1][j]) {
        ss[i] = ss[i].substr(0, j);
      }
    }
    if (!flag) {
      if (ss[i].length() > ss[i + 1].length()) ss[i] = ss[i].substr(0, Size2);
    }
  }
  for (int i = 1; i <= n; i++) cout << ss[i] << endl;
}
