#include <bits/stdc++.h>
using namespace std;
int n, ans, m, m1, o;
string second[550000], s2[550000], minn;
bool waas;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> second[i];
  for (int i = n - 1; i >= 1; i--) {
    s2[i] = "#";
    m = second[i].length();
    m1 = second[i + 1].length();
    waas = false;
    for (int j = 1; j < m; j++) {
      if (j > m1 - 1) {
        break;
      } else {
        if (!waas && second[i][j] > second[i + 1][j]) break;
        if (second[i][j] < second[i + 1][j]) {
          waas = true;
          for (int k = j; j < m; j++) s2[i] += second[i][j];
          break;
        }
        if (second[i][j] == second[i + 1][j]) {
          s2[i] += second[i][j];
        }
      }
    }
    if (s2[i] <= minn) {
      minn = s2[i];
      o = i;
    }
    second[i] = s2[i];
  }
  for (int i = 1; i <= n; i++) cout << second[i] << endl;
  return 0;
}
