peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
import itertools
import numpy as np
n = int(input())
p = tuple(map(int, input().split()))
q = tuple(map(int, input().split()))

num = np.arange(1, n+1)

zyun = list(itertools.permutations(list(num), n))

for i in range(0, len(zyun)):
    if zyun[i] == p:
        a = i+1
    if zyun[i] == q:
        b = i+1

print(abs(a-b))
# Judge status: Accepted
n = int(input())
arr = list(map(int, input().split()))
 
a = arr[0]
 
for i in range(1, n):
    a ^= arr[i]
 
ans = []
for i in range(n):
    ans.append(a ^ arr[i])
    
print(*ans)
# Judge status: Wrong Answer
n = int(input())
lis = list(map(int, input().split()))

lis = sorted(lis, reverse=True)

ans = 0
for i in range(n-1):
    ans += lis[i]

print(ans)
# Judge status: Wrong Answer
if sum(list(map(int,input().split())))>21:
    print("burst")
else:
    print("win")
# Judge status: Accepted
x = input()
y = input()
t = ''
for i in range(3):
  t = x[i] + t
if t == y:
  print('YES')
else:
  print('NO')
# Judge status: Wrong Answer
inp = int(input())-1
list = list(map(int,input().split()))
def xx(a):
    if a<0:
        return a*(-1)
    else:
        return a
def xxx(listing):
    cc=0
    for all in listing:
        cc=all+cc
    return cc
ans = xx(xxx(list[0:1]) - xxx(list[1:inp+1]))
for iterater in range(1,inp):
  iterater=iterater+1
  a = xx(xxx(list[0:iterater]) - xxx(list[iterater+1:inp]))
  if a <= ans:
    ans = a
print(ans)
# Judge status: Wrong Answer
N = int(input())
A = list(map(int, input().split()))
bottom = sum(A)

if A[0] >= 1:
  print(-1)
  exit()

ret = 1
children = 1

for i in range(N):
    children = children * 2 - A[i+1]
    if children <= 0 and i != N-1:
      ret = -1
      break
    
    bottom -= A[i+1]
    if children >= bottom:
      children = bottom
    ret += children + A[i+1]
    print(children)
    print(bottom)
print(ret)
# Judge status: Accepted
N=int(input())
P=list(input().split())
Q=list(input().split())
P=int(''.join(P))
Q=int(''.join(Q))
n=[i for i in range(1,N+1)]
A=[]
def dps(n,A,me):
    if len(n)==0:
        A.append(me)
        return
    else:
        for i in range(0, len(n)):
            t=n.pop(i)
            dps(n, A, me*10+t)
            n.insert(i, t)
dps(n,A,0)
print(abs(A.index(P)-A.index(Q)))
# Judge status: Accepted
n=int(input())
ab=[list(map(int, input().split())) for _ in range(n)]

cnt=0
for i in range(n):
    a=ab[n-i-1][0]
    b=ab[n-i-1][1]
    a+=cnt
    amari=a%b
    if amari!=0:
        cnt+=b-amari
print(cnt)
# Judge status: Accepted
n,k = map(int,input().split())
h = list(map(int,input().split()))
dp = [10**100]*n
dp[0] = 0
for i in range(1,n):
    for j in range(1,k+1):
        if i-j >= 0:
            dp[i] = min(dp[i-j]+abs(h[i]-h[i-j]),dp[i])
        else:
            break
print(dp[-1])
# Judge status: Wrong Answer
def mi(): return map(int,input().split())
def lmi(): return list(map(int,input().split()))
def ii(): return int(input())
def isp(): return input().split()

n=ii()
a=lmi()
ans=0
for i in range(60):
  x=0
  for j in range(n):

    if (a[j]>>i)&1:
      x+=1

  num=x*(n-x)*2**i
  ans+=num

print(ans)
# Judge status: Accepted
N=int(input())
a=list(map(int,input().split()))
a.sort(reverse=True)
sumA=0; sumB=0;
for i in range(N) :
  if i%2==0 :
    sumA+=a[i]
  else :
    sumB+=a[i]
