#include <bits/stdc++.h>
using namespace std;
const int MAXN = 500005;
string tag[MAXN];
string getNewTag(const string& t1, const string& t2) {
  string res;
  int n1, n2;
  n1 = t1.length();
  n2 = t2.length();
  res = "";
  for (int i = 0; i < min(n1, n2); i++) {
    if (t1[i] < t2[i]) {
      return t1;
    } else if (t1[i] == t2[i]) {
      res += t1[i];
      continue;
    } else {
      return res;
    }
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> tag[i];
  }
  for (int i = n - 1; i > 0; i--) {
    tag[i - 1] = getNewTag(tag[i - 1], tag[i]);
  }
  for (int i = 0; i < n; i++) cout << tag[i] << "\n";
  return 0;
}
