#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 10;
struct node {
  string str;
} arr[N];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> arr[i].str;
  for (int i = n - 2; i >= 0; --i) {
    if (arr[i + 1].str[1] > arr[i].str[1]) continue;
    int len1 = arr[i + 1].str.size();
    int len2 = arr[i].str.size();
    string t;
    t.clear();
    bool flag = false;
    if (len2 >= len1) {
      for (int j = 0; j < len1; ++j) {
        if (arr[i + 1].str[j] == arr[i].str[j]) {
          t += arr[i].str[j];
        } else if (arr[i + 1].str[j] > arr[i].str[j]) {
          flag = true;
          break;
        } else
          break;
      }
      if (!flag) arr[i].str = t;
    } else {
      for (int j = 0; j < len2; ++j) {
        if (arr[i + 1].str[j] == arr[i].str[j]) {
          t += arr[i].str[j];
        } else if (arr[i + 1].str[j] > arr[i].str[j]) {
          flag = true;
          break;
        } else
          break;
      }
      if (!flag) arr[i].str = t;
    }
  }
  for (int i = 0; i < n; ++i) cout << arr[i].str << endl;
  return 0;
}
