peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
def solve():
    N = int(input())
    A = list(map(int, input().split()))
    A.sort()
    ans = A[0]
    for i in range(1, N):
        ans = (ans + A[i])/2

    return ans

print(solve())
# Judge status: Wrong Answer
a,b,c = map(int,input().split())

if a > b and a > c :
    s = str(a)+str(b)
    total = int(s)+c
    print(total)

elif b > a and b > c:
    s = str(b)+str(a)
    total = int(s)+c
    print(total) 

elif c > a and c > b:
    s = str(c)+str(a)
    total = int(s)+b
    print(total)
# Judge status: Wrong Answer
q, h, s, d = map(int, input().split())
n = int(input())
ql = 4*q
hl = 2*h
dl = d/2
if n%2==0:
    print(n*(min(ql, hl, s, dl)))
else:
    print((n-1)*(min(ql, hl, s, dl))+min(ql, hl, s))
# Judge status: Accepted
n = int(input())
L = list(int(input()) for _ in range(n))
SL = sorted(L)
first_max = SL[-1]
second_max = SL[-2]
for l in L:
  if (l == first_max):
    print(second_max)
  else:
    print(first_max)
# Judge status: Wrong Answer
w,h,n=map(int,input().split())
wx=[0]*w
hy=[0]*h
for i in range(n):
  x,y,a=map(int,input().split())
  x-=1
  y-=1
  if a==1:
    for j in range(x):
      wx[j]=1
  if a==2:
    for j in range(x,w):
      wx[j]=1
  if a==3:
    for j in range(y):
      hy[j]=1
  if a==4:
    for j in range(y,h):
      hy[j]=1
