#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9;
map<int, int> pos, vis, state2st;
long long all, goal, sum[20];
int k, stval, num[20], vis_pos[20];
vector<int> c[20];
int ansc[20], ansp[20];
int dp[1 << 17], pre[1 << 17];
void dfs(int p, int v, int s) {
  if (vis[v]) {
    if (v == stval) state2st[s] = stval;
    return;
  }
  if (vis_pos[p]) return;
  vis[v] = vis_pos[p] = 1;
  long long vv = goal - sum[p] + v;
  if (vv > inf || vv < -inf) return;
  int nv = (int)vv;
  int np = pos[nv];
  if (!np) return;
  dfs(np, nv, s | (1 << (np - 1)));
}
int dfs(int sta) {
  if (~dp[sta]) return dp[sta];
  dp[sta] = 0;
  for (int i = sta, j; i; i = (i - 1) & sta) {
    j = sta ^ i;
    if (dfs(i) && dfs(j)) {
      pre[sta] = i;
      dp[sta] = 1;
      break;
    }
  }
  return dp[sta];
}
void print(int sta) {
  if (pre[sta] == sta) {
    int v = state2st[sta];
    int p = pos[v], lstp, lstv;
    int stv = v;
    while (1) {
      lstv = (int)(goal - sum[p] + v);
      lstp = pos[lstv];
      ansp[lstp] = p;
      ansc[lstp] = lstv;
      p = lstp;
      v = lstv;
      if (v == stv) break;
    }
  } else {
    print(pre[sta]);
    print(sta ^ pre[sta]);
  }
}
int main() {
  scanf("%d", &k);
  for (int i = 1; i <= k; ++i) {
    scanf("%d", &num[i]);
    for (int j = 1, x; j <= num[i]; ++j) {
      scanf("%d", &x);
      pos[x] = i;
      sum[i] += x;
      c[i].push_back(x);
    }
    all += sum[i];
  }
  if (all % k != 0) return puts("No"), 0;
  goal = all / k;
  for (int i = 1; i <= k; ++i) {
    for (int x : c[i]) {
      vis.clear();
      stval = x;
      memset(vis_pos, 0, sizeof(vis_pos));
      dfs(i, x, 1 << (i - 1));
    }
  }
  memset(dp, -1, sizeof(dp));
  for (auto x : state2st) {
    dp[x.first] = 1;
    pre[x.first] = x.first;
  }
  if (dfs((1 << k) - 1)) {
    puts("Yes");
    print((1 << k) - 1);
    for (int i = 1; i <= k; ++i) {
      sum[ansp[i]] += ansc[i];
      sum[i] -= ansc[i];
      printf("%d %d\n", ansc[i], ansp[i]);
    }
    for (int i = 1; i <= k; ++i) {
      assert(sum[i] == goal);
    }
  } else {
    puts("No");
  }
  return 0;
}