print(sumA-sumB)
# Judge status: Wrong Answer
n, m = map(int, input().split())
aa = list(map(int, input().split()))
print(n - sum(aa))
# Judge status: Accepted
N, D = map(int, input().split())
X = [list(map(int, input().split())) for _ in range(N)]

import math
ans = 0
for i in range(N):
    X1 = X[i]
    for X2 in X[i+1:]:
        if math.sqrt(sum([(x1-x2)**2 for x1, x2 in zip(X1, X2)])).is_integer():
            ans += 1
print(ans)
# Judge status: Accepted

n = int(input())
sp = [[i for i in range(3)] for i in range(n)]



for _ in range(n):
    s,ps = map(str,input().split())
    p = ps
    sp[_][0] = _
    sp[_][1] = s
    sp[_][2] = p

sp.sort(key=lambda x:(x[1],-int(x[2])))

for _ in sp:
    print(_[0]+1)
# Judge status: Accepted
a,b=map(int,input().split())
print(0 if a<=5 else b//2 if 6<=a<=12 else b)
# Judge status: Accepted
N = int(input())
A = list(map(str, input().split()))

import collections as cl
c_A = cl.Counter(A)
sum_c_A=0
for i in c_A.keys():
	if c_A[i]>1:
		sum_c_A += c_A[i]*(c_A[i]-1)/2

for j in A:
	print(int(sum_c_A-c_A[j]+1))
# Judge status: Accepted
n,a,b = map(int, input().split())
mod = 10 ** 9 + 7

def power_func(a,n,p):
  bi=str(format(n,"b"))#2進表現に
  res=1
  for i in range(len(bi)):
    res=(res*res) %p
    if bi[i]=="1":
      res=(res*a) %p
  return res

ans = power_func(2, n, mod) - 1

comb = [1] * (b + 1)

for i in range(b):
    comb[i + 1] = comb[i] * (n - i) * pow(i + 1,mod - 2, mod) % mod

ans -= comb[a] + comb[b]
ans %= mod


print(ans)
# Judge status: Accepted
N, M, K = map(int, input().split())
A = [int(i) for i in input().split()]
B = [int(i) for i in input().split()]

a, b = [0], [0]
for i in range(N):
    a.append(a[i] + A[i])

for i in range(M):
    b.append(b[i] + B[i])

ans, j = 0, M
for i in range(len(a)):
    if a[i] > K:
        break
    while a[i] + b[j] > K:
        j -= 1
    ans = max(ans, i + j)

print(ans)
# Judge status: Accepted
N, K = map(int, input().split())
P = list(map(int, input().split()))
P.sort()

ans = 0

for i in range(K):
  ans += P[i]
  
print(ans)
# Judge status: Accepted
sx,sy,tx,ty = map(int,input().split())
x = tx-sx
y = ty-sy
print("U"*y+"R"*x+"D"*y+"L"*(x+1)+"U"*(y+1)+"R"*(x+1)+"D"+"R"+"D"*(y+1)+"L"*(x+1)+"U")
# Judge status: Accepted
n,m,x=map(int,input().split())
arr=[list(map(int,input().split())) for _ in range(n)]
ans=10**18
for i in range(2**n):
  flag=format(i,'b')
  flag='0'*(n-len(flag))+flag
  tmp=0
  check=[0]*(m)
  for j in range(n):
    if flag[j]=='0':
      continue
    tmp+=arr[j][0]
    for k in range(m):
      check[k]+=arr[j][k+1]
  for j in range(m):
    if check[j]<x:
      break
  else:
    ans=min(ans,tmp)
if ans==10**18:
  print(-1)
else:
  print(ans)
# Judge status: Wrong Answer
Sa = list(input())
Sb = list(input())
Sc = list(input())
def turn(S):
  if len(S) == 0:
      return S
  else:
    next_turn = S.pop(0)
    print(next_turn)
    if next_turn == 'a':
      turn(Sa)
    elif next_turn == 'b':
      turn(Sb)
    elif next_turn == 'c':
      turn(Sc)
if turn(Sa) == Sa:
    print('A')
elif turn(Sa) == Sb:
    print('B')
elif turn(Sa) == Sc:
    print('C')
# Judge status: Accepted
s = input()
t = input()
u = len(s)
res = 0
for i in range(u):
    if s[i]!=t[i]:
        res += 1
print(res)
# Judge status: Accepted
a,b=map(int, input().split())

dif=b-a
sum=0

for i in range(1,dif):
    sum+=i
    
print(sum-a)
# Judge status: Accepted
N=int(input())
k=d=0
while k<=N:
    k+=1
    d=k*(k+1)//2
    if d >= N: break
for i in range(1,k+1):
    if i==d-N: continue
    print(i)
# Judge status: Accepted
# AGC004a
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**6)
    a, b, c = map(int, input().split())

    if a % 2 == 0 or b % 2 == 0 or c % 2 == 0:
        print(0)
        exit(0)
    print(min(a*b, b*c, c*a))


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
a = list(map(str, input().split()))
print(a[1], a[0])
# Judge status: Accepted
a = int(input())
if a == 0:
  print("1")
