#include <bits/stdc++.h>
using namespace std;
const long long int mod = 1e9 + 7;
const int maxn = 505 * 1001;
const int Base = 199;
int n;
string s[maxn], ans[maxn];
inline void solve(int i) {
  string ret;
  for (int j = 0; j < min(s[i].size(), ans[i + 1].size()); j++) {
    if (s[i][j] == ans[i + 1][j])
      ret += s[i][j];
    else if (s[i][j] < ans[i + 1][j]) {
      ret = s[i];
      break;
    } else
      break;
  }
  if (ret.size() == ans[i + 1].size() && ret != ans[i + 1]) ret = s[i];
  ans[i] = ret;
}
int32_t 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];
  ans[n] = s[n];
  for (int i = n - 1; i >= 1; i--) solve(i);
  for (int i = 1; i <= n; i++) cout << ans[i] << "\n";
  return 0;
}
