#include <bits/stdc++.h>
using namespace std;
const int _N = 5e5 + 11;
const long long INF = 1e18;
const long long MOD = 1e9 + 7;
int n;
string s[_N], res[_N];
int main() {
  ios_base ::sync_with_stdio(0);
  cin.tie();
  cout.tie();
  cout << fixed;
  cout << setprecision(15);
  srand(time(NULL));
  cin >> n;
  for (int i = 0; i < n; i++) cin >> s[i];
  res[n - 1] = s[n - 1];
  for (int i = n - 2; i >= 0; i--) {
    if (s[i] <= res[i + 1])
      res[i] = s[i];
    else {
      int pos = -1;
      for (int j = 0; j < (int)min(s[i].size(), res[i + 1].size()); j++) {
        if (s[i][j] > res[i + 1][j]) {
          pos = j;
          break;
        }
      }
      if (pos == -1) pos = (int)min(s[i].size(), res[i + 1].size());
      for (int j = 0; j < pos; j++) {
        res[i].push_back(s[i][j]);
      }
    }
  }
  for (int i = 0; i < n; i++) cout << res[i] << '\n';
  return 0;
}
