#include <bits/stdc++.h>
using namespace std;
string st1[1005];
string st2[1005];
int main() {
  int a, n, check = 1;
  string st;
  cin >> n;
  for (int i = 0; i <= n; i++) {
    getline(cin, st);
    st1[i] = st.substr(0, 3);
    a = st.find(' ');
    st2[i] = st.substr(0, 2) + st[a + 1];
  }
  for (int i = 1; i < n; i++) {
    check = 1;
    for (int j = i + 1; j <= n; j++) {
      if (st2[i] == st2[j]) {
        check = 0;
        st2[j] = "-1";
      }
    }
    if (check == 0) st2[i] = "-1";
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      if (st2[i] == st1[j]) st1[j] = "-1";
    }
  }
  for (int i = 1; i < n; i++) {
    check = 1;
    for (int j = i + 1; j <= n; j++) {
      if (st1[i] == st1[j]) {
        st1[j] = "-1";
        check = 0;
      }
    }
    if (check == 0) st1[i] = "-1";
  }
  check = 1;
  for (int i = 1; i <= n; i++) {
    if (st1[i] == "-1" && st2[i] == "-1") {
      check = 0;
      cout << "NO";
      break;
    }
  }
  if (check != 0) {
    cout << "YES" << endl;
    for (int i = 1; i <= n; i++) {
      if (st1[i] != "-1")
        cout << st1[i] << endl;
      else
        cout << st2[i] << endl;
    }
  }
}
