#include <bits/stdc++.h>
using namespace std;
const long long M = 1e5 + 10;
const long long K = 20;
long long dp[M], nx[M], col[M], k, c, s, sum[K];
bool mark[M], used[K];
map<long long, long long> id;
pair<long long, long long> p[M];
vector<pair<long long, pair<long long, long long> > > ans[M];
vector<long long> lst;
set<long long> pot[M];
void dfs(long long v, long long r) {
  mark[v] = true;
  used[col[v]] = true;
  lst.push_back(v);
  if (mark[nx[v]] && nx[v] == r) {
    long long mask = 0;
    for (auto x : lst) mask += (1LL << col[x]);
    if (!dp[mask]) {
      for (auto x : lst)
        ans[mask].push_back({col[nx[x]], {p[nx[x]].second, p[x].first}});
      dp[mask] = true;
    }
  }
  if (!mark[nx[v]] && !used[col[nx[v]]]) dfs(nx[v], r);
  used[col[v]] = false;
  mark[v] = false;
  lst.pop_back();
}
bool mem(long long mask) {
  if (mark[mask] || dp[mask]) return dp[mask];
  mark[mask] = true;
  for (long long submask = mask; submask; submask = (mask & (submask - 1)))
    if (mem(submask) && mem(mask ^ submask)) {
      dp[mask] = true;
      ans[mask] = ans[submask];
      for (auto x : ans[mask ^ submask]) ans[mask].push_back(x);
      break;
    }
  return dp[mask];
}
int32_t main() {
  cin >> k;
  for (long long i = 0; i < k; i++) {
    long long l;
    cin >> l;
    while (l--) {
      long long x;
      cin >> x;
      id[x] = ++c;
      p[c] = {i, x};
      col[c] = i;
      pot[i].insert(x);
      sum[i] += x;
      s += x;
    }
  }
  if (s % k != 0) return cout << "No" << endl, 0;
  for (long long i = 0; i < k; i++) {
    for (auto x : pot[i])
      for (long long j = 0; j < k; j++)
        if (pot[j].find((s / k) - (sum[i] - x)) != pot[j].end()) {
          nx[id[x]] = (id[(s / k) - (sum[i] - x)]);
        }
  }
  for (long long i = 1; i <= c; i++) dfs(i, i);
  dp[0] = true;
  long long bigmask = ((1LL << k) - 1LL);
  if (!mem(bigmask)) return cout << "No" << endl, 0;
  cout << "Yes" << endl;
  sort(ans[bigmask].begin(), ans[bigmask].end());
  for (auto x : ans[bigmask])
    cout << x.second.first << " " << x.second.second + 1 << endl;
  return 0;
}
