#include <bits/stdc++.h>
using namespace std;
int n, m, k, t;
int p[20];
bool dp[1 << 20];
int a[20][5010];
vector<vector<int> > dp1[1 << 20];
unordered_map<long long, int> mp;
bool used[20];
long long delta[20];
int main() {
  int i, j;
  scanf("%d", &k);
  long long sum = 0;
  for (i = 0; i < k; i++) {
    scanf("%d", &p[i]);
    for (j = 1; j <= p[i]; j++) {
      scanf("%d", &a[i][j]);
      delta[i] += a[i][j];
      sum += a[i][j];
      mp[a[i][j]] = i;
    }
  }
  if (sum % k != 0) {
    return 0 * puts("No");
  }
  sum /= k;
  for (i = 0; i < k; i++) {
    for (j = 1; j <= p[i]; j++) {
      long long st = a[i][j];
      int cur = i;
      memset(used, false, sizeof(used));
      bool ok = true;
      while (true) {
        long long nxt = sum - (delta[cur] - st);
        if (!mp.count(nxt) || used[mp[nxt]]) {
          ok = false;
          break;
        }
        st = nxt;
        cur = mp[nxt];
        used[cur] = true;
        if (cur == i) {
          if (st != a[i][j]) {
            ok = false;
          }
          break;
        }
      }
      if (ok && used[i]) {
        int mask = 0;
        long long st = a[i][j];
        int cur = i;
        memset(used, false, sizeof(used));
        bool ok = true;
        vector<int> tmp;
        while (true) {
          long long nxt = sum - (delta[cur] - st);
          if (!mp.count(nxt) || used[mp[nxt]]) {
            ok = false;
            break;
          }
          st = nxt;
          cur = mp[nxt];
          mask |= (1 << cur);
          tmp.push_back(st);
          used[cur] = true;
        }
        if (dp[mask]) continue;
        dp[mask] = true;
        dp1[mask].push_back(tmp);
      }
    }
  }
  for (i = 1; i < 1 << k; i++) {
    for (j = i; j; j = ((j - 1) & i)) {
      if (dp[i]) break;
      if (dp[j] && dp[j ^ i]) {
        dp[i] = true;
        for (auto x : dp1[j]) dp1[i].push_back(x);
        for (auto x : dp1[j ^ i]) dp1[i].push_back(x);
      }
    }
  }
  if (!dp[(1 << k) - 1]) return 0 * puts("No");
  puts("Yes");
  vector<pair<int, pair<int, int> > > ret;
  for (auto x : dp1[(1 << k) - 1]) {
    vector<int> tmp = x;
    int sz = (int)tmp.size();
    for (i = 0; i < sz; i++) {
      ret.push_back({mp[tmp[(i + 1) % sz]], {tmp[(i + 1) % sz], mp[tmp[i]]}});
    }
  }
  sort(ret.begin(), ret.end());
  for (auto x : ret) {
    printf("%d %d\n", x.second.first, x.second.second + 1);
  }
  return 0;
}
