Harryxun/stf_run huggingface dataset:
import math
s = int(input())
inf = 10**9
S = s * 2

def is_prime(num):
    if num < 2:
        return True
    else:
        num_sqrt = math.floor(math.sqrt(num))
        for prime in range(2,num_sqrt+1):
            if num%prime == 0:
                return False
                break
            return True

def division(num):
    for i in range(1,int(num**0.5)+1):
        if num%i == 0:
            if i <= inf and num%i <= inf:
                return x,y
    return 0,0

if is_prime(s):
    x,y = s,2
else:
    x,y = division(S)
print(0,0,x,0,0,y)

### FIXED CODE ###

s = int(input())
inf = 10**9

if s==10**18:
  print(0,0,inf,1,0,inf)
  exit()

x = inf - s%inf
y = s // inf + 1

print(0,0,inf,1,x,y)
s = list(input())
t = list(input())


def check_context(a, b):
    ss = s.copy()
    if a <= b:
        return []
    if len(s[a:]) < len(t[b:]):
        return []
    ss[a-b:a-b+len(t)] = t[:]
    return ss


x = []
count = 0
for i in range(len(s)):
    if s[i] == '?':
        continue
    for j in range(len(t)):
        if s[i] == t[j]:
            x.append(check_context(i, j))
            if x[count]:
                for k in range(len(x[count])):
                    if x[count][k] == '?':
                        x[count][k] = 'a'
                count += 1


if x:
    x.sort()
    while x[0] == []:
        x.pop(0)
    for i in x[0]:
        print(i, end='')
elif x == []:
    print('UNRESTORABLE')

### FIXED CODE ###

s = list(input())
t = list(input())

length_1 = len(s)
length_2 = len(t)


def check_word(num1, length):
    a = s[num1:num1+length]
    b = t[:]
    flag = True
    for i in range(length):
        if a[i] == '?':
            continue
        elif a[i] == b[i]:
            continue
        else:
            flag = False
            break
    if flag is True:
        c = s.copy()
        c[num1:num1+length] = t[:]
        c = fill_a(c)
        return c
    elif flag is False:
        return []


def fill_a(li):
    for i in range(len(li)):
        if li[i] == '?':
            li[i] = 'a'
    return li


word_list = []
for i in range(length_1 - length_2 + 1):
    x = check_word(i, length_2)
    if x != []:
        word_list.append(x)

if word_list == []:
    print('UNRESTORABLE')
else:
    word_list.sort()
    while word_list[0] == []:
        x.pop(0)
    for i in word_list[0]:
        print(i, end='')
import math
while True:
	x = map(int,raw_input().split(' '))
	a = math.log10(x[0] + x[1])
	if str(x[0]) != 'homoo...':
		print(int(a+1))
		continue
	else:
		break

### FIXED CODE ###

while True:
	try:
		a,b = map(int,raw_input().split(' '))
		print len(str(a+b))
	except: break
input_line = list(map(int,input().split()))

input_hp = list(map(int,input().split()))

input_hp.sort(reverse=True)

tec_count = input_line[1]

if input_line[0] <= input_line[1]:
    print('0')
else:
    for i in range(tec_count):
        input_hp.pop(i)
    result = sum(input_hp)
    print(result)

### FIXED CODE ###

input_line = list(map(int,input().split()))
input_hp = list(map(int,input().split()))

if input_line[0] <= input_line[1]:
    print('0')
else:
    input_hp.sort()
    result_input_hp = len(input_hp) - input_line[1]
    sum_total = sum(input_hp[:result_input_hp])
    print(sum_total)
n = int(input())
 
print(int((n+1)*n/2 - n))


### FIXED CODE ###

s = input()
t = input()
c = 0

if s[0] == t[0]:
  c += 1

if s[1] == t[1]:
  c += 1

if s[2] == t[2]:
  c += 1
    
print(c)
print(int(input()**3))


### FIXED CODE ###