elif a == 1:
  print("0")
# Judge status: Accepted
W,a,b=map(int,input().split())
print(max(0,b-a-W,a-b-W))
# Judge status: Accepted
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    a, b, n = list(map(int, readline().split()))

    x = min(b - 1, n)

    ans = int(a*x/b)

    print(ans)


if __name__ == '__main__':
    main()
# Judge status: Accepted
abc = [int(i) for i in input().split()]
abc.sort()
ab, bc = abc[2] - abc[1], abc[2] - abc[0]
cnt = 0
if ab % 2 == 0 and bc % 2 == 0:
    cnt += ab//2
    cnt += bc//2
elif ab % 2 != 0 and bc % 2 != 0:
    cnt += ab//2
    cnt += bc//2 + 1
else:
    cnt += ab//2
    cnt += bc//2 + 2
print(cnt)
# Judge status: Accepted
n, m = map(int, input().split())
l = [list(map(int, input().split())) for i in range(n)]
ll = sorted(l)
count = 0
total = 0
for i in range(n):
    if count < m:
        count += ll[i][1]
        total += ll[i][0]*ll[i][1]
    else:
        c = count-m
        total -= ll[i-1][0]*c
        print(total)
        exit()
    if i == n-1:
        d = m - count
        total += ll[i][0]*d
        print(total)
        exit()
# Judge status: Accepted
def gcd(a,b):
    if b==0:return a
    return gcd(b,a%b)

def Lcm(a,b):
    return (a*b)//gcd(a,b)

def dp():
    n=int(input())
    l=list(map(int,input().split()))
    lcm=l[0]
    for i in range(n):
        lcm=Lcm(lcm,l[i])
    ans=0
    mod=1000000007
    for i in range(n):
        ans+=lcm//l[i]
    print(ans%mod)

if __name__ == "__main__":
    dp()
# Judge status: Wrong Answer
def MinorChange():

    str1 = str(input())
    str2 = str(input())

    data = []

    for num in range(len(str1)):
        if str1[num] != str2[num]:
            data.append(str2[num])

    print(len(list(set(data))))

if __name__ == '__main__':
    MinorChange()
# Judge status: Accepted
import sys

input = sys.stdin.readline

S = input().rstrip()
n = len(S)
l = [0]*2019
d = 10

t = int(S[n-1])
l[t%2019] += 1

l[0] += 1

for i in range(n-2, -1, -1):
    t += int(S[i])*d%2019
    l[t%2019] += 1 
    d *= 10
    d %= 2019

ans = 0

for i in l:
    ans += i*(i-1)//2

print(ans)
# Judge status: Wrong Answer
N = int(input())

res = 0
for i in range(1,9):
    tmp = i * 111
    if tmp >= N:
        res = tmp
        break
print(res)
# Judge status: Accepted
import sys
input = sys.stdin.readline

x=int(input())

import math 
L=int(math.sqrt(x))

FACT=dict()

for i in range(2,L+2):
    while x%i==0:
        FACT[i]=FACT.get(i,0)+1
        x=x//i

if x!=1:
    FACT[x]=FACT.get(x,0)+1

ANS=0
for f in FACT.values():
    i=1
    while f:
        if f>=i:
            ANS+=1
            f-=i
            i+=1
        else:
            break
