#include <bits/stdc++.h>
const int mxn = 1e5 + 1;
const int MOD = 1e9 + 7;
using namespace std;
int main() {
  int t = 1;
  while (t--) {
    long long int n;
    cin >> n;
    vector<string> string_arr(n + 1);
    for (long long int i = 1; i <= n; ++i) {
      cin >> string_arr[i];
    }
    for (long long int i = n - 1; i >= 1; --i) {
      long long int j = 0;
      while (j < string_arr[i].size() && j < string_arr[i + 1].size() &&
             string_arr[i][j] <= string_arr[i + 1][j]) {
        if (string_arr[i][j] < string_arr[i + 1][j]) {
          j = string_arr[i].size();
          break;
        }
        j++;
      }
      string_arr[i] = string_arr[i].substr(0, j);
    }
    for (long long int i = 1; i <= n; ++i) cout << string_arr[i] << endl;
  }
  return 0;
}
