#include <bits/stdc++.h>
using namespace std;
const int MAXN = 15;
map<long long, int> idx;
int k;
vector<long long> box[MAXN];
long long sum[MAXN], tot;
void get_next(int &i, long long &val) {
  long long nxt_val = val - sum[i] + tot;
  auto itr = idx.find(nxt_val);
  if (itr == idx.end()) {
    i = -1;
  } else {
    i = itr->second;
  }
  val = nxt_val;
}
vector<pair<long long, int>> ans[1 << MAXN];
void update(int cur_idx, long long cur_val) {
  vector<bool> vis(k);
  vector<int> indeg(k), outdeg(k);
  vector<pair<long long, int>> cur_ans;
  long long tmp = cur_val;
  while (!vis[cur_idx]) {
    vis[cur_idx] = true;
    int nxt_idx = cur_idx;
    long long nxt_val = cur_val;
    get_next(nxt_idx, nxt_val);
    if (nxt_idx == -1) {
      return;
    }
    cur_ans.push_back({nxt_val, cur_idx});
    outdeg[nxt_idx]++;
    indeg[cur_idx]++;
    cur_idx = nxt_idx;
    cur_val = nxt_val;
  }
  if (cur_val != tmp) {
    return;
  }
  int mask = 0;
  for (int i = 0; i < k; i++) {
    if (indeg[i] == 1 && outdeg[i] == 1) {
      mask = (mask | (1 << i));
    } else if (indeg[i] == 0 && outdeg[i] == 0) {
      continue;
    } else {
      return;
    }
  }
  ans[mask] = cur_ans;
}
bool f[1 << MAXN];
int nxt[1 << MAXN];
pair<long long, int> anss[MAXN];
int main() {
  scanf("%d", &k);
  for (int i = 0; i < k; i++) {
    int n;
    scanf("%d", &n);
    box[i].resize(n);
    for (int j = 0; j < n; j++) {
      scanf("%lld", &box[i][j]);
      idx[box[i][j]] = i;
      sum[i] += box[i][j];
    }
    tot += sum[i];
  }
  if (tot % k != 0) {
    printf("No\n");
    return 0;
  }
  tot /= k;
  for (int i = 0; i < k; i++) {
    for (long long val : box[i]) {
      update(i, val);
    }
  }
  int max_mask = (1 << k);
  f[0] = true;
  for (int i = 1; i < max_mask; i++) {
    for (int j = i; j != 0; j = ((j - 1) & i)) {
      if (!ans[j].empty() && f[i ^ j]) {
        f[i] = true;
        nxt[i] = j;
        break;
      }
    }
  }
  if (f[max_mask - 1]) {
    printf("Yes\n");
    for (int cur = max_mask - 1; cur != 0;) {
      for (auto pr : ans[nxt[cur]]) {
        anss[idx[pr.first]] = pr;
      }
      cur ^= nxt[cur];
    }
    for (int i = 0; i < k; i++) {
      printf("%lld %d\n", anss[i].first, anss[i].second + 1);
    }
  } else {
    printf("No\n");
  }
  return 0;
}
