Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
def calc(n, w):
    min_sub = 100000
    N = N
    num = w
    for i in range(1,N):
        S1 = num[:i]
        S2 = num[i:]
        sub = abs(sum(S1)-sum(S2))
        if min_sub > sub:
            min_sub = sub
    print(min_sub)
     
N = int(input())
W = [int(i) for i in input().split()]
calc(N, W)

Fixed submission:
N = int(input())
W = [int(i) for i in input().split()]
a = []
for i in range(N - 1):
    a.append(abs(sum(W[:i+1]) - sum(W[i+1:])))

print(min(a))

Buggy python submission (verdict: Runtime Error):

def calc():
    min_sub = 100000
    N = int(input())
    num = list(map(int, input().split()))
    for i in range(1,N):
        S1 = num[:i]
        S2 = num[i:]
        sub = abs(sum(S1)-sum(S2))
        if min_sub > sub:
            min_sub = sub
    print(min_sub)

N = int(input())
W = [int(i) for i in input().split()]
calc(N, W)

Fixed submission:
N = int(input())
W = [int(i) for i in input().split()]
a = []
for i in range(N - 1):
    a.append(abs(sum(W[:i+1]) - sum(W[i+1:])))

print(min(a))

Buggy python submission (verdict: Runtime Error):
N = int(input())
W = [int(i) for i in input().split()]
calc(N, W)
def calc(n, w):
    min_sub = 100000
    N = n
    num = w
    for i in range(1,N):
        S1 = num[:i]
        S2 = num[i:]
        sub = abs(sum(S1)-sum(S2))
        if min_sub > sub:
            min_sub = sub
    print(min_sub)

Fixed submission:
N = int(input())
W = [int(i) for i in input().split()]
a = []
for i in range(N - 1):
    a.append(abs(sum(W[:i+1]) - sum(W[i+1:])))

print(min(a))
Buggy python submission (verdict: Runtime Error):
import itertools

def q49(n, k, h):
    h.sort()
    a = [h[i+k-1]-h[i] for i in range(n-k-1)]
    return min(a)
            
N, K = [int(i) for i in input().split()]
h = []
for _ in range(N):
    h.append(int(input()))
print(q49(N, K, h))

Fixed submission:
import itertools

def q49(n, k, h):
    h.sort()
    a = [h[i+k-1]-h[i] for i in range(n-k+1)]
    return min(a)
            
N, K = [int(i) for i in input().split()]
h = []
for _ in range(N):
    h.append(int(input()))
print(q49(N, K, h))

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

def q49(n, k, h):
    h.sort()
    a = [h[i+k-1]-h[i] for i in range(n-1)]
    return min(a)
            
N, K = [int(i) for i in input().split()]
h = []
for _ in range(N):
    h.append(int(input()))
print(q49(N, K, h))

Fixed submission:
import itertools

def q49(n, k, h):
    h.sort()
    a = [h[i+k-1]-h[i] for i in range(n-k+1)]
    return min(a)
            
N, K = [int(i) for i in input().split()]
h = []
for _ in range(N):
    h.append(int(input()))
print(q49(N, K, h))

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

def q49(n, k, h):
    h.sort()
    a = [h[i+k-1]-h[i] for i in range(n-2)]
    return min(a)
            
N, K = [int(i) for i in input().split()]
h = []
for _ in range(N):
    h.append(int(input()))
print(q49(N, K, h))

Fixed submission:
import itertools

def q49(n, k, h):
    h.sort()
    a = [h[i+k-1]-h[i] for i in range(n-k+1)]
    return min(a)
            
N, K = [int(i) for i in input().split()]
h = []
for _ in range(N):
    h.append(int(input()))
print(q49(N, K, h))

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

def q49(n, k, h):
    a = []
    for i in itertools.combinations(h, k):
        mi = min(i)
        ma = max(i)
        a.append(ma - mi)
    return min(a)
            
N, K = [int(i) for i in input().split()]
h = []
for _ in range(N):
    h.append(int(input()))
print(q49(N, K, h))

Fixed submission:
import itertools

def q49(n, k, h):
    h.sort()
    a = [h[i+k-1]-h[i] for i in range(n-k+1)]
    return min(a)
            
N, K = [int(i) for i in input().split()]
h = []
for _ in range(N):
    h.append(int(input()))
