#include <bits/stdc++.h>
using namespace std;
string gg, str[500001];
stringstream s1;
long long j, i, l1, l2, l3, n, a[1000000], pos, mx, ans, numb, u, l, m, b, jj,
    w;
int main() {
  ios_base ::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  for (i = n - 1; i >= 0; i--) cin >> str[i];
  for (i = 0; i < n; i++) {
    if (str[i] < str[i + 1]) {
      for (j = 0; j < str[i].size(); j++)
        if (str[i][j] < str[i + 1][j]) break;
      str[i + 1] = str[i + 1].substr(0, j);
    }
  }
  for (i = n - 1; i >= 0; i--) cout << str[i] << "\n";
  return 0;
}
