A two dimensional array is called a bracket array if each grid contains one of the two possible brackets — "(" or ")". A path through the two dimensional array cells is called monotonous if any two consecutive cells in the path are side-adjacent and each cell of the path is located below or to the right from the previous one. 

A two dimensional array whose size equals *n* × *m* is called a correct bracket array, if any string formed by writing out the brackets on some monotonous way from cell (1, 1) to cell (*n*, *m*) forms a correct bracket sequence. 

Let's define the operation of comparing two correct bracket arrays of equal size (*a* and *b*) like that. Let's consider a given two dimensional array of priorities (*c*) — a two dimensional array of same size, containing different integers from 1 to *nm*. Let's find such position (*i*, *j*) in the two dimensional array, that *a*<sub class="lower-index">*i*, *j*</sub> ≠ *b*<sub class="lower-index">*i*, *j*</sub>. If there are several such positions, let's choose the one where number *c*<sub class="lower-index">*i*, *j*</sub> is minimum. If *a*<sub class="lower-index">*i*, *j*</sub> = "(", then *a* &lt; *b*, otherwise *a* &gt; *b*. If the position (*i*, *j*) is not found, then the arrays are considered equal.

Your task is to find a *k*-th two dimensional correct bracket array. It is guaranteed that for the given sizes of *n* and *m* there will be no less than *k* two dimensional correct bracket arrays.
The first line contains integers *n*, *m* and *k* — the sizes of the array and the number of the sought correct bracket array (1 ≤ *n*, *m* ≤ 100, 1 ≤ *k* ≤ 10<sup class="upper-index">18</sup>). Then an array of priorities is given, *n* lines each containing *m* numbers, number *p*<sub class="lower-index">*i*, *j*</sub> shows the priority of character *j* in line *i* (1 ≤ *p*<sub class="lower-index">*i*, *j*</sub> ≤ *nm*, all *p*<sub class="lower-index">*i*, *j*</sub> are different).

