#include <bits/stdc++.h>
const int inf = 0x3f3f3f3f;
using namespace std;
struct temp {
  char a[105];
  int len;
} word[105];
bool cmp(temp a, temp b) { return a.len < b.len; }
int main() {
  int n;
  scanf("%d", &n);
  getchar();
  for (int i = 1; i <= n; i++) {
    gets(word[i].a);
    word[i].len = strlen(word[i].a);
  }
  sort(word + 1, word + 1 + n, cmp);
  for (int i = 1; i < n; i++) {
    if (strstr(word[i + 1].a, word[i].a) == NULL) {
      printf("NO\n");
      return 0;
    }
  }
  printf("YES\n");
  for (int i = 1; i <= n; i++) printf("%s\n", word[i].a);
  return 0;
}
