Harryxun/stf_run huggingface dataset:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
if abs(a-b) > k or abs(a-c) > k or abs(a-d) > k or abs(a-e) > k or abs(b-c) > k or abs(b-d) > k or abs(b-e) > k or abs(c-d) > k or abs(c-e) > k orabs(d-e) > k :
  print(':(')
else:
  print('Yay!')

### FIXED CODE ###

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
if abs(a-b) > k or abs(a-c) > k or abs(a-d) > k or abs(a-e) > k or abs(b-c) > k or abs(b-d) > k or abs(b-e) > k or abs(c-d) > k or abs(c-e) > k or abs(d-e) > k:
  print(':(')
else:
  print('Yay!')
import sys
def input(): return sys.stdin.readline().rstrip()
import numpy as np
def main():
    h,n=map(int,input().split())
    lis=np.array([list(map(int,input().split())) for _ in range(n)])
    a_max=np.max(lis[:,0])
    dp=np.zeros(h+a_max+1,int)
    for i in range(1,h+1):
        dp[i+lis[:,0]]=np.min(dp[i+lis[:,0]],dp[i]+lis[:,1])
    print(dp[h])

if __name__=='__main__':
    main()

### FIXED CODE ###

import sys
def input(): return sys.stdin.readline().rstrip()
import numpy as np
def main():
    h,n=map(int,input().split())
    lis=np.array([list(map(int,input().split())) for _ in range(n)])
    dp=np.zeros(10**4+1,int)
    dp[0]=0
    for l in lis:
        dp[1:l[0]+1]=np.minimum(dp[1:l[0]+1],l[1])
    for i in range(1,h+1):
        dp[i]=np.min(dp[i-lis[:,0]]+lis[:,1])
    print(dp[h])

if __name__=='__main__':
    main()
num = input().split()
result = ""
for i in num:
    if num[i] == 1:
        result += '9'
    if num[i] == 9:
        result += '1'
print(result)



### FIXED CODE ###

num = list(input())
result = ""
for i in range(len(num)):
    if num[i] == '1':
        result += '9'
    if num[i] == '9':
        result += '1'
print(result)
N = {} #10000以上key以下の回文数の個数
cnt = 0
for i in range(10000, 100000):
    L = list(str(i))
    if L == list(reversed(L)):
        cnt += 1
    N[i] = cnt
A, B = map(int, input().split())
print(N[B]-N[A-1])

### FIXED CODE ###

N = {} #10000以上key以下の回文数の個数
cnt = 0
for i in range(10000, 100000):
    L = list(str(i))
    if L == list(reversed(L)):
        cnt += 1
    N[i] = cnt
A, B = map(int, input().split())
print(N[B]-N[A-1] if A > 10000 else N[B])
def f(A, i, j, k, nex,res):
    if A[i] == A[j] == 0:
        print("No")
        exit()
    elif A[i] == A[j] == 1 and A[k] == 0:
        if i in nex:
            A[i] += 1
            A[j] -= 1
            return "ABC"[i]
        else:
            A[i] -= 1
            A[j] += 1
            return "ABC"[j]
    else:
        A[i] += 1
        A[j] -= 1
        return "ABC"[i]
    

def main():
    N, A, B, C = [int(_n) for _n in input().split()]
    S = []
    for i in range(N):
        s = input()
        S.append(s)
    if [A,B,C].count(0) == 3:
        print("No")
        return
    res = ""
    arr = [A,B,C]
    S.append("")
    for i,s in enumerate(S[:-1]):
        if S[i+1] == "AB":
            n = [0,1]
        if S[i+1] == "BC":
            n = [2,1]
        if S[i+1] == "AC":
            n = [0,2]
        if s == "AB":
            if arr[0] > arr[1]:
                res += f(arr, 1, 0, 2, n,res)
            else:
                res += f(arr,0,1,2,n,res)
        elif s == "BC":
            if arr[1] > arr[2]:
                res += f(arr, 2, 1, 0, n,res)
            else:
                res += f(arr,1,2,0,n,res)
        elif s == "AC":
            if arr[0] > arr[2]:
                res += f(arr, 2,0, 1, n,res)
            else:
                res += f(arr,0,2,1,n,res)
    print("Yes")
    for s in res:
        print(s)
