#include <bits/stdc++.h>
using namespace std;
string s[500000 + 10];
void calc(string& a, string& b) {
  if (a <= b) {
    return;
  }
  int i;
  for (i = 0; i < min(a.length(), b.length()); i++) {
    if (a[i] > b[i]) break;
  }
  a.resize(i);
}
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> s[i];
  for (int i = n; i >= 1; i--) calc(s[i - 1], s[i]);
  for (int i = 1; i <= n; i++) cout << s[i] << endl;
  return 0;
}
