#include <bits/stdc++.h>
using namespace std;
const int N = 10000;
const long double pi = acos(-1.0);
int n, head[100100], to[100100], pick[100100], loop[100100], can[100100];
long long sum[100100];
vector<int> a[20];
map<long long, int> mp;
bool vis[20];
int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while ((ch < '0') || (ch > '9')) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while ((ch >= '0') && (ch <= '9')) {
    x = x * 10 + (ch - '0');
    ch = getchar();
  }
  return x * f;
}
int main() {
  n = read();
  long long tot = 0;
  for (register int i = 1; i <= n; i++) {
    int len = read();
    for (register int j = 1; j <= len; j++) {
      int x = read();
      sum[i] += x;
      mp[x] = i;
      a[i].push_back(x);
      tot += x;
    }
  }
  if (tot % n) {
    puts("No");
    return 0;
  }
  long long ave = tot / n;
  memset(head, 0x3f, sizeof(head));
  for (register int i = 1; i <= n; i++) {
    int len = a[i].size();
    for (register int j = 0; j <= len - 1; j++) {
      int sta = 0;
      long long now = ave - sum[i] + a[i][j];
      if (mp.count(now)) {
        sta |= (1 << (i - 1));
        bool ok = 1;
        while (mp[now] != i) {
          if ((sta >> (mp[now] - 1)) & 1) {
            ok = 0;
            break;
          }
          sta |= (1 << (mp[now] - 1));
          now = ave - sum[mp[now]] + now;
        }
        if ((ok) && (now == a[i][j])) {
          head[sta] = a[i][j];
          can[sta] = 1;
        }
      }
    }
  }
  int lim = (1 << n) - 1;
  can[0] = 1;
  for (register int now = 1; now <= lim; now++) {
    for (int pre = now; pre; pre = (pre - 1) & now) {
      if ((head[pre] <= 1e9) && (can[pre ^ now])) {
        can[now] = 1;
        loop[now] = pre;
        break;
      }
    }
  }
  if (!can[lim]) {
    puts("No");
    return 0;
  }
  puts("Yes");
  int nows = lim;
  while (nows) {
    int nowc = loop[nows];
    nows ^= loop[nows];
    long long now = head[nowc];
    while (!vis[mp[now]]) {
      vis[mp[now]] = 1;
      pick[mp[now]] = now;
      long long nxt = ave - sum[mp[now]] + now;
      to[mp[nxt]] = mp[now];
      now = nxt;
    }
  }
  for (register int i = 1; i <= n; i++) printf("%d %d\n", pick[i], to[i]);
  return 0;
}
