Ujan has a lot of numbers in his boxes. He likes order and balance, so he decided to reorder the numbers.

There are $k$ boxes numbered from $1$ to $k$. The $i$-th box contains $n_i$ integer numbers. The integers can be negative. All of the integers are distinct. 

Ujan is lazy, so he will do the following reordering of the numbers exactly once. He will pick a single integer from each of the boxes, $k$ integers in total. Then he will insert the chosen numbers — one integer in each of the boxes, so that the number of integers in each box is the same as in the beginning. Note that he may also insert an integer he picked from a box back into the same box.

Ujan will be happy if the sum of the integers in each box is the same. Can he achieve this and make the boxes perfectly balanced, like all things should be?


-----Input-----

The first line contains a single integer $k$ ($1 \leq k \leq 15$), the number of boxes. 

The $i$-th of the next $k$ lines first contains a single integer $n_i$ ($1 \leq n_i \leq 5\,000$), the number of integers in box $i$. Then the same line contains $n_i$ integers $a_{i,1}, \ldots, a_{i,n_i}$ ($|a_{i,j}| \leq 10^9$), the integers in the $i$-th box. 

It is guaranteed that all $a_{i,j}$ are distinct.


-----Output-----

If Ujan cannot achieve his goal, output "No" in a single line. Otherwise in the first line output "Yes", and then output $k$ lines. The $i$-th of these lines should contain two integers $c_i$ and $p_i$. This means that Ujan should pick the integer $c_i$ from the $i$-th box and place it in the $p_i$-th box afterwards.

If there are multiple solutions, output any of those.

You can print each letter in any case (upper or lower).


-----Examples-----
Input
4
3 1 7 4
2 3 2
2 8 5
1 10

Output
Yes
7 2
2 3
5 1
10 4

Input
2
2 3 -2
2 -1 5

Output
No

Input
2
2 -10 10
2 0 -20

Output
Yes
-10 2
-20 1



-----Note-----

In the first sample, Ujan can put the number $7$ in the $2$nd box, the number $2$ in the $3$rd box, the number $5$ in the $1$st box and keep the number $10$ in the same $4$th box. Then the boxes will contain numbers $\{1,5,4\}$, $\{3, 7\}$, $\{8,2\}$ and $\{10\}$. The sum in each box then is equal to $10$.

In the second sample, it is not possible to pick and redistribute the numbers in the required way.

In the third sample, one can swap the numbers $-20$ and $-10$, making the sum in each box equal to $-10$.

```python

USER_FILENAME = "<user_code>"
import sys, json, builtins
import math, heapq, bisect, itertools, functools, collections, statistics, fractions, decimal, operator, array, random, re, string, os, pathlib
try:
    import resource as _res
except Exception:
    _res = None
from collections import Counter, defaultdict, deque, OrderedDict
from functools import lru_cache, reduce
from itertools import accumulate, permutations, combinations, product
from math import gcd, ceil, floor, sqrt
from decimal import Decimal
try:
    from typing import *
except Exception:
    pass
try:
    sys.setrecursionlimit(1_000_000)
except Exception:
    pass
try:
    import site as _site
    try:
        _sys_sites = _site.getsitepackages() if hasattr(_site, "getsitepackages") else []
        for _p in _sys_sites:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
    try:
        _usp = _site.getusersitepackages()
        if isinstance(_usp, str):
            _usp = [_usp]
        for _p in _usp:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
except Exception:
    pass

ns = {"__name__": "__main__"}
for _k, _v in list(globals().items()):
    if not _k.startswith("_"):
        ns[_k] = _v
_CODE = '\ndef main():\n    k = int(input())\n    n = []\n    a = []\n    for i in range(k):\n        line = [int(x) for x in input().split()]\n        ni = line[0]\n        ai = []\n        n.append(ni)\n        a.append(ai)\n        for j in range(ni):\n            ai.append(line[1 + j])\n    answer, c, p = solve(k, n, a)\n    if answer:\n        print("Yes")\n        for i in range(k):\n            print(c[i], p[i] + 1)\n    else:\n        print("No")\n\n\ndef solve(k, n, a):\n    asum, sums = calc_sums(k, n, a)\n    if asum % k != 0:\n        return False, None, None\n    tsum = asum / k\n    num_map = build_num_map(k, n, a)\n    masks = [None]*(1 << k)\n    answer = [False]*(1 << k)\n    left = [0]*(1 << k)\n    right = [0]*(1 << k)\n    for i in range(k):\n        for j in range(n[i]):\n            found, mask, path = find_cycle(i, j, i, j, k, n, a, sums, tsum, num_map, 0, dict())\n            if found:\n                answer[mask] = True\n                masks[mask] = path\n    for mask_right in range(1 << k):\n        if not masks[mask_right]:\n            continue\n        zeroes_count = 0\n        for u in range(k):\n            if (1 << u) > mask_right:\n                break\n            if (mask_right & (1 << u)) == 0:\n                zeroes_count += 1\n        for mask_mask in range(1 << zeroes_count):\n            mask_left = 0\n            c = 0\n            for u in range(k):\n                if (1 << u) > mask_right:\n                    break\n                if (mask_right & (1 << u)) == 0:\n                    if (mask_mask & (1 << c)) != 0:\n                        mask_left = mask_left | (1 << u)\n                    c += 1\n            joint_mask = mask_left | mask_right\n            if answer[mask_left] and not answer[joint_mask]:\n                answer[joint_mask] = True\n                left[joint_mask] = mask_left\n                right[joint_mask] = mask_right\n                if joint_mask == ((1 << k) - 1):\n                    return build_answer(k, masks, left, right)\n    if answer[(1 << k) - 1]:\n        return build_answer(k, masks, left, right)\n    return False, None, None\n\n\ndef build_answer(k, masks, left, right):\n    c = [-1] * k\n    p = [-1] * k\n    pos = (1 << k) - 1\n    while not masks[pos]:\n        for key, val in list(masks[right[pos]].items()):\n            c[key] = val[0]\n            p[key] = val[1]\n        pos = left[pos]\n    for key, val in list(masks[pos].items()):\n        c[key] = val[0]\n        p[key] = val[1]\n    return True, c, p\n\n\ndef build_num_map(k, n, a):\n    result = dict()\n    for i in range(k):\n        for j in range(n[i]):\n            result[a[i][j]] = (i, j)\n    return result\n\n\ndef find_cycle(i_origin, j_origin, i, j, k, n, a, sums, tsum, num_map, mask, path):\n    if (mask & (1 << i)) != 0:\n        if i == i_origin and j == j_origin:\n            return True, mask, path\n        else:\n            return False, None, None\n    mask = mask | (1 << i)\n    a_needed = tsum - (sums[i] - a[i][j])\n    if a_needed not in num_map:\n        return False, None, None\n    i_next, j_next = num_map[a_needed]\n    path[i_next] = (a[i_next][j_next], i)\n    return find_cycle(i_origin, j_origin, i_next, j_next, k, n, a, sums, tsum, num_map, mask, path)\n\n\ndef calc_sums(k, n, a):\n    sums = [0] * k\n    for i in range(k):\n        for j in range(n[i]):\n            sums[i] = sums[i] + a[i][j]\n    asum = 0\n    for i in range(k):\n        asum = asum + sums[i]\n    return asum, sums\n\n\ndef __starting_point():\n    main()\n\n__starting_point()'
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

```

Measured memory_bytes: 14879