#include <bits/stdc++.h>
using namespace std;
int n, m, m2, c;
vector<string> arr;
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  ;
  cin >> n;
  arr.resize(n + 1);
  for (int i = 0; i < n; i++) cin >> arr[i];
  for (int i = n - 2; i + 1; i--) {
    m = arr[i].size();
    m2 = arr[i + 1].size();
    if (arr[i] == arr[i + 1]) {
      continue;
    }
    c = 1;
    for (int j = 1; j < m && j < m2; j++) {
      if (arr[i][j] > arr[i + 1][j]) {
        arr[i][j] = ',';
        break;
      } else if (arr[i][j] == arr[i + 1][j])
        c++;
      else
        break;
    }
    if (m > m2 && c == m2) arr[i][m2] = ',';
  }
  for (int i = 0; i < n; i++) {
    m = arr[i].size();
    for (int j = 0; j < m; j++) {
      if (arr[i][j] == ',') break;
      cout << arr[i][j];
    }
    cout << endl;
  }
  return 0;
}
