#include <bits/stdc++.h>
using namespace std;
string s[500005];
int len[500005];
int main() {
  int n;
  while (cin >> n) {
    for (int i = 0; i < n; i++) {
      cin >> s[i];
      len[i] = s[i].size();
    }
    for (int i = n - 1; i > 0; i--) {
      bool win = true;
      for (int j = 0; j < len[i] && j < len[i - 1]; j++) {
        if (s[i][j] < s[i - 1][j]) {
          len[i - 1] = j;
          break;
        }
        if (s[i][j] > s[i - 1][j]) {
          win = false;
          break;
        }
      }
      if (len[i] < len[i - 1] && win) {
        if (s[i][len[i] - 1] == s[i - 1][len[i] - 1]) {
          len[i - 1] = len[i];
        }
      }
    }
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < len[i]; j++) {
        cout << s[i][j];
      }
      cout << endl;
    }
  }
  return 0;
}