print(q49(N, K, h))
Buggy python submission (verdict: Runtime Error):
import collections

N = int(input())
S = input()

m = 0
for i in range(N):
    m = max(set(S[:i]) & set(S[i:]), m)

print(m)

Fixed submission:
import collections

N = int(input())
S = input()

m = 0
index = 0
for i in range(N):
    a = set(S[:i])
    b = set(S[i:])
    d = 0
    for c in a:
        if c in b:
            d += 1
    if d > m:
        m = d
        index = i
print(m)
Buggy python submission (verdict: Time Limit Exceeded):
import copy
N = int(input())
X = [int(i) for i in input().split()]


c = int(N/2)

for i in range(N):
    Y = copy.deepcopy(X)
    Y[i:i+1] = []
    Y = sorted(Y, key= lambda x: -x)
    print(Y[c-1])

Fixed submission:
import copy
N = int(input())
X = [int(i) for i in input().split()]
Y = copy.deepcopy(X)
Y = sorted(Y, key= lambda x: -x)

c = int(N/2)

for i in range(N):
    a = X[i]
    if a >= Y[c-1]:
        print(Y[c])
    else:
        print(Y[c-1])
Buggy python submission (verdict: Runtime Error):
import fractions

def a(A, B):
    C = fractions.gcd(A, B)
    return int((A * B)/C)

N = int(input())

T = []

for _ in range(N):
    T.append(int(input()))

T = sorted(T)
C = T[0]

if N > 1:
    for i in range(1, N):
        C = a(C, T[i])
print(C)


Fixed submission:
import fractions

def a(A, B):
    C = fractions.gcd(A, B)
    return (A * B)//C

N = int(input())

T = []

for _ in range(N):
    T.append(int(input()))

T = sorted(T)
C = T[0]

if N > 1:
    for i in range(1, N):
        C = a(C, T[i])
print(C)

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

def a(A, B):
    C = fractions.gcd(A, B)
    return int((A * B)/C)

N = int(input())

T = []

for _ in range(N):
    T.append(int(input()))

T = sorted(T)
C = T[0]

for i in range(1, N):
    C = a(C, T[i])
print(C)


Fixed submission:
import fractions

def a(A, B):
    C = fractions.gcd(A, B)
    return (A * B)//C

N = int(input())

T = []

for _ in range(N):
    T.append(int(input()))

T = sorted(T)
C = T[0]

if N > 1:
    for i in range(1, N):
        C = a(C, T[i])
print(C)
Buggy python submission (verdict: Time Limit Exceeded):
N, M = [int(i) for i in input().split()]
ab = []

possible = False
for _ in range(M):
    ab.append([int(i) for i in input().split()])
    

c = []
e = []
for d in ab:
    if d[1] == N:
        c.append(d[0])
    elif d[0] == 1:
        e.append(d[1])

for f in e:
    if f in c:
        possible = True
        break

if possible:
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')

Fixed submission:
N, M = [int(i) for i in input().split()]
ab = []

possible = False
for _ in range(M):
    ab.append([int(i) for i in input().split()])
    

c = []
e = []
for d in ab:
    if d[1] == N:
        c.append(d[0])
    elif d[0] == 1:
        e.append(d[1])

if len(set(c) & set(e)):
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')

Buggy python submission (verdict: Time Limit Exceeded):
N, M = [int(i) for i in input().split()]
ab = []

possible = False
for _ in range(M):
    ab.append([int(i) for i in input().split()])
    

c = []
for d in ab:
    if d[1] == N:
        c.append(d[0])

for d in ab:
    if d[1] in c and d[0] == 1:
        possible = True

if possible:
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')

Fixed submission:
N, M = [int(i) for i in input().split()]
ab = []

possible = False
for _ in range(M):
    ab.append([int(i) for i in input().split()])
    

c = []
e = []
for d in ab:
    if d[1] == N:
        c.append(d[0])
    elif d[0] == 1:
        e.append(d[1])

if len(set(c) & set(e)):
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')

Buggy python submission (verdict: Time Limit Exceeded):
N, M = [int(i) for i in input().split()]
ab = []

possible = False
for _ in range(M):
    ab.append([int(i) for i in input().split()])
    