print(int(input())**3)
n=int(raw_input())
a=[int(raw_input()) for _ in xrange(n)]
mxlba=0
for i in xrange(n):
    mxlba=max(mxlba,len(bin(a[i])[2:]))
cnt=[0]*(mxlba+5)
for i in xrange(n):
    bit=bin(a[i])[2:]
    lb=len(bit)
    for j in xrange(lb-1,-1,-1):
        if bit[j]=="1":
            cnt[lb-1-j]+=1
            break

axor=0
for i in xrange(n):
    axor^=a[i]
if axor==0:
    print(0)
    exit()
axor=bin(axor)[2:]
la=len(axor)
ans=0
i=-1
while i<la:
    i+=1
    if axor[i]=="1":
        if cnt[i]==0:
            print(-1)
            exit()
        else:
            ans+=1
            cnt[i]-=1
            if la-i-1==0:
                break
            tmp=int("1"*(la-i-1),2)
            axor=int(axor,2)^tmp
            if axor==0:
                break
            axor=bin(axor)[2:]

print(ans)


### FIXED CODE ###

n=int(raw_input())
a=[int(raw_input()) for _ in xrange(n)]
mxlba=0
for i in xrange(n):
    mxlba=max(mxlba,len(bin(a[i])[2:]))

exist=[False]*(mxlba+1000)
for i in xrange(n):
    bit=bin(a[i])[2:]
    lb=len(bit)
    for j in xrange(lb-1,-1,-1):
        if bit[j]=="1":
            exist[lb-1-j]=True
            break

axor=0
for i in xrange(n):
    axor^=a[i]
if axor==0:
    print(0)
    exit()
axor=bin(axor)[2:]
la=len(axor)
ans=0
i=0
while i<la:
    if axor[i]=="1":
        if not exist[la-i-1]:
            print(-1)
            exit()
        else:
            ans+=1
            if la-i-1==0:
                break
            tmp=int("1"*(la-i-1),2)
            axor=int(axor,2)^tmp
            axor=bin(axor)[2:]
    i+=1

print(ans)
c = input().split()
c = list(map(int, c))
b = input().split()
b = list(map(int, b))
ans = 0
for n in range(c[0]):
	a[n] = input().split()
	a[n] = list(map(int, a[n]))
	tmp = 0
	for m in range(c[1]):
		tmp += b[m] * a[n][m]
	if tmp > -c[2]:
		ans += 1
print(ans)

### FIXED CODE ###

c = input().split()
c = list(map(int, c))
b = input().split()
b = list(map(int, b))
ans = 0
a = [0] * (c[0])
for n in range(c[0]):
	a[n] = input().split()
	a[n] = list(map(int, a[n]))
	tmp = 0
	for m in range(c[1]):
		tmp += b[m] * a[n][m]
	if tmp > -c[2]:
		ans += 1
print(ans)
N=input()
print N*800-(N-N%15)*200/15

### FIXED CODE ###

N=int(input())
ans=N*800-(N-N%15)*200/15
print(int(ans))
#!/usr/bin/env python
# -*- coding:utf-8 -*-


obj = input().strip().split(' ')
N, K, Q = map(int, obj)

winner_list = []
for _ in range(Q):
    A_i = int(input().strip())
    winner_list.append(A_i)

point_list = [K for _ in range(N)]

for A_i in winner_list:
    point_list = [k if i == A_i else k - 1 for i in range(1, N + 1)]

is_win = [True if point_list[i] > 0 else False for i in range(N) ]

for i in range(N):
    if is_win[i]:
        print('Yes')
    else:
        print('No')


### FIXED CODE ###

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


obj = input().strip().split(' ')
N, K, Q = map(int, obj)

win_count = [0] * N
for _ in range(Q):
    A_i = int(input().strip())
    win_count[A_i - 1] += 1

is_ok = [True if Q - cnt < K else False for cnt in win_count]

