#include <bits/stdc++.h>
using namespace std;
const int maxk = 15, maxn = 5e3 + 3;
int n[maxk];
long long a[maxk][maxn], sa[maxk], sm, avg;
vector<pair<int, int>> sol[1 << maxk];
unordered_map<long long, pair<int, int>> ra;
vector<pair<int, int>> my;
pair<int, int> findR(long long v) {
  if (ra.find(v) == ra.end()) return {-1, -1};
  return ra[v];
}
set<int> vis;
void append(int i, int j) {
  my.clear();
  vis.clear();
  my.emplace_back(i, j);
  vis.insert(i);
  int x, y;
  tie(x, y) = findR(a[i][j] - sa[i] + avg);
  while (x != -1 && vis.find(x) == vis.end()) {
    my.emplace_back(x, y);
    vis.insert(x);
    tie(x, y) = findR(-sa[x] + avg + a[x][y]);
  }
  if (x != i || y != j) {
    return;
  }
  int msk = 0;
  for (auto &&[u, _] : my) msk |= 1 << u;
  sol[msk] = my;
}
int main() {
  int k;
  scanf("%d", &k);
  for (int i = 0; i < k; ++i) {
    scanf("%d", n + i);
    for (int j = 0; j < n[i]; ++j) {
      scanf("%lld", &a[i][j]);
      ra[a[i][j]] = {i, j};
      sm += a[i][j];
      sa[i] += a[i][j];
    }
  }
  if (sm % k) {
    puts("No");
    return 0;
  }
  avg = sm / k;
  for (int i = 0; i < k; ++i) {
    for (int j = 0; j < n[i]; ++j) append(i, j);
  }
  for (int i = 0; i < (1 << k); ++i) {
    if (sol[i].empty()) {
      for (int j = i; j > 0; j = (j - 1) & i) {
        if (!sol[j].empty() && !sol[i ^ j].empty()) {
          for (auto &&v : sol[j]) sol[i].push_back(v);
          for (auto &&v : sol[i ^ j]) sol[i].push_back(v);
          break;
        }
      }
    }
  }
  auto &ans = sol[(1 << k) - 1];
  if (ans.empty()) {
    puts("No");
    return 0;
  }
  puts("Yes");
  vector<pair<long long, int>> res;
  res.resize(k);
  for (auto &&[u, v] : ans) {
    auto [x, y] = findR(-sa[u] + a[u][v] + avg);
    res[x] = {-sa[u] + a[u][v] + avg, u + 1};
  }
  for (auto &&[u, v] : res) printf("%lld %d\n", u, v);
  return 0;
}
