#include <bits/stdc++.h>
using namespace std;
int N;
vector<string> v;
int main() {
  scanf("%d", &N);
  for (int i = 0; i < N; i++) {
    string temp;
    cin >> temp;
    v.push_back(temp);
  }
  for (int i = N - 1; i >= 1; i--) {
    if (v[i] > v[i - 1]) continue;
    string temp = "";
    for (int j = 0; j < min(v[i].size(), v[i - 1].size()); j++) {
      if (v[i][j] < v[i - 1][j]) break;
      temp += v[i][j];
    }
    v[i - 1] = temp;
  }
  for (int i = 0; i < N; i++) {
    cout << v[i] << "\n";
  }
  return 0;
}
