#include <bits/stdc++.h>
using namespace std;
string findPrefix(string a, string b) {
  string temp = "";
  int i = 0;
  for (i = 0; i < min(a.length(), b.length()); i++) {
    if (a[i] == b[i]) {
      temp.append(a.substr(i, 1));
    } else
      break;
  }
  return temp;
}
int main() {
  long long n;
  cin >> n;
  string s[n];
  for (int i = 0; i < n; i++) cin >> s[i];
  for (int i = n - 1; i > 0; i--) {
    if (s[i] < s[i - 1]) s[i - 1] = findPrefix(s[i], s[i - 1]);
  }
  for (int i = 0; i < n; i++) cout << s[i] << "\n";
  return 0;
}
