#include <bits/stdc++.h>
using namespace std;
const int N = (int)1e5 + 10;
const int M = (int)16;
const int INF = (int)1e9 + 7;
const long long LINF = (long long)1e18 + 7;
int k;
long long total, need;
vector<int> v[M];
bool dp[(1 << M)];
unordered_map<int, int> which;
long long sum[M];
pair<int, int> ans[N];
int was[(1 << M)];
bool solve(int mask) {
  vector<int> id;
  for (int i = 0; i < k; i++) {
    if ((mask >> i) % 2) {
      id.push_back(i);
    }
  }
  if (id.empty()) return true;
  if (int(id.size()) == 1) {
    if (sum[id[0]] == need) {
      ans[id[0]] = {v[id[0]][0], id[0]};
      return true;
    }
    return false;
  }
  for (int i = 0; i < int(v[id[0]].size()); i++) {
    long long val = v[id[0]][i];
    long long cur = need - (sum[id[0]] - val);
    int pr = id[0], cmask = mask;
    bool good = false;
    for (int iter = 0; iter < int(id.size()); iter++) {
      if (!which.count(cur)) break;
      int j = which[cur];
      if ((cmask >> j) % 2 == 0 || j == pr) break;
      ans[j] = {cur, pr};
      pr = j;
      cmask -= (1 << j);
      if (cmask == 0 && cur == val) {
        good = true;
      }
      cur = need - (sum[j] - cur);
    }
    if (good) {
      return true;
    }
  }
  return false;
}
void recover(int mask) {
  for (int sub = mask; sub > 0; sub = (sub - 1) & mask) {
    if (sub == mask) continue;
    if (dp[sub] && dp[mask - sub]) {
      recover(sub);
      recover(mask - sub);
      return;
    }
  }
  solve(mask);
}
bool d[(1 << M)];
int main() {
  cin >> k;
  for (int i = 0; i < k; i++) {
    int n;
    cin >> n;
    while (n--) {
      int x;
      cin >> x;
      total += x;
      which[x] = i;
      sum[i] += x;
      v[i].push_back(x);
    }
  }
  if (total % k) {
    cout << "No";
    return 0;
  }
  need = total / k;
  for (int id = 0; id < k; id++) {
    if (sum[id] == need) {
      d[(1 << id)] = 1;
    }
    for (int i = 0; i < int(v[id].size()); i++) {
      int val = v[id][i];
      long long cur = need - (sum[id] - val);
      int pr = id, cmask = 0, good = 0;
      for (int iter = 0; iter < k; iter++) {
        if (!which.count(cur)) break;
        int j = which[cur];
        if ((cmask >> j) % 2 || j == pr) break;
        ans[j] = {cur, pr};
        pr = j;
        cmask += (1 << j);
        if (j == id && val == cur) {
          good = 1;
          break;
        }
        cur = need - (sum[j] - cur);
      }
      if (good && cmask != (1 << id)) d[cmask] = 1;
    }
  }
  for (int mask = 0; mask < (1 << k); mask++) {
    for (int sub = mask; sub > 0; sub = (sub - 1) & mask) {
      if (dp[sub] && dp[mask - sub]) {
        dp[mask] = 1;
      }
    }
    if (!dp[mask]) {
      dp[mask] = d[mask];
    }
  }
  if (dp[(1 << k) - 1]) {
    cout << "Yes\n";
    recover((1 << k) - 1);
    for (int i = 0; i < k; i++) {
      cout << ans[i].first << ' ' << ans[i].second + 1 << endl;
    }
  } else {
    cout << "No";
  }
  return 0;
}
