#include <bits/stdc++.h>
using namespace std;
const int maxn = 500050;
string s[maxn];
int n;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> s[i];
  for (int i = n; i >= 1; i--) {
    if (s[i] >= s[i - 1]) continue;
    int l1 = s[i].size();
    int l2 = s[i - 1].size();
    int l = min(l1, l2);
    bool fg = 1;
    for (int j = 0; j < l; j++) {
      if (s[i - 1][j] > s[i][j]) {
        s[i - 1][j] = '\0';
        fg = 0;
        break;
      }
    }
    if (fg) s[i - 1][l] = '\0';
  }
  for (int i = 1; i <= n; i++) cout << s[i].c_str() << endl;
  return 0;
}
