#include <bits/stdc++.h>
using namespace std;
double pi = acos(-1);
int n;
long long sum[1 << 15];
vector<long long> a[15];
map<long long, int> mp;
int dp[1 << 15];
vector<pair<int, pair<int, int>>> path[1 << 15];
int trace[1 << 15];
vector<pair<int, pair<int, int>>> ans;
void recursion(int mask) {
  if ((int)(path[mask]).size()) {
    for (auto first : (path[mask])) ans.push_back(first);
  } else
    recursion(mask ^ trace[mask]), recursion(trace[mask]);
}
int solve(int mask) {
  int &res = dp[mask];
  if (res == -1) {
    res = 0;
    for (int submask = mask; submask; submask = mask & (submask - 1)) {
      if (submask == mask) continue;
      if (solve(submask) && solve(mask ^ submask)) {
        res = 1;
        trace[mask] = submask;
        break;
      }
    }
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n;
  long long avg = 0;
  for (int i = (0); i < (n); ++i) {
    int k;
    cin >> k;
    for (int j = (1); j <= (k); ++j) {
      int first;
      cin >> first;
      sum[i] += first;
      a[i].push_back(first);
      avg += first;
      mp[first] = i;
    }
  }
  if (avg % n) {
    cout << "No";
    return 0;
  }
  avg /= n;
  for (int i = (0); i < ((1 << n)); ++i) dp[i] = -1;
  for (int i = (0); i < (n); ++i) {
    for (auto p : (a[i])) {
      long long first = p;
      long long second;
      long long cur = sum[i];
      int mask = 1 << i;
      vector<pair<int, pair<int, int>>> cycle;
      cycle.push_back({i, {first, first}});
      while ((second = avg - cur + first) != p && mp.count(second) &&
             ((1 << mp[second]) & mask) == 0) {
        int id = mp[second];
        cycle.push_back({id, {second, mp[first]}});
        cur = sum[id];
        mask |= 1 << id;
        first = second;
      }
      if (second == p) {
        cycle[0].second.second = mp[first];
        dp[mask] = 1;
        path[mask] = cycle;
      }
    }
  }
  if (solve((1 << n) - 1)) {
    cout << "YES" << '\n';
    recursion((1 << n) - 1);
    sort((ans).begin(), (ans).end());
    for (auto it = (ans).begin(); it != (ans).end(); ++it)
      cout << it->second.first << " " << it->second.second + 1 << '\n';
  } else
    cout << "NO";
  return 0;
}
