Harryxun/stf_run huggingface dataset:
a,b,x = list(map(int,input().split()))

import math

if x/a/a > b/2:
    y = 2*x/(a**2)-b

    print(90-math.degrees(math.atan(a/(b-y))))
else:
    y = 2*x/(a*b)

    print(90-math.degrees(math.atan(y/b)))

### FIXED CODE ###

import math
a,b,x=list(map(int,input().split()))
maxv=a*a*b
sukima=maxv-x
teimenseki=sukima/a
y=teimenseki*2/a
 
if x > (maxv/2):
    print(math.degrees(math.atan(y/a)))
else:
    tei=x/a
    z=tei*2/b
    print(math.degrees(math.atan(b/z)))
n = int(input())
a = list(map(int, input().split()))
answer = []

for i in range (n) :
    number = 0
    odd = a[i] %% 2
    a[i] = a[i] / 2    
    while odd <= 0 :
        number += 1
        odd = a[i] %% 2
        a[i] = a[i] / 2
    answer.append(number)

#print(answer)
print(min(answer))

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
answer = []

for i in range (n) :
    number = 0
    odd = a[i] % 2
    a[i] = a[i] // 2    
    while odd <= 0 :
        number += 1
        odd = a[i] % 2
        a[i] = a[i] // 2
    answer.append(number)

print(min(answer))
n=str(input())
ans=0
ans+=n%10
ans+=n%1000+1
ans+=n%100000+1
print(ans)

### FIXED CODE ###

n=int(input())
ans=min(n,9)
if n>99: ans=min(n-90,909)
if n>9999: ans=n-9000-90
if n>99999: ans=90909
print(ans)
# 締切の早いものから順番に見ていくのが最適戦略
N = int(input())
X = [list(map(int, input().split())) for _ in range(N)]
X = sorted(X, key=lambda x: x[1])  # B (締切の早い順にソート)
diff = 0
for i in range(N):
    diff += B[i] - A[i]
    if diff < 0:
        print("No")
        exit()
print("Yes")


### FIXED CODE ###

N = int(input())
X = sorted([list(map(int, input().split())) for _ in range(N)], key = lambda x: x[1])
a = [0] * N
a[0] = X[0][0]
for i in range(1, N):
	a[i] = a[i - 1] + X[i][0]
for j in range(N):
	if a[j] > X[j][1]:
		print("No")
		exit()
print("Yes")
import sys

n = sys.stdinp.readline().rstrip()

sum = 0
for i in range(n):
  line = sys.stdinp.readline().rstrip().split(" ")
  if(line[1] == "BTC"):
    sum += float(line[0]) * 380000.0
  else:
    sum += float(line[0])
print(sum)

### FIXED CODE ###

import sys

n = int(sys.stdin.readline().rstrip())

sum = 0
for i in range(n):
  line = sys.stdin.readline().rstrip().split(" ")
  if(line[1] == "BTC"):
    sum += float(line[0]) * 380000.0
  else:
    sum += float(line[0])
print(sum)
from sys import stdin
input = stdin.readline
def main():
  n = int(input())
  a = list(map(int,input().split())).sort()
  if a[0] == 0:
    print(0)
    return
  ret = 1
  for i in a:
    ret *= i
    if ret > 10**18:
      print(-1)
      return
  print(ret)
main()

### FIXED CODE ###

from sys import stdin
input = stdin.readline
def main():
  n = int(input())
  a = list(map(int,input().split()))
  a.sort()
  if a[0] == 0:
    print(0)
    return
  ret = 1
  for i in a:
    ret *= i
    if ret > 10**18:
      print(-1)
      return
  print(ret)
main()
#! /usr/bin/python
from collections import Counter
N = int(input())
V = list(map(int, input().split()))


def func(l):
    nanka = Counter(l).most_common()[0][1]
    return len(l) - nanka


