#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
const int N = 1e6 + 6;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  ll sum = 0;
  vector<vector<ll>> a(n);
  vector<ll> sa(n);
  map<ll, int> pos;
  for (int k = 0; k < n; ++k) {
    int d;
    cin >> d;
    a[k].resize(d);
    for (ll &x : a[k]) {
      cin >> x;
      sa[k] += x;
      pos[x] = k;
    }
    sum += sa[k];
  }
  if (sum % n) return cout << "No\n", 0;
  ;
  sum /= n;
  vector<bool> w(1 << n);
  vector<ll> how(1 << n);
  for (auto [_x, _i] : pos) {
    ll x = _x;
    int i = _i;
    int ms = 1 << i;
    bool ok = true;
    for (;;) {
      ll y = sum - sa[i] + x;
      if (!pos.count(y)) {
        ok = false;
        break;
      }
      int j = pos[y];
      if (j == _i) {
        if (y != _x) ok = false;
        break;
      }
      if (ms >> j & 1) {
        ok = false;
        break;
      }
      ms |= 1 << j;
      x = y;
      i = j;
    }
    if (ok) {
      w[ms] = true;
      how[ms] = _x;
    }
  }
  vector<bool> can(1 << n);
  vector<int> how_can(1 << n);
  can[0] = true;
  for (int ms = 1; ms < (1 << n); ++ms) {
    for (int mt = ms;; --mt) {
      mt &= ms;
      assert((ms & mt) == mt);
      if (w[mt] && can[ms ^ mt]) {
        can[ms] = true;
        how_can[ms] = mt;
      }
      if (mt == 0) break;
    }
  }
  if (!can[(1 << n) - 1]) return cout << "No\n", 0;
  ;
  cout << "Yes" << endl;
  vector<pair<int, int>> ans(n);
  for (int ms = (1 << n) - 1; ms;) {
    int m = how_can[ms];
    ll x = how[m];
    int i = pos[x];
    int st = i;
    for (;;) {
      ll y = sum - sa[i] + x;
      int j = pos[y];
      ans[j] = {y, i};
      if (j == st) break;
      x = y;
      i = j;
    }
    ms ^= m;
  }
  for (auto p : ans) cout << p.first << ' ' << p.second + 1 << endl;
  return 0;
}
