#include <bits/stdc++.h>
using namespace std;
const int MX = 1e5 + 5;
long long avg, tot[20];
long long box, sz[20];
vector<long long> ara[20];
map<long long, long long> mp;
long long dp[MX];
long long pick[20], put[20];
long long func(long long mask) {
  if (mask == (1 << box) - 1) return 1;
  long long &r = dp[mask];
  if (r != -1) return r;
  r = 0;
  long long cur;
  for (cur = 0; cur < box; ++cur)
    if (!((1 << cur) & mask)) break;
  if (tot[cur] == avg) {
    pick[cur] = ara[cur][0];
    put[cur] = cur + 1;
    return r = func(mask | (1 << cur));
  }
  long long tmask, req, pos, tpos;
  for (long long i = 0; i < sz[cur] && !r; ++i) {
    req = ara[cur][i];
    pos = cur;
    tmask = mask | (1 << cur);
    pick[pos] = req;
    while (1) {
      req = avg - (tot[pos] - req);
      tpos = pos;
      if (pos == mp[req] - 1) break;
      pos = mp[req] - 1;
      if (pos == cur && req == ara[cur][i]) {
        r = func(tmask);
        put[pos] = tpos + 1;
        break;
      }
      if (pos == -1 || ((1 << pos) & tmask)) break;
      tmask |= (1 << pos);
      pick[pos] = req;
      put[pos] = tpos + 1;
    }
  }
  return r;
}
int main() {
  long long i, j, k;
  cin >> box;
  avg = 0;
  for (i = 0; i < box; ++i) {
    cin >> sz[i];
    for (j = 0; j < sz[i]; ++j) {
      cin >> k;
      tot[i] += k;
      ara[i].push_back(k);
      mp[k] = i + 1;
    }
    avg += tot[i];
  }
  if (abs(avg) % box) return puts("No");
  avg /= box;
  memset(dp, -1, sizeof dp);
  memset(pick, -1, sizeof pick);
  if (func(0) == 0)
    puts("No");
  else {
    puts("Yes");
    for (i = 0; i < box; ++i) cout << pick[i] << " " << put[i] << endl;
  }
}
