Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import sys
import fractions


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    n, m = list(map(int, readline().split()))
    a = list(map(int, readline().split()))
    gcd = a[0]
    lcm = a[0]
    for i in range(1, n):
        gcd = fractions.gcd(lcm, a[i])
        lcm = lcm * a[i] // gcd
    if int(lcm / 2) - lcm / 2 == 0:
        print(max((m - (lcm // 2)) // lcm + 1, 0))
    else:
        print(0)


if __name__ == '__main__':
    solve()


Fixed submission:
import sys
import fractions


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    n, m = list(map(int, readline().split()))
    a = [v >> 1 for v in list(map(int, readline().split()))]
    lcm = a[0]
    for v in a[1:]:
        gcd = fractions.gcd(lcm, v)
        if lcm // gcd % 2 == 0 or v // gcd % 2 == 0:
            print(0)
            exit()
        else:
            lcm = lcm * v // gcd
        if lcm > m:
            print(0)
            exit()
    print(m // lcm - m // (lcm * 2))


if __name__ == '__main__':
    solve()
Buggy python submission (verdict: Time Limit Exceeded):
import sys


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    n = int(readline())
    a = list(map(int, readline().split()))
    t = 0
    ls = [0] * 70
    for v in a:
        tt = bin(v)
        for i in range(len(tt)-2):
            ls[i] += int(tt[-i-1])
    for v in a:
        tt = bin(v)
        for i in range(len(tt)-2):
            if tt[-i-1] == "1":
                t += 2 ** i * (n - ls[i])
                t %= mod
    print(t)


if __name__ == '__main__':
    solve()


Fixed submission:
import sys


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    n = int(readline())
    a = list(map(int, readline().split()))
    ls = [0] * 65
    for v in a:
        tt = bin(v)
        for i in range(len(tt)-2):
            ls[i] += int(tt[-i-1])
    t = 0
    for i in range(len(ls)):
        t += 2 ** i * (n - ls[i]) * ls[i]
        t %= mod
    print(t)


if __name__ == '__main__':
    solve()

Buggy python submission (verdict: Time Limit Exceeded):
import sys
import collections


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    n = int(readline())
    a = list(map(int, readline().split()))
    d = collections.defaultdict(int)
    for i in range(n):
        d[a[i]] += 1
    t = 0
    for v in a:
        d[v] -= 1
        if d[v] == 0:
            d.pop(v)
        for k2, v2 in d.items():
            t += (v ^ k2) * v2
            t %= mod
    print(t)


if __name__ == '__main__':
    solve()


Fixed submission:
import sys


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    n = int(readline())
    a = list(map(int, readline().split()))
    ls = [0] * 65
    for v in a:
        tt = bin(v)
        for i in range(len(tt)-2):
            ls[i] += int(tt[-i-1])
    t = 0
    for i in range(len(ls)):
        t += 2 ** i * (n - ls[i]) * ls[i]
        t %= mod
    print(t)


if __name__ == '__main__':
    solve()
Buggy python submission (verdict: Runtime Error):
import sys
import itertools
import collections


def solve():
    input = sys.stdin.readline
    mod = 10 ** 9 + 7
    n, k = list(map(int, input().rstrip('\n').split()))
    ls = [0] + list(map(lambda x: int(x) - 1, input().rstrip('\n').split()))
    ls = [i % k for i in list(itertools.accumulate(ls))]
    print(ls)

    d = collections.defaultls):
        t += d[x]
        d[x] += 1
        if i >= k - 1:
            d[ls[i - k + 1]] -= 1
    print(t)


if __name__ == '__main__':
    solve()


Fixed submission:
import sys
import itertools
import collections


def solve():
    input = sys.stdin.readline
    mod = 10 ** 9 + 7
    n, k = list(map(int, input().rstrip('\n').split()))
    ls = [0] + list(map(lambda x: int(x) - 1, input().rstrip('\n').split()))
    ls = [i % k for i in list(itertools.accumulate(ls))]
    
    d = collections.defaultdict(int)
    t = 0
    for i, x in enumerate(ls):
        t += d[x]
        d[x] += 1
        if i >= k - 1:
            d[ls[i - k + 1]] -= 1
    print(t)


if __name__ == '__main__':
    solve()

Buggy python submission (verdict: Runtime Error):
import sys


def solve():
    input = sys.stdin.readline
    mod = 10 ** 9 + 7
    n, k = list(map(int, input().rstrip('\n').split()))
    ls = list(map(lambda x: int(x) % k, input().rstrip('\n').split()))
    cnt = 0
    print(ls)
    for i in range(min(n, k)):
        t = sum(ls[:i+1])
        if t % k == i + 1:
            cnt += 1
            print(i, j)
        for j in range(i+1, n):
            t -= ls[j-i-1]
            t += ls[j]
            if t % k == i + 1:
                cnt += 1
                print(i, j)
            elif t % k > k:
                break
    print(cnt)


if __name__ == '__main__':
    solve()


Fixed submission:
import sys
import itertools
import collections


def solve():
    input = sys.stdin.readline
    mod = 10 ** 9 + 7
    n, k = list(map(int, input().rstrip('\n').split()))
    ls = [0] + list(map(lambda x: int(x) - 1, input().rstrip('\n').split()))
    ls = [i % k for i in list(itertools.accumulate(ls))]
    
    d = collections.defaultdict(int)
    t = 0
    for i, x in enumerate(ls):
        t += d[x]
        d[x] += 1
        if i >= k - 1:
            d[ls[i - k + 1]] -= 1
    print(t)


if __name__ == '__main__':
    solve()
Buggy python submission (verdict: Runtime Error):
import sys


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    n, m = list(map(int, readline().split()))
    s = str(readline().rstrip().decode('utf-8'))
    cur = n
    ans = []
    while True:
        b = False
        for i in range(cur - m, cur):
            if s[i] == "0" and i >= 0:
                b = True
                ans.append(cur - i)
                cur = i
                break
        if not b:
            print(-1)
            exit()
        if cur == 0:
            ans.reverse()
            print(*ans)
            exit()


if __name__ == '__main__':
    solve()


Fixed submission:
import sys


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    n, m = list(map(int, readline().split()))
    s = str(readline().rstrip().decode('utf-8'))
    cur = n
    ans = []
    while True:
        b = False
        for i in range(cur - m, cur):
            if 0 <= i < n + 1:
                if s[i] == "0":
                    b = True
                    ans.append(cur - i)
                    cur = i
                    break
        if not b:
            print(-1)
            exit()
        if cur == 0:
            ans.reverse()
            print(*ans)
            exit()


if __name__ == '__main__':
    solve()
Buggy python submission (verdict: Runtime Error):
import sys


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    n, t = list(map(int, readline().split()))
    ls = [0] * (200 + 1)
    ab = []
    mt = 0
    for i in range(n):
        a, b = list(map(int, readline().split()))
        mt = max(mt, a)
        ab.append([a, b])
        for j in range(t, -1, -1):
            ls[j + a] = max(ls[j + a], ls[j] + b)
    print(max(ls[:t+mt]))


if __name__ == '__main__':
    solve()


Fixed submission:
import sys


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    n, t = list(map(int, readline().split()))
    ab = [list(map(int, readline().split())) for _ in range(n)]
    ab.sort()
    dp = [0] * (t + 1)
    for a, b in ab:
        dp[-1] = max(dp[-1], dp[-2] + b)
        for i in range(t - a - 1, -1, -1):
            dp[i + a] = max(dp[i + a], dp[i] + b)
    print(dp[-1])


if __name__ == '__main__':
    solve()
Buggy python submission (verdict: Runtime Error):
import sys
import fractions


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    n = int(readline())
    m = 0
    for i in range(2, int(n ** 0.5) + 1):
        m = max(m, fractions.gcd(n, i))
    print(n // m + m - 2)


if __name__ == '__main__':
    solve()


Fixed submission:
import sys


def solve():
    input = sys.stdin.readline
    mod = 10 ** 9 + 7
    n = int(input().rstrip('\n'))
    t = n
    mt = 10 ** 20
    for i in range(1, int(n ** 0.5) + 1):
        if t % i == 0:
            mt = min(mt, (i - 1) + (t // i - 1))
    print(mt)


if __name__ == '__main__':
    solve()

Buggy python submission (verdict: Time Limit Exceeded):
import sys
import itertools


def solve():
    input = sys.stdin.readline
    mod = 10 ** 9 + 7
    n = int(input().rstrip('\n'))
    ls = []
    t = n
    for i in range(2, int(n ** 0.5) + 1):
        while True:
            if t % i == 0:
                ls.append(i)
                t //= i
            else:
                break
    if t != 1:
        ls.append(t)
    mt = 10 ** 20
    for i in range(len(ls)):
        for v in itertools.combinations(ls, i):
            t = 1
            for vv in v:
                t *= vv
            mt = min(mt, (t - 1) + (n // t - 1))
    print(mt)


if __name__ == '__main__':
    solve()


Fixed submission:
import sys


def solve():
    input = sys.stdin.readline
    mod = 10 ** 9 + 7
    n = int(input().rstrip('\n'))
    t = n
    mt = 10 ** 20
    for i in range(1, int(n ** 0.5) + 1):
        if t % i == 0:
            mt = min(mt, (i - 1) + (t // i - 1))
    print(mt)


if __name__ == '__main__':
    solve()
Buggy python submission (verdict: Time Limit Exceeded):
import sys


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    n, k = list(map(int, readline().split()))
    a = list(map(int, readline().split()))
    a.sort()
    f = list(map(int, readline().split()))
    f.sort(reverse=True)

    cor_v = 10 ** 22
    inc_v = -1
    while cor_v - inc_v > 1:
        bin_v = (cor_v + inc_v) // 2
        cost = 0
        #条件を満たすcostを全検索
        for i in range(n):
            if a[i] * f[i] >= bin_v:
                cost += ((a[i] * f[i]) - bin_v + f[i] - 1) // f[i]
            if cost > k:
                break
        #costが制約を満たすか
        if cost <= k:
            cor_v = bin_v
        else:
            inc_v = bin_v
    print(cor_v)


if __name__ == '__main__':
    solve()


Fixed submission:
import sys


def solve():
    input = sys.stdin.readline
    mod = 10 ** 9 + 7
    n, k = list(map(int, input().rstrip('\n').split()))
    a = list(map(int, input().rstrip('\n').split()))
    f = list(map(int, input().rstrip('\n').split()))
    a.sort()
    f.sort(reverse=True)
    left = -1
    right = 10 ** 13
    while right - left > 1:
        mid = (left + right) // 2
        count = 0
        for av, fv in zip(a, f):
            count += max(0, av - (mid // fv))
        if count <= k:
            right = mid
        else:
            left = mid
    print(right)


if __name__ == '__main__':
    solve()
Buggy python submission (verdict: Time Limit Exceeded):
def slove():
    import sys
    input = sys.stdin.readline
    n, m, l = list(map(int, input().rstrip('\n').split()))
    INF = 10 ** 11
    w = [[INF] * n for _ in range(n)]
    wl = [[INF] * n for _ in range(n)]

    for i in range(n):
        w[i][i] = 0

    for i in range(m):
        a, b, c = list(map(int, input().rstrip('\n').split()))
        if c <= l:
            w[a - 1][b - 1] = c
            w[b - 1][a - 1] = c

    for i in range(n):
        for j in range(n):
            for k in range(n):
                w[j][k] = min(w[j][k], w[j][i] + w[i][k])

    for i in range(n):
        for j in range(n):
            if w[i][j] <= l:
                wl[i][j] = 1
    for i in range(n):
        for j in range(n):
            for k in range(n):
                wl[j][k] = min(wl[j][k], wl[j][i] + wl[i][k])

    q = int(input().rstrip('\n'))
    for i in range(q):
        s, t = list(map(int, input().rstrip('\n').split()))
        if wl[s-1][t-1] == INF:
            print(-1)
        else:
            print(wl[s-1][t-1] - 1)


if __name__ == '__main__':
    slove()


Fixed submission:
def slove():
    import sys
    input = sys.stdin.readline
    n, m, l = list(map(int, input().rstrip('\n').split()))
    INF = 10 ** 11
    w = [[INF] * n for _ in range(n)]
    wl = [[INF] * n for _ in range(n)]

    for i in range(n):
        w[i][i] = 0

    for i in range(m):
        a, b, c = list(map(int, input().rstrip('\n').split()))
        if c <= l:
            w[a - 1][b - 1] = c
            w[b - 1][a - 1] = c

    for i in range(n):
        for j in range(n):
            for k in range(n):
                w[j][k] = min(w[j][k], w[j][i] + w[i][k])

    for i in range(n):
        for j in range(n):
            if w[i][j] <= l:
                wl[i][j] = 1
    for i in range(n):
        for j in range(n):
            for k in range(n):
                wl[j][k] = min(wl[j][k], wl[j][i] + wl[i][k])

    q = int(input().rstrip('\n'))
    for i in range(q):
        s, t = list(map(int, input().rstrip('\n').split()))
        if wl[s-1][t-1] == INF:
            print(-1)
        else:
            print(wl[s-1][t-1] - 1)


if __name__ == '__main__':
    slove()
Buggy python submission (verdict: Time Limit Exceeded):
H,W= map(int, input().split())

while H!=0 and W!=0:
    print('#'*W)
    for i in range(H-2):
        print('#'+'.'*(W-2)+'#')
    print('#'*W)
    print()        
    


Fixed submission:
H,W= map(int, input().split())

while not (H==0 and W==0):
    print('#'*W)
    for i in range(H-2):
        print('#'+'.'*(W-2)+'#')
    print('#'*W)
    print()
    H,W= map(int, input().split())

Buggy python submission (verdict: Time Limit Exceeded):
H,W= map(int, input().split())

while not (H==0 and W==0):
    print('#'*W)
    for i in range(H-2):
        print('#'+'.'*(W-2)+'#')
    print('#'*W)
    print()        
    


Fixed submission:
H,W= map(int, input().split())

while not (H==0 and W==0):
    print('#'*W)
    for i in range(H-2):
        print('#'+'.'*(W-2)+'#')
    print('#'*W)
    print()
    H,W= map(int, input().split())
Buggy python submission (verdict: Runtime Error):
def even_line(w):
    s=''
    for i in range(0,w):
        if i%2 == 0:
            s=s+'#'
        else:
            s=s+'.'
    print(s)
    return 0

def odd_line(w):
    s=''
    for i in range(0,w):
        if i%2 == 0:
            s=s+'.'
        else:
            s=s+'#'

    print(s)
    return 0

if __name__ == '__main__':

    h, w = map(int, input().split())

    while (h != 0) and (w != 0):
        for i in range(0,h):
            if i%2==0:
                even_line(w)
            else:
                odd_line(w)
　　　　　　print()
        h, w = map(int, input().split())


Fixed submission:
def even_line(w):
    s=''
    for i in range(0,w):
        if i%2 == 0:
            s=s+'#'
        else:
            s=s+'.'
    print(s)

def odd_line(w):
    s=''
    for i in range(0,w):
        if i%2 == 0:
            s=s+'.'
        else:
            s=s+'#'

    print(s)

if __name__ == '__main__':

    h, w = map(int, input().split())

    while (h != 0) and (w != 0):
        for i in range(0,h):
            if i%2==0:
                even_line(w)
            else:
                odd_line(w)
        h, w = map(int, input().split())
        print()

Buggy python submission (verdict: Runtime Error):
def even_line(w):
    s=''
    for i in range(0,w):
        if i%2 == 0:
            s=s+'#'
        else:
            s=s+'.'
    print(s)
    return 0

def odd_line(w):
    s=''
    for i in range(0,w):
        if i%2 == 0:
            s=s+'.'
        else:
            s=s+'#'

    print(s)
    return 0

if __name__ == '__main__':

    h, w = map(int, input().split())

    while (h != 0) and (w != 0):
        for i in range(0,h):
            if i%2==0:
                even_line(w)
            else:
                odd_line(w)
　　　　　　print()
        h, w = map(int, input().split())


Fixed submission:
def even_line(w):
    s=''
    for i in range(0,w):
        if i%2 == 0:
            s=s+'#'
        else:
            s=s+'.'
    print(s)

def odd_line(w):
    s=''
    for i in range(0,w):
        if i%2 == 0:
            s=s+'.'
        else:
            s=s+'#'

    print(s)

if __name__ == '__main__':

    h, w = map(int, input().split())

    while (h != 0) and (w != 0):
        for i in range(0,h):
            if i%2==0:
                even_line(w)
            else:
                odd_line(w)
        h, w = map(int, input().split())
        print()
Buggy python submission (verdict: Runtime Error):
import sys

length = int(sys.stdin.readline())
num_seq = sys.stdin.readlines()

for i in range(1,length + 1):
    print(num_seq[length - i],end=' ')
print(num_seq[0],end='')


Fixed submission:
import sys

length = int(sys.stdin.readline())
num_seq = sys.stdin.readline().split()

for i in range(1, length):
    print(num_seq[length - i], end=' ')
print(num_seq[0])

Buggy python submission (verdict: Runtime Error):
import sys

length = int(sys.stdin.readline())
num_seq = sys.stdin.readlines()

for i in range(1,length + 1):
    print(num_seq[length - i],end=' ')
print(num_seq[0],end='')


Fixed submission:
import sys

length = int(sys.stdin.readline())
num_seq = sys.stdin.readline().split()

for i in range(1, length):
    print(num_seq[length - i], end=' ')
print(num_seq[0])

Buggy python submission (verdict: Runtime Error):
import sys

length = int(sys.stdin.readline())
num_seq = sys.stdin.readlines()

for i in range(1,length):
    print(num_seq[length - i],end=' ')
print(num_seq[0],end='')


Fixed submission:
import sys

length = int(sys.stdin.readline())
num_seq = sys.stdin.readline().split()

for i in range(1, length):
    print(num_seq[length - i], end=' ')
print(num_seq[0])
Buggy python submission (verdict: Runtime Error):
import sys

n = int(sys.stdin.readline())
values =[ [ int(val) for val in num[:-1].split() ] for num in sys.stdin.readlines() ]

nyukyo =[ [ [ 0 for _ in range(10) ] for _ in range(3) ] for _ in range(4) ]

for value in values:
    nyukyo[value[0]-1][value[1]-1][value[2]-1] = value[3]


for j in range(4):
    for n in range(3):
        for m in range(10):
            print( ' ' + nyukyo[j][n][m], end='')
        print()
    print('#' * 20)

print()



Fixed submission:
import sys

n = int(sys.stdin.readline())
values =[ [ int(val) for val in num[:-1].split() ] for num in sys.stdin.readlines() ]

nyukyo =[ [ [ 0 for _ in range(10) ] for _ in range(3) ] for _ in range(4) ]

for value in values:
    nyukyo[value[0]-1][value[1]-1][value[2]-1] += value[3]
    if nyukyo[value[0] - 1][value[1] - 1][value[2] - 1] < 0:
        nyukyo[value[0] - 1][value[1] - 1][value[2] - 1] = 0
    elif nyukyo[value[0]-1][value[1]-1][value[2]-1] > 9:
        nyukyo[value[0] - 1][value[1] - 1][value[2] - 1] = 9

for j in range(4):
    for n in range(3):
        for m in range(10):
            print( ' ' + str(nyukyo[j][n][m]), end='')
        print('')
    if j < 3:
        print('#' * 20)

Buggy python submission (verdict: Runtime Error):
import sys

n = int(sys.stdin.readline())
values =[ [ int(val) for val in num[:-1].split() ] for num in sys.stdin.readlines() ]

nyukyo =[ [ [ 0 for _ in range(10) ] for _ in range(3) ] for _ in range(4) ]

for value in values:
    nyukyo[value[0]-1][value[1]-1][value[2]-1] = value[3]


for j in range(4):
    for n in range(3):
        for m in range(10):
            print( ' ' + nyukyo[j][n][m], end='')
        print()
    print('#' * 20)

print()



Fixed submission:
import sys

n = int(sys.stdin.readline())
values =[ [ int(val) for val in num[:-1].split() ] for num in sys.stdin.readlines() ]

nyukyo =[ [ [ 0 for _ in range(10) ] for _ in range(3) ] for _ in range(4) ]

for value in values:
    nyukyo[value[0]-1][value[1]-1][value[2]-1] += value[3]
    if nyukyo[value[0] - 1][value[1] - 1][value[2] - 1] < 0:
        nyukyo[value[0] - 1][value[1] - 1][value[2] - 1] = 0
    elif nyukyo[value[0]-1][value[1]-1][value[2]-1] > 9:
        nyukyo[value[0] - 1][value[1] - 1][value[2] - 1] = 9

for j in range(4):
    for n in range(3):
        for m in range(10):
            print( ' ' + str(nyukyo[j][n][m]), end='')
        print('')
    if j < 3:
        print('#' * 20)
Buggy python submission (verdict: Runtime Error):
import sys

while True:
    n = sys.stdin.readline()[:-1]

    if n = '-1 -1 -1':
        break

    marks = [ int(m) for m in n.split() ]

    mt_points,retest = marks[0] + marks[1],marks[2]

    if -1 in marks[:-1]:
        print('F')
        continue
    elif mt_points >= 80:
        print('A')
        continue
    elif mt_points >= 65 and 80 > mt_points:
        print('B')
        continue
    elif mt_points >= 50 and 65 > mt_points:
        print('C')
        continue
    elif mt_points >= 30 and 50 > mt_points:
        if retest >= 50:
            print('C')
            continue
        print('D')
        continue
    elif 30 > mt_points:
        print('F')


Fixed submission:
import sys

while True:
    n = sys.stdin.readline()[:-1]

    if n == '-1 -1 -1':
        break

    marks = [ int(m) for m in n.split() ]

    mt_points,retest = marks[0] + marks[1],marks[2]

    if -1 in marks[:-1]:
        print('F')
        continue
    elif mt_points >= 80:
        print('A')
        continue
    elif mt_points >= 65 and 80 > mt_points:
        print('B')
        continue
    elif mt_points >= 50 and 65 > mt_points:
        print('C')
        continue
    elif mt_points >= 30 and 50 > mt_points:
        if retest >= 50:
            print('C')
            continue
        print('D')
        continue
    elif 30 > mt_points:
        print('F')
Buggy python submission (verdict: Runtime Error):
import sys

W = sys.stdin.readline().strip()
num = 0

while True:
    T = sys.stdin.readline().strip()
    if T == 'END_OF_TEXT'
        break
    T_line = T.split()
    for i in T_line:
        if W == i:
            num += 1

print(num,end='')


Fixed submission:
import sys

W = sys.stdin.readline().strip()
num = 0

while True:
    T = sys.stdin.readline().strip()
    if T == 'END_OF_TEXT':
        break
    t = T.lower()
    T_line = t.split()
    for i in T_line:
        if W == i:
            num += 1

print(num)
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = list(map(int, input().split()))
k = len(set(s))
c = [0 for i in range(k+1)]
def counting_sort(a, k):
    global c
    b = [0 for i in range(len(a)+1)]
    for i in range(n):
        c[a[i]] += 1

    for i in range(1,k+1):
        c[i] = c[i] + c[i - 1]

    for i in reversed(range(n)):
        b[c[a[i]]] = a[i]
        c[a[i]] -= 1
    return b
res = counting_sort(s, k)[1:n+1]
print(*res)


Fixed submission:
n = int(input())
s = list(map(int, input().split()))
k = max(s)
c = [0 for i in range(k+1)]
def counting_sort(a, k):
    global c
    b = [0 for i in range(len(a)+1)]
    for i in range(n):
        c[a[i]] += 1

    for i in range(1,k+1):
        c[i] = c[i] + c[i - 1]

    for i in reversed(range(n)):
        b[c[a[i]]] = a[i]
        c[a[i]] -= 1
    return b
res = counting_sort(s, k)[1:n+1]
print(*res)
#print(c)