#include <bits/stdc++.h>
using namespace std;
string s[500005];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, i, j;
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> s[i];
  }
  for (i = n - 1; i >= 1; i--) {
    string temp = "";
    int st = 0;
    for (j = 0; j < s[i].size(); j++) {
      if (s[i][j] < s[i + 1][j]) {
        st = 1;
        break;
      } else if (s[i][j] > s[i + 1][j]) {
        break;
      } else {
        temp += s[i][j];
      }
    }
    if (st == 1) {
      temp = s[i];
    }
    s[i] = temp;
  }
  for (i = 1; i <= n; i++) {
    cout << s[i] << endl;
  }
  return 0;
}
