#include <bits/stdc++.h>
using namespace std;
const int N = 5010 + 12, mod = int(1e9) + 7;
int k, sz[20], a[20][N];
map<long long, int> ma, did;
long long second[20];
int used[N], c[20], num[20];
int good[(1 << 15) + 10], d[(1 << 15) + 10], pred[(1 << 15) + 10];
pair<int, int> rb[(1 << 15) + 10];
long long sum;
void go(int mask) {
  int id = rb[mask].first;
  if (id == -1) {
    id = rb[mask].second;
    c[id] = a[id][1];
    num[id] = id;
    return;
  }
  int x = a[id][rb[mask].second];
  c[id] = x;
  int prev = id;
  while (true) {
    int i = ma[x];
    num[i] = prev;
    c[i] = x;
    x = sum + x - second[i];
    prev = i;
    if (ma.count(x)) {
      if (x == c[id]) {
        num[id] = i;
        break;
      }
    }
  }
}
int main() {
  scanf("%d", &k);
  for (int i = 0; i < k; i++) {
    scanf("%d", &sz[i]);
    for (int j = 1; j <= sz[i]; j++) {
      scanf("%d", &a[i][j]);
      ma[a[i][j]] = i;
      second[i] += a[i][j];
    }
    sum += second[i];
  }
  if (sum % k != 0) {
    cout << "No";
    return 0;
  }
  sum /= k;
  bool ok = 0;
  good[0] = 1;
  for (int i = 0; i < k; i++) {
    if (second[i] != sum) {
      for (int j = 1; j <= sz[i]; j++) {
        long long x = sum + a[i][j] - second[i];
        int mask = (1 << i);
        used[i] = 1;
        if (ma.count(x)) {
          while (true) {
            int id = ma[x];
            mask += (1 << id);
            x = sum + x - second[id];
            used[id] = 1;
            if (ma.count(x)) {
              if (x == a[i][j]) break;
              if (used[ma[x]] == 1) {
                mask = 0;
                break;
              }
            } else {
              mask = 0;
              break;
            }
          }
          good[mask] = 1;
          rb[mask] = make_pair(i, j);
        }
        for (int x = 0; x < k; x++) used[x] = 0;
      }
    } else {
      good[(1 << i)] = 1;
      rb[(1 << i)] = make_pair(-1, i);
    }
  }
  d[0] = 1;
  for (int m = 1; m < (1 << k); m++) {
    if (good[m]) {
      pred[m] = m;
      d[m] = 1;
      continue;
    }
    for (int second = m; second > 0; second = (second - 1) & m) {
      if (good[second]) {
        if (d[m ^ second]) {
          d[m] = 1;
          pred[m] = second;
        }
      }
    }
  }
  if (d[(1 << k) - 1]) {
    cout << "Yes" << endl;
    int m = (1 << k) - 1;
    for (int i = 0; i < k; i++) {
      c[i] = mod;
    }
    while (m > 0) {
      go(pred[m]);
      m = (m ^ pred[m]);
    }
    for (int i = 0; i < k; i++) {
      cout << c[i] << " " << num[i] + 1 << endl;
    }
  } else {
    cout << "No";
  }
  return 0;
}
