#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  cout.tie(0);
  long long n, i, j;
  cin >> n;
  string x;
  vector<string> second(n);
  for (i = 0; i < n; i++) {
    cin >> second[i];
  }
  for (i = n - 2; i >= 0; i--) {
    x = "";
    if (second[i] > second[i + 1]) {
      for (j = 0; j < min(second[i + 1].size(), second[i].size()); j++) {
        if (second[i][j] <= second[i + 1][j]) {
          x += second[i][j];
        } else
          break;
      }
      second[i] = x;
    }
  }
  for (i = 0; i < n; i++) cout << second[i] << endl;
  return 0;
}
