#include <bits/stdc++.h>
using namespace std;
int getBit(long long x, int pos) { return (x & (1ll << pos)) > 0 ? 1 : 0; }
int n;
vector<long long> a[20];
long long sum[20];
map<long long, int> pos;
int use[20][5050];
long long totalSum;
long long needSum;
int dp[(1 << 16) + 123];
pair<int, pair<int, int>> par[(1 << 16) + 123];
pair<long long, int> ans[20];
void restoreAnswer(pair<int, int> p) {
  int fidx = p.first;
  int i = p.first, j = p.second;
  ans[i].first = a[i][j];
  long long need = needSum - (sum[i] - a[i][j]);
  int prev = i;
  while (true) {
    int go = pos[need];
    ans[go].first = need;
    ans[go].second = prev;
    if (go == fidx) {
      break;
    }
    prev = go;
    need = needSum - (sum[go] - need);
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int cnt;
    scanf("%d", &cnt);
    for (int j = 0; j < cnt; j++) {
      long long x;
      scanf("%lld", &x);
      a[i].push_back(x);
      pos[x] = i;
      totalSum += x;
      sum[i] += x;
    }
  }
  needSum = totalSum / n;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < (int)a[i].size(); j++) {
      int mask = 1 << i;
      bool ok = true;
      long long need = needSum - (sum[i] - a[i][j]);
      while (true) {
        if (pos.count(need) == 0) {
          ok = false;
          break;
        }
        int go = pos[need];
        if (go == i) {
          if (need != a[i][j]) {
            ok = false;
          }
          break;
        }
        if (getBit(mask, go) == 1) {
          ok = false;
          break;
        }
        mask |= (1 << go);
        need = needSum - (sum[go] - need);
      }
      if (!ok)
        use[i][j] = -1;
      else
        use[i][j] = mask;
    }
  }
  dp[0] = true;
  for (int i = 1; i < (1 << n); i++) {
    int f = 0;
    for (int j = 0; j < n; j++) {
      if (getBit(i, j) == 1) {
        f = j;
        break;
      }
    }
    for (int j = 0; j < (int)a[f].size(); j++) {
      int subMask = use[f][j];
      if (subMask == -1 || (i & subMask) != subMask) continue;
      if (dp[i ^ subMask]) {
        dp[i] = true;
        par[i] = {subMask, {f, j}};
      }
    }
  }
  if (dp[(1 << n) - 1] == false) {
    puts("No");
    return 0;
  }
  int mask = (1 << n) - 1;
  while (mask) {
    restoreAnswer(par[mask].second);
    mask = mask ^ par[mask].first;
  }
  puts("Yes");
  for (int i = 0; i < n; i++) {
    printf("%lld %d\n", ans[i].first, ans[i].second + 1);
  }
  return 0;
}
