#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, a, t, r, m, b, j, c, x, p, ans;
  cin >> n;
  char str[n + 5][200];
  int ara[n + 10][2];
  for (int i = 0; i < n; i++) {
    cin >> str[i];
    ara[i][0] = strlen(str[i]);
    ara[i][1] = i;
  }
  for (int i = 0; i < n - 1; i++) {
    for (int j = 0; j < n - i - 1; j++) {
      if (ara[j][0] > ara[j + 1][0]) {
        a = ara[j][0];
        ara[j][0] = ara[j + 1][0];
        ara[j + 1][0] = a;
        r = ara[j][1];
        ara[j][1] = ara[j + 1][1];
        ara[j + 1][1] = r;
      }
    }
  }
  char efa[n + 5][200];
  for (int i = 0; i < n; i++) {
    strcpy(efa[i], str[ara[i][1]]);
  }
  for (int i = 0; i < n - 1; i++) {
    for (p = i + 1; p < n; p++) {
      if (strlen(efa[i]) <= strlen(efa[p])) {
        break;
      } else if (p == n - 1) {
        p = 200;
        break;
      }
    }
    if (p == 200) continue;
    m = 0, ans = 0;
    for (int j = 0; efa[p][j] != NULL; j++) {
      if (efa[p][j] == efa[i][m]) {
        x = 0;
        b = j;
        for (k = m; efa[i][k] != NULL; k++, j++) {
          if (efa[i][k] == efa[p][j]) x++;
          if (x == strlen(efa[i])) {
            ans = 1;
            break;
          }
          if (efa[i][k] != efa[p][j]) {
            j = b;
            break;
          }
        }
        if (ans == 1) break;
      }
    }
    if (ans == 0) {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
  for (int i = 0; i < n; i++) cout << efa[i] << endl;
}
