#include <bits/stdc++.h>
using namespace std;
const long long maxn_node = 15 * 5010;
const long long maxn_dp_state = (1LL << 16);
long long st[maxn_node];
long long st_idx;
long long color[maxn_node];
long long sum_boxes[20];
long long revmp[maxn_node];
long long next_node[maxn_node];
long long box_number[maxn_node];
long long cnt_array[20];
long long ans_array[20];
long long ans_array2[20];
long long dp_store1[maxn_dp_state];
long long dp_store2[maxn_dp_state];
bool found[maxn_dp_state];
long long dp[maxn_dp_state];
long long path[maxn_dp_state];
map<long long, long long> mp, mp2;
map<long long, bool> exists;
vector<long long> v[20];
vector<long long> incycle_nodes;
vector<long long> nodeset[maxn_dp_state];
vector<vector<long long> > ansv;
vector<pair<long long, pair<long long, long long> > > ansv2;
long long k;
long long setbit(long long mask, long long i) { return mask | (1LL << i); }
bool checkbit(long long mask, long long i) { return mask & (1LL << i); }
void dfs(long long u) {
  st[st_idx++] = u;
  long long v = next_node[u];
  if (v == -1) return;
  color[u] = 1;
  if (color[v] == 1) {
    long long idx = st_idx - 1;
    while (idx >= 0) {
      incycle_nodes.push_back(st[idx]);
      if (st[idx] == v) break;
      idx--;
    }
  }
  if (color[v] == 0) {
    dfs(v);
  }
  color[u] = 2;
  st_idx--;
}
void dfs2(long long mask) {
  cerr << mask << endl;
  if (mask == 0) return;
  if (dp_store1[mask] == 0) {
    for (long long i = 0; i < nodeset[mask].size(); i++) {
      long long boxnumber = box_number[nodeset[mask][i]];
      ans_array[boxnumber] = revmp[nodeset[mask][i]];
    }
  } else {
    dfs2(dp_store1[mask]);
    dfs2(mask ^ dp_store1[mask]);
  }
}
long long start_node;
void dfs3(long long u) {
  long long v = next_node[u];
  assert(v != -1);
  color[u] = 1;
  if (color[v] == 1) {
    assert(v == start_node);
  }
  if (color[v] != 2)
    ansv2.push_back(
        make_pair(box_number[v], make_pair(revmp[v], box_number[u])));
  if (color[v] == 0) {
    dfs3(v);
  }
  color[u] = 2;
}
int main() {
  long long sum = 0, cnt = 0;
  scanf("%lld", &k);
  for (long long i = 1; i <= k; i++) {
    long long tempcnt = 0;
    scanf("%lld", &tempcnt);
    for (long long j = 0; j < tempcnt; j++) {
      long long temp;
      scanf("%lld", &temp);
      v[i].push_back(temp);
      sum_boxes[i] += temp;
      sum += temp;
      mp[temp] = ++cnt;
      revmp[cnt] = temp;
      box_number[cnt] = i;
      exists[temp] = true;
    }
  }
  if (sum % k) {
    printf("No\n");
    return 0;
  }
  sum /= k;
  memset(next_node, -1, sizeof next_node);
  for (long long i = 1; i <= k; i++) {
    for (long long j = 0; j < v[i].size(); j++) {
      long long newsum = sum_boxes[i] - v[i][j];
      long long need = sum - newsum;
      if (exists[need]) {
        next_node[mp[v[i][j]]] = mp[need];
      } else {
        exists.erase(need);
      }
    }
  }
  for (int i = 1; i <= cnt; i++) {
    if (color[i] == 0) {
      incycle_nodes.clear();
      dfs(i);
      if (incycle_nodes.size()) {
        bool alright = true;
        memset(cnt_array, 0, sizeof cnt_array);
        for (int j = 0; j < incycle_nodes.size(); j++) {
          long long node = incycle_nodes[j];
          long long thisbox = box_number[node];
          if (cnt_array[thisbox]) {
            alright = false;
          } else {
            cnt_array[thisbox] = true;
          }
        }
        if (alright && incycle_nodes.size()) {
          long long mask = 0;
          for (int j = 1; j <= k; j++) {
            if (cnt_array[j]) {
              mask = setbit(mask, j - 1);
            }
          }
          dp[mask] = true;
          nodeset[mask] = incycle_nodes;
        }
      }
    }
  }
  dp[0] = true;
  long long mask_all = (1LL << k) - 1;
  for (long long i = 1; i < (1LL << k); i++) {
    if (dp[i]) continue;
    for (long long s = i; s; s = (s - 1) & i) {
      if (dp[s] && dp[i ^ s]) {
        dp[i] = true;
        dp_store1[i] = s;
      }
    }
  }
  long long current_mask = (1LL << k) - 1;
  dfs2(current_mask);
  for (int i = 1; i <= k; i++) {
    cerr << ans_array[i] << endl;
  }
  current_mask = (1LL << k) - 1;
  for (int i = 1; i <= k; i++) {
    long long num_to_remove = ans_array[i];
    long long newsum = sum_boxes[i] - num_to_remove;
    long long need = sum - newsum;
    mp2[need] = i;
  }
  if (dp[current_mask]) {
    printf("Yes\n");
    memset(color, 0, sizeof color);
    for (int i = 1; i <= k; i++)
      printf("%lld %lld\n", ans_array[i], mp2[ans_array[i]]);
  } else {
    printf("No\n");
  }
  return 0;
}
