#include <bits/stdc++.h>
using namespace std;
int n;
char s[500050];
string ss[500010];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf(" %s", s);
    ss[i] = s;
  }
  for (int i = n - 1; i >= 1; i--) {
    int flag = 0, Size1 = ss[i].length(), Size2 = ss[i + 1].length();
    for (int j = 0; j < Size1 && j < Size2; j++) {
      if (ss[i][j] < ss[i + 1][j]) {
        flag = 1;
        break;
      } else if (ss[i][j] > ss[i + 1][j]) {
        ss[i] = ss[i].substr(0, j);
      }
    }
    if (!flag) {
      if (ss[i].length() > ss[i + 1].length()) ss[i] = ss[i].substr(0, Size2);
    }
  }
  for (int i = 1; i <= n; i++) printf("%s\n", ss[i].c_str());
}