c = []
for i, d in enumerate(ab):
    if d[1] == N:
        c.append(d[0])
        del ab[i]
    elif d[0] != 1:
        del ab[i]

for d in ab:
    if d[1] in c and d[0] == 1:
        possible = True

if possible:
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')

Fixed submission:
N, M = [int(i) for i in input().split()]
ab = []

possible = False
for _ in range(M):
    ab.append([int(i) for i in input().split()])
    

c = []
e = []
for d in ab:
    if d[1] == N:
        c.append(d[0])
    elif d[0] == 1:
        e.append(d[1])

if len(set(c) & set(e)):
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')

Buggy python submission (verdict: Time Limit Exceeded):
N, M = [int(i) for i in input().split()]
ab = []

possible = False
for _ in range(M):
    ab.append([int(i) for i in input().split()])
    
c = []
for d in ab:
    if d[1] == N:
        c.append(d[0])

for d in ab:
    if d[1] in c and d[0] == 1:
        possible = True

if possible:
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')

Fixed submission:
N, M = [int(i) for i in input().split()]
ab = []

possible = False
for _ in range(M):
    ab.append([int(i) for i in input().split()])
    

c = []
e = []
for d in ab:
    if d[1] == N:
        c.append(d[0])
    elif d[0] == 1:
        e.append(d[1])

if len(set(c) & set(e)):
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')
Buggy python submission (verdict: Runtime Error):
N = int(input())
a = [int(i) for i in input().split()]


s = sum(a)
m = s - a[:1]
#print(m)
for i in range(2, N):
    b = sum(a[:i])
    c = s - b
    #print(b)
    #print(c)
    if m > (abs(b-c)):
        m = abs(b-c)
    else:
        break
print(m)

Fixed submission:
N = int(input())
a = [int(i) for i in input().split()]


s = sum(a)
m = pow(10, 20)
b = 0
for i in range(N-1):
    b += a[i]
    c = s - b
    #print(b)
    #print(c)
    if m > (abs(b-c)):
        m = abs(b-c)
    #print(a[i])
print(m)

Buggy python submission (verdict: Runtime Error):
N = int(input())
a = [int(i) for i in input().split()]


s = sum(a)
m = s - a[:1]
print(m)
for i in range(2, N):
    b = sum(a[:i])
    c = s - b
    #print(b)
    #print(c)
    if m > (abs(b-c)):
        m = abs(b-c)
    else:
        break
print(m)

Fixed submission:
N = int(input())
a = [int(i) for i in input().split()]


s = sum(a)
m = pow(10, 20)
b = 0
for i in range(N-1):
    b += a[i]
    c = s - b
    #print(b)
    #print(c)
    if m > (abs(b-c)):
        m = abs(b-c)
    #print(a[i])
print(m)
Buggy python submission (verdict: Runtime Error):
def b(N, s):
    v = sum(s)
    for i in range(N, 0, -1):
        if v % 10 == 0:
            if s[i-1] % 10:
                v -= s[i-1]
            continue
        else:
            return a
    return 0
    
N = int(input())
s = []

for _ in range(N):
    s.append(int(input()))
    
s.sort(key=lambda x:-x)

print(b(N, s))

Fixed submission:
def b(N, s):
    v = sum(s)
    for i in range(N, 0, -1):
        if v % 10 == 0:
            if s[i-1] % 10:
                v -= s[i-1]
            continue
        else:
            return v
    return 0
    
N = int(input())
s = []

for _ in range(N):
    s.append(int(input()))
    
s.sort(key=lambda x:-x)

print(b(N, s))

Buggy python submission (verdict: Runtime Error):
def b(N, s):
    v = sum(s)
    for i in range(N, 0, -1):
        if v % 10 == 0:
            if s[i] % 10:
                v -= s[i]
            continue
        else:
            return a
    return 0
    
N = int(input())
s = []

for _ in range(N):
    s.append(int(input()))
    
s.sort(key=lambda x:-x)

print(b(N, s))

Fixed submission:
def b(N, s):
    v = sum(s)
    for i in range(N, 0, -1):
        if v % 10 == 0:
            if s[i-1] % 10:
                v -= s[i-1]
            continue
        else:
            return v
    return 0
    
N = int(input())
s = []

for _ in range(N):
    s.append(int(input()))
    
