#include <bits/stdc++.h>
using namespace std;
struct op {
  int start_box, end_box;
  long long val;
  op(int start_box, int end_box, long long val)
      : start_box(start_box), end_box(end_box), val(val) {}
};
int main() {
  int n;
  scanf("%d", &n);
  vector<vector<long long> > a(n, vector<long long>());
  vector<long long> sum(n);
  long long s = 0;
  for (int i = 0; i < n; i++) {
    int k;
    scanf("%d", &k);
    for (int j = 0; j < k; j++) {
      int x;
      scanf("%d", &x);
      a[i].push_back(x);
      s += x;
      sum[i] += x;
    }
    sort(a[i].begin(), a[i].end());
  }
  if (s % n != 0) {
    printf("No\n");
    return 0;
  }
  s /= n;
  vector<vector<op> > cycles(1 << n);
  for (int i = 0; i < n; i++) {
    for (long long o : a[i]) {
      long long need = s - (sum[i] - o);
      int x = -1;
      for (int j = 0; j < n; j++)
        if (binary_search(a[j].begin(), a[j].end(), need)) x = j;
      if (x == -1) continue;
      int bad = 0, msk = 1 << i;
      vector<op> moves;
      int prv = i;
      while (1) {
        if (x == -1) {
          bad = 1;
          break;
        }
        if (msk >> x & 1) {
          if (x != i) bad = 1;
          msk |= 1 << x;
          moves.push_back(op(x, prv, need));
          break;
        }
        msk |= 1 << x;
        moves.push_back(op(x, prv, need));
        need = s - (sum[x] - need);
        prv = x;
        x = -1;
        for (int j = 0; j < n; j++)
          if (binary_search(a[j].begin(), a[j].end(), need)) x = j;
      }
      auto tmp = sum;
      for (auto o : moves) {
        tmp[o.start_box] -= o.val;
        tmp[o.end_box] += o.val;
      }
      for (int i = 0; i < n; i++)
        if (msk >> i & 1)
          if (tmp[i] != s) bad = 1;
      if (!bad) {
        cycles[msk] = moves;
      }
    }
  }
  vector<int> dp(1 << n), from(1 << n);
  dp[0] = 1;
  for (int mask = 1; mask < (1 << n); mask++) {
    for (int msk = mask; msk > 0; msk = (msk - 1) & mask) {
      if (dp[mask ^ msk] && !cycles[msk].empty()) {
        dp[mask] = 1;
        from[mask] = mask ^ msk;
      }
    }
  }
  if (!dp[(1 << n) - 1]) {
    printf("No\n");
    return 0;
  }
  int x = (1 << n) - 1;
  vector<pair<long long, int> > movs(n);
  while (x > 0) {
    int cur = x ^ from[x];
    for (auto o : cycles[cur]) movs[o.start_box] = {o.val, o.end_box};
    x = from[x];
  }
  printf("Yes\n");
  for (int i = 0; i < n; i++) {
    printf("%lld %d\n", movs[i].first, movs[i].second + 1);
  }
  return 0;
}
