#include <bits/stdc++.h>
using namespace std;
long long bigMod(long long b, long long p, long long m) {
  if (!p)
    return 1 % m;
  else if (p & 1)
    return (((b % m) + m) % m * bigMod(b, p - 1, m)) % m;
  else {
    long long ret = bigMod(b, p / 2, m);
    return (ret * ret) % m;
  }
}
long long inline gcd(long long x, long long y) {
  return !y ? (long long)abs(x) : gcd(y, x % y);
}
long long inline lcm(long long a, long long b) {
  return ((long long)abs((a / gcd(a, b)) * b));
}
double inline cartesian_dist(double x1, double y1, double x2, double y2) {
  return sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
}
const double PI = acos(-1.0);
const double EPS = 10E-7;
int main() {
  int n;
  string s, temp;
  while (1 == scanf("%d", &n)) {
    vector<string> vec;
    for (int i = 0; i < n; i++) {
      cin >> s;
      vec.push_back(s);
    }
    for (int i = vec.size() - 2, k = vec.size() - 1; i >= 0; i--) {
      bool flag = false, flag2 = true;
      for (int j = 0; j < vec[i].size() && j < vec[k].size(); j++) {
        if (vec[i][j] < vec[k][j]) {
          flag = true;
          break;
        } else if (vec[i][j] > vec[k][j]) {
          break;
        }
        if (vec[i][j] != vec[k][j]) flag2 = false;
        temp += vec[i][j];
      }
      if (!flag)
        vec[i] = temp;
      else if (!flag && flag2 == true)
        vec[i] = temp;
      temp.clear();
      k--;
    }
    for (int i = 0; i < vec.size(); i++) cout << vec[i] << endl;
  }
  return 0;
}
