#include <bits/stdc++.h>
using namespace std;
void search(int n) {
  int *a, *b;
  bool *unused;
  a = new int[n];
  b = new int[n];
  unused = new bool[n];
  int Num = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i] >> b[i];
    Num += a[i];
    unused[i] = true;
  }
  for (int i = 0; i < n; i++) {
    int max = 0;
    int maxNum = 0;
    int maxVal = 0;
    for (int j = 0; j < n; j++) {
      if (unused[j]) {
        if (max < b[j]) {
          max = b[j];
          maxNum = j;
          maxVal = a[j];
        }
      }
    }
    if (b[maxNum] < Num) {
      cout << "No" << endl;
      return;
    }
    unused[maxNum] = false;
    Num -= maxVal;
    cout << maxVal << " " << max << " " << maxNum << " " << Num << endl;
  }
  cout << "Yes" << endl;
  return;
}
int main() {
  vector<int> n;
  int a;
  int i = 0;
  for (;;) {
    cin >> a;
    n.push_back(a);
    if (n[i] == 0) break;
    search(n[i]);
    i++;
  }
  return 0;
}
