#include <bits/stdc++.h>
using namespace std;
const int maxn = 16;
vector<pair<pair<int, long long>, int> > ans[1 << maxn];
map<long long, int> color;
vector<int> a[maxn];
long long sum[maxn];
int k, dp[1 << maxn];
int main() {
  scanf("%d", &k);
  long long all_sum = 0;
  for (int i = 0; i < k; i++) {
    int n;
    scanf("%d", &n);
    for (int j = 0; j < n; j++) {
      long long x;
      scanf("%I64d", &x);
      a[i].push_back(x);
      all_sum += x;
      sum[i] += x;
      color[a[i][j]] = i;
    }
  }
  if (all_sum % k != 0) {
    puts("NO");
    return 0;
  }
  all_sum /= k;
  for (int i = 0; i < k; i++) {
    for (int j = 0; j < a[i].size(); j++) {
      long long cur = a[i][j];
      int used = 0;
      bool ok = 1;
      vector<pair<pair<int, long long>, int> > an;
      do {
        int c1 = 0;
        auto it = color.find(cur);
        if (it != color.end())
          c1 = it->second;
        else {
          ok = 0;
          break;
        }
        if (used & (1 << c1)) {
          ok = 0;
          break;
        }
        used |= (1 << c1);
        cur = cur + (all_sum - sum[c1]);
        auto c12 = color.find(cur);
        if (c12 != color.end()) {
          an.push_back({{c12->second, cur}, c1});
        }
      } while (cur != a[i][j]);
      if (ok) {
        dp[used] = 1;
        ans[used] = an;
      }
    }
    for (int i = 0; i < (1 << k); i++) {
      if (dp[i]) continue;
      for (int j = i; j > 0; j = (j - 1) & i) {
        if (dp[j] && dp[i & (~j)]) {
          dp[i] = 1;
          ans[i] = ans[j];
          for (auto &x : ans[i & (~j)]) ans[i].push_back(x);
          break;
        }
      }
    }
  }
  int x = (1 << k) - 1;
  if (dp[x]) {
    puts("Yes");
    sort(ans[x].begin(), ans[x].end());
    for (auto a : ans[x]) {
      printf("%I64d %d\n", a.first.second, a.second + 1);
    }
  } else {
    puts("No");
  }
  return 0;
}
