#include <bits/stdc++.h>
using namespace std;
int k;
vector<long long> n, su, IND, VAL;
vector<vector<long long> > g, ind, val;
map<long long, int> I;
int main() {
  ios_base::sync_with_stdio(false);
  cin >> k;
  n.resize(k);
  g.resize(k);
  su.assign(k, 0);
  long long sum = 0;
  for (int i = 0; i < k; ++i) {
    cin >> n[i];
    g[i].resize(n[i]);
    for (int j = 0; j < n[i]; ++j) {
      cin >> g[i][j];
      sum += g[i][j];
      su[i] += g[i][j];
      I[g[i][j]] = i;
    }
  }
  if (sum % k != 0) {
    cout << "No";
    return 0;
  }
  sum /= k;
  int M = (1 << k);
  ind = val = vector<vector<long long> >(M, vector<long long>());
  for (int i = 0; i < k; ++i) {
    for (int j = 0; j < g[i].size(); ++j) {
      long long x = g[i][j];
      int ma = (1 << i);
      int ii = i;
      IND.clear();
      IND.push_back(ii);
      VAL.clear();
      VAL.push_back(x);
      while (true) {
        long long y = sum + x - su[ii];
        if (!I.count(y)) break;
        ii = I[y];
        if (ii == i) {
          if (y == g[i][j] && ind[ma].empty()) {
            ind[ma] = IND;
            val[ma] = VAL;
          }
          break;
        }
        if ((ma & (1 << ii)) > 0) break;
        x = y;
        ma ^= (1 << ii);
        IND.push_back(ii);
        VAL.push_back(x);
      }
    }
  }
  vector<long long> dp(M, 0);
  dp[0] = 1;
  vector<long long> pp(M, -1);
  for (int ma = 1; ma < M; ++ma) {
    for (int ad = ma; ad > 0; ad = (ad - 1) & ma) {
      int fr = ma ^ ad;
      if (ind[ad].empty()) continue;
      if (dp[fr] == 0) continue;
      if (dp[fr ^ ad]) continue;
      dp[fr ^ ad] = 1;
      pp[fr ^ ad] = ad;
    }
  }
  if (!dp[M - 1]) {
    cout << "No";
    return 0;
  }
  vector<long long> z;
  int ma = M - 1;
  while (ma) {
    z.push_back(pp[ma]);
    ma ^= z.back();
  }
  vector<long long> XX(k), YY(k);
  for (int e = 0; e < z.size(); ++e) {
    int ma = z[e];
    int hh = ind[ma].size();
    for (int i = 0; i < hh; ++i) {
      int j = ind[ma][i];
      XX[j] = val[ma][i];
      YY[j] = ind[ma][(i + hh - 1) % hh] + 1;
    }
  }
  cout << "Yes\n";
  for (int i = 0; i < k; ++i) cout << XX[i] << " " << YY[i] << "\n";
  return 0;
}
