#include <bits/stdc++.h>
using namespace std;
long long n[20];
long long a[20][5004];
unordered_map<long long, pair<long long, long long>> mp;
long long sum = 0;
long long s[20];
vector<pair<long long, long long>> v[1 << 17], temp;
vector<vector<pair<long long, long long>>> ans[1 << 17];
pair<long long, long long> ret[17];
bool dp[1 << 17];
void dfs(long long first, long long i, long long j, long long x,
         long long sta) {
  long long need = sum - (s[i] - x);
  if (!mp.count(need)) return;
  long long nexi = mp[need].first;
  long long nexj = mp[need].second;
  if (a[nexi][nexj] == first) {
    if (v[sta].size()) return;
    for (auto it : temp) {
      v[sta].push_back(it);
    }
    v[sta].push_back(make_pair(i, need));
    return;
  }
  if (sta & (1 << nexi)) return;
  temp.push_back(make_pair(i, need));
  dfs(first, nexi, nexj, need, sta | (1 << nexi));
  return;
}
int main() {
  memset(s, 0, sizeof(s));
  long long k;
  cin >> k;
  for (int i = 0; i < k; ++i) {
    scanf("%lld", &n[i]);
    for (int j = 0; j < n[i]; ++j) {
      scanf("%lld", &a[i][j]);
      mp[a[i][j]] = make_pair(i, j);
      sum += a[i][j];
      s[i] += a[i][j];
    }
  }
  if (sum % k != 0) {
    puts("No");
    return 0;
  }
  sum /= k;
  for (int i = 0; i < k; ++i) {
    for (int j = 0; j < n[i]; ++j) {
      temp.clear();
      dfs(a[i][j], i, j, a[i][j], (1 << i));
    }
  }
  for (int i = 1; i < (1 << k); ++i) {
    if (v[i].size()) {
      dp[i] = 1;
      ans[i].push_back(v[i]);
    }
  }
  for (int i = 0; i < ((1 << k)); ++i) {
    if (dp[i]) continue;
    for (int j = (i - 1) & i; j > 0; j = (j - 1) & i) {
      if (dp[j] && dp[i - j]) {
        dp[i] = 1;
        for (auto it : ans[j]) ans[i].push_back(it);
        for (auto it : ans[i - j]) ans[i].push_back(it);
        break;
      }
    }
  }
  if (dp[(1 << k) - 1]) {
    puts("Yes");
    for (auto it : ans[(1 << k) - 1]) {
      for (int i = 0; i < it.size(); ++i) {
        int nxt = (i + 1) % it.size();
        nxt = it[nxt].first + 1;
        ret[nxt].first = it[i].second;
        ret[nxt].second = it[i].first + 1;
      }
    }
    for (int i = 1; i <= k; ++i) {
      printf("%lld %lld\n", ret[i].first, ret[i].second);
    }
  } else
    puts("No");
  return 0;
}
