#include <bits/stdc++.h>
using namespace std;
template <typename T>
class Matriz2D : public vector<vector<T>> {
 public:
  Matriz2D() {}
  Matriz2D(int n, int m, const T &valor) {
    this->resize(n);
    for (int i = 0; i < n; i++) {
      (*this)[i].resize(m, valor);
    }
  }
};
int main() {
  long long n;
  cin >> n;
  vector<string> v(n);
  for (auto &x : v) cin >> x;
  for (long long i = n - 2; i >= 0; i--) {
    size_t j;
    bool lol = false;
    for (j = 1; j < v[i].size() and j < v[i + 1].size(); j++) {
      if (v[i][j] != v[i + 1][j]) {
        lol = true;
        break;
      }
    }
    if (not lol) {
      if (v[i].size() > v[i + 1].size())
        v[i] = string(v[i + 1].begin(), v[i + 1].begin() + v[i + 1].size());
      continue;
    }
    if (v[i][j] < v[i + 1][j]) continue;
    v[i] = string(v[i + 1].begin(), v[i + 1].begin() + j);
  }
  for (auto &x : v) {
    cout << x << endl;
  }
}
