#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e3 + 50;
const int inf = 0x3f3f3f3f;
void print(int a) {
  int i = 1, ju = 0;
  while (i < a) i <<= 1;
  while (i) {
    if (i & a) {
      putchar('1');
      ju = 1;
    } else if (ju)
      putchar('0');
    i >>= 1;
  }
}
int n, allstate;
long long a[16][maxn], sum, aver;
unordered_map<long long, pair<int, int>> mpp;
struct P {
  int sta, id;
};
vector<P> vec[16];
bool vis[16][maxn];
bool dfs(int idi, int idj, int& sta, int sti, int stj) {
  int num = a[idi][0];
  long long tsum = a[idi][num + 1], val, tval = a[idi][idj];
  val = aver - tsum + tval;
  if (!mpp.count(val)) return 0;
  pair<int, int> pa = mpp[val];
  if (vis[pa.first][pa.second]) return 0;
  if (pa.first == idi && pa.second != idj) return 0;
  if (pa.first == sti && pa.second == stj) {
    vis[idi][idj] = 1;
    vec[idi].push_back(P{sta, idj});
    return 1;
  }
  if ((1 << pa.first) & sta) return 0;
  sta |= (1 << pa.first);
  if (dfs(pa.first, pa.second, sta, sti, stj)) {
    vis[idi][idj] = 1;
    vec[idi].push_back(P{sta, idj});
    return 1;
  }
  return 0;
}
int ans[16];
bool can[16][maxn];
bool cann[140000][15];
bool search(int sta) {
  if (!sta) return 1;
  for (int i = 1; i <= n; i++) {
    if ((1 << i) & sta && !cann[sta][i]) {
      for (int j = 0; j < vec[i].size(); j++) {
        if (can[i][j]) continue;
        if ((sta & vec[i][j].sta) == vec[i][j].sta) {
          if (search(sta - vec[i][j].sta)) {
            ans[i] = vec[i][j].id;
            return 1;
          }
        }
        if (sta == allstate) can[i][j] = 1;
      }
    }
    cann[sta][i] = 1;
  }
  return 0;
}
int tans[16];
void last(int idi, int idj) {
  int num = a[idi][0];
  long long tsum = a[idi][num + 1], val, tval = a[idi][idj];
  val = aver - tsum + tval;
  pair<int, int> p = mpp[val];
  tans[p.first] = idi;
  if (ans[p.first] != inf) return;
  ans[p.first] = p.second;
  last(p.first, p.second);
}
int main() {
  int i, j, sta;
  long long tsum;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    allstate |= 1 << i;
    scanf("%lld", &a[i][0]);
    for (j = 1, tsum = 0; j <= a[i][0]; j++) {
      scanf("%lld", &a[i][j]);
      tsum += a[i][j];
      mpp[a[i][j]] = make_pair(i, j);
    }
    sum += tsum;
    a[i][j] = tsum;
  }
  if (sum % n) {
    puts("No");
    return 0;
  }
  aver = sum / n;
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= a[i][0]; j++) {
      if (!vis[i][j]) {
        sta = 1 << i;
        dfs(i, j, sta, i, j);
      }
    }
  }
  for (i = 1; i <= n; i++)
    if (!vec[i].size()) {
      puts("No");
      return 0;
    }
  memset(ans, inf, sizeof(ans));
  if (search(allstate)) {
    puts("Yes");
    for (i = 1; i <= n; i++) {
      if (ans[i] != inf) last(i, ans[i]);
    }
    for (i = 1; i <= n; i++) {
      printf("%lld %d\n", a[i][ans[i]], tans[i]);
    }
  } else
    puts("No");
}
