#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  int k;
  cin >> k;
  vector<long long> sums(k);
  vector<vector<int>> boxes(k);
  vector<pair<long long, int>> nums;
  long long sum = 0;
  for (int i = 0; i < k; i++) {
    int a;
    long long csum = 0;
    cin >> a;
    for (int b = 0; b < a; b++) {
      int curr;
      cin >> curr;
      boxes[i].push_back(curr);
      csum += curr;
      nums.emplace_back(curr, i);
    }
    sum += csum;
    sums[i] = csum;
  }
  if (sum % k) {
    cout << "No\n";
    return 0;
  }
  long long goal = sum / k;
  sort(nums.begin(), nums.end());
  vector<bool> poss(1 << k, false);
  vector<vector<pair<long long, int>>> points(1 << k,
                                              vector<pair<long long, int>>(k));
  deque<int> soFar;
  poss[0] = true;
  for (int i = 0; i < k; i++) {
    long long res = goal - sums[i];
    for (int a : boxes[i]) {
      vector<pair<long long, int>> options(k);
      options[i].first = a;
      int mask = 1 << i;
      long long cres = res + a;
      bool loop = false;
      int cb = i;
      while (true) {
        int low = 0;
        int high = nums.size() - 1;
        bool can = false;
        while (low <= high) {
          int mid = (low + high) >> 1;
          if (nums[mid].first > cres) {
            high = mid - 1;
          } else if (nums[mid].first < cres) {
            low = mid + 1;
          } else {
            if (cres == a) {
              options[i].second = cb;
              loop = true;
              break;
            }
            if (!(mask & (1 << nums[mid].second))) {
              mask += 1 << (nums[mid].second);
              options[nums[mid].second].first = cres;
              options[nums[mid].second].second = cb;
              cb = nums[mid].second;
              can = true;
              low = mid;
            }
            break;
          }
        }
        if (loop || !can) {
          break;
        }
        cres = goal - sums[nums[low].second] + cres;
      }
      if (loop) {
        if (poss[mask]) {
          continue;
        }
        deque<int> adds;
        adds.push_back(mask);
        poss[mask] = true;
        points[mask] = options;
        for (int mas : soFar) {
          if (!(mas & mask) && !poss[mas | mask]) {
            poss[mas | mask] = true;
            for (int b = 0; b < k; b++) {
              points[mas | mask][b].first =
                  options[b].first + points[mas][b].first;
              points[mas | mask][b].second =
                  options[b].second + points[mas][b].second;
            }
            adds.push_back(mas | mask);
          }
        }
        for (int ma : adds) {
          soFar.push_back(ma);
        }
      }
    }
  }
  if (poss[(1 << k) - 1]) {
    cout << "Yes\n";
    for (int i = 0; i < k; i++) {
      cout << points[(1 << k) - 1][i].first << " "
           << points[(1 << k) - 1][i].second + 1 << "\n";
    }
  } else {
    cout << "No\n";
  }
}