for i in range(N):
    if is_ok[i]:
        print('Yes')
    else:
        print('No')
import sys
input = sys.stdin.readline
N, W = list(map(int, input().split()))
WV = [list(map(int, input().split())) for _ in range(N)]

DP = [0] * (W+1)

for n in range(N):
    next = [0] * (W+1)
    for w in range(1, W+1):
        if w < WV[n][0]:
            next[w] = DP[w]
        else:
            next[w] = max(DP[w], DP[w-WV[n][0]]+WV[n][1])
    DP = next

print(DP[W])


### FIXED CODE ###

import sys
input = sys.stdin.readline
N, W = list(map(int, input().split()))
WV = [list(map(int, input().split())) for _ in range(N)]

DP = [[float("inf")] * (10**5+1)]
for _ in range(N):
    DP.append([float("inf")] * (10**5+1))

DP[0][0] = 0

for n in range(N):
    for v in range(10 ** 5 + 1):
        if v - WV[n][1] >= 0:
            DP[n+1][v] = min(DP[n+1][v], DP[n][v - WV[n][1]] + WV[n][0])
        DP[n+1][v] = min(DP[n+1][v], DP[n][v])

ans = 0
for v in range(10 ** 5 + 1):
    if DP[N][v] <= W:
        ans = v

print(ans)
a=int(input())
b=int(input())
c=int(input())
if a+c==b:
  print(Yes)
else:
  print(No)


### FIXED CODE ###

a,b,c=map(int,input().split())
if a+c==2*b:
  print("YES")
else:
  print("NO")
# -*- coding: utf-8 -*-

n, m = map(int, input().split())
a = list(map(int, input().split()))

total = sum(a)
thres = total/(4*m)

ct = 0
for i in a:
    if i >= thres:
        ct += 1

if ct >= m:
    print("Yes")
else:
    print("No")d

### FIXED CODE ###

# -*- coding: utf-8 -*-

n, m = map(int, input().split())
a = list(map(int, input().split()))

total = sum(a)
thres = total/(4*m)

ct = 0
for i in a:
    if i >= thres:
        ct += 1

if ct >= m:
    print("Yes")
else:
    print("No")
number = int(input())
flag = False
for i in range(len(number)):
	if int(number[i])==7:
		flag = True
		break
if(flag):
	print("Yes")
else:
	print("No")
























### FIXED CODE ###

number = str(input())
flag = False
for i in range(len(number)):
	if int(number[i])==7:
		flag = True
		break
if(flag):
	print("Yes")
else:
	print("No")
def func_d(n):
    if n == 1:
        return 1
    else:
        return n + func_d(n-1)

N, K = [int(i) for i in input().split()]
P = [int(i) for i in input().split()]

hp = []
for i in P:
    hp.append(func_d(i)/i)
    
A= [0]
for i in hp:
    A.append(A[-1]+i)
 
ans = []
for i in range(K, N+1):
    ans.append(A[i] - A[i-K])
    
print(max(ans))

### FIXED CODE ###

def func(x):
    return (x+1)/2
N, K = [int(i) for i in input().split()]
P = [func(int(i)) for i in input().split()]

# 累積和
A = [0]
for i in P:
    A.append(A[-1]+i)

ans = []
for i in range(K, N+1):
    ans.append(A[i] - A[i-K])
    
print(max(ans))
import sys

input = sys.stdin.readline

# input = sys.stdin.readline
sys.setrecursionlimit(2147483647)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7


def main():
    a = int(input())
    s = int(input())

    if a >= 3200:
        print(s)
    else:
        print('red')


if __name__ == '__main__':
    main()


### FIXED CODE ###


import sys

input = sys.stdin.readline

# input = sys.stdin.readline
sys.setrecursionlimit(2147483647)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7


def main():
    a = int(input())
    s = input()

    if a >= 3200:
        print(s)
    else:
        print('red')


if __name__ == '__main__':
    main()
