8,4,6,8,3,6,4,5,3
1 2 3 4 5 6 7 8 9
2 14 15 16 17
3 23 24 25 26 27 28
4 32 33 34 35 36 37 38 39
5 11 12 13
6 43 44 45 46 47 48
7 1 10 18 19
8 20 21 22 29 30
9 31 40 41
m = 50 w = 10 n = 9 f = [1] * m a = list(map(int, input().split(","))) def getpos(r): for i in range(m): if f[i] >= r: return i return -1 for i in range(m): f[i] = w - i % w v = 0 for i in range(n): s = "" __________ if p == -1: j = 1 while j <= a[i]: if f[v] != 0: s += str(v + 1) + " " f[v] = 0 j += 1 __________ else: k = (f[p] - a[i]) // 2 for j in range(k, 0, -1): f[p] = j p += 1 for j in range(__________): f[j] = 0 s += str(j + 1) + " " print(i + 1, s)