#include <bits/stdc++.h>
using ll = long long;
using ld = long double;
using ull = unsigned long long;
using namespace std;
const int N = 15;
int K, nxt[N * 5001], nmp, idBox[N * 5001], par[N * 5001], val[N * 5001],
    track[1 << N];
ll tot[N], atot;
vector<int> ele[N];
map<int, int> mp;
bool vis[N * 5001], in[N * 5001], dp[1 << N];
struct Move {
  int c, to, from;
};
int curMask = 0;
vector<Move> cur, ofDp[1 << N];
void dfs(int u) {
  in[u] = 1;
  vis[u] = 1;
  if (nxt[u]) {
    int v = nxt[u];
    if (in[v]) {
      int x = u, lst = v;
      curMask |= (1 << idBox[x]);
      cur.push_back({val[lst], idBox[x], idBox[lst]});
      while (x != v) {
        lst = x;
        x = par[x];
        if (curMask >> (idBox[x]) & 1) {
          curMask = 0;
          break;
        }
        curMask |= (1 << idBox[x]);
        cur.push_back({val[lst], idBox[x], idBox[lst]});
      }
    } else if (!vis[v]) {
      par[v] = u;
      dfs(v);
    }
  }
  in[u] = 0;
}
pair<int, int> ans[N];
void solve(int m) {
  if (!ofDp[m].empty()) {
    for (Move M : ofDp[m]) ans[M.from] = {M.c, M.to};
    return;
  }
  if (m == 0) return;
  solve(track[m]);
  solve(m ^ track[m]);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> K;
  for (int i = (0); i <= (K - 1); ++i) {
    int len;
    cin >> len;
    ele[i].assign(len, 0);
    for (int j = (0); j <= (len - 1); ++j) {
      int x;
      cin >> x;
      ele[i][j] = x;
      tot[i] += x;
      mp[x] = ++nmp;
      idBox[nmp] = i;
      val[nmp] = x;
    }
    atot += tot[i];
  }
  if (atot % K != 0) {
    cout << "No";
    return 0;
  }
  atot /= K;
  for (int i = (0); i <= (K - 1); ++i) {
    for (int v : ele[i]) {
      int id = mp[v];
      ll to = atot - (tot[i] - v);
      if (to <= 1e9 && mp.find(to) != mp.end()) nxt[id] = mp[to];
    }
  }
  for (int i = (0); i <= (K - 1); ++i) {
    for (int v : ele[i]) {
      int u = mp[v];
      if (!vis[u]) {
        curMask = 0;
        cur.clear();
        dfs(u);
        if (curMask && !dp[curMask]) {
          dp[curMask] = 1;
          ofDp[curMask] = cur;
        }
      }
    }
  }
  dp[0] = 1;
  for (int x = (1); x <= ((1 << K) - 1); ++x)
    if (!dp[x])
      for (int subx = x; subx; subx = (subx - 1) & x)
        if (dp[subx] && dp[x ^ subx]) {
          dp[x] = 1;
          track[x] = subx;
          break;
        }
  if (!dp[(1 << K) - 1])
    cout << "No";
  else {
    cout << "Yes\n";
    solve((1 << K) - 1);
    for (int i = (0); i <= (K - 1); ++i)
      cout << ans[i].first << ' ' << ans[i].second + 1 << '\n';
  }
  return 0;
}
