#include <bits/stdc++.h>
using namespace std;
struct st {
  char s[100001];
} arr[200];
bool if_sub(string s1, string s2) {
  if (s1.size() <= s2.size()) {
    for (int i = 0; i < s2.size(); i++) {
      if (s2[i] == s1[0]) {
        int id = i;
        bool flag = 1;
        for (int j = 0; j < s1.size(); j++) {
          if (id < s2.size() && s2[id] == s1[j]) {
            id++;
          } else {
            flag = 0;
            break;
          }
        }
        if (flag) return 1;
      }
    }
  }
  return 0;
}
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> arr[i].s;
  }
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      if (if_sub(arr[j].s, arr[i].s)) {
        char temp[100010];
        strcpy(temp, arr[i].s);
        strcpy(arr[i].s, arr[j].s);
        strcpy(arr[j].s, temp);
      }
    }
  }
  bool yes = 1;
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      if (!if_sub(arr[i].s, arr[j].s)) {
        yes = 0;
        break;
      }
    }
  }
  if (yes) {
    cout << "YES" << endl;
    for (int i = 0; i < n; i++) {
      cout << arr[i].s << endl;
    }
  } else
    cout << "NO" << endl;
}