print(ANS)
# Judge status: Accepted
from collections import Counter
S = list(map(int, list(input())))
MOD = 2019

acc_mod = [0]
for i, s in enumerate(S[::-1]):
    acc_mod.append((acc_mod[-1] + s * pow(10, i, MOD)) % MOD)

ans = 0
for v in Counter(acc_mod).values():
    ans += v * (v - 1) // 2
print(ans)
# Judge status: Wrong Answer
n = int(input())
ing_total = 0
N = n

while N < 1:
    N /= 10
    ing_total += 1

total_count = 0

for i in range(1,ing_total+1,2):
    if ing_total % 2 == 0:
        total_count += 10**i - 10**(i-1)
    else:
        if i == ing_total:
            gap = n - (10**(i-1)-1)
            total_count += gap

        else:
            total_count += 10**i - 10**(i-1)

print(total_count)
# Judge status: Accepted
a, b, x = map(int, input().split())

if a+b >= x:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
#coding:utf-8
a,b,c = map(int,input().split())

if (a%2==0 or b%2==0 or c%2==0):
    print (0)
else:
    print (a*b*c//max(a,max(b,c)))
# Judge status: Accepted
S = list(input())
Answer = []

for s in S:
    if s == 'B' and Answer != []:
        del Answer[-1]
    elif s == 'B' and Answer == []:
        continue
    else:
        Answer.append(s)

print(*Answer, sep="")
# Judge status: Accepted
line = input().split()
n = int(line[0])
m = int(line[1])

# 偶数と偶数の方法の数
eeCount = n * (n - 1) / 2

# 奇数と奇数の方法の数
ooCount = m * (m - 1) / 2

print(int(eeCount + ooCount))
# Judge status: Accepted
s = input()

result = ""
for i in range(len(s)):
    if s[i] == "B":
        result = result[0:len(result) - 1]
    else:
        result = result + s[i]
print(result)
# Judge status: Accepted
S = input().split()
S = S[0]
S =  list(S)

if S[-1] == "s":
  S.append("es")
  print(''.join(S))
  
else:
  S.append("s")
  print(''.join(S))
# Judge status: Accepted
a = int(input())
s = str(input())
if (a >= 3200):
    print(s)
else:
    print("red")
# Judge status: Wrong Answer
#!/usr/bin/env python3

def main():
    n, y = map(int, input().split())

    for i in range(n):
        for j in range(n):
            if n - i - j >= 0 and 10000 * i + 5000 * j + 1000 * (n - i - j) == y:
                print(i, j, n - i - j)
                exit()
    else:
        print("-1 -1 -1")


if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
from collections import Counter
m1,m2=0,0
N=int(input())
A=Counter(list(map(int,input().split())))
key=sorted(A.keys(),reverse=True)
for i in key:
  if A[i]>1 and m1==0:
    m1=i
  elif m1!=0 and A[i]>1:
    print(m1*i)
    exit()
print(0)
# Judge status: Wrong Answer
S=str(input())
T=str(input())
flag=0
for i in range(len(S)):
    if S!=T:
        k=str(S[-1])
        S=S.strip(k)
        S=k+S
    else:
        flag=1
print('Yes' if flag==1 else 'No')
# Judge status: Accepted
import bisect, collections, copy, heapq, itertools, math, string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int, sys.stdin.readline().rstrip().split())
def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())

from  collections import defaultdict
from collections import Counter
import bisect
def main():
     N = I()
     A = LI()
     c = Counter(A)
     if len(c.values()) == N:
         print('YES')
     else:
         print('NO')
if __name__ == "__main__":
    main()
# Judge status: Accepted
s,t=input().split()
a,b=map(int,input().split())
u=input()
ans=0
if u  in s:
  a-=1
if u in t:
  b-=1
print(a,b)
# Judge status: Accepted
x = max(map(len,input().split("S")))
print(x)
# Judge status: Accepted
n = int(input())
for i in range(15):
    for j in range(26):
        if i * 7 + j * 4 == n:
            print('Yes')
            exit()
print('No')
# Judge status: Wrong Answer
n, t = map(int, input().split())
c, tx = [0]*n, [0]*n
a = 1000
for i in range(n):
  c[i], tx[i] = map(int, input().split())
  if tx[i] <= t and a > c[i]:
    a = c[i]
