#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  vector<string> s(n);
  for (int i = 0; i < n; i++) cin >> s[i];
  for (int i = n - 1; i > 0; i--) {
    int length_first = s[i - 1].length();
    int length_second = s[i].length();
    for (int j = 0; j < min(length_first, length_second); j++) {
      if (s[i - 1][j] < s[i][j]) {
        break;
      }
      if (s[i - 1][j] > s[i][j]) {
        s[i - 1].erase(j);
        break;
      }
    }
    if (s[i - 1] > s[i]) {
      s[i - 1].erase(s[i].length());
    }
  }
  for (int i = 0; i < n; i++) cout << s[i] << "\n";
}
