#include <bits/stdc++.h>
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("-O3")
#pragma GCC optimize("Ofast")
using namespace std;
const int oo = 2e9;
const long long OO = 4e18;
const long double pi = arg(complex<long double>(-1, 0));
const long double pi2 = pi + pi;
const int md = 0x3b800001;
const int MD = 1e9 + 7;
inline long long time() {
  return chrono ::system_clock().now().time_since_epoch().count();
}
mt19937 rnd(time());
mt19937_64 RND(time());
const int N = 1e5 + 228;
inline string bin(int x, int n) {
  string ans = "";
  for (int i = 0; i < n; ++i) ans += '0' + (x & 1), x >>= 1;
  return ans;
}
int k, m, n[16], a[16][5007];
long long s[16];
pair<int, int> ans[16];
unordered_map<int, int> v;
void solve() {
  cin >> k;
  m = 1 << k;
  for (int i = 0; i < k; ++i) s[i] = 0;
  long long S = 0;
  v.clear();
  for (int i = 0; i < k; ++i) {
    cin >> n[i];
    for (int j = 0; j < n[i]; ++j)
      cin >> a[i][j], v[a[i][j]] = i, s[i] += a[i][j];
    S += s[i];
  }
  if (S % k) {
    cout << "No\n";
    return;
  }
  S /= k;
  unordered_map<int, vector<pair<int, int> > > D;
  for (int i = 0; i < k; ++i)
    for (int j = 0; j < n[i]; ++j) {
      bool bad = 0;
      int f = i;
      int ms = 0;
      long long e = a[i][j];
      vector<pair<int, int> > g;
      if (s[i] != S) {
        while (1) {
          e = S - (s[f] - e);
          g.emplace_back(e, f + 1);
          if (abs(e) > oo || v.find((int)e) == v.end()) {
            bad = 1;
            break;
          }
          f = v[e];
          if (ms & (1 << f)) {
            bad = 1;
            break;
          }
          ms |= (1 << f);
          if (e == a[i][j]) break;
        }
      } else {
        g.assign(1, {a[i][j], i + 1});
        ms = (1 << i);
      }
      reverse(g.begin(), g.end());
      if (bad) continue;
      if (D.find(ms) == D.end()) D[ms] = g;
    }
  int dp[m];
  memset(dp, 0, sizeof dp);
  for (auto &a : D) dp[m - 1 - a.first] = a.first;
  for (int i = m - 1; i; --i)
    if (dp[i]) {
      vector<int> z;
      for (int t = 0; t < k; ++t)
        if (i & (1 << t)) z.emplace_back((1 << t));
      int j = int(z.size());
      for (int t = 0; t < (1 << j); ++t)
        if (t) {
          int u = 0;
          for (int w = 0; w < j; ++w)
            if (t & (1 << w)) u |= z[w];
          if (D.find(u) == D.end()) continue;
          dp[i - u] = u;
        }
    }
  if (!(dp[0])) {
    cout << "No\n";
    return;
  }
  for (int i = 0; i + 1 < m; i += dp[i]) {
    int u = dp[i];
    for (pair<int, int> p : D[u]) ans[v[p.first]] = p;
  }
  cout << "Yes\n";
  for (int i = 0; i < k; ++i)
    cout << ans[i].first << ' ' << ans[i].second << endl;
}
int main() {
  ios_base ::sync_with_stdio(0);
  solve();
  return 0;
}
