#include <bits/stdc++.h>
using namespace std;
int dp[(1 << 15)];
int p[(1 << 15)];
int dd[1 << 15];
int nxt[80000];
map<long long, int> mp;
int a[80000];
long long b[15][5000];
int c[15];
long long d[15];
long long n;
long long inv[80000];
int visit[80000];
int e[(1 << 16)][16];
pair<int, int> ans[16];
int aa[16];
int q;
void dfs(int st, int v, int s) {
  int u = nxt[v];
  aa[q++] = v;
  if (u == -1) return;
  if (u == st) {
    dd[s] = 1;
    for (int i = 0; i < q; i++) {
      e[s][i] = aa[i];
    }
    return;
  }
  if ((1 << a[u]) & s) {
    return;
  }
  dfs(st, u, s + (1 << a[u]));
}
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cin >> n;
  int i, j;
  int k = 0;
  long long avg;
  long long s = 0;
  int m = 0;
  for (i = 1; i <= 75000; i++) a[i] = nxt[i] = -1;
  for (i = 0; i < n; i++) {
    cin >> c[i];
    for (j = 0; j < c[i]; j++) {
      cin >> b[i][j];
      s += b[i][j];
      d[i] += b[i][j];
      mp[b[i][j]] = ++k;
      a[k] = i;
      inv[k] = b[i][j];
    }
  }
  if (s % n) {
    cout << "No";
    return 0;
  }
  avg = s / n;
  for (i = 0; i < n; i++) {
    if (d[i] == avg) {
      dd[1 << i] = 1;
      e[1 << i][0] = mp[b[i][0]];
      continue;
    }
    for (j = 0; j < c[i]; j++) {
      int t = mp[avg - d[i] + b[i][j]];
      if (a[t] == i || t == 0) continue;
      nxt[mp[b[i][j]]] = t;
    }
  }
  for (i = 1; i <= k; i++) {
    q = 0;
    dfs(i, i, (1 << a[i]));
  }
  dp[0] = 1;
  for (i = 1; i < (1 << n); i++) {
    for (j = i; j > 0; j = ((j - 1) & i)) {
      if (dd[j] && dp[i - j]) {
        p[i] = i - j;
        dp[i] = 1;
        break;
      }
    }
  }
  int x = (1 << n) - 1;
  if (dp[x] == 0) {
    cout << "No";
    return 0;
  }
  cout << "Yes\n";
  while (x) {
    int y = x - p[x];
    int k = e[y][0];
    for (i = 1; e[y][i]; i++) {
      ans[a[e[y][i]]] = {inv[e[y][i]], a[e[y][i - 1]] + 1};
      k = e[y][i];
    }
    ans[a[e[y][0]]] = {inv[e[y][0]], a[k] + 1};
    x = p[x];
  }
  for (i = 0; i < n; i++) cout << ans[i].first << " " << ans[i].second << "\n";
  return 0;
}
