#include <bits/stdc++.h>
using namespace std;
const int maxn = 110;
const int N = 1 << 16;
const int INF = 0x3f3f3f3f;
const int mod = 14997;
const double eps = 10e-6;
struct node {
  int len;
  char s[maxn];
} a[maxn];
bool cmp(node x, node y) { return x.len < y.len; }
int main() {
  int n, cnt = 1;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i].s;
    a[i].len = strlen(a[i].s);
  }
  sort(a, a + n, cmp);
  for (int i = 0; i < n; i++) {
    if (strstr(a[i + 1].s, a[i].s))
      cnt++;
    else
      break;
  }
  if (cnt != n)
    cout << "NO" << endl;
  else {
    cout << "YES" << endl;
    for (int i = 0; i < n; i++) cout << a[i].s << endl;
  }
  return 0;
}