Please do not use the %lld specificator to read or write 64-bit integers in С++. It is preferred to use the cin, cout streams or the %I64d specificator.
1 2 1
1 2
()
2 3 1
1 2 3
4 5 6
(()
())
3 2 2
3 6
1 4
2 5
()
)(
()
4 3 1
1 4 6
10 12 2
7 8 5
3 11 9
(()
()(
)()
())
4 3 1
2 3 11
4 10 5
8 12 9
7 1 6
(()
())
))(
)()
3 4 2
3 10 12 2
7 9 4 11
8 5 6 1
()((
)(()
(())
3 4 2
5 8 12 10
7 3 11 1
4 9 2 6
(())
())(
))()
4 3 4
2 8 3
12 6 7
9 11 1
10 4 5
(((
(()
())
)))
4 5 14
3 10 5 6 17
18 20 9 15 16
8 7 19 13 4
14 11 2 12 1
(()((
()(()
)(())
(()))
5 4 12
10 9 4 19
8 17 16 12
13 14 7 15
11 6 20 2
5 18 1 3
(()(
()((
)(()
(())
()))
5 4 1
13 6 4 2
17 9 8 15
14 1 19 11
7 10 20 3
18 16 12 5
()((
)(()
(())
())(
))()
6 5 8
7 17 4 16 14
2 9 15 11 22
3 28 20 24 8
23 18 29 10 27
12 19 6 25 30
21 13 26 5 1
((())
(()))
()))(
)))((
))(()
)(())
5 6 3
5 4 18 3 27 26
16 29 22 10 20 9
23 1 19 17 6 12
8 30 25 14 21 13
15 11 2 24 28 7
(()())
()())(
)())((
())(()
))(())
5 6 35
17 4 6 19 25 2
16 13 22 29 23 12
9 27 20 21 11 10
3 15 14 5 30 26
7 18 8 24 28 1
((()))
(()))(
()))((
)))(()
))(())
6 3 2
2 12 14
5 7 1
18 11 10
13 16 3
17 6 8
4 15 9
()(
)((
(()
()(
)()
())
6 7 41
15 42 34 40 7 17 20
25 11 8 6 3 27 5
33 12 41 32 24 9 36
26 35 2 29 14 23 31
4 16 19 22 37 18 30
1 39 28 21 13 38 10
(()()((
()()(((
)()((()
()((())
)((()))
((())))
8 7 206
16 1 53 40 43 54 52
30 23 27 8 5 47 35
37 19 33 44 56 22 32
31 55 3 51 39 13 15
25 4 50 38 12 34 20
10 48 36 26 21 45 41
46 28 9 24 17 7 42
6 29 18 11 14 49 2
(()())(
()())((
)())(((
())((()
))((()(
)((()()
((()())
(()()))
7 8 429
3 27 38 30 54 20 31 16
12 28 5 52 32 26 39 47
49 9 56 23 36 53 35 46
4 51 34 21 44 45 19 1
55 50 24 37 29 14 6 40
43 25 17 41 42 13 10 8
18 22 33 15 48 11 7 2
()()((((
)()(((((
()((((()
)((((())
((((()))
(((())))
((()))))
7 8 313
1 44 8 39 54 6 35 29
37 12 50 34 9 25 48 21
7 42 56 3 16 31 53 40
38 24 2 55 19 47 28 45
43 5 14 17 46 26 32 20
15 23 52 4 33 22 30 36
18 51 49 10 11 41 27 13
(()(())(
()(())((
)(())(((
(())((()
())((())
))((()))
)((())))
8 9 124
15 5 45 72 66 14 20 17 47
12 53 71 56 32 19 11 42 27
63 69 21 23 6 18 33 43 1
70 34 24 68 10 37 60 65 44
41 61 9 51 48 39 3 54 31
22 13 46 38 26 58 49 62 30
29 16 28 67 7 36 55 59 50
64 35 40 4 52 57 8 25 2
((()((())
(()((()))
()((()))(
)((()))()
((()))())
(()))()))
()))()))(
)))()))()
10 9 2353
9 29 1 30 70 25 90 44 2
34 15 48 79 53 87 61 20 32
4 62 64 26 69 66 18 57 43
10 65 88 82 37 19 86 84 42
59 33 68 36 28 24 40 51 60
46 55 45 5 11 27 74 6 76
77 49 8 89 73 41 39 72 58
54 14 67 17 85 71 80 75 31
38 78 13 63 52 47 83 16 7
23 22 35 12 3 81 21 50 56
((())()()
(())()()(
())()()()
))()()()(
)()()()()
()()()()(
)()()()((
()()()(()
)()()(())
()()(()))
7 10 1
14 29 33 8 1 70 49 62 54 44
46 12 20 2 61 26 56 69 48 31
16 13 3 65 27 59 68 10 40 18
15 4 53 25 47 42 36 17 37 34
5 64 38 55 45 60 30 35 6 22
66 32 67 50 51 9 57 19 21 11
39 52 43 58 23 7 63 24 28 41
()((()()))
)((()()))(
((()()))((
(()()))(((
()()))((()
)()))((())
()))((()))
8 11 2907
50 85 1 30 20 70 4 69 35 10 23
43 15 8 37 77 26 82 48 76 32 46
2 79 87 63 14 74 61 12 38 56 17
86 88 66 7 60 36 19 54 41 59 84
27 39 5 40 58 18 33 29 83 45 44
53 3 55 64 11 34 28 22 42 16 72
9 75 67 24 49 6 25 81 13 62 71
80 51 73 57 52 47 78 21 68 65 31
((((()))())
(((()))()))
((()))()))(
(()))()))()
()))()))()(
)))()))()((
))()))()(()
)()))()(())
11 12 11192
12 74 114 18 59 103 33 47 23 93 69 45
8 108 4 113 92 49 68 118 119 122 95 94
115 24 26 48 34 50 62 117 112 61 11 100
5 85 84 67 60 39 125 63 127 13 35 32
36 76 25 99 46 107 89 80 79 38 73 131
82 111 65 71 124 58 30 31 126 10 37 53
28 54 109 88 77 106 55 42 21 75 66 83
57 20 129 102 90 29 123 22 14 98 7 43
101 121 110 87 81 132 16 9 70 72 44 52
91 64 116 51 128 78 1 27 3 19 40 56
130 96 41 86 6 2 97 17 104 120 105 15
()((())())((
)((())())(((
((())())((()
(())())((()(
())())((()((
))())((()(()
)())((()(())
())((()(()))
))((()(())))
)((()(())))(
((()(())))()
1 16 1272
13 2 3 5 8 10 9 1 6 12 11 4 15 14 16 7
()((()()))(()())
44 1 44490484850
38
33
13
10
43
20
22
15
25
41
21
40
1
7
14
2
26
32
4
3
6
24
23
16
37
28
29
8
27
42
44
12
39
31
36
19
9
11
34
17
35
30
5
18
(
(
)
(
(
(
)
(
(
(
)
(
(
(
)
)
)
(
(
)
)
)
)
(
)
)
(
)
)
(
)
)
(
(
)
(
(
)
)
(
)
(
)
)
import sys

def print_nice(f):
  for row in f:
    print(''.join(row))
  print('')

def solve(n, m):

  def is_good(field):
    if field[0][0] == ')':
      return False

    possible = [[set() for i in range(m)] for j in range(n)]
    possible[0][0].add(1)

    good = True
    for i in range(n):
      for j in range(m):
        if i == j == 0:
          continue

        d = 1 if field[i][j] == '(' else -1

        if i - 1 >= 0:
          possible[i][j].update(x + d for x in possible[i - 1][j])
        if j - 1 >= 0:
          possible[i][j].update(x + d for x in possible[i][j - 1])

        for t in possible[i][j]:
          good &= t >= 0

        if not good:
          return False

    return good and possible[n - 1][m - 1] == set([0])

  good = []
  for mask in range(2 ** (n * m)):
    field = []
    idx = 0
    for i in range(n):
      row = []
      for j in range(m):
        cur = '(' if mask & (1 << idx) else ')'
        row.append(cur)
        idx += 1
      field.append(row)


    if is_good(field):
      good.append(field)

  print(n, m, len(good))
  for x in good:
    print_nice(x)

INF = 10 ** 50

def count(s):
  n = len(s)
  dp = [[0 for i in range(n + 2)] for j in range(n + 2)]

  dp[0][0] = 1

  for i in range(1, n + 1):
    v = s[i - 1]
    for bal in range(n + 1):
      if bal > 0 and v != ')':
        dp[i][bal] += dp[i - 1][bal - 1]
      if v != '(':
        dp[i][bal] += dp[i - 1][bal + 1]

  return dp[n][0]

def real_solve(row, col, k, priority):
  k -= 1
  n = row + col - 1
  cur_string = ['?' for i in range(n)]

  for step in range(row * col):
    min_prior = INF

    for i in range(row):
      for j in range(col):
        min_prior = min(min_prior, priority[i][j])

    r, c = 0, 0
    for i in range(row):
      for j in range(col):
        if min_prior == priority[i][j]:
          r, c = i, j

    idx = (r + c) % n
    priority[r][c] = INF

    if cur_string[idx] != '?':
      continue
    cur_string[idx] = '('
    cnt = count(cur_string)

    if cnt <= k:
      k -= cnt
      cur_string[idx] = ')'

  ans = []
  for i in range(row):
    ans.append(cur_string[i:i+col])

  return ans



n, m, k = map(int, input().split())
pr = []
for i in range(n):
  pr.append(list(map(int, input().split())))

print_nice(real_solve(n, m, k, pr))