#include <bits/stdc++.h>
using namespace std;
string s[500005];
int main() {
  ios_base::sync_with_stdio(0);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> s[i];
  for (int i = n - 2; i >= 0; i--) {
    string cur = "";
    bool f = 1;
    for (int j = 0; j < min(s[i].size(), s[i + 1].size()); j++) {
      cur += s[i][j];
      if (cur[j] > s[i + 1][j]) {
        if (cur.size() > 0) cur.erase(cur.size() - 1, 1);
        break;
      } else {
        if (cur[j] < s[i + 1][j]) {
          f = 0;
          break;
        }
      }
    }
    if (f) s[i] = cur;
  }
  for (int i = 0; i < n; i++) cout << s[i] << endl;
  return 0;
}
