#include <bits/stdc++.h>
using namespace std;
string now, hu[500010];
int num[500010], kk;
int main() {
  int n;
  memset(num, -1, sizeof(num));
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    cin >> hu[i];
  }
  now = hu[n];
  for (int i = n - 1; i >= 1; i--) {
    int len = min(hu[i].length(), now.length()), pan = 0, k;
    for (k = 0; k < len; k++) {
      if (now[k] < hu[i][k]) {
        pan = 2;
        num[i] = k - 1;
        break;
      } else if (now[k] > hu[i][k]) {
        pan = 1;
        now = hu[i];
        break;
      }
    }
    if (!pan && now.length() < hu[i].size()) {
      num[i] = len - 1;
    } else if (!pan && now.length() > hu[i].size()) {
      now = hu[i];
    }
    if (pan == 2) {
      now[k] = '\0';
    }
  }
  for (int i = 1; i <= n - 1; i++) {
    if (num[i] != -1)
      for (int j = 0; j <= num[i]; j++) {
        cout << hu[i][j];
      }
    else
      cout << hu[i];
    cout << endl;
  }
  cout << hu[n];
  return 0;
}
