#include <bits/stdc++.h>
using namespace std;
const int N = 16, MAXN = 1 << 16;
long long n, sum[N], tot, need;
bool vis[MAXN], dp[MAXN];
vector<int> g[MAXN];
map<long long, int> m;
pair<int, int> res[MAXN];
struct Node {
  int fr, to, cnt;
  Node(int fr, int to, int cnt) : fr(fr), to(to), cnt(cnt) {}
};
vector<Node> b[MAXN];
vector<Node> v;
int solve(int mask) {
  if (vis[mask]) return dp[mask];
  vis[mask] = 1;
  if (((int)(b[mask]).size())) return dp[mask] = 1;
  for (int s = mask; s; s = (s - 1) & mask) {
    if (s && solve(s) && solve(mask ^ s)) return dp[mask] = 1;
  }
  return dp[mask] = 0;
}
void build(int mask) {
  if (!mask) return;
  if (((int)(b[mask]).size())) {
    for (auto it : b[mask]) res[it.fr] = {it.cnt, it.to};
    return;
  }
  for (int s = mask; s; s = (s - 1) & mask) {
    if (s && solve(s) && solve(mask ^ s)) {
      build(s);
      build(mask ^ s);
      return;
    }
  }
  assert(0);
}
int gen(int i, int j) {
  v.clear();
  v.push_back(Node(i, -1, j));
  int res = 1 << i;
  long long cur = need - (sum[i] - j);
  while (1) {
    if (!m.count(cur)) return 0;
    int x = m[cur];
    if (res & (1 << x)) {
      if (i == x && cur == j) break;
      return 0;
    }
    res = res | (1 << x);
    v.push_back(Node(x, v.back().fr, cur));
    cur = need - (sum[x] - cur);
  }
  if (res == (1 << i) && sum[i] != need) return 0;
  v[0].to = v.back().fr;
  return res;
}
int main() {
  cin >> n;
  for (int i = 0, ggdem = n; i < ggdem; i++) {
    int k;
    cin >> k;
    g[i].resize(k);
    for (int j = 0, ggdem = k; j < ggdem; j++) {
      cin >> g[i][j];
      sum[i] += g[i][j];
      m[g[i][j]] = i;
    }
    tot += sum[i];
  }
  if (tot % n) cout << "No" << endl, exit(0);
  need = tot / n;
  for (int i = 0, ggdem = n; i < ggdem; i++) {
    for (int j : g[i]) {
      int mask = gen(i, j);
      if (!mask || ((int)(b[mask]).size())) continue;
      b[mask] = v;
    }
  }
  if (!solve((1 << n) - 1)) cout << "No" << endl, exit(0);
  cout << "Yes" << endl;
  build((1 << n) - 1);
  for (int i = 0, ggdem = n; i < ggdem; i++)
    cout << res[i].first << " " << res[i].second + 1 << "\n";
}
