#include <bits/stdc++.h>
using namespace std;
int main(int argc, const char* argv[]) {
  int n;
  cin >> n;
  string* array = new string[n];
  int* length = new int[n];
  for (int i = 0; i < n; i++) {
    cin >> array[i];
    length[i] = array[i].length();
  }
  for (int i = n - 1; i >= 1; i--) {
    int j = 0;
    int len = length[i] < length[i - 1] ? length[i] : length[i - 1];
    while (array[i - 1][j] == array[i][j] && j < len) {
      j++;
    }
    if (j < len && array[i - 1][j] > array[i][j] ||
        j >= len && length[i - 1] > len) {
      array[i - 1] = array[i - 1].substr(0, j);
    }
  }
  for (int i = 0; i < n; i++) {
    cout << array[i] << endl;
  }
}
