#include <bits/stdc++.h>
int lun[500111];
int main() {
  char *S[500111];
  char T[500111];
  int N;
  scanf("%d", &N);
  for (int i = 0; i < N; ++i) {
    scanf("%s", T);
    int n = strlen(T);
    lun[i] = n;
    S[i] = (char *)malloc((n + 5) * sizeof(char));
    strcpy(S[i], T);
  }
  for (int i = N - 1; i > 0; --i) {
    if (strcmp(S[i], S[i - 1]) < 0) {
      int j = 0;
      while (S[i][j] == S[i - 1][j]) j++;
      strncpy(T, S[i - 1], j);
      T[j] = '\0';
      strcpy(S[i - 1], T);
    }
  }
  for (int i = 0; i < N; ++i) {
    printf("%s\n", S[i]);
  }
  return 0;
}