main()

### FIXED CODE ###

def f(A, i, j, k, nex,res):
    if A[i] == A[j] == 0:
        print("No")
        exit()
    elif A[i] == A[j] == 1 and A[k] == 0:
        if i in nex:
            A[i] += 1
            A[j] -= 1
            return "ABC"[i]
        else:
            A[i] -= 1
            A[j] += 1
            return "ABC"[j]
    else:
        A[i] += 1
        A[j] -= 1
        return "ABC"[i]
    

def main():
    N, A, B, C = [int(_n) for _n in input().split()]
    S = []
    for i in range(N):
        s = input()
        S.append(s)
    if [A,B,C].count(0) == 3:
        print("No")
        return
    res = ""
    arr = [A,B,C]
    S.append("")
    for i,s in enumerate(S[:-1]):
        n = []
        if S[i+1] == "AB":
            n = [0,1]
        if S[i+1] == "BC":
            n = [2,1]
        if S[i+1] == "AC":
            n = [0,2]
        if s == "AB":
            if arr[0] > arr[1]:
                res += f(arr, 1, 0, 2, n,res)
            else:
                res += f(arr,0,1,2,n,res)
        elif s == "BC":
            if arr[1] > arr[2]:
                res += f(arr, 2, 1, 0, n,res)
            else:
                res += f(arr,1,2,0,n,res)
        elif s == "AC":
            if arr[0] > arr[2]:
                res += f(arr, 2,0, 1, n,res)
            else:
                res += f(arr,0,2,1,n,res)
    print("Yes")
    for s in res:
        print(s)
main()
#!/usr/bin/env python

def main():
    N, M = map(int, input().split())
    INF = float('inf')

    LR = [-INF, INF]
    for _ in range(M):
        L, R = map(int, input().split())
        if LR[0] < L:
            LR[0] = L
        if LR[1] > R:
            LR[1] = R
    if LR[1] > LR[0]:
        return int(LR[1] - LR[0] + 1)
    else:
        return 0

if __name__ == '__main__':
    print(main())

### FIXED CODE ###

#!/usr/bin/env python

def main():
    A, B = map(int, input().split())
    if A < 6:
        return 0
    elif A < 13:
        return B / 2
    else:
        return B

if __name__ == '__main__':
    print(int(main()))
h , w = (int(i) for i in input().split())
a =[]
dy = [0, 0, 1, -1]
dx = [1, -1, 0, 0]


for i in range(h):
    a.append(input())
    
f = True
def check(x,y):
    if a[x][y] =='.':
        return True
    for n in range(4):
        i = dx[n]
        j = dy[n]
#        print(a[x+i][y+j])
        if 0 <= x+i < w and 0 <= y + j < h and a[x+i][y+j]=='#':
            #print(x+i,y+j)
            return True
    return False
#print(check(0,3))
f = True
for i in range(w):
    for j in range(h):
        l = check(i,j)
        if not(l) and f:
            print ("No")
            f = False
if(f):
    print("Yes")


### FIXED CODE ###

a, b, c = (int(i) for i in input().split())
d = int(input())
max_a = max(a,b,c)

ans = a + b + c + max_a * pow(2 , d) - max_a
print(ans)
import math
import random

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors


def is_prime3(q, k=50):
    q = abs(q)
    # 計算するまでもなく判定できるものははじく
    if q == 2: return True
    if q < 2 or q & 1 == 0: return False

    # n-1=2^s*dとし（但しaは整数、dは奇数)、dを求める
    d = (q - 1) >> 1
    while d & 1 == 0:
        d >>= 1

    # 判定をk回繰り返す
    for i in range(k):
        a = random.randint(1, q - 1)
        t = d
        y = pow(a, t, q)
        # [0,s-1]の範囲すべてをチェック
        while t != q - 1 and y != 1 and y != q - 1:
            y = pow(y, 2, q)
            t <<= 1
        if y != q - 1 and t & 1 == 0:
            return False
    return True