if a == 1000:
  print('TLE')
else:
  print(a)
# Judge status: Accepted
N = list(input())

if N[0] == N[1] == N[2] or N[1] == N[2] == N[3]:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
S = input().split()
print(S[1]+S[0])
# Judge status: Accepted
N, M = [int(x) for x in input().split()]
A = [int(a) for a in input().split()]
tmp = N - sum(A)
if tmp >= 0:
    print(tmp)
else:
    print(-1)
# Judge status: Accepted
s=input()
n,ans,l=len(s),len(s),0
for c in s:
	if c=='S':
		l += 1
	elif l:
		l -= 1
		ans -= 2
print(ans)
# Judge status: Accepted
s = input()
k = int(input())

if "1" not in s[:k]:
	print (s[0])
	exit()
first = "1"
t = 0
for i in range(len(s)):
	if s[i] != "1":
		first = s[i]
		break
	else:
		t += 1
if k <= t:
	print ("1")
else:
	print (first)
# Judge status: Wrong Answer
n = int(input())
ans = 0

for i in range(2,n,1):
    if n % i != 0:
        ans += 1

ans = ans*2 + 1


print(ans)
# Judge status: Accepted
N = int(input().rstrip())
A = []
mx1 = 0
mx2 = 0
for i in range(N):
    A.append(int(input().rstrip()))
    if A[i] > mx1:
        mx1, mx2 = A[i], mx1
    elif A[i] > mx2:
        mx2 = A[i]
for j in range(N):
    if A[j] == mx1:
        print(mx2)
    else:
        print(mx1)
# Judge status: Accepted
n = list(input())
if (n[0] == n[1] == n[2]) or (n[1] == n[2] == n[3] ):
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
N, K = map(int,input().split())
print(N % K)
# Judge status: Accepted
p,q,r=map(int,input().split())
if p>=q and p>r:
    print(q+r)
if q>=r and q>p:
    print(p+r)
if r>=p and r>q:
    print(q+p)
if r==p and p==q:
    print(q+p)
# Judge status: Wrong Answer
s = input()
t = input()
n,m = len(s),len(t)
ans = 10**4
for i in range(n-m):
    c = 0
    for j in range(m):
        if t[j] != s[i+j]:
            c += 1
    ans = min(ans,c)
print(ans)
# Judge status: Accepted
t=int(input())
i=1
while((i*t)%360!=0):
    i+=1
print(i)
# Judge status: Accepted
## C - Next Prime　https://atcoder.jp/contests/abc149/tasks/abc149_c>
Number=int(input())
flg =0

if Number ==2: #2だったらflg＝1にして終了したい
    flg=1
    print(Number)
elif Number%2==0:
    Number+=1

Odd_Number_List =[i for i in range(3,Number,2)]

while flg==0:
    Amari_List = list(map(lambda x:Number%x,Odd_Number_List))
    if Amari_List.count(0)==0:
        flg=1
        print(Number)
        
    else:
        Odd_Number_List.append(Number)
        Number+=2
# Judge status: Accepted
#解説AC

n = int(input())

def dfs(s, mx):
    if len(s) == n:
        print(s)
    else:
        for i in range(ord('a'), ord(mx)+1):

            dfs(s + chr(i), chr(ord(mx) + 1) if i == ord(mx) else mx)
dfs('', 'a')
# Judge status: Accepted
S = input()

List = ['SUN','SAT','FRI','THU','WED','TUE','MON']

a = List.index(S)

if a == 0:
    a = 7

print(a)
# Judge status: Wrong Answer
temp=input()
n=int(temp.split()[0])
a=int(temp.split()[1])
b=int(temp.split()[2])

