#include <bits/stdc++.h>
using namespace std;
int n[16 + 5], a[16 + 5][5010], vis[1 << 16], fr[1 << 16], pre[1 << 16];
int ans1[16 + 5], ans2[16 + 5];
long long cnt[20], sum;
map<long long, int> p;
void nxt(long long &x) {
  long long fa = p[x];
  x = sum - (cnt[fa] - x);
}
int main() {
  int k;
  scanf("%d", &k);
  for (int i = 1; i <= k; i++) {
    scanf("%d", &n[i]);
    for (int j = 1; j <= n[i]; j++) {
      scanf("%d", &a[i][j]);
      p[a[i][j]] = i;
      cnt[i] += 1ll * a[i][j];
    }
    sum += cnt[i];
  }
  if (sum % k) {
    printf("No\n");
    return 0;
  }
  sum /= 1ll * k;
  for (int i = 1; i <= k; i++) {
    for (int j = 1; j <= n[i]; j++) {
      long long now = a[i][j];
      long long s = 1 << (p[now] - 1);
      bool flag = true;
      while (1) {
        nxt(now);
        if (now == a[i][j]) break;
        if (!p.count(now)) {
          flag = false;
          break;
        }
        if (s & (1 << (p[now] - 1))) {
          s = -1;
          break;
        }
        s |= 1 << (p[now] - 1);
      }
      if (s == -1 || !flag) continue;
      fr[s] = a[i][j];
      vis[s] = 1;
    }
  }
  for (int i = 0; i < 1 << k; i++) pre[i] = -1;
  pre[0] = 0;
  for (int i = 0; i < 1 << k; i++) {
    if (pre[i] == -1) continue;
    for (int s = i; s < 1 << k; s = (s + 1) | i)
      if (vis[s ^ i]) pre[s] = i;
  }
  long long full = (1 << k) - 1;
  if (pre[full] == -1) {
    printf("No\n");
    return 0;
  }
  printf("Yes\n");
  while (full) {
    long long z = full ^ pre[full];
    long long now = fr[z];
    while (1) {
      long long b = p[now];
      ans1[p[now]] = now;
      nxt(now);
      ans2[p[now]] = b;
      if (now == fr[z]) break;
    }
    full = pre[full];
  }
  for (int i = 1; i <= k; i++) printf("%d %d\n", ans1[i], ans2[i]);
}