a, b = map(int, input().split())
gcd = math.gcd(a, b)
divisors = make_divisors(gcd)

ans = 0
for divisor in divisors:
    if is_prime3(divisor) is True:
        ans += 1

print(ans + 1)


### FIXED CODE ###

import sys
sys.setrecursionlimit(200000)
input = sys.stdin.readline

A, B = map(int, input().split())

def gcd(a, b):
    if a < b:
        a, b = b, a
    if a % b == 0:
        return b
    return gcd(b, a % b)


# https://en.wikipedia.org/wiki/Trial_division
def f(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1: a.append(n)
    # Only odd number is possible
    return a


c = gcd(A, B)

print(len(set(f(c))) + 1)
N = int(input())
T, A = (int(x) for x in input().split())
altitude_list = [int(x) for x in input().split()]
dif_list = list(map(lambda x: abs(A - (T - x * 0.006)), altitude_list))
print(dif_list.index(min(dif_list)) + 1)

### FIXED CODE ###

X, Y = (int(x) for x in input().split())
print(X + int(Y / 2))
while True:
    x = int(input())
    if x == 0:
            break
    print('Case {}: {}'.format(i, x))
    i += 1

### FIXED CODE ###

i = 1
while True:
    x = input()
    if x == "0":
        break
    else:
        print("Case {}: {}".format(i, x))
        i += 1
def gcd(x,y):
    if y==0:
        return x
    else:
        return gcd(y,x%y)

n=int(input())
a_array=[int(a) for a in input().split()]

for i in range(1, n-1):
    a=gcd(a,a_array[i])
    left_gcd.append(a)

right_gcd=[a_array[-1]]
for i in range(n-2,0,-1):
    b=gcd(b,a_array[i])
    right_gcd.append(b)

ans_gcd=[right_gcd[n-2],left_gcd[n-2]]

for i in range(n-2):
    ans_gcd.append(gcd(left_gcd[i],right_gcd[n-i-3]))

print(max(ans_gcd))


### FIXED CODE ###


# 最大公約数を求める
def gcd(x,y):
    if y==0:
        return x
    else:
        return gcd(y,x%y)

n=int(input())
a_array=[int(a) for a in input().split()]

# 累積GCDの計算(A1, A2, ... Ai-1の最大公約数)
left_gcd=[a_array[0]] # 
a=a_array[0] # 最初のループはgcd(a_array[0], a_array[1])になる
for i in range(1, n-1):
    a=gcd(a,a_array[i])
    left_gcd.append(a)

# 累積GCDの計算(Ai, Ai+1, ... ANの最大公約数)
right_gcd=[a_array[-1]]
b=a_array[-1] # 最初のループはgcd(a_array[-1], a_array[-2])になる
for i in range(n-2,0,-1):
    b=gcd(b,a_array[i])
    right_gcd.append(b)

# i番目の数値以外の最大公約数を格納
ans_gcd=[right_gcd[n-2],left_gcd[n-2]]

for i in range(n-2):
    ans_gcd.append(gcd(left_gcd[i],right_gcd[n-i-3]))

print(max(ans_gcd))
#AGC030 B - Powers of two
import collections
import math
beki=[]
for i in range(1,32):
    beki.append(2**i)#bekiは２のべき乗の配列
N=int(input())
A=list(map(int,input().split()))
A.sort(reverse=True)
cnter=collections.Counter(A)
ans=0
for a in A:
    inv=2**(int(math.log2(a))+1)
    if cnter[a]==0:
        continue
    if cnter[a]>=2 and a=inv//2:
        cnter[a]=cnter[a]-2
        ans=ans+1
        continue
    if inv-a in cnter:
        cnter[inv-a]=cnter[inv-a]-1
        ans=ans+1
print(ans)

### FIXED CODE ###

#AGC030 B - Powers of two
import collections
import math
N=int(input())
A=list(map(int,input().split()))
A.sort(reverse=True)
cnter=collections.Counter(A)
ans=0
for a in A:
    inv=2**(int(math.log2(a))+1)
    if cnter[a]==0:
        continue
    if inv==2*a and cnter[inv-a]<=1:
      	continue
    if cnter[inv-a]>0:
        cnter[inv-a]=cnter[inv-a]-1
        cnter[a]=cnter[a]-1
        ans=ans+1
print(ans)
N = int(input())
print(sum(range(1, N))

### FIXED CODE ###

N = int(input())
print(sum(range(1, N)))
N, A, B = map(int, input().split())
if A ==0:
  print(0)
  exit()
s = ''
while len(s) < N:
  s = s + (A * 'b')
  s = s + (B * 'r')
print(s[:N].count('b'))

### FIXED CODE ###

n, a, b = map(int, input().split())
c = n // (a + b) * a
d = n % (a + b)
if d > a:
  print(c+a)
else:
  print(c+d)
K,N=map(int,input().split())
L=list(map(int,input().split()))
A=[]
for i in range(N-1):
  A.append(L[i+1]-L[i])
L.append(K-L[L-1]+L[0])
print(K-max(L))



### FIXED CODE ###

K,N=map(int,input().split())
L=list(map(int,input().split()))
A=[]
for i in range(N-1):
  A.append(L[i+1]-L[i])
A.append(K-L[N-1]+L[0])
print(K-max(A))
print("Yes" if ('N' in s) == ('S' in s) and ('W' in s) == ('E' in s) for s in [input()] else "No")


### FIXED CODE ###

import os
import math
import itertools
INF, MOD = float("inf"), 1e9 + 7
MAX, MIN = -INF, INF
dx1, dy1, dx2, dy2 = [-1, 0, 1, 0], [0, -1, 0, 1], [-1, 0, 1, -1, 1, -1, 0, 1], [-1, -1, -1, 0, 0, 1, 1, 1]

def get_int():
    return int(input())

def get_int_list():
    return list(map(int, input().split()))

while(True):
    try:
        s = input()
        if ('N' in s) == ('S' in s) and ('W' in s) == ('E' in s):
            print("Yes")
        else:
            print("No")
    except EOFError:
        exit()
N = list(map(int, input().split()))
N = NK[0]; K = NK[1]

result = 0
for i in range(K,N+2):
    result += i*(N-i+1) +1

print(result)


### FIXED CODE ###

NK = list(map(int, input().split()))
N = NK[0]; K = NK[1]
 
result = 0
for i in range(K,N+2):
    result += i*(N-i+1) +1
    result = result%1000000007
 
print(result)
N = int(input())
H = list(map(int, input().split()))
result = []
p = 0
q = 0
    
for q in range(N):
    for i in range(N-1):     
        if H[i-1] >= H[i+p]:
            p += 1 
            q += 1
        else:
            result.append(q)
            break


print(max(result))

### FIXED CODE ###

def solve():
    
    N = int(input())
    H = list(map(int, input().split()))
    result = []
    p = 0
    q = 0
    
    for i in range(N-1):     
        if H[i] >= H[i+1]:
            q += 1
        else:
            p = max(p, q)
            q = 0
    p = max(p, q)
    print(p)

solve()
#深さ優先探索

import collections

n, m ,k= map(int, input().split())
# 入力値をzero-basedにしつつ格納する
pairs = [tuple(map(lambda x: int(x) - 1, input().split()))
         for _ in range(m)]
node=[[] for _ in range(n)]
block=[[] for _ in range(n)]
for p in pairs:
  node[p[0]].append(p[1])
  node[p[1]].append(p[0])
s=0
seen=[None]*n

sys.setrecursionlimit(10**9)
def dfs(v,c):
  seen[v]=c
  for next_v in node[v]:
    if seen[next_v]!=None:
      continue
    else:
      dfs(next_v,c)
      
for i in range(n):
  if seen[i]!=None:
    continue
  else:
    dfs(i,s)
    s+=1

#ブロックについて
for i in range(k):
  c,d=map(lambda x: int(x) - 1, input().split())
  if seen[c]==seen[d]:
    block[c].append(d)
    block[d].append(c)
  
count=collections.Counter(seen)
for i in range(n):
  print(count[seen[i]]-len(node[i])-1-len(block[i]))
  
print(block)

### FIXED CODE ###

import sys
from collections import deque, Counter, defaultdict
from fractions import gcd
input = lambda: sys.stdin.readline().rstrip()

def eprint(s):
    sys.stderr.write('DEBUG: {}'.format(s))
    return

def main():
    n, m, k = map(int, input().split())
    fgraph = [list() for i in range(n)]
    bgraph = [list() for i in range(n)]
    cgraph = [list() for i in range(n)]
    
    rks = [None] *n
    sys.setrecursionlimit(10**9)
    # r: どの連結成分に存在するかをメモするid
    def dfs(graph,s,r):
        if rks[s] is None:
            rks[s] = r
        for i in range(len(graph[s])):
            if rks[graph[s][i]-1] is not None:
                continue
            dfs(graph, graph[s][i]-1,r)

    for i in range(m):
        a,b = map(int, input().split())
        fgraph[a-1].append(b)
        fgraph[b-1].append(a)

    # print(fgraph)
    #print(bgraph)
    # 連結成分に対してid的なindexをつける
    c = -1
    for i in range(n):
        if rks[i] is None:
            c += 1
            dfs(fgraph, i, c)
    
    for i in range(k):
        c,d = map(int, input().split())
        if rks[c-1] == rks[d-1]:
            bgraph[d-1].append(c)
            bgraph[c-1].append(d)

    counter = Counter(rks)
    for i in range(n):
        # counter[rks[i]] 連結成分のサイズ
        # len(fgraph[i]) 友達の数
        # len(bgraph[i]) 連結成分内のブロックの数
        # 1 自分
        print(counter[rks[i]] - len(fgraph[i]) - len(bgraph[i]) - 1)

if __name__ == '__main__':
    main()
N=int(input())
S=[input() for i in range[N]]
for v in ['AC','WA','TLE','RE']:
  print('{} x {}'.format(v,s.count()))

### FIXED CODE ###

N=int(input())
s=[input()  for i in range(N)]
for v in ['AC', 'WA', 'TLE','RE']:
  print('{0} x {1}'.format(v,s.count(v)))
a,b = raw_input().split()
c = math.ceil(math.sqrt(int(a+b)))
print("Yes" if c * 2 == int(a+b) else "No")

### FIXED CODE ###

a,b = input().split()
c = int(a+b)
i = 0
txt = "No"
while i * i <= c:
  if i * i == c:
    txt = "Yes"
    break
  i = i + 1
print(txt)
n,m=map(int,input().split())
hoge=[[0 for i in range(n+2)] for j in range(m+2)]
for i in range(m):
  sss=input()
  for j in range(n):
    if(sss[j]=="#"):
      hoge[1+i][1+j]=1
    
flag=True
for i in range(m):
  for j in range(n):
    if(hoge[1+i][1+j]==1):
      ans=0
      ans+=hoge[i][1+j]+hoge[1+i][j]+hoge[2+i][1+j]+hoge[1+i][2+j]
      if(ans==0):
        flag=False
        
if(flag):
  print("Yes")
else:
  print("No")

### FIXED CODE ###

m,n=map(int,input().split())
hoge=[[0 for i in range(n+2)] for j in range(m+2)]
for i in range(m):
  sss=input()
  for j in range(n):
    if(sss[j]=="#"):
      hoge[1+i][1+j]=1
    

flag=True
for i in range(m):
  for j in range(n):
    if(hoge[1+i][1+j]==1):
      ans=0
      #print(1+i,1+j,ans,hoge[i][1+j],hoge[1+i][j],hoge[2+i][1+j],hoge[1+i][2+j])
      ans=max(hoge[i][1+j],hoge[1+i][j],hoge[2+i][1+j],hoge[1+i][2+j])
      if(ans==0):
        flag=False
        
if(flag):
  print("Yes")
else:
  print("No")
import itertools
N = int(input())
combi = []
l = []
count = 0

def dfs(s):
    if int(s) > N:
        return 0
    ret = 1 if all(s.count(c) > 0 for c in '753') else 0
    for c in '753':
        ret += dfs(s+c)
    return
print(dfs('0'))


### FIXED CODE ###

N = int(input())
def dfs(s):
    if int(s) > N:
        return 0
    ret = 1 if all(s.count(c) > 0 for c in '753') else 0
    for c in '753':
        ret += dfs(s+c)
    return ret
print(dfs('0'))
a=int(input())
c=0
for i in range(0,n+1):
  if(i%3!=0)and(i%5==0):
    continue
  if(i%3!=0):
    continue
  if(i%5==0):
    continue
  else:
    c+=i
print(c)  
   

### FIXED CODE ###

n=int(input())
c=0
for i in range(1,n+1):
  if((i%3==0)and(i%5==0)):
    continue
  elif(i%3==0):
    continue
  elif((i%5==0)):
    continue
  else:
    c+=i
print(c)
n, m = map(int, input().split())

edges = [ [] for _ in range(n) ]

for _ in range(m):
    a, b = map(int, input().split())
    edges[a - 1].append(b - 1)
    edges[b - 1].append(a - 1)

INF = 10 ** 10

def dijkstra_travel(edges):
    paths = [ None for _ in range(n) ]
    paths[0] = 0

    def travel_adjacent(n):
        adjacent_nodes = list(
            map(
                lambda x: paths[x],
                edges[n],
            )
        )

        next_travel = []

        for i, node in enumerate(adjacent_nodes):
            if node is None:
                paths[edges[n][i]] = n
                next_travel.append(edges[n][i])

        for x in next_travel:
            travel_adjacent(x)

    travel_adjacent(0)

    return paths[1:]

result = dijkstra_travel(edges)

if all(map(lambda x: x is not None, result)):
    print('Yes')

    for x in result:
        print(x + 1)

else:
    print('No')

### FIXED CODE ###

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

edges = [ [] for _ in range(n) ]

for _ in range(m):
    a, b = map(int, input().split())
    edges[a - 1].append(b - 1)
    edges[b - 1].append(a - 1)

INF = 10 ** 6

def dijkstra_travel(edges):
    dists = [ INF  for _ in range(n) ]
    paths = [ None for _ in range(n) ]

    dists[0] = 0
    paths[0] = 0

    next_travel = [ 0 ]

    def travel_adjacent():
        n = next_travel.pop(0)

        adjacent_nodes = list(
            map(
                lambda node: (node, paths[node]),
                edges[n],
            )
        )

        for node, path in adjacent_nodes:
            if path is None or dists[node] > dists[n] + 1:
                dists[node] = dists[n] + 1
                paths[node] = n
                next_travel.append(node)


    while len(next_travel) > 0:
        travel_adjacent()

    return paths[1:]

result = dijkstra_travel(edges)

if all(map(lambda x: x is not None, result)):
    print('Yes')

    for x in result:
        print(x + 1)

else:
    print('No')
from collections import deque

N, M = map(int, input().split())
G = [[] for _ in range(M)]
for i in range(M):
  A, B = map(int, input().split())
  G[A-1].append(B-1)
  G[B-1].append(A-1)

seen = [0 for _ in range(N)]
seen[0] = 1
shirube = [-1 for _ in range(N-1)]

stack = deque([0])
while stack:
  now = stack.popleft()
  for i in G[now]:
    if seen[i] == 0:
      seen[i] = 1
      stack.append(i)
      shirube[i-1] = now
    
for i in range(N):
  if seen[i] == 0:
    print('No')
    break
else:
  print('Yes')
  for j in range(N-1):
    print(shirube[j]+1)


### FIXED CODE ###

from collections import deque

N, M = map(int, input().split())
G = [[] for _ in range(N)]
for i in range(M):
  A, B = map(int, input().split())
  G[A-1].append(B-1)
  G[B-1].append(A-1)

seen = [0 for _ in range(N)]
seen[0] = 1
shirube = [-1 for _ in range(N-1)]

stack = deque([0])
while stack:
  now = stack.popleft()
  for i in G[now]:
    if seen[i] == 0:
      seen[i] = 1
      stack.append(i)
      shirube[i-1] = now
    
for i in range(N):
  if seen[i] == 0:
    print('No')
    exit()
    
print('Yes')
for j in range(N-1):
  print(shirube[j]+1)
a = input()
b = input()
print(int(6-a-b))

### FIXED CODE ###

a = int(input())
b = int(input())
print(6-a-b)
s=input()
if s=="RRR":
    print(3)
elif s="RR":
    print(2)
elif s="R":
    print(1)
else: print(0)


### FIXED CODE ###

s=input()
cnt=0
if s=="SSS":
    cnt=0
elif s=="RRR":
    cnt=3
elif s=="RRS" or s=="SRR":
    cnt=2
else:cnt=1
print(cnt)
import numpy as np
import math
n=int(input())
li=[]
a=[]
b=[]
s=0
while True:
    try:
        li.append(list(map(int,input().split())))
    except:
        break;
for x in li:
  a.append(x[0])
  b.append(x[1])

for i in range(0,n):
  for j in range(i,n):
  	s+=np.sqrt(((a[j]-a[i])**2)+((b[j]-b[i])**2))

p=math.factorial(n)
print(s)

### FIXED CODE ###

a=int(input())
a=a*a
print(a)
N, K = map(int, input().split())
P_L = [int(x)-1 for x in input().split()]
C_L = [int(x) for x in input().split()]

ans = float("-Inf")
for s in range(N):
    _s_l = []
    _v = s
    _cumsum = 0
    _ans = float("-Inf")
    while True:
        _nextv = P_L[_v]
        _cumsum += C_L[_nextv]
        _s_l.append(_cumsum)
        _v = _nextv
        if _nextv == s:
            break
    if K <= len(_s_l):
        _ans = max(_s_l[:K])
    else:
        if _s_l[-1] < 0:
            _ans = max(_s_l)
        else:
            _l = len(_s_l)
            _ans = max(_s_l[-1] * (K // _l) + max(_s_l[:K % _l]),
                       _s_l[-1] * (K // _l - 1) + max(_s_l))
    ans = max(ans, _ans)

print(ans)


### FIXED CODE ###

N, K = map(int, input().split())
P_L = [int(x)-1 for x in input().split()]
C_L = [int(x) for x in input().split()]

ans = float("-Inf")
for s in range(N):
    _s_l = []
    _v = s
    _cumsum = 0
    _ans = float("-Inf")
    while True:
        _nextv = P_L[_v]
        _cumsum += C_L[_nextv]
        _s_l.append(_cumsum)
        _v = _nextv
        if _nextv == s:
            break
    if K <= len(_s_l):
        _ans = max(_s_l[:K])
    else:
        if _s_l[-1] < 0:
            _ans = max(_s_l)
        else:
            _l = len(_s_l)
            if K % _l == 0:
                _ans = max(_s_l[-1] * (K // _l),
                           _s_l[-1] * (K // _l - 1) + max(_s_l))
            else:
                _ans = max(_s_l[-1] * (K // _l) + max(_s_l[:K % _l]),
                           _s_l[-1] * (K // _l - 1) + max(_s_l))
    ans = max(ans, _ans)

print(ans)
a, b = ri(), ri()
if a == b:
  print('EQUAL')
elif a > b:
  print('GREATER')
else:
  print('LESS')

### FIXED CODE ###

import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np
from functools import reduce

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

 
a, b = ri(), ri()
if a == b:
  print('EQUAL')
elif a > b:
  print('GREATER')
else:
  print('LESS')
n = int(input())
d = input()

c = 0
for i in range(len(d):
    if d[i] != d[i+1]:
        c += 1

print(c+1)

### FIXED CODE ###

n = int(input())
d = input()

c = 0
for i in range(len(d)-1):
    if d[i] != d[i+1]:
        c += 1

print(c+1)
n,x = map(int, input().split())
a = list(map(int, input().split()))

a.sort()

for i in range(n):
  if a[i] == n:
    ans+=1
    break
  elif a[i] > n:
    break
  else:
    if i!=n(-1):
      ans+=1
      n-=a[i]
print(ans)
    

### FIXED CODE ###

n,x = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
ans=0
for i in range(n):
  if a[i] == x:
    ans+=1
    break
  elif a[i] > x:
    break
  else:
    if i!=(n-1):
      ans+=1
      x-=a[i]
print(ans)