if len([*set(V)]) == 1:
    print(N // 2)
else:
    print(func(V[::2]) + func(V[1::2]))


### FIXED CODE ###

#! /usr/bin/python
from collections import Counter
N = int(input())
V = list(map(int, input().split()))
#N = 4
#V = list(map(int, "1 2 3 2 2 2 2 2 1 1 2 3 4 5 2 12 1 1".split()))


def func(l, aa):
    counter = Counter(l)
    if counter[aa] == 0:
        c, count = counter.most_common()[0]
    else:
        c, count = counter.most_common()[1]
    #print(l, c, len(l) - count)
    return (c, len(l) - count)


if len(set(V)) == 1:
    print(N // 2)
else:
    c, count = func(V[::2], -1)
    c2, count2 = func(V[1::2], c)
    a = count + count2
    c2, count2 = func(V[1::2], -1)
    c, count = func(V[::2], c2)
    print(min(a, count + count2))
def cmb(n, k, mod, fac, ifac):
    """
    nCkを計算する
    """
    k = min(k, n-k)
    return fac[n] * ifac[k] * ifac[n-k] % mod


def make_tables(mod, n):
    """
    階乗テーブル、逆元の階乗テーブルを作成する
    """
    fac = [1, 1] # 階乗テーブル・・・(1)
    ifac = [1, 1] #逆元の階乗テーブル・・・(2)
    inverse = [0, 1] #逆元テーブル・・・(3)

    for i in range(2, n+1):
        fac.append((fac[-1] * i) % mod)
        inverse.append((-inverse[mod % i] * (mod//i)) % mod)
        ifac.append((ifac[-1] * inverse[-1]) % mod)
    return fac, ifac
    
n,k=map(int,input().split())
a=sorted(list(map(int, input().split())))
MOD=10**9+7

fac, ifac=make_tables(MOD,n)

s=0
for i in range(k-1,n):
	s+=(a[i]-a[n-i-1])*cmb(i,k-1,MOD,fac,ifac)
	s%=10**9+7
print(s)



### FIXED CODE ###

import sys
input = sys.stdin.readline
C = input().rstrip()
al = [chr(i) for i in range(97, 97+26)]
alpha2num = lambda c: ord(c) - ord("a")
print(al[alpha2num(C) + 1])
n=int(input())
lst=[]
for i in range(n):
  a,b,c=map(int,input().split())
  lst.append([a,b,c])
C=[[float('inf')]*3]*n
C[0][0]=lst[0][0]
C[0][1]=lst[0][1]
C[0][2]=lst[0][2]
D=[0,1,2]
d=D
for i in range(n-1):
  for j in d:
    D=d
    D.remove(j)
    C[i+1][j]=C[i][D[0]]+lst[i][D[0]]
    for k in range(1,len(e)):
      if C[i][D[k]]+lst[i][D[k]]>C[i+1][j]:
        C[i+1][j]=C[i][D[k]]+lst[i][D[k]]
print(max(C[n-1]))
      
    
  
  


### FIXED CODE ###

n=int(input())
lst=[]
for i in range(n):
  a,b,c=map(int,input().split())
  lst.append([a,b,c])
C=[]
for i in range(n):
    C.append([float('inf')]*3)
C[0][0]=lst[0][0]
C[0][1]=lst[0][1]
C[0][2]=lst[0][2]
D=[0,1,2]
for i in range(n-1):
  for j in [0,1,2]:
    del D[j]
    C[i+1][j]=max(C[i][D[0]]+lst[i+1][j],C[i][D[1]]+lst[i+1][j])
    D=[0,1,2]
print(max(C[n-1]))
N = int(input())
L_list = list(map(int, input().split()))

L_list = sorted(L_list)

count = 0
for i in range(N-2):
    for j in range(i+1, N-1):
        for k in range(j+1, N):
            count += L_list[i] + L_list[j] > L_list[k]:

print(count)

### FIXED CODE ###

import bisect

N = int(input())
L_list = list(map(int, input().split()))

L_list = sorted(L_list)

total = 0
for i in range(N-2):
    for j in range(i+1, N-1):
        total += bisect.bisect_left(L_list, L_list[i] + L_list[j]) - j -1

print(total)
n = int(input())
a = list(map(int(input().split()) for i in range(n))
a1 = [i for i in a if i%2==0]
a2 = [i for i in a1 if i%3!=0]
a3 = [i for i in a2 if i%5!=0]
if len(a3)==0:
  print('APPROVED')
else:
  print('DENIED')

### FIXED CODE ###

n = int(input())
try:
  a = list(map(int,input().split()))
  a1 = list(i for i in a if i%2==0)
  a2 = list(i for i in a1 if i%3!=0)
  a3 = list(i for i in a2 if i%5!=0)
except EOFError:
  pass
if len(a3) == 0:
  print('APPROVED')
else:
  print('DENIED')
from fractions import gcd


def get_primes(n):
    ans = []
    flags = [1] * (n + 1)
    for i in range(2, n + 1):
        if flags[i]:
            ans.append(i)
            for j in range(i, n + 1, i):
                flags[j] = 0
    return ans


def solve(string):
    a, b = map(int, string.split())
    g = gcd(a, b)
    return str(len([p for p in get_primes(g) if g % p == 0]) + 1)


if __name__ == '__main__':
    print(solve(input()))


### FIXED CODE ###

from fractions import gcd
import numpy as np


def get_primes(n):
    ans = []
    m = int(n**0.5) + 1
    flags = np.zeros(m + 1, dtype=bool)
    for i in range(2, m + 1):
        if flags[i]:
            continue
        while n % i == 0:
            n //= i
        ans.append(i)
        flags[i:m + 1:i] = 1
    if n > 1 and all(map(lambda x: n % x, ans)):
        ans.append(n)
    return ans


def solve(string):
    a, b = map(int, string.split())
    g = gcd(a, b)
    return str(len([p for p in get_primes(g) if g % p == 0]) + 1)


if __name__ == '__main__':
    print(solve(input()))
a, b = input().split("")
if a == b:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

a, b = input().split()
if a == b:
  print("Yes")
else:
  print("No")
A = input()
B = input()
C = input()
A = list(A)
A.append("end")
B = list(B)
B.append("end")
C = list(C)
C.append("end")
i = 1
j = 0
k = 0
cur = A[0]
while i < len(A) and j < len(B) and k < len(C) :
    if cur == "a":
        cur = A[i]
        if cur == "end":
            print("A")
            sys.exit()
        i += 1
    elif cur == "b":
        cur = B[j]
        if cur == "end":
            print("B")
            sys.exit()
        j += 1
    elif cur == "c":
        cur = C[k]
        if cur == "end":
            print("C")
            sys.exit()
        k += 1

### FIXED CODE ###

import sys
A = input()
B = input()
C = input()
A = list(A)
A.append("end")
B = list(B)
B.append("end")
C = list(C)
C.append("end")
i = 1
j = 0
k = 0
cur = A[0]
while i < len(A) and j < len(B) and k < len(C) :
    if cur == "a":
        cur = A[i]
        if cur == "end":
            print("A")
            sys.exit()
        i += 1
    elif cur == "b":
        cur = B[j]
        if cur == "end":
            print("B")
            sys.exit()
        j += 1
    elif cur == "c":
        cur = C[k]
        if cur == "end":
            print("C")
            sys.exit()
        k += 1
# ABC138D - Ki
import sys

input = sys.stdin.readline
sys.setrecursionlimit(2 * 10 ** 5 + 1)


def dfs(v: int, p: int) -> None:
    x = cnt[v]
    for u in T[v]:
        if u != p:  # p: parent -> skip
            cnt[u] += x  # cumulative sum
            dfs(u, v)


def main():
    # Ai (A[i][0]) may be not a parent of Bi (A[i][1])
    global T, cnt
    N, Q = tuple(map(int, input().split()))  # vertices and queues
    E = tuple(tuple(map(int, input().split())) for _ in range(N - 1))
    P = tuple(tuple(map(int, input().split())) for _ in range(Q))
    T = [[] for _ in range(N + 1)]  # tree, N+1: 1-idx
    for a, b in E:
        T[a] += [b]
        T[b] += [a]
    cnt = [0] * (N + 1)
    for p, x in P:
        cnt[p] += x  # increase vertex p by x
    dfs(1, -1)
    print(*cnt[1:])


if __name__ == "__main__":
    main()

### FIXED CODE ###

# ABC138D - Ki
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

def dfs(v, p, tree, cnt):
    for u in tree[v]:
        if u != p:
            cnt[u] += cnt[v]
            dfs(u, v, tree, cnt)


def main():
    N, Q = tuple(map(int, input().split()))
    A = tuple(tuple(map(int, input().split())) for _ in range(N - 1))
    P = tuple(tuple(map(int, input().split())) for _ in range(Q))
    T = [[] for _ in range(N + 1)]  # T[i] := children of vertex i
    cnt = [0] * (N + 1)
    for a, b in A:  # set tree relations
        T[a] += [b]
        T[b] += [a]
    for p, x in P:  # increment on roots
        cnt[p] += x
    dfs(1, -1, T, cnt)
    print(*cnt[1:])


if __name__ == "__main__":
    main()
k = input()
a,b = map(int,input().split())
han = False
for i in range(a,b,1):
    if i%k == 0:
        han = True
if han == True:
    print("OK")
else:
    print("NG")

### FIXED CODE ###

k = int(input())
a,b = map(int,input().split())
han = False
for i in range(a,b+1):
    if i%k == 0:
        han = True
if han == True:
    print("OK")
else:
    print("NG")
l = map(int, raw_input().split())
if l[0] > l[1]:
    print str(l[0])+" > "+str(l[1])
elif l[0] == l[1]:
    print str(l[0])+" == "+str(l[1])
else
    print str(l[0])+" < "+str(l[1])

### FIXED CODE ###

l = map(int, raw_input().split())
if l[0]>l[1]:
    print "a > b"
elif l[0]==l[1]:
    print "a == b"
else:
    print "a < b"
N = int(raw_input())
S = [list(raw_input()) for t in range(N)]
ans = 0
for n in range(N):
  t = s[a:]+s[:a]
  t_t = list(map(list, zip(*t)))
  if t == t_t:
    ans += 1
#for n in range(N):
#  isSym = True
#  for i in range(N):
#    for j in range(i,N):
#      if S[i][j] != S[j][i]:
#        isSym = False
#        break
#    if not isSym:
#      break
#  ans += 1 if isSym else 0
#  s = S.pop()
#  S.insert(0, s)
print ans*N


### FIXED CODE ###

N = int(raw_input())
S = [list(raw_input()) for t in range(N)]
ans = 0
for n in range(N):
  t = S[n:]+S[:n]
  t_t = list(map(list, zip(*t)))
  if t == t_t:
    ans += 1
#for n in range(N):
#  isSym = True
#  for i in range(N):
#    for j in range(i,N):
#      if S[i][j] != S[j][i]:
#        isSym = False
#        break
#    if not isSym:
#      break
#  ans += 1 if isSym else 0
#  s = S.pop()
#  S.insert(0, s)
print ans*N
n = int(input())
print(sum(n/i * (n/i+1) / 2 * i for i in range(1, n+1))

### FIXED CODE ###

n = int(input())
print(sum(n//i * (n//i+1) // 2 * i for i in range(1, n+1)))
import sys
n = int(sys.stdin.readline())
t = 0
for i in range(N):
  if i%3 != 0 or i%5 != 0:
    t += i
print(t)


### FIXED CODE ###

import sys
n = int(sys.stdin.readline())
t = 0
for i in range(n+1):
  if i%3 != 0 and i%5 != 0:
    t += i
print(t)
H, W = map(int, input())
for i in range(N):
  c = input()
  print(c)
  print(c)

### FIXED CODE ###

H, W = map(int, input().split())
for i in range(H):
  c = input()
  print(c)
  print(c)
a, b, c = map(int, input().split())
d = max(a, b)
l = []
for i in range(1,d+1):
  if a % i == 0 and b % i == 0:
    l.append(i)
print(l[len(l)-c+1])

### FIXED CODE ###

a, b, c = map(int, input().split())
d = max(a, b)
l = []
for i in range(1,d+1):
  if a % i == 0 and b % i == 0:
    l.append(i)
print(l[len(l)-c])
n = input()
a = [i for i in n]
if sum(a) % 9 == 0: print("Yes")
else: print("No")

### FIXED CODE ###

n = input()
a = [int(i) for i in n]
if sum(a) % 9 == 0: print("Yes")
else: print("No")
#!/usr/bin/env python
# -*- coding: utf-8 -*-

N = int(input())
A = [list(map(int, input().split())) for _ in range(N)]

count = 0
tmp = 1
for i in range(1, N+1):
    if A[i] == A[i - 1]:
        tmp += 1
    else:
        # 等しくなくなったら
        count += tmp // 2
        tmp = 1  # tmp のリセット

print(count)


### FIXED CODE ###

#!/usr/bin/env python
# -*- coding: utf-8 -*-

N = int(input())
A = [int(i) for i in input().split()] + [0]

count = 0
tmp = 1
for i in range(1, N+1):
    if A[i] == A[i - 1]:
        tmp += 1
    else:
        # 等しくなくなったら
        count += tmp // 2
        tmp = 1  # tmp のリセット

print(count)
N, K = map(int, input().split())
S = input()
S[K-1] = S[K-1].lower()
print(S)

### FIXED CODE ###

N, K = map(int, input().split())
S = list(input())
S[K-1] = S[K-1].lower()
print("".join(S))
s = int(input())
print(s.count(1))

### FIXED CODE ###

s = input()
print(s.count("1"))
N,K,X,Y=map(int,input().split())
print(X*N if N<=K else X*K+Y*(N-K))



### FIXED CODE ###

N,K,X,Y=[int(input()) for i in range(4)]
print(X*N if N<=K else X*K+Y*(N-K))
a,b,c = list(map(int,input().split()))

if c-a-b > 0 and 4*a*b < (c-a-b)**2:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

a = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
k = int(input())
print(a[k-1])
N=list(str(input()))
ans=0
if len(N)==1:
    print(int(N[0]))
    exit()
for i in range(1,len(N)):
    if N[i]!='9':
        ans+=int(N[0])-1
        ans+=(len(N)-1)*9
        print(ans)
        exit()
for i in range(N):
    ans+=int(N[i])
print(ans)
        

### FIXED CODE ###

N=list(str(input()))
ans=0
if len(N)==1:
    print(int(N[0]))
    exit()
for i in range(1,len(N)):
    if N[i]!='9':
        ans+=int(N[0])-1
        ans+=(len(N)-1)*9
        print(ans)
        exit()
for i in range(len(N)):
    ans+=int(N[i])
print(ans)
x = input()
count = 0
for i in range(len(x)):
  if i % 2 == 0:
    if x[i] == "R" || x[i] == "U" || x[i] == "D":
      count += 1
    else:
      print("No")
      break
  if i % 2 == 1:
    if x[i] == "L" || x[i] == "U" || x[i] == "D":
      count += 1
    else:
      print("No")
      break
if count == len(x):
  print("Yes")

### FIXED CODE ###

x = input()
count = 0
for i in range(len(x)):
  if i % 2 == 0:
    if x[i] == "R" or x[i] == "U" or x[i] == "D":
      count += 1
    else:
      print("No")
      break
  if i % 2 == 1:
    if x[i] == "L" or x[i] == "U" or x[i] == "D":
      count += 1
    else:
      print("No")
      break
if count == len(x):
  print("Yes")
n, m = map(int, input().split())
A = list(map(int, input().split()))
BC = [tuple(map(int, input().split())) for _ in range(m)]

A.sort()
BC.sort(key=lambda x: x[1], reverse=True)

cnt = 0
for b, c in BC:
    for i in range(b):
        if c < A[cnt]:
            break
        A[cnt] = c
        cnt += 1
    if cnt >= n:
        break

print(sum(A))

### FIXED CODE ###

n, m = map(int, input().split())
A = list(map(int, input().split()))
BC = [tuple(map(int, input().split())) for _ in range(m)]

A.sort()
BC.sort(key=lambda x: x[1], reverse=True)

cnt = 0
for b, c in BC:
    for i in range(b):
        if c < A[cnt]:
            break
        A[cnt] = c
        cnt += 1
        if cnt >= n:
            break
    else:
        continue
    break

print(sum(A))
a, b, c = input()

if len(set(a, b, c)) == 2:
  print("yes")
else:
  print("No")

### FIXED CODE ###

a, b, c = input().split()
 
if len(set([a, b, c])) == 2:
  print("Yes")
else:
  print("No")
print(" ".join([map(str,input().split())]))

### FIXED CODE ###

x,y,z=map(int,input().split())
print(str(z)+" "+str(x)+" "+str(y))
A,B=map(int,input()split())
print(max(A*(A-1),A*B,B*(B-1)))


### FIXED CODE ###

A,B=map(int,input().split())
print(max(A+(A-1),A+B,B+(B-1)))
import sys
sys.setrecursionlimit(1000000000)
def list_count(my_list,n,x):
    dic={} #辞書型の宣言
    for i in range(x,n,2):
        if my_list[i] in dic: #もしnumがkeyとして辞書にあれば
            dic[my_list[i]]+=1 #valueに+1
        else: #なければ
            dic[my_list[i]]=1 #dicにnumというkeyを追加し、対応するvalueを1とする
    return dic

n=int(input())
v=list(map(int,input().split()))
dic0=list_count(v,n,0)
dic1=list_count(v,n,1)
a=[[0,0],[0,0]]
b=[[0,0],[0,0]]
for i in dic0.keys():
    if a[0][1]<=dic0[i]:
        a[1][0]=a[0][0]
        a[1][1]=a[0][1]
        a[0][0]=i
        a[0][1]=dic0[i]
    elif a[1][1]<dic0[1]:
        a[1][0]=i
        a[1][1]=dic0[i]
for i in dic1.keys():
    if b[0][1]<=dic1[i]:
        b[1][0]=b[0][0]
        b[1][1]=b[0][1]
        b[0][0]=i
        b[0][1]=dic1[i]
    elif b[1][1]<dic1[1]:
        b[1][0]=i
        b[1][1]=dic1[i]
if a[0][0]==b[0][0]:
    print(n-min(a[0][1]+b[1][1],a[1][1]+b[0][1]))
else:
    print(n-a[0][1]-b[0][1])

### FIXED CODE ###

def list_count(my_list,n,x):
    dic={} #辞書型の宣言
    for i in range(x,n,2):
        if my_list[i] in dic: #もしnumがkeyとして辞書にあれば
            dic[my_list[i]]+=1 #valueに+1
        else: #なければ
            dic[my_list[i]]=1 #dicにnumというkeyを追加し、対応するvalueを1とする
    return dic

n=int(input())
v=list(map(int,input().split()))
dic0=list_count(v,n,0)
dic1=list_count(v,n,1)
a=[[0,0],[0,0]]
b=[[0,0],[0,0]]
for i in dic0.keys():
    if a[0][1]<=dic0[i]:
        a[1][0]=a[0][0]
        a[1][1]=a[0][1]
        a[0][0]=i
        a[0][1]=dic0[i]
    elif a[1][1]<dic0[i]:
        a[1][0]=i
        a[1][1]=dic0[i]
for i in dic1.keys():
    if b[0][1]<=dic1[i]:
        b[1][0]=b[0][0]
        b[1][1]=b[0][1]
        b[0][0]=i
        b[0][1]=dic1[i]
    elif b[1][1]<dic1[i]:
        b[1][0]=i
        b[1][1]=dic1[i]
if a[0][0]==b[0][0]:
    print(n-max(a[0][1]+b[1][1],a[1][1]+b[0][1]))
else:
    print(n-a[0][1]-b[0][1])
#!/usr/bin/env python3
import sys


def main():
    X, Y = map(int, input().split())
    if (X + Y) % 3 != 0:
        print(0)
        exit()
    n = (X+Y) // 3
    if X < 2 or Y < 2:
        print(0)
        exit()
    r = X - n

    # nCrを計算する
    a = [None] * (n+1)
    inva = [None] * (n+1)
    a[0] = 1
    inva[0] = 1
    p = 10**9 + 7

    for i in range(1, n+1):
        a[i] = i * a[i-1] % p
        inva[i] = pow(i, p-2, p) * inva[i-1] % p

    ans = (a[n] * inva[r] % p) * inva[n-r] % p
    print(ans)


if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys


def main():
    X, Y = map(int, input().split())
    if (X + Y) % 3 != 0:
        print(0)
        exit()
    n = (X+Y) // 3
    if X < n or Y < n:
        print(0)
        exit()
    r = X - n

    # nCrを計算する
    a = [None] * (n+1)
    inva = [None] * (n+1)
    a[0] = 1
    inva[0] = 1
    p = 10**9 + 7

    for i in range(1, n+1):
        a[i] = i * a[i-1] % p
        inva[i] = pow(i, p-2, p) * inva[i-1] % p

    ans = (a[n] * inva[r] % p) * inva[n-r] % p
    print(ans)


if __name__ == '__main__':
    main()
from operator import itemgetter
D, G = map(int, input().split())
p = []
c = []
score = 0
ans = 0
for i in range(D):
    pi, ci = map(int, input().split())
    p.append(pi)
    c.append(ci)
a = [i for i in range(D)]
comp = [[i, 100*(i+1)*p[i]+c[i], (100*(i+1)*p[i]+c[i])//p[i], p[i]] for i in range(D)]
comp.sort(key=itemgetter(2),reverse=True)
for d in range(D):
    if score + comp[d][1] < G:
        #print(comp[d][0])
        score += comp[d][1]
        a.pop(comp[d][0])
        ans += comp[d][3]
    else:
        can = d
        for dd in range(d,D):
            if score + comp[dd][1] >= G and comp[can][3] > comp[dd][3]:
                can = dd

        if 100*(max(a)+1)*p[max(a)] + score >= G and comp[can][3] >= (G-score-1)//(100*(max(a)+1)) + 1:
            #print(ans)
            ans += (G-score-1)//(100*(max(a)+1)) + 1
            #print(ans)
            break
        else:
            ans += comp[can][3]
            break
print(ans)


### FIXED CODE ###

D,G = map(int,input().split())
pc = [list(map(int,input().split())) for i in range(D)]
ans = 10**9
from math import ceil
for i in range(2**D):
    now = 0
    score = 0
    for j in range(D):
        if i>>j & 1:
            now += pc[j][0]
            score += pc[j][0]*100*(j+1) + pc[j][1]

    if score >= G:
        ans = min(ans,now)
    else:
        for j in reversed(range(D)):
            if i>>j & 1 == 0:
                if ceil((G-score)/(100*(j+1))) < pc[j][0]:
                    now += ceil((G-score)/(100*(j+1)))
                    break
        else:
            continue

        if now==0:
            continue
        ans = min(ans,now)

print(ans)
#https://atcoder.jp/contests/abc109/tasks/abc109_b
import collections
N = int(input())
Word_List = []
SP = ""
for i in range(N):
    CW = str(input())
    if i == 0:
        Word_List.append(CW)
        SP = CW[-1]
    elif SP != CW[0]:
        break
    else:
        Word_List.append(CW)
        SP = CW[-1]
else:
    Word_List = collections.Counter(Word_List))
    if len(Word_List) != N:
        print("No")
    else:
        print("Yes")

### FIXED CODE ###

#https://atcoder.jp/contests/abc109/tasks/abc109_b
import collections
N = int(input())
Word_List = []
SP = ""
for i in range(N):
    CW = str(input())
    if i == 0:
        Word_List.append(CW)
        SP = CW[-1]
    elif SP != CW[0]:
        print("No")
        break
    else:
        Word_List.append(CW)
        SP = CW[-1]
else:
    Word_List = collections.Counter(Word_List)
    if len(Word_List) != N:
        print("No")
    else:
        print("Yes")
i = 0
while 1:
   x,y = map(int, raw_input().split())
   i += 1
   if x == '0' and y == '0':
      break
   if x >= y:
      print '%s %s' % (y,x)
   if y >= x:
      print '%s %s' % (x,y)
   

### FIXED CODE ###

while True:
   x,y = map(int, raw_input().split())
   if x == 0 and y == 0:
      break
   if x >= y:
      print '%s %s' % (y, x)
   else:
      print '%s %s' % (x, y)