#include <bits/stdc++.h>
using namespace std;
#pragma GCC miniimize("Ofast")
const long long maxn = 2e5 + 5, N = 5e5 + 10, SQ = 100, base = 800287,
                mod = 1e9 + 7, INF = 1e9 + 10, lg = 16;
const long double eps = 1e-4;
long long k, a[lg][maxn], sz[maxn], sum[maxn], par[maxn], start[maxn], tot;
bitset<lg> mark;
bool dp[maxn];
unordered_map<long long, long long> box;
vector<long long> vec;
pair<long long, long long> ans[maxn];
void find_sources(long long x = (1ll << k) - 1) {
  if (par[x] == -1) {
    vec.push_back(x);
    return;
  }
  long long mask1 = par[x], mask2 = x ^ par[x];
  find_sources(mask1), find_sources(mask2);
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> k;
  for (long long i = 0; i < k; ++i) {
    cin >> sz[i];
    for (long long j = 0; j < sz[i]; ++j) {
      cin >> a[i][j];
      box[a[i][j]] = i;
      tot += a[i][j], sum[i] += a[i][j];
    }
  }
  if ((tot % k) != 0) {
    return cout << "No\n", 0;
  }
  tot /= k;
  for (long long i = 0; i < k; ++i) {
    for (long long j = 0; j < sz[i]; ++j) {
      mark.reset();
      mark[i] = 1;
      long long need = tot - sum[i] + a[i][j], mask = (1ll << i);
      while (need != a[i][j] && box.find(need) != box.end() &&
             !mark[box[need]]) {
        mask += (1ll << box[need]);
        mark[box[need]] = 1;
        need = tot - sum[box[need]] + need;
      }
      if (need == a[i][j]) {
        dp[mask] = 1, start[mask] = a[i][j];
      }
    }
  }
  fill(par, par + maxn, -1);
  for (long long mask = 0; mask < (1ll << k); ++mask) {
    if (dp[mask]) {
      continue;
    }
    for (long long sub = mask; sub; sub = (sub - 1) & mask) {
      if (dp[mask ^ sub] && dp[sub]) {
        dp[mask] = 1, par[mask] = sub;
        break;
      }
    }
  }
  if (!dp[(1ll << k) - 1]) {
    return cout << "No\n" << '\n', 0;
  }
  cout << "Yes\n";
  find_sources();
  for (auto u : vec) {
    long long val = start[u], need = tot - sum[box[val]] + val;
    while (1) {
      ans[box[need]] = {need, box[val]};
      if (need == start[u]) {
        break;
      }
      val = need, need = tot - sum[box[need]] + need;
    }
  }
  for (long long i = 0; i < k; ++i) {
    cout << ans[i].first << ' ' << ans[i].second + 1 << '\n';
  }
}
