peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
S=sorted(list(input()))
if S[0]==S[1] and S[2]==S[3]:
  print('Yes')
else:
  print('No')
# Judge status: Wrong Answer
MM = input().split()
N =int(MM[0])
M =int(MM[1])
list1 = [i for i in range(M)]
for i in range(N):
  MM = input().split()
  list2 = [int(MM[j]) for j in range(1,int(MM[0])+1)]
  list1 = set(list1)&set(list2)
print(len(list1))
# Judge status: Accepted
X,Y=map(int,input().split())
if (X+Y)%3!=0:
  print(0)
  exit()
A=int((X+Y)/3)
B=int((2*Y-X)/3)
if A<0 or B<0:
  print(0)
  exit()
MOD=10**9+7
def comb(n,k):
  tmp=1
  for i in range(n-k+1,n+1):
    tmp*=i
    tmp%=MOD
  for i in range(1,k+1):
    tmp*=pow(i,MOD-2,MOD)
    tmp%=MOD
  return tmp
ans = comb(A,B)
print(ans%MOD)
# Judge status: Accepted
# coding: utf-8
N = int(input())
A = []
for _ in range(2):
    A.append(list(map(int, input().split())))
dp = [[0 for _ in range(N)] for _ in range(2)]
# dp = np.array(dp)
dp[0][0] = A[0][0]
dp[1][0] = A[0][0] + A[1][0]
for i in range(1, N):
    dp[0][i] = dp[0][i-1] + A[0][i]
    dp[1][i] = max(dp[0][i], dp[1][i-1]) + A[1][i]
print(dp[1][N-1])
# Judge status: Accepted
#A
h =list(input() )
z = False
for x in h:
    if x =="7":
        z =True
        break
if z ==True:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n, m = map(int,input().split())
a = list(map(int,input().split()))
ans = 0
for i in range(m):
    ans += a[i]

kotae = n - ans
if kotae >= 0:
    print(kotae)
else:
    print(-1)
# Judge status: Wrong Answer
import math

x = int(input())

y = int(math.sqrt(2*x))
for i in range(y+1, 0, -1):
    if i * (i + 1) < 2 * x:
        print(i + 1)
        break
# Judge status: Wrong Answer
a,b=map(int,input().split())
ans=0
for i in range(b-a+1):
    print(i)
    ans+=i
print(ans-b)
# Judge status: Wrong Answer
import math
N=int(input())
def isp(N):
  k=int(math.sqrt(N))
  
  for i in range(2,k+2):
    if N%i==0:
      return(False)
  return(True)
while isp(N)==False:
  N+=1
print(N)
# Judge status: Wrong Answer
s = input()

if s[:2] == "00" or s[2:] == "00":
  print("NA")
  exit()

if int(s[:2]) > 13 and int(s[2:]) > 13:
  print("NA")
  exit()

if 1 <= int(s[:2]) <= 12 and 1 <= int(s[2:]) <= 12:
  print("AMBIGUOUS")
  exit()


if int(s[2:]) > 13:
  print("MMYY")