def rel(n):
  k1000=n//1000
  k100=n//100
  k10=(n-n//100*100)//10
  k1=n%10
  return k1000+k100+k10+k1

result=[]
for x in range(1,n+1):
  if b >= rel(x) >= a:
    result.append(x)

print(sum(result))
# Judge status: Accepted
n = int(input())
s = input()
alp = [chr(ord('A') + i) for i in range(26)]
res = ''
for si in s:
    index = 0
    for i in range(len(alp)):
        if si == alp[i]:
            index = i
    res += alp[(index + n) % len(alp)]
print(res)
# Judge status: Accepted
s = input()
if s[0] != s[1] and s[1] != s[2] and s[2] != s[0]:
    print("Yes")
else:
    print("No")
# Judge status: Accepted

N = int(input())
print(N * (N - 1) // 2)
# Judge status: Wrong Answer
n,m=map(int,input().split())
s=set(range(m+1))
for i in range(n):s=s&set(map(int,input().split()))
print(len(s)-1)
# Judge status: Accepted
w,h,x,y=map(int,input().split())
b=0
if x==w/2 and y==h/2:
    b=1
s=w*h/2
print(s,b)
# Judge status: Accepted

N = int(input())
As = list(map(int, input().split()))
ans = 0

tall = int(As[0])

for A in As:
	if(tall > A):
		ans += tall - A
	else:
		tall = A

print(ans)
# Judge status: Wrong Answer
# ABC133B

import numpy as np

n, d = map(int, input().split())
x = [0] * n
for i in range(n):
    x[i] = list(map(int, input().split()))
x = np.array(x)
count = 0
for i in range(n-1):
    for j in range(i+1, n):
        d = np.sqrt(sum((x[i, :] - x[j, :]) ** 2))
        print(i, j, "** d =", d)
        if d == int(d):
            count += 1
print(count)
# Judge status: Wrong Answer
N,M = map(int,input().split())
if N%2==1:
    N += 1
for i in range(M):
    print(N//2+1-M+i,N//2+M-i)
# Judge status: Accepted
n,k = list(map(int, input().split()))
a = list(map(int, input().split()))

# 最小値付近から攻める
idx = a.index(min(a))

ans = 10**12
for i in range(k):
    right = n - idx - 1 - i
    left = max(idx - k + 1 + i, 0)
    
    q1,r1 = divmod(left, k-1)
    q2,r2 = divmod(right, k-1)
    ans = min(ans, q1 + q2 + min(r1,1) + min(r2,1))

print(ans+1)
# Judge status: Wrong Answer
N,x = map(int, input().split())
A = list(map(int, input().split()))

A.sort()
S = 0
count = 0

for i in range(N):
  S += A[i]
  
if S < x:
  print(N-1)
  exit()
else:
  for i in range(N):
    b = x - A[i]
    if b > 0:
      count += 1
      x -= A[i]
    elif b == 0:
      count += 1
      exit()
    else:
      exit()
  print(count)
# 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

if A < B < C:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
n = int(input())
A = list(map(int, input().split()))
cnt = 0
for i in range(n):
    now = A[i]
    if now == i + 1:
        cnt += 1
        if i + 1 < n:
            nex = A[i + 1]
            if nex == i + 2:
                A[i + 1] = now
                continue
print(cnt)
# Judge status: Accepted
N=int(input())
s=[input()for i in range(N)]
M=int(input())
t=[input()for i in range(M)]
ans=0
for i in s:ans=max(ans,s.count(i)-t.count(i))
print(ans)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split( )))
front = 0
step = 0
for height in a :
    x = 0
    if front > height :
        x = front - height
        step += x
    if front < height:
        front = height
print(step)
# Judge status: Wrong Answer
import itertools

N = int(input())

A1 = list(map(int,input().split()))
A2 = list(map(int,input().split()))

#どこで下の行に移るか
csA1 = list(itertools.accumulate(A1))
csA2 = list(itertools.accumulate(A2))

#print(csA1)
#print(csA2)

ans = A1[-1] + csA2[-1]
for i in range(N-1):
    tmp = csA1[i] + (csA2[-1] - csA2[i]) + A2[i]
    ans = max(ans,tmp)
print(ans)
# Judge status: Wrong Answer
N=int(input())
a=list(map(int,input().split()))
l=[0]*N
for i in range(N):
    if a[i]%4:
        if a[i]%2:l[i]=1
        else:l[i]=2
    else:l[i]=4
print('Yes'if(l.count(1)+(1 if l.count(2)else 0)+1)//2<=l.count(4)else'No')
# Judge status: Accepted
from sys import stdin

A=input()
if A[0]=='7' or A[1]=='7' or A[2]=='7':
    print("Yes\n")
else:
    print("No\n")
# Judge status: Wrong Answer
youbi=['MON','TUE','WED','THU','FRI','SAT','SUN']
s=input()
for i in range(len(youbi)):
  if s=='SUN':
    print(7)
    
  elif youbi[i]==s:
    print(6-i)
# Judge status: Accepted
a,b,c=map(int,input().split())
k=int(input())
m=max(a,b,c)

print(a+b+c+(m*2**k)-m)
# Judge status: Accepted
X = int(input())

output = 1
for i in range(1,32):
    for j in range(2, 10):
        p = i ** j
        if p > X:
            break
        if p > output:
            output = p
print(output)
# Judge status: Wrong Answer
import sys
import os


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N = int(sys.stdin.buffer.readline())
    S = sys.stdin.buffer.readline().decode()

    ret = []
    for s in S:
        n = ord(s) + N
        if n > 90:
            ret.append(chr(n - 26))
        else:
            ret.append(chr(n))

    print("".join(ret))


if __name__ == '__main__':
    main()
# Judge status: Accepted
import math

n = int(input())
max_num = int(-(-(math.sqrt(1 + 8*n) - 1) // 2))

s = int(max_num * (1 + max_num) / 2)

d = s - n

for i in range(max_num):
    if i+1 != d:
        print(i+1)
# Judge status: Accepted
from collections import deque
S = deque()
tmp = input()
for i in range(len(tmp)):
  S.append(tmp[i])
Q = int(input())
flag = True
for i in range(Q):
  string = input().split()
  if string[0] == '1':
    flag = not flag
  elif flag ^ (string[1] == '1'):
      S.append(string[2])
  else:
      S.appendleft(string[2])
if not flag:
  S.reverse()
for s in S:
  print(s, end='')
# Judge status: Accepted
x=int(input())
s=(x//11)*2
a=x%11
if a>0:
    s+=1
if a>6:
    s+=1
print(s)
# Judge status: Accepted
N = int(input())
if N == 3 or N==5 or N==7:
    print('YES')
else:
    print('NO')
# Judge status: Accepted
n,m=map(int,input().split())
print(n*m)
# Judge status: Accepted
a, b, c, k = map(int,input().split())

s = abs(a - b)

if len(str(s)) >= 19:
    print('Unfair')
else:
    if k % 2 != 0:
        print(-a + b)
    else:
        print(a - b)
# Judge status: Wrong Answer
a=input()
if str.isupper(a)==True:
    print("A")
else:
    print("b")
# Judge status: Wrong Answer
import math
n = int(input())
t = [int(input()) for _ in range(n)]
if n == 1:
    print(0)
    exit()
a = t[0]*t[1]//math.gcd(t[0],t[1])
for i in range(2, n):
    a = t[i]*a//math.gcd(t[i],a)
print(a)
# Judge status: Wrong Answer
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

n = int(readline())
a = list(map(int,readline().split()))
a.sort()
if a[0] == a[-1]:
  print(0)
  exit()

s = set()
ans = 0
s.add(a[0])
for i in a[1:]:
  p = True
  for j in s:
    if i%j == 0:
      ans += 1
      p = False
      break
  if p:
    s.add(j)

print(ans)
# Judge status: Accepted
K, A, B = map(int, input().split())
if B - A <= 2:
    print(K + 1)
    exit()
count = K - A + 1
ans = A + (count // 2) * (B - A) + count % 2
print(ans)
# Judge status: Accepted
import math
b=input()
c=[]
for i in range(len(b)):
	c.append(b[i])
#a = list(map(int,input().split()))
#b = list(map(int,input().split()))
#s=int(input())

f=input()
t=[]
for i in range(len(f)):
	t.append(f[i])
d=[]
for i in range(len(c)):
	d.append(c[-(i+1)])
	
if d==t:
	print("YES")
else:
	print("NO")
# Judge status: Wrong Answer
*A,=sorted(map(int,input().split()))
print((A[2]-A[1])+int(-~(A[1]-A[0])/2) if (A[1]-A[0])%2==0 else A[1]+A[2]-2*A[0])