s.sort(key=lambda x:-x)

print(b(N, s))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

a = pow(10, 9) + 7

power = 1
for i in range(1, N+1):
    power *= i
print(power% a)

Fixed submission:
import math
N = int(input())

a = pow(10, 9) + 7

power = math.factorial(N)

print(power% a)
Buggy python submission (verdict: Time Limit Exceeded):
import itertools
K, S = [int(i) for i in input().split()]

count = 0
for i in range(0, K+1):
    for j in range(0, K+1):
        for k in range(0, K+1):
            if i+j+k == S:
                count += 1
    
print(count)

Fixed submission:
K, S = [int(i) for i in input().split()]

count = 0
for i in range(0, K+1):
    for j in range(0, K+1):
        k = S - i -j
        if 0 <= k <= K:
            count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
import math

N = int(input())
a = [int(i) for i in input().split()]
b = math.round(sum(a)/N)

c = sum([(i - b)**2 for i in a])
print(c)

Fixed submission:
import math

N = int(input())
a = [int(i) for i in input().split()]
b = round(sum(a)/N)

c = sum([(i - b)**2 for i in a])
print(c)
Buggy python submission (verdict: Runtime Error):
N = int(input())
if N / 9 == 0:
    print("Yes")
else :
    print("No")

Fixed submission:
N=int(input())
if N%9 == 0:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
A = int(input())
B = int(input())
print(A*B)

Fixed submission:
A, B = map(int, input().split())
print(A * B)
Buggy python submission (verdict: Runtime Error):
N = 0
for (N<1000 N++)
    if N == [2,4,5,7,9]
        print("h")
    elif N == [0,1,6,8]
        print("p")
    else N == [3]
        print("b")
print ("on")


Fixed submission:
int = input()
if int[-1] == "3":
  	print("bon")
elif int[-1] == "0" or int[-1] == "1" or int[-1] == "6" or int[-1] == "8":
    print("pon")
else:
	print("hon")
Buggy python submission (verdict: Runtime Error):
def main():
    N=input()
    A=list(map(int, input().split()))

    mod_value = 10**9 + 7
    sum_ = 0
    b_sum = 0
    for i in range(len(A)-1):
        b_sum = b_sum + A[len(A)-i-1]
        sum_ = sum_ + (A[len(A)- i - 2]*b_sum) % mod_value
    print(sum_%mod_value)
main()

Fixed submission:
def main():
    D, T, S = map(int, input().split())
    if float(T) < float(D) /float(S) :
        print("No")
    else:
        print("Yes")
    #N = int(input())
    #A = [int(s) for s in input().split()]
    #

main()

Buggy python submission (verdict: Runtime Error):
def main():
    N=input()
    A=list(map(int, input().split()))

    mod_value = 10**9 + 7
    sum_ = 0
    for i in range(len(A)-1):
        sum_ = sum_ + A[i]*sum(A[i+1:]) % mod_value
    print(sum_ % mod_value)
main()

Fixed submission:
def main():
    D, T, S = map(int, input().split())
    if float(T) < float(D) /float(S) :
        print("No")
    else:
        print("Yes")
    #N = int(input())
    #A = [int(s) for s in input().split()]
    #

main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N=input()
    A=list(map(int, input().split()))

    mod_value = 10**9 + 7
    sum_ = 0
    for i in range(len(A)-1):
        sum_ = (sum_ + A[i]*sum(A[i+1:])) % mod_value
    print(sum_)
main()

Fixed submission:
def main():
    N=input()
    A=list(map(int, input().split()))

    mod_value = 10**9 + 7
    sum_ = 0
    b_sum = 0
    for i in range(len(A)-1):
        b_sum = b_sum + A[len(A)-i-1]
        sum_ = sum_ + (A[len(A)- i - 2]*b_sum) % mod_value
    print(sum_%mod_value)
main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N=input()
    A=list(map(int, input().split()))

    mod_value = 10**9 + 7
    sum_ = 0
    for i in range(len(A)-1):
        sum_ = sum_ + A[i]*sum(A[i+1:]) % mod_value
    print(sum_ % mod_value)
main()

