#include <bits/stdc++.h>
using namespace std;
int k;
map<long long, int> m;
vector<long long> a[20];
long long sum;
long long sum1[20];
int flag;
int vis[1 << 20];
vector<int> ans, ans1;
int get_circle(int x, long long y, int f) {
  f ^= (1 << x), ans[x] = y;
  long long z = y;
  int now = x;
  while (1) {
    long long d = sum - sum1[now] + z;
    if (d == y) {
      ans1[x] = now;
      return f;
    }
    if (m.find(d) == m.end()) return -1;
    int p = m[d];
    if (f & (1 << p)) return -1;
    ans[p] = d;
    f ^= (1 << p);
    ans1[p] = now;
    now = p, z = d;
  }
}
void dfs(int u, int f) {
  if (flag == 1) return;
  if (u >= k + 1) {
    flag = 1;
    printf("YES\n");
    for (int i = 1; i <= k; i++) {
      printf("%d %d\n", ans[i], ans1[i]);
    }
    return;
  }
  if (vis[f]) return;
  if (f & (1 << u))
    dfs(u + 1, f);
  else {
    vector<int> b(ans), c(ans1);
    for (int i = 0; i < a[u].size(); i++) {
      int v = a[u][i];
      int t = get_circle(u, v, f);
      if (t != -1) dfs(u + 1, t);
      ans = b;
      ans1 = c;
    }
    vis[f] = 1;
  }
}
int main() {
  scanf("%d", &k);
  for (int i = 1; i <= k; i++) {
    int n;
    scanf("%d", &n);
    for (int j = 0; j < n; j++) {
      long long v;
      scanf("%lld", &v);
      m[v] = i;
      a[i].push_back(v);
      sum1[i] += v;
      sum += v;
    }
  }
  if (sum % k != 0) {
    printf("NO\n");
    return 0;
  }
  sum /= k;
  ans.resize(k + 1);
  ans1.resize(k + 1);
  dfs(1, 0);
  if (flag == 0) printf("NO\n");
  return 0;
}