N=int(input())
A=[]
for i in range(N):
    A.append(int(input()))
ans=1
li=[A[0]]
for i in range(1,N):
    ans+=1 if li.count(A[i])%2==0 else -1
    li.append(A[i])
print(ans)


### FIXED CODE ###

N=input()
for i in N:
    if(i=='9'):
        print("Yes")
        exit()
print('No')
n = int(input())
hoge = []

for i in range(n):
    hoge.append(list(map(int, input().split())))
hoge.sort(key = lambda x: x[1])

total = 0
able = True
for i in hoge:
    total += i[0]
    if i[1]<total:
        able = False

if able:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

pa = input()
x = ""
out = False
for i in pa:
    if x == i:
        out = True
    x = i
if out:
    print("Bad")
else:
    print("Good")
import math 
n,d=map(int,input().split())
print(math.ceil(n/(s*2+1)))


### FIXED CODE ###

import math 
n,d=map(int,input().split())
print(math.ceil(n/(d*2+1)))
N=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=list(map(int,input().split()))
A.sort()
B.sort()
C.sort()
d=[0 for i in range(N)]
ac=0
for i in range(N):
  while C[ac]<=B[i]:
    ac+=1
  d[i]=N-ac
ab=0
ans=0
for i in range(1,N):
  d[i]+=d[i-1]
def f(x):
  if x!=0:
    return d[N-1]-d[x-1]
  else:
    return d[N-1]
for i in range(N):
  while B[ab]<=A[i]:
    ab+=1
    if ab==N:
      break
  ans+=f(ab)
print(ans)

### FIXED CODE ###

N=int(input())
import math
A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=list(map(int,input().split()))
A.sort()
B.sort()
C.sort()
A=A+[math.inf]
B=B+[math.inf]
C=C+[math.inf]
d=[0 for i in range(N)]
ac=0
for i in range(N):
  while C[ac]<=B[i]:
    ac+=1
  if ac==N:
    break
  d[i]=N-ac
ab=0
ans=0
for i in range(1,N):
  d[i]+=d[i-1]
def f(x):
  if x!=0:
    return d[N-1]-d[x-1]
  else:
    return d[N-1]
for i in range(N):
  while B[ab]<=A[i]:
    ab+=1
    if ab==N:
      break
  ans+=f(ab)
print(ans)
h, w = map(int, input().split())
mass = [list(input()) for _ in range(h)]

ans = "Yes"
for i in range(w):
    for j in range(h):
        if mass[i][j] == "#":
            if i < w-1:
                if mass[i+1][j] == "#":
                    continue
            if 0 < i:
                if mass[i-1][j] == "#":
                    continue
            if j < h-1:
                if mass[i][j+1] == "#":
                    continue
            if 0 < j:
                if mass[i][j-1] == "#":
                    continue
            ans = "No"
            break

print(ans)
h, w = map(int, input().split())
mass = [list(input()) for _ in range(h)]

ans = "Yes"
for i in range(w):
    for j in range(h):
        if mass[i][j] == "#":
            if i < w-1:
                if mass[i+1][j] == "#":
                    continue
            if 0 < i:
                if mass[i-1][j] == "#":
                    continue
            if j < h-1:
                if mass[i][j+1] == "#":
                    continue
            if 0 < j:
                if mass[i][j-1] == "#":
                    continue
            ans = "No"
            break

print(ans)


### FIXED CODE ###

h, w = map(int, input().split())
mass = [list(input()) for _ in range(h)]

ans = "Yes"
for i in range(h):
    for j in range(w):
        if mass[i][j] == "#":
            if i < h-1:
                if mass[i+1][j] == "#":
                    continue
            if 0 < i:
                if mass[i-1][j] == "#":
                    continue
            if j < w-1:
                if mass[i][j+1] == "#":
                    continue
            if 0 < j:
                if mass[i][j-1] == "#":
                    continue
            ans = "No"
            break