else:
  print("YYMM")
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
a.sort()
a.append(0)
b = {}
c = 0
for i in range(n):
    if a[i] not in b:
        for j in range(1, 10**6//a[i]+1):
            b[a[i]*j] = 1
        if a[i] != a[i+1]:
            c += 1
print(c)
# Judge status: Wrong Answer
N = int(input())

ans = 0
for i in range(N):
    for j in range(N):
        k = N - i - j
        if k>0:
            vol = i * j * k
            ans = max(ans,vol)
        
print(ans)
# Judge status: Accepted
'''
Accepted    　:No
difficult   　: 
ペナルティ　  　:5分
実際の回答時間  :分
WAの回数　     :回
合計時間　　  　:分
'''

def myAnswer(x:int) -> int:
   total = 0
   if (x > 11):
      total = x // 11 * 2
      x = x % 11
   if(x == 0):
      return total
   elif(x <= 6):
      return total + 1
   else:
      return total + 2


def modelAnswer():
   return
def main():
   x = int(input())
   print(myAnswer(x))

if __name__ == '__main__':
   main()
# Judge status: Accepted
s = input()

if s[len(s)-1] == 's':
  print(s+'es')
else:
  print(s+'s')
# Judge status: Accepted
import sys


def input():
    return sys.stdin.readline().strip()


sys.setrecursionlimit(10 ** 9)


def main():
    N, C, K = map(int, input().split())
    T = [int(input()) for _ in range(N)]
    T.sort()
    answer = 0
    cst = C
    time = 0
    for t in T:
        if (time + K >= t) and (cst + 1 <= C):
            cst += 1
        else:
            answer += 1
            time = t
            cst = 1

    print(answer)


if __name__ == "__main__":
    main()
# Judge status: Accepted
import sys
input = lambda: sys.stdin.readline().rstrip()

N, M = map(int, input().split())

card = [0] * (N+1)
for i in range(M):
    L, R = map(int, input().split())
    card[L-1] += 1
    card[R] -= 1

for i in range(len(card)-1):
    card[i+1] += card[i]

print(card.count(M))
# Judge status: Wrong Answer
N, M = map(int,input().split())
L = list(map(int,input().split()))
max(-1,N-sum(L))
# Judge status: Accepted
print('YNEOS'[''.join(sorted(input()))!='  557'::2])
# Judge status: Accepted
import sys
a,b,c,x=map(int,sys.stdin.read().split())
cnt=0

for aa in range(a+1):
  for bb in range(b+1):
    for cc in range(c+1):
      if (aa*500+bb*100+cc*50) == x:
        cnt+=1

print(cnt)
# Judge status: Accepted


N,X,Y = map(int, input().split())


ans = [0] * (N)
for i in range(1, N):
    for j in range(i+1, N+1):
        #ans[j-i] += 1
        if (j - i) > abs(X - i) + abs(j - Y) + 1:
            ans[abs(X - i) + abs(j - Y) + 1] += 1
        else:
            ans[j-i] += 1
           # ans[j-i] -= 1

        #print("--", i,j, ans)


print(*ans[1:], sep="\n")
# Judge status: Accepted
a=input().split()

for x in range(5):
  if a[x]=="0":
    print(x+1)
# Judge status: Accepted
N,K = map(int, input().split())
A=list(map(int, input().split()))
print(-(-(N-1)//(K-1)))
# Judge status: Accepted
a = int(input())
b = int(input())
h = int(input())
 
print(int(a+b)*h//2 )
# Judge status: Wrong Answer
#5問目
N = int(input())
a = list(map(int, input().split()))
#XORはpythonでは^で表現
temp = 0
result = []
for i in range(N):
    for j in range(len(a)):
        if j != i:
            temp = temp ^ a[j]
    result.append(temp)
    temp = 0
print(result)
# Judge status: Accepted
a1,a2,a3= map(int,input().split())
a4,a5,a6= map(int,input().split())
a7,a8,a9= map(int,input().split())
n=int(input())
b=[int(input()) for _ in range(n)]
bing = [(a1,a2,a3),(a4,a5,a6),(a7,a8,a9),
        (a1,a4,a7),(a2,a5,a8),(a3,a6,a9),
        (a1,a5,a9),(a3,a5,a7)]
for cs in bing:
    for c in cs:
        if not c in b:break
    else:
        print('Yes')
        break
else:print('No')
# Judge status: Wrong Answer
def resolve():
    N, x = list(map(int, input().split()))
    A = list(map(int, input().split()))
    cnt = 0
    for i in range(N-1):
        if A[i] + A[i+1] > x:
            diff = (A[i] + A[i+1]) - x
            cnt += diff
            A[i+1] -= diff
    print(cnt)


if '__main__' == __name__:
    resolve()
# Judge status: Wrong Answer
n, m = map(int, input().split())
A = [input() for _ in range(n)]
B = [input() for _ in range(m)]

#print(A)
#print(B)

for a in A:
    for b in B:
        flg = True
        if b not in a:
            flg = False
        if flg:
            print("Yes")
            exit()
print("No")
# Judge status: Accepted
mod = 10**9+7
n,a,b=map(int, input().split())
total = pow(2, n, mod) - 1
comb1 = 1
for i in range(n-a+1, n+1):
    comb1*=i
    comb1%=mod
for i in range(1, a+1):
    comb1*=pow(i, mod-2, mod)
    comb1%=mod
comb2 = 1
for i in range(n-b+1, n+1):
    comb2*=i
    comb2%=mod
for i in range(1, b+1):
    comb2*=pow(i, mod-2, mod)
    comb2%=mod
ans = total - comb1 - comb2
print(ans%mod)
# Judge status: Accepted
N=int(input())
C=[list(map(int,input().split())) for _ in range(N-1)]

for i in range(N-1):
 c,s,f=C[i]
 A=s+c
 for j in range(i+1,N-1):
    nc,ns,nf=C[j]
    if A<ns:A=ns
    elif (A-ns)%nf!=0:A+=nf-(A-ns)%nf
    A+=nc
 print(A)
print(0)
# Judge status: Accepted
n = int(input())
N = input()
L = 0
R = 0
num = 0
for c in N:
    if c == '(':
        num += 1
    else:
        if num:
            num -= 1
        else:
            L += 1
R = num

print('(' * L + N + ')' * R)
# Judge status: Accepted
from math import sqrt

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

ans = 1
for i in range(1, int(sqrt(m)+1)):
  if m % i == 0:
    if n * i <= m:
      ans = max(ans,i)
    if n * (m//i) <= m:
      ans = max(ans, m//i)
                           
print(ans)
# Judge status: Accepted

n = int(input())

t, a = map(int,input().split())

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

for i in range(0,n):
    h_list[i] = abs(a-(t - h_list[i]*0.006))

MinH = min(h_list)
print(h_list.index(MinH)+1)
# Judge status: Accepted
import math

a, b, x = map(float, input().split())

tan = (2*((a**2)*b-x))/a**3

if x <= (a**3)*tan/2:
    tan = (a*(b**2))/(x*2)

deg = math.degrees(math.atan(tan))
print(deg)
# Judge status: Accepted
s = list(input())
if len(s) == len(set(s)):
  print("yes")
else:
  print("no")
# Judge status: Wrong Answer
A,B,C = map(int,input().split())
K = int(input())
cnt = 0
if B <= A :
    while B < A :
        B = B*2 
        cnt += 1
        break
    if C*(2**(K-cnt)) > B:
        print('Yes')
    else :
        print('No')
elif B > A :
    if C*(2**K) > B :
        print('Yes')
    elif C*(2**K) <= B:
        print('No')
# Judge status: Accepted
x = input().split()
n = int(x[0])
m = int(x[1])
N = n
M = m

r = m % n
while r != 0:
    m = n
    n = r
    r = m % n

print(int(N*M/n))
# Judge status: Accepted
n,m=map(int,input().split())
a,b=[],[]
for i in range(n):
    a.append(input())
for i in range(m):
    b.append(input())
c=0
for i in range(n-m+1):
    for j in range(n-m+1):
        p = [l[j:j+m] for l in a[i:i+m]]
        if b == p and c==0:
            print('Yes')
            c=1
            break
if c==0:
    print('No')
# Judge status: Wrong Answer
import sys
input = sys.stdin.readline
s=input().strip()
for i in range(len(s)):
    if s[i]=="A":
        sa=i
for i in range(len(s)):
    if s[i]=="Z":
        sz=i
print(len(s[sa:sz+1]))
# Judge status: Accepted
n=int(input())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
ans=0
for i in range(n):
    ans=max(ans,sum(x[:i+1])+sum(y[i:]))
print(ans)
# Judge status: Wrong Answer
n,k = map(int,input().split())
for i in range(1,30):
    if n >= k**(i-1) and n < k**i:
        print(i)
# Judge status: Accepted
s = input()

Flag = False
for i in range(len(s)):
    for j in range(i+1,len(s)):
        if s[i] == s[j]:
            Flag = True

if Flag:
    print('no')
else:
    print('yes')
# Judge status: Wrong Answer
#!/usr/bin/env python3

n = int(input())
ab = [list(map(int, input().split())) for i in range(n)]


ab = sorted(ab, key=lambda x: x[1])

weight = 0
for w, d in ab:
    print(weight, d)
    weight += w
    if weight > d:
        print("No")
        exit()
# print(weight, d)
print("Yes")
# Judge status: Accepted
import sys

sys.setrecursionlimit(10 ** 7)
rl = sys.stdin.readline


def solve():
    N, X, Y = map(int, rl().split())
    X -= 1
    Y -= 1
    
    ans = [0] * N
    for i in range(N - 1):
        for j in range(i + 1, N):
            ans[min(j - i, abs(X - i) + 1 + abs(j - Y), abs(Y - i) + 1 + abs(j - X))] += 1
    print('\n'.join(map(str, ans[1:])))


if __name__ == '__main__':
    solve()
# Judge status: Accepted
n = int(input())
a = []
b = []
for _ in range(n):
    atmp, btmp = map(int, input().split())
    a.append(atmp)
    b.append(btmp)
a.sort()
b.sort()
if n % 2 == 1:
    pos = n // 2
    print(b[pos] - a[pos] + 1)
else:
    pos = n // 2 - 1
    a1 = a[pos]
    a2 = a[pos + 1]
    b1 = b[pos]
    b2 = b[pos + 1]
    medmin = a1 + a2
    medmax = b1 + b2
    print(medmax - medmin + 1)
# Judge status: Wrong Answer
N = int(input())
X = list(map(int, input().split()))
min_X = min(X)
max_X = max(X)
ans = float("inf")
for p in range(min_X, max_X):
    tmp = 0
    for x in X:
        tmp += (x - p) ** 2
    ans = min(ans, tmp)
print(ans)
# Judge status: Wrong Answer
N = int(input())
s = list(input())
res = []
cnt = 0
for i in range(N):
    if s[i] == 'I':
        cnt += 1
    elif s[i] == 'D':
        cnt -= 1
    res.append(cnt)
print(max(res))
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
lo=0
cnt=0
maxi=0
while lo<n-1:
    if a[lo]>=a[lo+1]:
        cnt+=1
        lo+=1
    else:
        maxi=max(maxi,cnt)
        cnt=0
        lo+=1
    if lo==n-1:
        maxi=max(maxi,cnt)
print(maxi)
# Judge status: Accepted
a, b = map(int, input().split())

if a*b%2 == 1:
    print("Odd")
else :
    print("Even")
# Judge status: Wrong Answer
from collections import deque
que=deque([i for i in range(1,10)])
k=int(input())
count=0
while count!=k:
  a=que.popleft()
  count+=1
  if a%10==9:
    que.extend([10*a+8,10*a+9])
  else:
    b=a*10+(a%10)-1
    que.extend([b,b+1,b+2])
print(a)
# Judge status: Wrong Answer
n=int(input())
x=list(map(int,input().split()))

a=sum(x)//n+1

m=999999999999
for i in range(x[0],x[n-1]):
    a=i
    s=0
    for i in range(n):
        s+=(x[i]-a)**2
    m=min(m,s)

print(m)
# Judge status: Wrong Answer
n,x,y = map(int, input().split())

k = [0]*(n+1)
for i in range(1,n):
    for j in range(i+1,n+1):
        length = min(j-i, abs(x-i)+abs(j-y)+1, abs(y-i)+abs(j-x)+1)
        k[length] = k[length]+1

for i in range(1,n+1):
    print(k[i])
# Judge status: Accepted
import sys
import socket

hostname = socket.gethostname()

if hostname == 'F451C':
    sys.stdin = open('a1.in')


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


def read_str_list():
    return input().split()


def read_int():
    return int(input())


def read_str():
    return input()


def main():
    a, b = read_int_list()
    if a > b:
      res = str(b) * a
    else:
      res = str(a) * b
    print(res)


main()
# Judge status: Accepted
n,k=map(int,input().split())
s=input()

rl=s.count('RL')
if s[0]=='L':
    start=1
else:
    start=0
if s[-1]=='R':
    end=1
else:
    end=0
a=rl-k
if a>=1:
    ans=a*2+start+end
elif a==0:
    ans=start+end
elif a<=-1:
    ans=1
print(n-ans)
# Judge status: Wrong Answer
N = int(input())
A = [0 for _ in range(N)]

for i in range(N):
    a, b = map(int, input().split())
    A[i] = b-a+1

A.sort()
if N%2 == 0:
    print((A[N//2-1]+A[N//2])//2+1)
else:
    print(A[N//2])
# Judge status: Accepted
#キャンディとＮ人の子供イージー
def ABC_43_A():
    N = int(input())

    sum=0

    for i in range(N+1):
        sum = sum + i

    print(sum)

if __name__ == '__main__':

    ABC_43_A()
# Judge status: Accepted
def main():
    n = int(input())
    a = list(map(int, input().split()))
    a.sort(reverse=True)
    ret = a[0]
    i = 2
    for _a in a[1:]:
        if i == n:
            break
        ret += _a
        i += 1
        if i == n:
            break
        ret += _a
        i += 1
    print(ret)




if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
N = int(input())
x = list(map(int, input().split(' ')))
y = list(map(int, input().split(' ')))


def down_count():
    count = x[0]
    for i in range(N):
        count += y[i]
    return count


def switch_count(count):
    for i in range(N - 1):
        switch_sum = count + x[i + 1] - y[i]
        if switch_sum > count:
            count = switch_sum
    return count

count = down_count()
switch_sum = switch_count(count)
print(switch_sum)
# Judge status: Wrong Answer
n = int(input())
C = input()

ans = 0
if C[0] == 'W':
    ans += 1

c = C[1::]

for i in range(len(c) - 1):
    if c[i] == 'W' and c[i + 1] == 'R':
        ans += 1

print(ans)
# Judge status: Accepted
A,B,C,K = list(map(int,input().split()))

if A>=K:
    print(K)
elif A+B>=K:
    print(A)
else:
    print(A - (K-A-B))
# Judge status: Wrong Answer
# D Alter Altar

n = int(input())
C = input()

num_R = C.count("R")

if len(C) == num_R or num_R == 0:
  print(0)
  exit()

space = 0
for c in C:
  if c == "W":
    space += 1
  elif c == "R":
    break

if num_R <= space:
  print(num_R)
else:
  print(num_R - 1)
# Judge status: Wrong Answer
#n = int(input())
#n,k = map(int,input().split())
#x = list(map(int,input().split()))

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

ans = 0
mm = 0
i = 0
while(i<N-2):
    if (A[i]-A[i+1])*(A[i+1]-A[i+2])<0:
        ans += 1
        i+=1
    i+=1
    
print(ans)
# Judge status: Accepted
x=int(input())
p=[100,101,102,103,104,105]
ans=[False]*2001
ans[0]=True
for i in range(2000):
    if ans[i]:
        for j in p:
            if i+j>2000:
                continue
            else:
                ans[i+j]=True
if x>2000:
    print(1)
elif ans[x]:
    print(1)
else:
    print(0)
# Judge status: Accepted
n = int(input())
total = 0
for i in range(n):
  d = list(map(int,input().split()))
  if d[0]==d[1]:
    if total != 0:
      total +=1
      if total ==3:
        print('Yes')
        break
    else:
      total = 1
  else:
    total = 0
if total !=3:
  print('No')
# Judge status: Accepted
n,k = map(int,input().split())
k -= 1
a = sorted([int(input()) for i in range(n)])
b = sorted([a[i+k]-a[i] for i in range(n-k)])
print(b[0])
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))

S = sum(A)

snk = 0
arigm = S

ans = 1e20

for i in range(N-1):
  snk += A[i]
  arigm -= A[i]
  #print(snk,arigm)
  ans = min(abs(snk-arigm),ans)
print(ans)
# Judge status: Accepted
n, k = map(int, input().split())
s = input()

print(s[:k-1] + s.lower()[k-1] + s[k:])
# Judge status: Accepted
s=input()
if s=="Sunny":
    print("Cloudy")
elif s=="Cloudy":
    print("Rainy")
else:
    print("Sunny")
# Judge status: Accepted
#--Red or Not

a = int(input())
s = input()

if (a >= 3200):
  print(s)
else:
  print("red")
# Judge status: Accepted
n,m=map(int,input().split())
X=list(map(int,input().split()))

if m==1 :
    print(0)
    exit()

X.sort()
D=[]
for i in range(1,m):
    D.append(X[i]-X[i-1])

D.sort(reverse=True)
d=0
if i>1:
    for i in range(min(n-1,m-1)):
        d += D[i]    

ans = sum(D)-d
print(ans)
# Judge status: Wrong Answer
A = input()

if A == "a"  or "e" or "i"or "o" or "u" : print("vowel")
else: print("consonant")
# Judge status: Accepted
N, M = map(int, input().split())
a_s = []
b_s = []
for i in range(M):
	a, b = map(int, input().split())
	a_s.append(a)
	b_s.append(b)

for i in range(1, N + 1):
	print(a_s.count(i) + b_s.count(i))
# Judge status: Accepted
N,K,S=list(map(int, input().split()))
L=[0]*N
L[:K]=[S]*K
if S==10**9:
  L[K:]=[1]*(N-K)
else:
  L[K:]=[10**9]*(N-K)
print(*L)
# Judge status: Accepted
C = input()

alp=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
i=0
while True:
    if alp[i]==C:
        print(alp[i+1])
        break
    else:
        i+=1
# Judge status: Accepted
# input
N = int(input())
A = list(map(int, input().split()))

# check
cnt = 0
while len([1 for a in A if a % 2 == 0]) == len(A):
    A = [a // 2 for a in A]
    cnt += 1

print(cnt)
# Judge status: Accepted
import collections
n = int(input())
aa = list(map(int, input().split()))
ca = collections.Counter(aa)
la = sorted([a for a in ca.items()], key = lambda x:x[0], reverse=True)

list1 = []
list2 = []

for a in la:
  if a[1] > 1:
    list1.append(a)
  if a[1] >3:
    list2.append(a)
    
if len(list1) > 1:    
    xr = list1[0][0] * list1[1][0]
else:
  xr = 0
    
if len(list2) > 0:
  xs = list2[0][0] * list2[0][0]
else:
  xs = 0
  
ans = max(xr, xs)

print(ans)
# Judge status: Accepted
N = int(input())
ans = float('inf')
for i in range(N//2):
  A = i+1
  B = N-A
  ans = min(ans, sum(list(map(int,str(A)))) + sum(list(map(int,str(B))) ))

print(ans)
# Judge status: Accepted
h,n=map(int, input().split()) 
ab=[list(map(int, input().split())) for _ in range(n)] 

INF = 10**18
dp = [INF]*(h+1)
#dp[i]: hpがiの相手に消費する魔力の最小値
dp[0]=0

for i in range(h):#i:累積ダメージi
    for j in range(n):#
        if i+ab[j][0]<=h: #
            dp[i+ab[j][0]]=min(dp[i+ab[j][0]],dp[i]+ab[j][1])
        else:
            dp[-1]=min(dp[-1],dp[i]+ab[j][1])
print(dp[-1])
# Judge status: Accepted
[A,B,C,D] = [int(s) for s in input().rstrip().split(' ')]
t = -(-A//D)
a = -(-C//B)
if t >= a:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
import math
from functools import reduce
N, X = map(int, input().split())
x = list(map(int, input().split()))
x.append(X)
x = [y - X for y in x]
print(reduce(math.gcd, x))
# Judge status: Accepted
N = int(input())
a = list(map(int, input().split()))

count=0
for i in range(N):
    if a[i] %2==1 and (i+1)%2==1:
        count+=1
print(count)
# Judge status: Accepted
if __name__ == '__main__':
    N = int(input())
    arr = [int(x) for x in input().split()]
    freq = {}
    for elem in arr:
        if elem not in freq:
            freq[elem] = 0
        freq[elem] += 1
    total = 0
    for elem, f in freq.items():
        total += (f * (f - 1)) / 2
    for elem in arr:
        print(int(total - freq[elem] + 1))
# Judge status: Accepted
a, b, x = map(int, input().split())

import math
if x <= ((a ** 2) * b) / 2:
    n = 2 * x / (a * b)
    ans = math.acos(n / (math.sqrt(b ** 2 + n ** 2)))
else:
    n = 2 * b - (2 * x / (a ** 2))
    ans = math.acos(a / math.sqrt(a ** 2 + n ** 2))

print(math.degrees(ans))
# Judge status: Accepted
s=input()
k=int(input())
ans=0
for i in range(k):
    if s[i]!="1":
        ans=int(s[i])
        break
    else:
        ans=1
print(ans)
# Judge status: Wrong Answer
def main():
    k = int(input())
    hp = list(range(1, 10))
    for i in range(k-1):
        n = hp.pop(0)
        if n % 10 != 0:
            hp.append(n * 10 + n - 1)
        hp.append(n * 10 + n)
        if n % 10 != 9:
            hp.append(n * 10 + n + 1)
    print(hp[0])
# Judge status: Accepted
N = int(input())
arrange = input().split()
split = True
count = 0

for i in range(N):
    arrange[i] = int(arrange[i])

while split:
    for i in range(N):
        if arrange[i] % 2 == 0:
            arrange[i] /= 2
        else:
            split = False
    count += 1

print(str(count - 1))
# Judge status: Accepted
a, b = map(int, input().split())
if a < 0 and b < 0:
    if (max(a, b) - min(a, b) + 1) % 2:
        print('Negative')
    else:
        print('Positive')
else:
    if a * b <= 0:
        print("Zero")
    else:
        print('Positive')
# Judge status: Accepted
H, N = map(int, input().split())
A = list(map(int, input().split()))
 
S = sum(A)
if S >= H: print('Yes')
else: print('No')
# Judge status: Wrong Answer
n=int(input())
s=[]
for i in range(n):
    s.append(int(input()))
p=sum(s)
i=0
while p%10==0:
    p=p-min(s)
    i+=1
    if i==n:
        p=0
        break

print(p)
# Judge status: Wrong Answer
s=input()
t=input()
if len(s) > 10 or len(t) == len(s) + 1:
  if t[:-1] == s:
    print("Yes")
else:
  print("No")
# Judge status: Accepted
N = int(input())

if N==0:
  print("1")
else:
  print("0")
# Judge status: Accepted
A,B,C = map(int, input().split())
cnt = 0
if A%2 or B%2 or C%2:
    print(cnt)
    exit()
if A == B and B == C:
    print(-1)
    exit()
while True:
    if A%2 or B%2 or C%2:
        print(cnt)
        break
    temp_a = A//2
    temp_b = B//2
    temp_c = C//2
    A += 2*temp_a + temp_b + temp_c
    B += 2*temp_b + temp_a + temp_c
    C += 2*temp_c + temp_a + temp_b
    cnt += 1
# Judge status: Accepted
N, K, Q = map(int, input().split())

point = [K-Q]*N

for i in range(Q):
    A = int(input()) - 1
    point[A] += 1

for j in range(N):
    if point[j] > 0:
        print('Yes')
    else:
        print('No')
# Judge status: Accepted
#!/usr/bin/env python3

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

ans = 0 
if n>=3 and m>=3:
    ans = n*m - ((n+m)*2-4)

elif n == 2 or m == 2:
    ans = 0 
elif n == 1 and m == 1:
    ans = 1 
else:
    ans = max(n, m)-2

print(ans)
# Judge status: Wrong Answer

N = int(input())
S = []
count = 1
for i in range(N):
    S.append(input())

for i in range(N-1):
    if S[i] != S[i+1]:
        count+=1
print(count)
# Judge status: Wrong Answer
from functools import reduce
from fractions import gcd

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

ans = 1
for i in range(N):
    B = A[:i] + A[i+1:]
    ans = max(ans, reduce(gcd, B))
    print(B)

print(ans)
# Judge status: Accepted
N, A, B = map(int, input().split())
ans = 0
for i in range(1, N+1):
    i = str(i)
    val = 0
    for j in range(len(i)): val += int(i[j])
    if A <= val <= B: ans += int(i)
print(ans)
# Judge status: Accepted
n = int(input())
if n == 0:
  print(2)
elif n == 1:
  print(1)
else:
  a = 2
  b = 1
  for i in range(2, n + 1):
    c = b
    b += a
    a = c
  print(b)
# Judge status: Wrong Answer
s, w = map(int, input().split())

if s//2 >= w:
  print('safe')
else:
  print('unsafe')
# Judge status: Wrong Answer
N=int(input())
A=list(map(int, input().split()))

A.sort()
A.pop(0)

print(sum(A))
# Judge status: Accepted
n,m = map(int, input().split())

l = int(str(n)+str(m))

for i in range(317):
    if i**2 == l:
        print("Yes")
        exit()

print("No")
# Judge status: Accepted
S = input()
Flag = False
if (S[0]=='A') and S[2:len(S)-1].count('C')==1:
    ReS = S.replace('C','')[1:]
    if ReS.islower():
        Flag = True
if Flag:
    print('AC')
else:
    print('WA')