Fixed submission:
def main():
    N=input()
    A=list(map(int, input().split()))

    mod_value = 10**9 + 7
    sum_ = 0
    b_sum = 0
    for i in range(len(A)-1):
        b_sum = b_sum + A[len(A)-i-1]
        sum_ = sum_ + (A[len(A)- i - 2]*b_sum) % mod_value
    print(sum_%mod_value)
main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N=input()
    A=list(map(int, input().split()))

    mod_value = 10**9 + 7
    sum_ = 0
    for i in range(len(A)-1):
        sum_ = sum_ + A[i]*sum(A[i+1:])
    print(sum_ % mod_value)
main()

Fixed submission:
def main():
    N=input()
    A=list(map(int, input().split()))

    mod_value = 10**9 + 7
    sum_ = 0
    b_sum = 0
    for i in range(len(A)-1):
        b_sum = b_sum + A[len(A)-i-1]
        sum_ = sum_ + (A[len(A)- i - 2]*b_sum) % mod_value
    print(sum_%mod_value)
main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N=input()
    A=list(map(int, input().split()))

    mod_value = 10**9 + 7
    sum = 0
    for i in range(len(A)-1):
        for j in range(i+1,len(A)):
           sum = sum + A[i]*A[j] % mod_value
    print(sum % mod_value)
main()


Fixed submission:
def main():
    N=input()
    A=list(map(int, input().split()))

    mod_value = 10**9 + 7
    sum_ = 0
    b_sum = 0
    for i in range(len(A)-1):
        b_sum = b_sum + A[len(A)-i-1]
        sum_ = sum_ + (A[len(A)- i - 2]*b_sum) % mod_value
    print(sum_%mod_value)
main()

Buggy python submission (verdict: Runtime Error):
4
141421356 17320508 22360679 244949

Fixed submission:
def main():
    N=input()
    A=list(map(int, input().split()))

    mod_value = 10**9 + 7
    sum_ = 0
    b_sum = 0
    for i in range(len(A)-1):
        b_sum = b_sum + A[len(A)-i-1]
        sum_ = sum_ + (A[len(A)- i - 2]*b_sum) % mod_value
    print(sum_%mod_value)
main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
#    N, X, T = map(int, input().split())
    N = input()
    heights = [int(s) for s in input().split()]

    sum = 0
    while True:
        max_value = 0
        max_index = 0
        temp_sum =0
        for i in range(0, len(heights)):
            if max_value < heights[i]:
                max_value = heights[i]
                max_index = i
                temp_sum = 0
            temp_sum= temp_sum + heights[i]

        sum = sum + (len(heights) - max_index ) * max_value - temp_sum
        if max_index == 0 :
            break

        heights = heights[0:max_index]
    print(sum)
main()

Fixed submission:
def main():
#    N, X, T = map(int, input().split())
    N = input()
    heights = [int(s) for s in input().split()]

    sum = 0

    max_value = 0

    for i in range(0, len(heights)):
        if max_value < heights[i]:
            max_value = heights[i]
        else:
            sum = sum + max_value - heights[i]


    print(sum)
main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
#    N, X, T = map(int, input().split())
    N = input()
    heights = [int(s) for s in input().split()]

    sum = 0
    while True:
        max_value = max(heights)
        max_index = heights.index(max_value)

        for i in range(max_index,len(heights)):
            sum = sum + max_value - heights[i]

        if max_index == 0 :
            break

        heights = heights[0:max_index]
    print(sum)
main()


Fixed submission:
def main():
#    N, X, T = map(int, input().split())
    N = input()
    heights = [int(s) for s in input().split()]

    sum = 0

    max_value = 0

    for i in range(0, len(heights)):
        if max_value < heights[i]:
            max_value = heights[i]
        else:
            sum = sum + max_value - heights[i]


    print(sum)
main()
Buggy python submission (verdict: Runtime Error):
X, K, D = map(int, input().split())
current_position = X

times = abs(X) // D

if times < K:
    if times > 0 :
        if current_position >= 0:
            current_position = current_position - D*times
        elif current_position < 0:
            current_position = current_position + D*times
    K = K - times
    if abs(current_position) <= D:
    if K % 2 == 1:
        if current_position >= 0:
            current_position = current_position - D
        elif current_position < 0:
            current_position = current_position + D
else:
    if times > 0 :
        if current_position >= 0:
            current_position = current_position - D*times
        elif current_position < 0:
            current_position = current_position + D*times