print(ans)
from bisect import bisect_left as bl
x,n = map(int, input().split())
p = list(map(int, input().split()))
if n == 0:
    print(x)
else:
    i = 0
    p.sort()
    a = bl(p, x)
    if a == n:
        print(x)
    elif p[a] != x:
        print(x)
    else:
        while(True):
            i += 1
            if p[bl(p, x-i)] != x-i:
                print(x-i)
                break
            elif p[bl(p, x+i)] != x+i:
                print(x+i)
                break

### FIXED CODE ###

from bisect import bisect_left as bl
x,n = map(int, input().split())
p = list(map(int, input().split()))
if n == 0:
    print(x)
else:
    i = 0
    p.sort()
    a = bl(p, x)
    if a == n:
        print(x)
    elif p[a] != x:
        print(x)
    else:
        while(True):
            i += 1
            if p[bl(p, x-i)] != x-i:
                print(x-i)
                break
            else:
                a = bl(p, x+i)
                if a == n:
                    print(x+i)
                    break
                elif p[a] != x+i:
                    print(x+i)
                    break
t=list(input())

if t[0]=="A" and not t[1]=="C" and not t[-1]=="C" and t[-1].islower==True and t[1].islower==True:
    rs=1
else:
    rs=0

del t[:2]
del t[-1]

if not t.count("C")==1:
    rs -=1

if rs==1:
    t.remove("C")

for i in t:
    if i.isupper()==True:
        rs -=1

if rs==1:
    print("AC")
else:
    print("WA")

### FIXED CODE ###

t=int(input())

if t<1200:
    print("ABC")
elif t<2800:
    print("ARC")
else:
    print("AGC")
i = input()

for j in range(i-1):
  if(j==j+1):
    print("Bad")
    break
  else(j==(len(i)-2)):
    print("Good")

### FIXED CODE ###

i = input()
k=1
for j in range(len(i)-1):
  if(i[j]==i[j+1]):
    print("Bad")
    k=0
    break
    
if(k==1):
  print("Good")
N,M,K = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
ans = 0
time = 0
while time < K:
    if not A:
        ans += 1
        time += B[0]
        B.pop(0)
    elif not B:
        ans += 1
        time += A[0]
        A.pop(0)
    elif A[0] == B[0]:
        if A[1] > B[1]:
            time += B[0]
            ans += 1
            B.pop(0)
        elif A[1] < B[1]:
            time += B[0]
            ans += 1
            A.pop(0)
    elif A[0] > B[0] :
        time += B[0]
        ans += 1
        B.pop(0)
    elif A[0] < B[0]:
        time += B[0]
        ans += 1
        A.pop(0)
print(ans)


### FIXED CODE ###

#import sys
N,M,K = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))

a=[0]
b=[0]
for i in range(N):
    a.append(a[i]+A[i])
for j in range(M):
    b.append(b[j]+B[j])
ans = 0
l = M
for k in range(N+1):
    if a[k] > K:
        break
    while b[l] > K - a[k]:
        l -= 1
    ans = max(ans,k+l)
print(ans)
n,x = map(int, raw_input().split())
lis = sorted(map(int, raw_input().split()))
def gcd(a, b):
    if a == 0:
        return b
    return gcd(b%a,a)
if n == 1:
    val = abs(lis[0]-x)
    print val
    exit()
import bisect
#print lis
idx = bisect.bisect_left(lis, x)
#print idx
if idx == 0:
    val = lis[0] - x
    flag = 0
    lmao = -1
    for i in range(1, n):
        if (lis[i] - x) % val != 0:
            flag = 1
            lmao = i
            break
    if flag == 0:
        print val
    else:
        factors = []
        flag1 = 0
        for i in range(min(x, lis[lmao]), 0, -1):
            if x % i == 0 and lis[lmao] % i == 0:
                for j in xrange(n):
                    if abs(lis[j]-x) % i != 0:
                        flag1 = 1
                        break
                if flag1==0:
                    print i
                    break
