#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<string> v;
  set<string> s;
  map<string, vector<string> > m;
  long long int n;
  cin >> n;
  cin.ignore(256, '\n');
  for (long long int i = 1; i <= n; i++) {
    char str[10000];
    string fhj;
    gets(str);
    char ch[10000], ch1[10000];
    ch[0] = str[0];
    ch[1] = str[1];
    ch1[0] = str[0];
    ch1[1] = str[1];
    ch1[2] = str[2];
    int j;
    for (int k = 0; k <= strlen(str); k++) {
      if (str[k] == ' ') {
        j = k;
        break;
      }
    }
    ch[2] = str[j + 1];
    if (s.find(ch) == s.end() || s.empty()) {
      s.insert(ch);
      v.push_back(ch);
    } else {
      for (int l = 0; l < m[ch].size(); l++) {
        if (m[ch][l] == ch1) {
          cout << "NO";
          return 0;
        }
      }
      v.push_back(ch1);
      s.insert(ch1);
    }
    m[ch].push_back(ch1);
  }
  if (s.size() != v.size()) {
    cout << "NO";
    return 0;
  }
  cout << "YES" << endl;
  for (int i = 0; i < v.size(); i++) {
    cout << v[i];
    cout << endl;
  }
  return 0;
}
