#include <bits/stdc++.h>
using namespace std;
int isSubstring(string s1, string s2) {
  int M = s1.length();
  int N = s2.length();
  for (int i = 0; i <= N - M; i++) {
    int j;
    for (j = 0; j < M; j++)
      if (s2[i + j] != s1[j]) break;
    if (j == M) return i;
  }
  return -1;
}
void sort(string s[], int n) {
  for (int i = 1; i < n; i++) {
    string temp = s[i];
    int j = i - 1;
    while (j >= 0 && temp.length() < s[j].length()) {
      s[j + 1] = s[j];
      j--;
    }
    s[j + 1] = temp;
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  int n;
  cin >> n;
  bool f = true;
  string arr[n];
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  sort(arr, n);
  for (int i = 1; i < n; i++) {
    if (arr[i].size() == arr[i - 1].size() && arr[i] != arr[i - 1]) {
      f = false;
      break;
    }
    if (arr[i].size() != arr[i - 1].size()) {
      int ans = isSubstring(arr[i - 1], arr[i]);
      if (ans == -1) {
        f = false;
        break;
      }
    }
  }
  if (f) {
    cout << "YES" << endl;
    for (int i = 0; i < n; i++) {
      cout << arr[i] << endl;
    }
  } else
    cout << "NO";
}