print(wx.count(0)*hy.count(0))
# Judge status: Accepted
l,r=map(int,input().split())
M=2019;s=range(l,r+1)
print(0 if r//M-l//M>0 else min(i*j%M for i in s for j in s if i<j))
# Judge status: Wrong Answer
x=list(map(int, input().split()))
if x[2]+x[1]+x[0]>21:
	print('bust')
elif x[2]+x[1]+x[0]==21:
	print('win')
# Judge status: Wrong Answer
import numpy as np
import itertools
N=int(input())
L=[list(map(int,input().split())) for _ in range(N)]
L=np.array(L)

for p in itertools.permutations(L):

    path_length = 0
    for (x1,y1), (x2,y2) in zip(p, p[1:]):
        path_length += ((x1 - x2) ** 2 + (y1 - y2) ** 2) ** .5
print(path_length)
# Judge status: Accepted
from fractions import gcd
N = int(input())
A = list(map(int, input().split()))
MOD = 10**9+7
def lcm (x,y):
  return x*y//gcd(x,y)
 
p = A[0]
for a in A[1:]:
  p = lcm(p, a)
 
ans = 0
for a in A:
  ans += p//a
print(ans % MOD)
# Judge status: Wrong Answer
P,Q,R = map(int,input().split())
a = P+Q
b = Q+R
c = P+R
if a<=b<=c or a<=c<=b:
    print(a)
elif b<=a<=c or b<=a<=c:
    print(b)
else:
    print(c)
# Judge status: Accepted
N = int(input())
a = list(map(int,input().split()))

flag = True
for a_i in a:
    if a_i%2==0:
        if not (a_i%3==0 or a_i%5==0):
            flag=False

print("APPROVED" if flag else "DENIED")
# Judge status: Accepted
check=[99, 111, 222, 333, 444, 555, 666, 777, 888, 999]

n=int(input())

if n in check:
    print(n)
else:
    for i in range(20):
        if check[i]<n<check[i+1]:
            print(check[i+1])
            exit()
# Judge status: Accepted
a,b,k=map(int, input().split())
wk=a-k
if wk>=0:
  print(str(wk)+" "+str(b))
else:
  wk=b+wk
  if wk>=0:
    print(str(0)+" "+str(wk))
  else:
    print(str(0)+" "+str(0))
# Judge status: Wrong Answer
N = int(input())
d = list(map(int, input().split()))

D = sorted(d)

cn = 0
for i in range(10**5):
    if i >= D[N//2 - 1] and i <= D[N//2]:
        cn = cn + 1

    
print(cn - 1)
# Judge status: Accepted
from string import ascii_lowercase
s = input()
print(ascii_lowercase[ascii_lowercase.index(s)+1])
# Judge status: Accepted
n = int(input())

a = n // 4
b = n // 7

print("Yes" if any([(n - 4*i) % 7 == 0 for i in range(a+1)] + [(n - 7*i) % 4 == 0 for i in range(b+1)]) else "No")
# Judge status: Wrong Answer
# -*- coding: utf-8 -*-
MOD=1000000007
x = int(input())
n1 = (10**x)%MOD
n2 = 2*9**x%MOD
n3 = 8**x%MOD
print(n1, n2, n3)
n = n1-n2+n3
print(int(n))
# Judge status: Wrong Answer
K = int(input())
counter = [1,2,3,4,5,6,7,8,9,10]
while len(counter) < K:
  n = str(counter[-1]+1)
  if int(n[-1]) in [int(n[-2])-1,int(n[-2]),int(n[-2])+1]:
    counter.append(int(n))
print(counter[-1])
# Judge status: Wrong Answer
x,y,z=map(int,input().split())
temp=y
result=1
while temp<=x-y-z:
  temp=temp+y+z
  result=result+1
print(result)
# Judge status: Wrong Answer
import math
n = int(input())
found = False
for y in range(n):
    if n == math.floor(y*1.08):
        print(y)
        found = True
        break
if (found == False):
    print(":(")
# Judge status: Accepted
import sys
n=int(input())
for i in range(1,10):
    if n%i==0 and 1<=n//i<=9:
        print("Yes")
        sys.exit()
print("No")
# Judge status: Accepted
import collections

N = int(input())
A = list(map(int, input().split()))
Q = int(input())
B = []
C = []
for i in range(Q):
    Bi, Ci = map(int, input().split())
    B.append(Bi)
    C.append(Ci)

counter = collections.Counter(A)
s = sum(A)

for i in range(Q):
    if B[i] not in counter:
        print(s)
        continue
    s += counter[B[i]] * (C[i] - B[i])
    counter[C[i]] += counter[B[i]]
    del counter[B[i]]
    print(s)
# Judge status: Accepted
s = input()
s = s.replace("eraser", "X")
s = s.replace("erase", "X")
s = s.replace("dreamer", "X")
s = s.replace("dream", "X")
 
count = s.count("X")
if len(s) == count:
    print("YES")
else:
    print("NO")
# Judge status: Wrong Answer
l = []
for _ in range(int(input())):
    x, y = map(int, input().split())
    l.append(x+y)
l.sort()
print(l[-1]-l[0])
# Judge status: Wrong Answer
H = int(input())
i = 2
count = 0
while True:
    if H > 1:
        H = H // i
        count += 2 ** (i - 1)
        i += 1
    else:
        break
print(count + 1)
# Judge status: Accepted


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

tower = [1]*999
for i in range(1,999):
  tower[i] = tower[i-1]+i+1

print(tower[b - a - 1] - b)
# Judge status: Accepted
I=[]
for i in range(5):
    I.append(int(input()))
k=int(input())
if I[4]-I[0]<=k:
    print("Yay!")
else:
    print(":(")
# Judge status: Accepted
s, w=map(int, input().split())

if s>w:
    print('safe')

elif s<=w:
    print('unsafe')
# Judge status: Accepted
n,k = map(int, input().split())
a = n
cnt = 1
while a>=k:
    a = a//k
    cnt += 1

print(cnt)
# Judge status: Accepted
n = int(input())
A = ['a']
S = 'abcdefghij'
for _ in range(n-1):
    A = [ a + s for a in A for s in S[:len(set(a)) + 1]]
print('\n'.join(A))
# Judge status: Accepted
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

n, m = map(int, read().split())
if n * 2 < m:
    print(n + (m - n * 2) // 4)
else:
    print(m // 2)
# Judge status: Accepted
import networkx as nx
n,m=map(int,input().split())
s=[list(map(int,input().split())) for i in range(m)]

g=nx.Graph()
g.add_edges_from(s)
di=nx.predecessor(g,source=1)

print("Yes")
for x in range(2,n+1):
      print(di[x][0])
# Judge status: Wrong Answer
N = int(input())

ans = 0

if((N % 2) == 0):
    ans = N/2
    print(float(ans))
elif(N == 1):
    ans = 1
    print(float(ans))
else:
    ans = (N+1)/N*0.5
    print(float(ans))
# Judge status: Wrong Answer
def ll():
    return list(map(int,input().split()))
s = ll()
if 2*s[0]-1>s[0]+s[1]:
    print(2*s[0]-1)
else:print(s[0]+s[1])
# Judge status: Wrong Answer
n=int(input())
ans=n
for i in range(2,n):
  if n%i:continue
  j=n//i
  if j<i:break
  ans=j+i-2
print(ans)
# Judge status: Accepted
s = input()

flag = 0
slen = len(s)

if s == s[::-1]:
  flag += 1
  
s1 = s[::(slen-1)//2]
if s1 == s1[::-1]:
  flag += 1
  
s2 = s[(slen+3)//2-1:]
if s2 == s2[::-1]:
  flag += 1

if flag > 2:
  print('Yes')
else:
  print('No')
# Judge status: Wrong Answer
n, m = map(int, input().split())
x = list(map(int, input().split()))
x.sort()

ans = [x[i+1] - x[i] for i in range(m-1)]
ans.sort()

print(sum([ans[i] for i in range(m-3)]))
# Judge status: Accepted
n,d = map(int,input().split())
p = [[int(i) for i in input().split()] for y in range(n)]

def how_far(a,b):
  x = 0
  for s in range(0,d):
    x += (a[s] - b[s]) ** 2
  x = x ** (1/2)
  return x
count = 0
for i in range(n-1):
  for j in range(i+1,n):
    kyori = how_far(p[i],p[j])
    true_kyori = int(kyori)
    if kyori == true_kyori:
      count += 1
      
print(count)
# Judge status: Accepted

s = set(input())
a = set(["a","b","c"])

print("Yes" if s == a else "No")
# Judge status: Accepted
a = list(map(int, input().split()))
x = 0
y = 0
for i in range(0,a[1]):
    x = x + a[0]*(10**i)
for i in range(0,a[0]):
    y = y + a[1]*(10**i)
if x<=y:
    print(y)
else:
    print(x)
# Judge status: Accepted
A = int(input())
B = int(input())
C = int(input())
X = int(input())
 
cnt = 0
 
for a in range(0,A+1):
  for b in range(0,B+1):
    for c in range(0,C+1):
      if a*500+b*100+c*50 == X:
        cnt +=1
 
print(cnt)
# Judge status: Accepted
def main():
	h,m,h2,m2,k = map(int,input().split())
	
	mins = (h2-h)*60 + (m2-m)

	print(mins-k)


if __name__ == '__main__':
	main()
# Judge status: Wrong Answer
a, b = map(int, input().split())
if (a + b) % 2 == 0 :
  print ((a + b) / 2)
else :
  print ("IMPOSSIBLE")
# Judge status: Accepted
a,b,c,x,y = map(int,input().split())
# print(a,b,c,x,y)

#Cについての全列挙する
v1 = max(x*2,y*2)*c
v2 = a*x+b*y
v3=120000*100000
for i in range(max(x,y)+1):
    c_sum = c*2*(i)
    if x > i:
        c_sum += a*(x-i)
    if y > i:
        c_sum += b*(y-i)
    if c_sum < v3:
        v3 = c_sum
    # print(c_sum)

 # print(v1,v2,v3)
print(min(v1,v2,v3))
# Judge status: Wrong Answer
a, b = map(int, input().split())
c = 0
for i in range(a, b+1):
  s = str(i)
  print(s[:len(s)//2], s[len(s)//2+1:])
  if s[:len(s)//2] == s[len(s)//2+1:]:
    c += 1
print(c)
# Judge status: Wrong Answer
from sys import stdin


n, *s = (x.rstrip() for x in stdin.readlines())

ac = s.count('AC')
wa = s.count('WA')
tle = s.count('TLE')
re = s.count('RE')

print(f'AC × {ac}')
print(f'WA × {wa}')
print(f'TLE × {tle}')
print(f'RE × {re}')
# Judge status: Accepted
import sys, math
from functools import lru_cache
sys.setrecursionlimit(10**9)
MOD = 10**9+7

def input():
    return sys.stdin.readline()[:-1]

def mi():
    return map(int, input().split())

def ii():
    return int(input())

def i2(n):
    tmp = [list(mi()) for i in range(n)]
    return [list(i) for i in zip(*tmp)]

def main():
    N = ii()
    A = list(mi())

    s = 0
    t = 0
    for i in range(N):
        s += A[i]*A[i]
        t += A[i]

    print(((t*t-s)//2)%MOD)

if __name__ == '__main__':
    main()
# Judge status: Accepted
d = { 'a':input(), 'b':input(), 'c':input() }
pointer = 'a'
while True:
    if 0 < len(d[pointer]):
        tmp = d[pointer][0]
        d[pointer] = d[pointer][1:]
        pointer = tmp
    else:
        print(pointer.upper())
        break
# Judge status: Accepted
a,b,k=map(int,input().split())
ans=[]
num_min=a+k
num_max=b-k+1
if (b-a+1)>2*k:
    for i in range(a,num_min):
        ans.append(i)
    for i in range(num_max,b+1):
        ans.append(i)
else:
    for i in range(a,b+1):
        ans.append(i)
ans=sorted(set(ans))
for i in ans:
    print(i)
# Judge status: Accepted
x = int(input())
xd = x//100
if xd*100 <= x <= xd*105:
  print(1)
else:
  print(0)
# Judge status: Wrong Answer
n, m = map(int, input().split())

if abs(n-m)>1:
    ans = 0
else:
    if m > n:
        n, m = m, n

    total_n = 1
    for i in range(1,n+1):
        total_n *= i
        if total_n >= 1000000007:
            total_n = total_n % 1000000007

    if n != m:
        total_m = total_n / n
        ans = (total_m * total_n) % 1000000007
    else:
        ans = (total_n * total_n * 2) % 1000000007

print(int(ans))
# Judge status: Accepted
N = int(input())
strl = [input()]
for i in range(N-1):
  s = input()
  if s in strl or s[0] != strl[i][-1]:
    print("No")
    exit()
  else:
    strl.append(s)
print("Yes")
# Judge status: Accepted
#ABC117-C
n,m = map(int,input().split())
x = list(map(int,input().split()))
x.sort()
sabun = []
for i in range(1,m):
    sabun.append(x[i]-x[i-1])
sabun.sort(reverse=True)

print(sum(sabun[n-1:]))
# Judge status: Accepted
n = int(input())
a = [int(input()) for i in range(n)]
ans = 0
flag = 0
for i in range(n):
    if flag and a[i] >= 1:
        ans += 1
        a[i] -= 1
    flag = a[i] % 2
    ans += a[i] // 2
print(ans)
# Judge status: Accepted
n, k = map(int, input().split())
if n==0 or k==1:
    print(0)
    exit()
elif n<k:
    print(min(n, abs(n-k)))
    exit()
elif n % k == 0:
    print(0)
    exit()
else:
    mx = n%k
print(min(abs(mx-k), mx))
# Judge status: Accepted
s = input()

for i in range(2**3):
    op = ["+"]*3
    op.append("")
    fomula = ""
    for j in range(3):
        if(i >> j & 1):
            op[j] = "-"
    for k in range(4):
        fomula += s[k] + op[k]
    if eval(fomula) == 7:
        print(fomula + "=7")
        break
# Judge status: Accepted
from collections import deque
s=input()
stack = deque()
count=0
for i in s:
  if not stack:
    stack.append(i)
  elif stack[-1]!=i:
    stack.pop()
    count+=2
  else:
    stack.append(i)
print(count)
# Judge status: Wrong Answer
n=int(input())
a=list(map(int,input().split()))

c=0

for i in range(0,n):
  if i%2 == 1 and a[i]%2 == 1:
    c+=1
print(c)
# Judge status: Accepted
#template
def inputlist(): return [int(k) for k in input().split()]
#template
N = int(input())
A = inputlist()
from fractions import gcd
L = [0]*N
R = [0]*N
for i in range(1,N):
    L[i] = gcd(L[i-1],A[i-1])
for i in range(1,N):
    j = (N-1)-i
    R[j] = gcd(R[j+1],A[j+1])
ans = 0
for i in range(N):
    k = gcd(L[i],R[i])
    ans = max(k,ans)
print(ans)
# Judge status: Accepted
h=int(input())
w=int(input())
n=int(input())

a=max(h,w)

print( (n+a-1)//a )
# Judge status: Wrong Answer
def main():
    days = {'SUN':0,'MON':6,'TUE':5,'WED':4,'THU':3,'FRI':2,'SAT':1}
    S = input()
    print(days[S])
    return 0
    
if __name__ == '__main__':
    main()
# Judge status: Accepted
n,k=map(int,input().split())
a=[0]+list(map(int,input().split()))
already=[0]*(n+1)
already[1]=1
history=[1]
tmp=1
now=0
jump=1
while jump:
  now+=1
  tmp=a[tmp]
  history.append(tmp)
  if now==k:
    ans=tmp
    break
  elif already[tmp]==1:
    jump=0
    past=history.index(tmp)
    loop=now-past
    ans=history[past+(k-now)%loop]
    break
  else:
    already[tmp]=1

print(ans)
# Judge status: Accepted
X = int(input())
ans = 1

for a in range(2, X+1):
    p = 2
    
    while a**p<=X:
        ans = max(ans, a**p)
        p += 1

print(ans)
# Judge status: Accepted
H = int(input())

ans = 0
cnt = 1
while H != 0:
    ans += cnt
    H //= 2
    cnt *= 2

print(ans)
# Judge status: Wrong Answer
from collections import defaultdict

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

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

flag = True

num = {}

for s, c in sc:
    if s == 1 and c == 0:
        flag = False
        break
    elif num.get(s) == None:
        num[s] = c
    else:
        if num.get(s) != c:
            flag = False
            break

a = -1

if flag:
    a = 0
    for k, v in num.items():
        a += v * (10**(n-k))

print(a)
# Judge status: Accepted
s = input()
ans = 753
for i in range(len(s)-2):
    ans = min(ans, abs(int(s[i:i+3])-753))
print(ans)
# Judge status: Accepted
n = int(input())
r = 100
s = [0] * (r+1)
w = 0
for i in range(r+1):
    mod = 2 ** (i+1)
    if n % mod == w % mod:
        s[i] = 0
    else:
        s[i] = 1
    w += s[i] * (-2)**i
    if w == n:
        break

print(int("".join(map(str, reversed(s)))))
# Judge status: Wrong Answer
N, M = list(map(int, input().split()))

skip = 0
remain = set(range(N))

#print(remain)

for i in range(1, M + 1 + skip):
  lo = i
  hi = N + 1 - i
  short = hi - lo - 1
  long = N + lo - hi - 1
  #print(lo, hi, short, long)
  if {short, long} <= remain:
    print(f'{lo} {hi}')
    remain -= {short, long}
  else:
    skip += 1
# Judge status: Accepted
n = int(input())
w = [input() for _ in range(n)]
words_hist = set([])

last_letter = w[0][0]
for word in w:
    if word in words_hist:
        print('No')
        exit()
    if not word.startswith(last_letter):
        print('No')
        exit()
    
    words_hist.add(word)
    last_letter = word[-1]

print('Yes')
# Judge status: Accepted
a,b=sorted(map(int,input().split()))
mod=10**9+7
ans=1
if a==b:
    for i in range(1,a+1):
            ans=ans*i*i%mod
    ans=ans*2%mod        
elif b-a>1:ans=0
else:
    for i in range(1,a+1):
        ans=ans*i*i%mod
    ans=ans*b%mod
print(ans)
# Judge status: Accepted
N = int(input())

ans = 0
for i in range(1,N+1):
    ans += i * (N//i) * (N//i+1) // 2

print(ans)
# Judge status: Wrong Answer
x, k, d = map(int, input().split())
wantk = x // d
if wantk > k:
    print(abs(x - k * d))
    exit()
x -= wantk * d
k -= wantk
if k % 2 == 0:
    print(abs(x))
else:
    print(abs(x - d))
# Judge status: Accepted
X, Y, Z = map(int, input().split())
X, Y = Y, X
X, Z = Z, X

print(X, Y, Z)
# Judge status: Accepted
n = int(input()); a = list(map(int, input().split())); b = -1; x = 1
for i in range(n-1):
    if b == 0:
        if a[i] > a[i+1]: b = -1; x += 1
    elif b == 1:
        if a[i] < a[i+1]: b = -1; x += 1
    else:
        if a[i] < a[i+1]: b = 0
        elif a[i] > a[i+1]: b = 1
print(x)
# Judge status: Accepted
N, K = map(int,input().split())
num = list(map(int, input().split())) 
p = list(map(lambda x: (x+1)/2, num))
    
ans = sum(p[0:K])
temp = ans
for i in range(N-K):
    temp = temp-p[i]+p[i+K]
    ans = max(ans, temp)
print(ans)
# Judge status: Accepted
x = int(input())
def judge(x):
    for i in range(1,1000):
        bottom = i*100
        top = i*105
        if bottom <=  x <= top:
            return 1
    return  0

print(judge(x))
# Judge status: Accepted
n = int(input())
p = [int(i) - 1 for i in input().split()]
cnt_swap = 0
for i in range(n - 1):
    if p[i] == i:
        p[i], p[i + 1] = p[i + 1], p[i]
        cnt_swap += 1
print(cnt_swap if p[n - 1] != n - 1 else cnt_swap + 1)
# Judge status: Wrong Answer
import sys

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

if A == B and B == C:
    print('-1')
    sys.exit()

count = 0
while True:
    a = B//2 + C//2
    b = C//2 + A//2
    c = A//2 + B//2
    count += 1
    if a == b and b == c:
        print('-1')
        sys.exit()
    if a % 2 == 1 or b % 2 == 1 or c % 2 == 1:
        break
    A = a
    B = b
    C = c

print(count)
# Judge status: Wrong Answer
n=str(input())
r=''
count=0
for i in n:
    if i==r:
        count+=1
    r=i
if count>=2:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
S = input()
N = len(S)
flag = True
for i in range(0,N//2):
    if S[i] != S[N//2 - i-1]:
        flag = False
    if S[i+N//2+1] != S[N-i-1]:
        flag = False
for i in range(N):
    if S[i] != S[N-1-i]:
        flag = False
print("Yes" if flag else "No")
# Judge status: Accepted
# ABC079 B - Lucas Number

n = int(input())
a=[2,1]
a_tes = 0

for i in range(2,n+1):
    a_tes = a[i-1] + a[i-2]
    a.append(a_tes)
print(a[n])
# Judge status: Accepted
import math
n, d = map(int, input().split())
p = [tuple(map(int, input().split())) for _ in range(n)]

ans = 0
for x, y in p:
    if math.sqrt(x**2+y**2) <= d:
        ans += 1
print(ans)
# Judge status: Wrong Answer
A=sorted(list(map(int,input().split())))
print(A[-1]*2*int(input())+A[0]+A[1])
# Judge status: Wrong Answer
import math

n, h = map(int, input().split(" "))
abL = [list(map(int, input().split(" "))) for _ in range(n)]

aL = []
bL = []
for a, b in abL:
    aL.append(a)
    bL.append(b)
aL = sorted(aL)
bL = sorted(bL)

aMax = max(aL)
ans = 0
while h != 0:
    if h <= 0:
        break
    if len(bL) == 0 or bL[-1] < aMax:
        ans += h // aMax
        break
    ans += 1
    h -= bL.pop()

print(ans)
# Judge status: Wrong Answer
def calculate(n,m,arr):

    if n >= m:
        print(0)
        return

    arr.sort()
    drr = list([])
    for index in range(1,len(arr)):
        drr.append(arr[index] - arr[index-1])
    drr.sort()
    drr = drr[:(m-1-n-1)]
    print(sum(drr))



S = input().split(" ")
n = int(S[0])
m = int(S[1])

S = input().split(" ")

arr = list([int(s) for s in S])


calculate(n,m,arr)
# Judge status: Wrong Answer
A, B, C = map(int, input().split())
D = max(max(A, B), C)
print((D*3-A-B-C)//2)
# Judge status: Wrong Answer
n,m=map(int,input().split())
p=tuple(tuple(map(int,input().split())) for _ in range (m))
s=set()
t=set()
for i in range(m):
    if 1 in p[i]:
        s.add(p[i][0])
        s.add(p[i][1])
    if n in p[i]:
        t.add(p[i][0])
        t.add(p[i][1])
res=s&t
if res:
    print("POSSIBLE")
else:
    print("INPOSSIBLE")
# Judge status: Wrong Answer
s = input()
weather = ['Sunny', 'Cloudy', 'Rainy']
i = weather.index(s)
if i == 0 | 1:
    print(weather[i + 1])
else:
    print(weather[0])
# Judge status: Wrong Answer
l, r, d = map(int, input().split())
count = 0

for i in range(1, 100):
    temp = i * d
    if l <= temp and temp <= r:
        count += 1
    elif temp > r:
        break

print(count)
# Judge status: Accepted
expected = {}

n, k = [int(i) for i in input().split(" ")]
p = [int(i) for i in input().split(" ")]

max_sum = 0
for i in range(k):
  max_sum += p[i]
  
last_sum = max_sum
max_init_index = 0

for i in range(1, n - k + 1):
  current_sum = last_sum - p[i - 1] + p[i + k - 1]
  if max_sum < current_sum:
    max_sum = current_sum
    max_init_index = i
  last_sum = current_sum

for i in range(1, 1001):
  expected[i] = 1 + (i - 1)/2

ans = 0
for i in range(max_init_index, max_init_index + k):
  ans += expected[p[i]]

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

for _ in range(K):
    if A>=B: B*=2
    else: C*=2

print('Yes' if A<B and B<C else 'No')
# Judge status: Accepted
n, k = map(int, input().split())
A = list(map(int, input().split()))

seen = {1: 0}
a = 1

for i in range(1, n+1):
  if seen.setdefault(a:=A[a-1], i) != i:
    break

p = seen[a]
q = i - seen[a]

if k >= p+q:
  k = (k - p) % q + p

a = 1
for i in range(k):
  a = A[a-1]

print(a)
# Judge status: Wrong Answer
contest_num = int(input())

if contest_num >= 1999: # 不等号は=の手前に
    result_str = 'The contest has not been held'

elif contest_num < 1000:
    result_str = 'abc'

elif contest_num >= 1000:
    result_str = 'abd'

print(result_str)
# Judge status: Accepted
n,k = list(map(int, input().split()))

print(min(n % k, -n % k))
# Judge status: Wrong Answer
S = list(str(input()))
if S[0] == "1":
    for i, j in enumerate(S):
        if i % 2 == 0 and j == "0":
            S[i] = "1"
        elif i % 2 == 1 and j == "1":
            S[i] = "0"
else:
    for i, j in enumerate(S):
        if i % 2 == 0 and j == "1":
            S[i] = "0"
        elif i % 2 == 1 and j == "0":
            S[i] = "1"
print(S)
# Judge status: Accepted
X, Y = map(int, input().split())
print(int(X + Y/2))
# Judge status: Accepted
N = int(input())
A = sorted(list(map(int, input().split())), reverse=True)
ans = sum(A[:2 * N][1::2])
print(ans)
# Judge status: Accepted
P, Q, R = map(int, input().split())
min = P + Q
if P + R < min:
  min = P + R
if Q + R < min:
  min = Q + R
print(min)
# Judge status: Accepted
a,b = map(int,input().split())
ans = 0
for i in range(10**18+1):
  if a*(2**i) <= b:
    ans += 1
  else:
    break
print(ans)
# Judge status: Accepted
N, A, B = map(int, input().split())

ans = -1
if abs(A - B) % 2 == 1:
  ans = min(A-1, N-B) + 1 + (B-A-1)//2
else:
  ans = abs(A - B) // 2

print(ans)
# Judge status: Accepted
n = int(input())
ans = 0
for i in range(1, n+1):
    m = n//i
    ans += i * m * (m+1) // 2
#m = n//2+1
#ans += n * (n+1) // 2 - m * (m+1) // 2
print(ans)
# Judge status: Accepted
#!/usr/bin/env python3

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

s = A[0]

for a in A[1:]:
    s ^= a

ret = []

for a in A:
    ret.append(s^a)

print(' '.join(map(str, ret)))
# Judge status: Accepted
N = int(input())
A = sorted(list(map(int, input().split())))
Amax = max(A)

ans = [False] * (Amax + 1)
for x in A:
    for j in range(x, Amax + 1, x):
        ans[j] += 1

print(sum(ans[i] == 1 for i in A))
# Judge status: Wrong Answer
N, M = map(int, input().split())
l = [list(map(int, input().split())) for i in range(N)]
m = []
for i in range(1, l[0][0] + 1):
    m.append(l[0][i])
for i in range(1, N):
    for j in m:
        
        if l[i][1:l[i][0] + 1].count(j) == 0:
            m.remove(j)
            
print(len(m))
# Judge status: Accepted
n = int(input())
 
s = input()
 
alphabet = ["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"]
 
ans = ""
for i in range(len(s)):
    num = (alphabet.index(s[i]) + n) % len(alphabet)
    ans += alphabet[num]
    
print(ans)