print(current_position)



Fixed submission:
X, K, D = map(int, input().split())
current_position = X

times = abs(X) // D

if times < K:
    if times > 0 :
        if current_position >= 0:
            current_position = current_position - D*times
        elif current_position < 0:
            current_position = current_position + D*times
    K = K - times
    if K % 2 == 1:
        if current_position >= 0:
            current_position = current_position - D
        elif current_position < 0:
            current_position = current_position + D
else:
    if current_position >= 0:
        current_position = current_position - D * K
    elif current_position < 0:
        current_position = current_position + D * K
print(abs(current_position))
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    K = int(input())

    K_1 = str(K)[len(str(K)) - 1]

    if K % 2 == 0 or K_1 == "4" or K_1 == "5" or K_1 == "6" or K_1 == "8":
        print("-1")
    else:
        start_num = 0
        if K_1 == "1" :
            start_num = 7
        elif K_1 == "3":
            start_num = 9
        elif  K_1 == "7":
            start_num = 1
        elif K_1 == "9":
            start_num = 3

        while True:
            if len(str(K * start_num)) == str(K * start_num).count("7"):
                print(str(K * start_num).count("7"))
                break
            start_num = start_num + 10
main()

Fixed submission:
def main():
    K = int(input())

    work = 7

    answer = -1
    for i in range(1, K+1):
        i_mod = work % K
        if i_mod == 0 :
            answer = i
            break
        work = i_mod * 10 + 7
    print(answer)
main()
Buggy python submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(250000)

def main():
    a,b,c = map(int, input().split())

    if a == b + c :
        print("Yes")
    elif b == a + c:
        print("Yes")
    elif c == a + b:
        print("Yes")
    else
        print("No")
main()


Fixed submission:
import sys
sys.setrecursionlimit(250000)

def main():
    a,b,c = map(int, input().split())

    if a == b + c :
        print("Yes")
    elif b == a + c:
        print("Yes")
    elif c == a + b:
        print("Yes")
    else:
        print("No")
main()



#
# while True:
#     pair_str = input().split()
#     pair_int = [int(s) for s in pair_str]
#     if pair_int[0] == 0 and pair_int[1] == 0 :
#         break
#     else:
#         input_list.append(pair_int)


# if b > c * 2 :
    #     b_price = c
    #
    # input_array_list = []
    #
    # while True:
    #     input_array = input().split()
    #     if input_array[0] == "0" and input_array[1] == "0":
    #         break
    #     else:
    #         input_array_list.append(input_array)
    #
    # for item in input_array_list:
    #     n = int(item[0])
    #     k_sum = int(item[1])
    #
    #     count = 0
    #     for i in range(1,n + 1- 2):
    #         for j in range(i+1, n + 1 - 1):
    #             for k in range (j+1, n+ 1):
    #                 if i + j + k == k_sum :
    #                     count = count + 1
    #     print(count)

    #
    # for item in input_array_list:
    #     if item[1] == "+":
    #         print(str(int(item[0])+int(item[2])))
    #     elif item[1] =="-":
    #         print(str(int(item[0])-int(item[2])))
    #     elif item[1] == "/":
    #         print(str(int(item[0])//int(item[2])))
    #     elif item[1] == "*":
    #         print(str(int(item[0])*int(item[2])))
    #

# import sympy as sp

# input_list = []
# a,b,c = map(int, input().split())
# divisors = sp.divisors(c)
#
# count = 0
#
# for divisor in divisors:
#     if a <= divisor and divisor <= b:
#         count = count + 1
# print(count)
#
# while True:
#     pair_str = input().split()
#     pair_int = [int(s) for s in pair_str]
#     if pair_int[0] == 0 and pair_int[1] == 0 :
#         break
#     else:
#         input_list.append(pair_int)
#
# for pair_int in input_list:
#     if pair_int[0] <= pair_int[1]:
#         print("{} {}".format(pair_int[0], pair_int[1]))
#     else:
#         print("{} {}".format(pair_int[1], pair_int[0]))

#for i in range(10000):
#    print("Hello World")
#a = input().split()
#a_int = [int(s) for s in a]
#a_sorted = sorted(a_int)
#print(' '.join(map(str, a_sorted)))