#include <bits/stdc++.h>
using namespace std;
const int N = (1 << 15) + 5, mo = 1e9 + 7;
int k, n;
vector<int> a[20];
map<long long, int> ex;
long long sum, su[20];
int fr[N], fr2[N];
int to[N], out[N], in[N];
bool is[N];
int main() {
  ios::sync_with_stdio(false);
  cin >> k;
  for (int i = 1, _e = k; i <= _e; ++i) {
    cin >> n;
    a[i].resize(n);
    for (int j = 0, _e = n - 1; j <= _e; ++j)
      cin >> a[i][j], su[i] += a[i][j], ex[a[i][j]] = i;
    sum += su[i];
  }
  if (sum % k) return printf("No"), 0;
  sum /= k;
  for (int i = 1, _e = k; i <= _e; ++i) {
    long long s;
    for (int j = 0, _e = a[i].size() - 1; j <= _e; ++j) {
      s = sum - su[i] + a[i][j];
      if (ex[s]) {
        int S = 1 << i - 1;
        bool can = 1;
        for (; ex[s] != i;) {
          if (S & (1 << ex[s] - 1)) {
            can = 0;
            break;
          }
          S |= 1 << ex[s] - 1;
          s = sum - su[ex[s]] + s;
        }
        if (can && !fr[S] && s == a[i][j]) fr[S] = a[i][j], is[S] = 1;
      }
    }
  }
  for (int i = 1, _e = (1 << k) - 1; i <= _e; ++i)
    if (!is[i]) {
      for (int j = i; j; j = (j - 1) & i)
        if (is[j] && fr[i ^ j]) {
          fr2[i] = i ^ j;
          is[i] = 1;
          break;
        }
    } else
      fr2[i] = i;
  if (!is[(1 << k) - 1]) return printf("No"), 0;
  printf("Yes\n");
  for (int S = (1 << k) - 1; S;) {
    long long j = fr[fr2[S]];
    int o = ex[j], *tt;
    out[ex[j]] = j;
    tt = &to[ex[j]];
    j = sum - su[ex[j]] + j;
    for (; ex[j] != o;) {
      *tt = ex[j];
      out[ex[j]] = j;
      tt = &to[ex[j]];
      j = sum - su[ex[j]] + j;
    }
    *tt = o;
    S ^= fr2[S];
  }
  for (int i = 1, _e = k; i <= _e; ++i) in[to[i]] = i;
  for (int i = 1, _e = k; i <= _e; ++i) printf("%d %d\n", out[i], in[i]);
}
