#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
using namespace std;
using ll = long long;
using db = long double;
using row = vector<int>;
using ii = pair<int, int>;
const int N = 3e5 + 5, A = 6561, LG = 19, MOD = 1e9 + 7;
const int SQ = 450;
const long double EPS = 1e-7;
int dp[1 << 15];
int take[1 << 15], k;
map<int, int> toM;
vector<vector<int>> vals;
ll sum[22], tot;
int from[22];
int to[22], ptr;
void finish() {
  cout << "Yes\n";
  for (int i = 0; i < k; i++) cout << from[i] << ' ' << to[i] + 1 << '\n';
  exit(0);
}
int all[1 << 15];
void solve(int mask, int capt, int want, int idx, int prv, int cas) {
  if (mask == 0) {
    if (capt == want) {
      from[idx] = capt;
      to[idx] = prv;
      finish();
    }
    return;
  }
  if (dp[mask] == cas) return;
  if (all[mask]) return;
  ;
  dp[mask] = cas;
  if (capt == want) {
    from[idx] = capt;
    to[idx] = prv;
    int cnt = 0;
    for (auto v : vals[take[mask & -mask]]) {
      solve(mask - (mask & -mask), v, tot - (sum[take[mask & -mask]] - v),
            take[mask & -mask], take[mask & -mask], ++ptr);
      cnt++;
    }
    all[mask] = 1;
    return;
  }
  int tmp = idx;
  if (toM.count(want) == 0) return;
  for (int m = toM[want] & mask; m > 0; m -= (m & -m)) {
    int idx = take[m & -m];
    int want2 = sum[idx] - want;
    want2 = tot - want2;
    from[idx] = want;
    to[idx] = prv;
    solve(mask ^ (1 << idx), capt, want2, tmp, idx, cas);
  }
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  for (int j = 0; j < 15; j++) take[1 << j] = j;
  cin >> k;
  vals.resize(k);
  toM[0] = (1 << k) - 1;
  for (int i = 0; i < k; i++) {
    int sz;
    cin >> sz;
    vals[i].resize(sz);
    for (auto& x : vals[i]) cin >> x, toM[x] |= (1 << i);
    sum[i] = accumulate(vals[i].begin(), vals[i].end(), 0ll);
    tot += sum[i];
  }
  if (tot % k) {
    cout << "No\n";
    return 0;
  }
  tot /= k;
  vector<int> take;
  solve((1 << k) - 1, 0, 0, k, k, ++ptr);
  cout << "No\n";
  return 0;
}
