#include <bits/stdc++.h>
using namespace std;
char strs[2000010];
char sStr[1000010];
int starts[1000010];
int main() {
  int n;
  scanf("%d", &n);
  starts[0] = 0;
  int j = 0;
  for (int i = 0; i < n; i++) {
    scanf("%s", sStr);
    for (j = 0; sStr[j] != '\0'; j++) {
      strs[starts[i] + j] = sStr[j];
    }
    strs[starts[i] + j] = '\0';
    starts[i + 1] = starts[i] + j + 1;
  }
  for (int i = n - 2; i >= 0; i--) {
    j = 0;
    while (true) {
      if (strs[starts[i] + j] < strs[starts[i + 1] + j]) {
        break;
      } else if (strs[starts[i] + j] > strs[starts[i + 1] + j]) {
        strs[starts[i] + j] = '\0';
        break;
      }
      if (strs[starts[i] + j] == '\0') {
        break;
      }
      j++;
    }
  }
  char *ptr = strs;
  for (int i = 0; i < n; i++) {
    printf("%s\n", ptr + starts[i]);
  }
  return 0;
}
