#include <bits/stdc++.h>
using namespace std;
const int MAX = (1 << 15) + 10;
vector<long long> mat[16];
map<long long, long long> mopa;
long long sum[16], totSum;
long long tok[16], placed[16];
bool dp[MAX], sol[MAX];
pair<long long, long long> ans[MAX], refe[MAX];
long long rec(long long p, long long need, long long hereExtra,
              long long mask) {
  mask |= (1 << p);
  if (need == hereExtra) return mask;
  if (mopa.find(need) == mopa.end()) return 0;
  long long isPlaced = mopa[need];
  if (mask & (1 << isPlaced)) return 0;
  long long newNeed = totSum - (sum[isPlaced] - need);
  return rec(isPlaced, newNeed, hereExtra, mask);
}
long long chao(long long p, long long need, long long hereExtra) {
  if (need == hereExtra) return p;
  long long isPlaced = mopa[need];
  tok[isPlaced] = need;
  placed[isPlaced] = p;
  long long newNeed = totSum - (sum[isPlaced] - need);
  return chao(isPlaced, newNeed, hereExtra);
}
void prin(long long p) {
  if (!p) return;
  if (sol[p]) {
    long long i = ans[p].first, x = ans[p].second;
    long long need = totSum - (sum[i] - x);
    long long last = chao(i, need, x);
    tok[i] = x;
    placed[i] = last;
    return;
  }
  for (long long i = p; i; i = (i - 1) & p) {
    long long rest = p ^ i;
    if (dp[rest] && dp[i] && i && rest) {
      prin(i);
      prin(rest);
      return;
    }
  }
}
int main() {
  ios::sync_with_stdio(false);
  long long n, m, v, k;
  cin >> n;
  for (long long i = 0; i < n; i++) {
    cin >> m;
    for (long long j = 0; j < m; j++) {
      cin >> v;
      totSum += v;
      sum[i] += v;
      mat[i].push_back(v);
      mopa[v] = i;
    }
  }
  if (totSum % n) {
    cout << "No" << endl;
    return 0;
  }
  totSum /= n;
  for (long long i = 0; i < n; i++) {
    for (long long x : mat[i]) {
      long long need = totSum - (sum[i] - x);
      long long mask = rec(i, need, x, 0);
      sol[mask] = dp[mask] = 1;
      ans[mask] = {i, x};
    }
  }
  for (long long p = 0; p < (1 << n); p++) {
    if (dp[p]) continue;
    for (long long i = p; i; i = (i - 1) & p) {
      long long rest = p ^ i;
      if (dp[rest] && dp[i]) {
        dp[p] = 1;
        refe[p] = {rest, i};
      }
    }
  }
  if (!dp[(1 << n) - 1]) {
    cout << "No" << endl;
    return 0;
  }
  cout << "Yes" << endl;
  prin((1 << n) - 1);
  for (long long i = 0; i <= n - 1; i++) {
    cout << tok[i] << ' ' << placed[i] + 1 << endl;
  }
  return 0;
}
