#include <bits/stdc++.h>
using namespace std;
map<long long, int> vis;
vector<int> vec[15];
bool mem[(1 << (15))];
pair<int, int> ara[(1 << (15))];
vector<pair<int, int> > vv[(1 << (15))];
long long tt[15];
queue<int> q[(1 << (15))];
int main() {
  long long sum = 0;
  int k, x;
  scanf("%d", &k);
  for (int i = 0; i < k; i++) {
    int n;
    scanf("%d", &n);
    for (int j = 0; j < n; j++)
      scanf("%d", &x), vec[i].push_back(x), vis[x] = i + 1, sum += x,
                                            tt[i] += x;
  }
  if (abs(sum) % k) {
    printf("No\n");
    return 0;
  }
  long long s = (sum / k);
  for (int i = 0; i < k; i++) {
    for (int j = 0; j < vec[i].size(); j++) {
      long long x = (s - tt[i] + vec[i][j]);
      if (!vis[x]) continue;
      bool vs[15];
      memset(vs, 0, sizeof vs);
      int msk = 0;
      vector<pair<int, int> > temp;
      int prev = i;
      while (true) {
        if (vis[x] && !vs[vis[x] - 1]) {
          if ((vis[x] - 1) == i) {
            if (x == vec[i][j]) {
              temp.push_back({x, prev});
              msk |= (1 << (vis[x] - 1));
              vv[msk] = temp;
              mem[msk] = 1;
            }
            break;
          } else {
            vs[vis[x] - 1] = 1;
            msk |= (1 << (vis[x] - 1));
            temp.push_back({x, prev});
            prev = (vis[x] - 1);
            x = (s - tt[vis[x] - 1] + x);
          }
        } else
          break;
      }
    }
  }
  int mx = (1 << (k)) - 1;
  for (int i = 1; i < (1 << (k)); i++) {
    if (mem[i]) {
      q[i].push(i);
      continue;
    }
    for (int j = i; j > 0; j = (i & (j - 1))) {
      if (mem[j] && mem[i ^ j]) {
        q[i].push(j);
        if ((i ^ j)) q[i].push(i ^ j);
        mem[i] = 1;
        break;
      }
    }
  }
  if (!mem[(1 << (k)) - 1]) {
    printf("No\n");
    return 0;
  }
  pair<int, int> res[15];
  while (!q[mx].empty()) {
    int x = q[mx].front();
    q[mx].pop();
    if (q[x].size() > 1) {
      q[mx].push(q[x].front());
      q[x].pop();
      q[mx].push(q[x].front());
      q[x].pop();
    } else {
      for (int i = 0; i < vv[x].size(); i++) {
        pair<int, int> p = vv[x][i];
        res[vis[p.first] - 1] = p;
      }
    }
  }
  printf("Yes\n");
  for (int i = 0; i < k; i++)
    printf("%d %d\n", res[i].first, res[i].second + 1);
  return 0;
}
