#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
const int MAX = 5e3 + 5;
const long long MAX2 = 11;
const long long MOD = 1000000007;
const long long MOD2 = 1000005329;
const long long INF = 2e18;
const int dr[] = {1, 0, -1, 0, 1, 1, -1, -1, 0};
const int dc[] = {0, 1, 0, -1, 1, -1, 1, -1, 0};
const double pi = acos(-1);
const double EPS = 1e-9;
const int block = 2000;
long long k, n[16], x[16][MAX], ttl[16], tgt, en, zz, c[16], p[16];
map<long long, int> pos;
bool dp[1 << 15], vis[1 << 15];
bool f(int mask) {
  if (mask == en) {
    cout << "Yes\n";
    return true;
  }
  if (vis[mask]) return dp[mask];
  vis[mask] = true;
  int st, tmp = mask, ls, nw, res;
  long long fn;
  bool sta;
  stack<int> rese;
  for (long long i = 0; i <= k; ++i) {
    if (!(mask & (1 << i))) {
      st = i;
      break;
    }
  }
  tmp |= (1 << st);
  for (long long i = 1; i <= n[st]; ++i) {
    fn = tgt - ttl[st] + x[st][i];
    if (!pos.count(fn)) continue;
    res = pos[fn];
    if (tmp & (1 << res)) continue;
    sta = true;
    ls = st;
    while (1) {
      c[res] = fn, p[res] = ls;
      rese.push(1 << res);
      tmp |= (1 << res);
      fn = tgt - ttl[res] + fn;
      if (fn == x[st][i]) break;
      if (!pos.count(fn)) {
        sta = false;
        break;
      }
      ls = res, res = pos[fn];
      if (tmp & (1 << res)) {
        sta = false;
        break;
      }
    }
    if (!sta || !f(tmp))
      while (!rese.empty()) tmp ^= rese.top(), rese.pop();
    else {
      c[st] = fn, p[st] = res;
      return dp[mask] = true;
    }
  }
  return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> k;
  en = (1 << k) - 1, --k;
  for (long long i = 0; i <= k; ++i) {
    cin >> n[i];
    for (long long j = 1; j <= n[i]; ++j)
      cin >> x[i][j], pos[x[i][j]] = i, ttl[i] += x[i][j];
    tgt += ttl[i];
  }
  if (tgt % (k + 1)) return cout << "No\n", 0;
  tgt /= k + 1;
  for (long long i = 0; i <= k; ++i)
    if (ttl[i] == tgt) zz |= (1 << i), c[i] = x[i][1], p[i] = i;
  if (!f(zz)) return cout << "No\n", 0;
  for (long long i = 0; i <= k; ++i) cout << c[i] << ' ' << p[i] + 1 << '\n';
  return 0;
}