elif idx == n:
    val = x - lis[-1]
    flag = 0
    lmao = -1
    for i in range(n-2, -1, -1):
        if (x - lis[i]) % val != 0:
            lmao = i
            flag = 1
            break
    if flag == 0:
        print val
    else:
        factors = []
        flag1 = 0
        for i in range(min(x, lis[lmao]), 0, -1):
            if x % i == 0 and lis[lmao] % i == 0:
                for j in xrange(n):
                    if abs(lis[j]-x) % i != 0:
                        flag1 = 1
                        break
                if flag1==0:
                    print i
                    break
else:
    val = min(lis[idx]-x, x-lis[idx-1])
    flag = 0
    lmao = -1
    for i in range(idx, n, 1):
        if (lis[i]-x)%val != 0:
            flag= 1
            lmao = i
            break
    for i in range(idx-1, -1, -1):
        if (x-lis[i])%val != 0:
            lmao = i
            flag = 1
            break
    if flag == 0:
        print val
    else:
        factors = []
        flag1 = 0
        for i in range(min(x, lis[lmao]), 0, -1):
            if x % i == 0 and lis[lmao] % i == 0:
                for j in xrange(n):
                    if abs(lis[j]-x) % i != 0:
                        flag1 = 1
                        break
                if flag1==0:
                    print i
                    break


#print bisect.bisect_left(lis, 38)

### FIXED CODE ###

n,x = map(int, raw_input().split())
lis = sorted(map(int, raw_input().split()))
def gcd(a, b):
    if a == 0:
        return b
    return gcd(b%a,a)
if n == 1:
    val = abs(lis[0]-x)
    print val
    exit()
val = 0
#print lis
for i in xrange(n):
    lis[i] -= x
    val = gcd(abs(lis[i]), val)
print val
n,time=(map(int,input().split()))
c=[]
t=[]
for i in range(n):
    C,T=map(int,input().split())
    c.append(C)
    t.append(T)
#print(c)
#print(t)
if min(t)>time:
    print("TLE")
else:
    p=[]
    j=0
    for i in range(len(t)):
        if t[i]>time:
            p.append(i)
            j=i
            del c[i]
    if len(p)==n-1:
        print(c[p[j]])
    print(min(c))

### FIXED CODE ###

n,time=(map(int,input().split()))
c=[]
t=[]
for i in range(n):
    C,T=map(int,input().split())
    c.append(C)
    t.append(T)
#print(c)
#print(t)
if min(t)>time:
    print("TLE")
else:
    for i in range(len(t)):
        if t[i]>time:
            c[i]=max(c)


    #print(c)
    if len(c)==1:
        print(c[0])
    elif len(c)==2:
        if c[0]>=c[1]:
            print(c[1])
        else:
            print(c[0])
    else:
        print(min(c))
O,E=map(int,input().split())
for i in range(O.size()):
  print(O[i]+E[i],end='')

### FIXED CODE ###

o=list(input())
e=list(input())+[""]
for x,y in zip(o,e):print(x+y,end="")
n = int(input())
a = list(map(int,input().split()))
for i in range(a):
    if i%2==0:
        if i%3 !=0 or i%5 !=0:
            print('DENIED')
print('APPROVED')

        
        
                

### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
for i in a:
    if i%2==0:
        if i%3 !=0 and i%5 !=0:
            print('DENIED')
            exit()
print('APPROVED')
a, b = map(int, input().split())
if a[0] < b[1] :
  print (0)
else:
  print (10)

### FIXED CODE ###

a, b = map(int, input().split())
if a < b :
  print (0)
else:
  print (10)
N, Y = map(int, input().split())
for x in range(N+1):
	for y in range(N+1-x):
		for z in range(N+1-x-y):
   			if Y == 10000*x+5000*y+1000*z :
    			print(x,y,z)
    			exit()
print("-1 -1 -1")

