#include <bits/stdc++.h>
using namespace std;
const int N = 5005;
vector<pair<pair<int, long long>, int> > g[50005];
long long a[17][N];
long long sum[17];
long long ave, sumall;
int k, x[17];
map<long long, int> color;
const int M = (1 << 17);
bool dp[M];
vector<pair<pair<int, long long>, int> > ans;
vector<int> oth[M];
int main() {
  scanf("%d", &k);
  for (int i = 0; i < k; i++) {
    scanf("%d", &x[i]);
    for (int j = 0; j < x[i]; j++) {
      scanf("%lld", &a[i][j]);
      sumall += a[i][j];
      sum[i] += a[i][j];
      color[a[i][j]] = i;
    }
  }
  if (sumall % k) {
    printf("No\n");
    return 0;
  }
  ave = sumall / k;
  for (int i = 0; i < k; i++) {
    for (int j = 0; j < x[i]; j++) {
      bool flag = true;
      long long cur = a[i][j];
      int used = 0;
      vector<pair<pair<int, long long>, int> > tmp;
      tmp.clear();
      do {
        map<long long, int>::iterator ind = color.find(cur);
        int c1 = 0;
        if (ind != color.end()) {
          c1 = ind->second;
        } else {
          flag = false;
          break;
        }
        if (used & (1 << c1)) {
          flag = false;
          break;
        }
        used |= (1 << c1);
        cur += ave - sum[c1];
        ind = color.find(cur);
        if (ind != color.end()) {
          tmp.push_back(make_pair(make_pair(ind->second, cur), c1));
        }
      } while (cur != a[i][j]);
      if (flag) {
        dp[used] = true;
        g[used] = tmp;
      }
    }
  }
  for (int i = 0; i < (1 << k); i++) {
    if (dp[i]) {
      oth[i].push_back(i);
      continue;
    }
    for (int j = i; j > 0; j = (j - 1) & i) {
      if (dp[j] && dp[j ^ i]) {
        dp[i] = true;
        for (int k = 0; k < oth[j].size(); k++) {
          oth[i].push_back(oth[j][k]);
        }
        for (int k = 0; k < oth[j ^ i].size(); k++) {
          oth[i].push_back(oth[j ^ i][k]);
        }
        break;
      }
    }
  }
  int val = (1 << k) - 1;
  if (dp[val]) {
    printf("Yes\n");
    for (int i = 0; i < oth[val].size(); i++) {
      for (int j = 0; j < g[oth[val][i]].size(); j++) {
        ans.push_back(g[oth[val][i]][j]);
      }
    }
    sort(ans.begin(), ans.end());
    for (int i = 0; i < ans.size(); i++) {
      printf("%lld %d\n", ans[i].first.second, ans[i].second + 1);
    }
  } else {
    printf("No\n");
  }
  return 0;
}
