#include <bits/stdc++.h>
using namespace std;
struct square {
  int w;
  int h;
};
int main() {
  square face[6];
  int i, j, ipow, jpow, T, F, R, Flags = 0;
  for (i = 0; i < 6; i++) {
    cin >> face[i].h >> face[i].w;
    if (face[i].w > face[i].h) swap(face[i].w, face[i].h);
  }
  for (i = 0; i < 5; i++) {
    for (j = i + 1; j < 6; j++) {
      ipow = pow(2, i);
      jpow = pow(2, j);
      if (face[i].w == face[j].w && face[i].h == face[j].h &&
          (Flags & ipow) == 0 && (Flags & jpow) == 0) {
        Flags += ipow;
        Flags += jpow;
        T = i;
        break;
      }
    }
    if (j < 6) break;
  }
  cout << bitset<6>(Flags) << endl;
  if (i == 5 && j == 4) {
    cout << "No" << endl;
    return 0;
  }
  for (i = 0; i < 5; i++) {
    for (j = i + 1; j < 6; j++) {
      ipow = pow(2, i);
      jpow = pow(2, j);
      if (face[i].w == face[j].w && face[i].h == face[j].h &&
          (Flags & ipow) == 0 && (Flags & jpow) == 0) {
        Flags += ipow;
        Flags += jpow;
        F = i;
        break;
      }
    }
    if (j < 6) break;
  }
  cout << bitset<6>(Flags) << endl;
  if (i == 5 && j == 4) {
    cout << "No" << endl;
    return 0;
  }
  for (i = 0; i < 6; i++) {
    ipow = pow(2, i);
    if ((Flags & ipow) == 0) {
      Flags += ipow;
      R = i;
      break;
    }
  }
  for (i = 0; i < 6; i++) {
    ipow = pow(2, i);
    if ((Flags & ipow) == 0) {
      Flags += ipow;
      break;
    }
  }
  if (face[R].w != face[i].w || face[R].h != face[i].h) {
    cout << "No" << endl;
    return 0;
  }
  cout << bitset<6>(Flags) << endl;
  if (face[T].w == face[F].w &&
      (face[T].h == face[R].w || face[T].h == face[R].h)) {
    cout << "Yes" << endl;
    return 0;
  }
  if (face[T].w == face[F].h &&
      (face[T].w == face[R].w || face[T].w == face[R].h)) {
    cout << "Yes" << endl;
    return 0;
  }
  cout << "No" << endl;
  return 0;
}