### FIXED CODE ###

N, Y = map(int, input().split())
 
for x in range(N+1):
  for y in range(N-x+1):
    z = N - x - y
    if 10000 * x + 5000 * y + 1000 * z == Y:
      print(x,y,z)
      exit()
print(-1,-1,-1)
A, B = map(int, input().split())
return((A + B) % 24)

### FIXED CODE ###

A, B = map(int, input().split())
print((A + B) % 24)
#!/usr/bin/env python
# -*- coding: utf-8 -*-


def solve():
    s = input()
    n = int(input())
    idx = 0
    while s[idx] == "1":
        idx += 1
    if idx == len(s):
        print(1)
    else:
        print(s[idx])


if __name__ == "__main__":
    solve()


### FIXED CODE ###

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


def solve():
    s = input()
    n = int(input())
    idx = 0
    slen = len(s)
    while idx < slen and s[idx] == "1":
        idx += 1
        if idx == n:
            print(1)
            return
    if idx == slen:
        print(1)
    else:
        print(s[idx])


if __name__ == "__main__":
    solve()
#!/usr/bin/env python
# -*- coding: utf-8 -*-

while True:
    n = int(raw_input())
    island = []
    if n == 0:
        break
    for i in range(n):
        g,b = map(int,input().split())
        island.append((g,b,b-g))
    sorted(island,key = lambda x:(x[2],[0],[1]))
    
    gem = 0
    for g,b,c in island:
        gem += g
        if b < gem:
            break
    else:
        print 'Yes'
        continue
    print 'No'
        

### FIXED CODE ###

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

while True:
    n = int(raw_input())
    island = []
    if n == 0:
        break
    for i in range(n):
        g,b = map(int,raw_input().split())
        island.append((g,b))
    island = sorted(island,key = lambda x:(x[1],x[0]))
    
    gem = 0
    for g,b in island:
        gem += g
        if b < gem:
            break
    else:
        print 'Yes'
        continue
    print 'No'
A ,B = list(map(int,input().split()))
def problem_koganemaru(A,B):  
  # x =  A / (0.08) 
  # y =  B / (0.10) 
  # print(x,y)
  # if x == y:
  #   return x
  # else:
  #   return -1
  for price in range(10000):
    if math.ceil(price*0.08) == A and math.ceil(price*0.1) == B:
      return price
  return -1
print(problem_koganemaru(A,B))

### FIXED CODE ###

import math
A ,B = list(map(int,input().split()))
 
def problem_koganemaru(A,B):  
  for price in range(10000):
    if math.floor(price*0.08) == A and math.floor(price*0.1) == B:
      return price
  return -1
 
print(problem_koganemaru(A,B))
n = int(input())
p = list(map(int, input().split()))
q = [i for i in range(1, n+1)]
cnt = 0
for j in range(n):
    if p[j] == q[j]:
        p[j], p[j+1] = p[j+1], p[j]
        cnt += 1
print(cnt)


### FIXED CODE ###

n = int(input())
p = list(map(int, input().split()))
q = [i for i in range(1, n+1)]
cnt = 0
for j in range(n):
    if p[j] == q[j]:
        if j != n-1:
            p[j], p[j+1] = p[j+1], p[j]
            cnt += 1
        else :
            p[j], p[j-1] = p[j-1], p[j]
            cnt += 1
print(cnt)
S=input()

if S = "Mon":
    print(6)
elif S = "TUE":
    print(5)
elif S = "WED":
    print(4)
elif S="THU":
    print(3)
elif S="FRI":
    print(2)
elif S="SAT":
    print(1)
else:
    print(7)

### FIXED CODE ###

S=input()

if S=="MON":
    print(6)
elif S == "TUE":
    print(5)
elif S == "WED":
    print(4)
elif S=="THU":
    print(3)
elif S=="FRI":
    print(2)
elif S=="SAT":
    print(1)
else:
    print(7)