#include <bits/stdc++.h>
using namespace std;
const int N = 150010;
const int M = 70010;
int to[N], v[N], dfn[N], ll[M], rr[M], f[M], ff[M], g[20];
long long ans[20][2], h[N];
long long a[20][N];
int cnt;
void addedge(int x, int y, int vv) {
  to[x] = y;
  v[x] = vv;
}
void mem() {
  for (int i = 1; i <= 15; i++) g[i] = 0;
}
void dfs(int x) {
  int xx, fla, s, i;
  if (dfn[x] == cnt) {
    mem();
    fla = 1;
    g[v[x]] = 1;
    xx = to[x];
    while (xx != x) {
      if (g[v[xx]]) fla = 0;
      g[v[xx]] = 1;
      xx = to[xx];
    }
    s = 0;
    if (fla) {
      for (i = 1; i <= 15; i++)
        if (g[i]) s = s | (1 << (i - 1));
      f[s] = 1;
      ff[s] = x;
    }
    return;
  }
  if (dfn[x]) return;
  dfn[x] = cnt;
  xx = to[x];
  if (xx) dfs(xx);
}
void dfs2(int x) {
  int now, pre, xx;
  if (ff[x]) {
    xx = ff[x];
    now = to[xx];
    pre = xx;
    while (xx != now) {
      ans[v[now]][0] = h[now];
      ans[v[now]][1] = v[pre];
      pre = now;
      now = to[now];
    }
    ans[v[now]][0] = h[now];
    ans[v[now]][1] = v[pre];
  } else {
    dfs2(ll[x]);
    dfs2(rr[x]);
  }
}
int main() {
  int n, i, j, l, x, y;
  long long sum = 0;
  cnt = 0;
  cin >> n;
  sum = 0;
  for (i = 1; i <= n; i++) {
    cin >> a[i][0];
    for (j = 1; j <= a[i][0]; j++) {
      cin >> a[i][j];
      a[i][a[i][0] + 1] += a[i][j];
    }
    sum += a[i][a[i][0] + 1];
  }
  if (sum % n) {
    printf("No");
    return 0;
  }
  sum /= n;
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= a[i][0]; j++) {
      h[++cnt] = a[i][j];
      h[++cnt] = sum - a[i][a[i][0] + 1] + a[i][j];
    }
  }
  sort(h + 1, h + cnt + 1);
  l = unique(h + 1, h + cnt + 1) - h - 1;
  cnt = 0;
  for (i = 1; i <= n; i++)
    for (j = 1; j <= a[i][0]; j++) {
      x = lower_bound(h + 1, h + l + 1, a[i][j]) - h;
      y = lower_bound(h + 1, h + l + 1, sum - a[i][a[i][0] + 1] + a[i][j]) - h;
      addedge(x, y, i);
    }
  for (i = 1; i <= l; i++)
    if (!dfn[i]) {
      cnt++;
      dfs(i);
    }
  for (i = 1; i < (1 << n); i++)
    if (!f[i])
      for (j = i; j > 0; j = (j - 1) & i)
        if (f[j] && f[i ^ j]) {
          f[i] = 1;
          ll[i] = j;
          rr[i] = i ^ j;
        }
  if (!f[(1 << n) - 1]) {
    printf("No");
    return 0;
  }
  printf("Yes\n");
  dfs2((1 << n) - 1);
  for (i = 1; i <= n; i++) cout << ans[i][0] << " " << ans[i][1] << endl;
  return 0;
}
