peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
n=int(input())
 
t = list(map(int,input().split()))
 
count = 0
 
for i in range(n-2):
    if t[i] <= t[i+1] and t[i+1] <= t[i+2] or t[i] >= t[i+1] and t[i+1] >= t[i+2]:
        count += 1
print(count)
# Judge status: Wrong Answer
n,d=map(int,input().split())
for i in range(1,n):
    if (2*d+1)*i>=n:
        print(i)
        break
# Judge status: Accepted
X, Y, Z = map(int, input().split())
X -= Z
people = 0
while X >= 0:
    X -= (Y + Z)
    if X >= 0:
        people += 1
print(people)
# Judge status: Wrong Answer
S = list(input())
before = ''
count = 0
answer = 0
for s in S:
  if s == before:
    count += 1
  else:
    before = s
    if count > 0:
      answer += (count+1)*(count+2)//2
      count = 0
if count > 0:
  answer += (count+1)*(count+2)//2
print(answer)
# Judge status: Wrong Answer
X = int(input())
 
cnt = 1
 
a = X - 400 / 200
for i in range(1,9):
    if  7 <= a < 8:
        print(cnt)
    else:
        cnt += 1
# Judge status: Accepted
A, B, X = map(int, input().split())

if X > A+B:
  print("NO")
elif A > X:
  print("NO")
else:
  print("YES")
# Judge status: Accepted
s=input()
s0=s.count("0")
s1=s.count("1")
print(min(s0,s1)*2)
# Judge status: Accepted
a,b = map(int,input().split())
ans = 0
while a <= b:
  ans += 1
  a *= 2
print(ans)
# Judge status: Accepted
import numpy as np
A = np.array([])
f=False
B= np.zeros((3,3))

for i in range(3):
  A=np.append(A,list(map(int,input().split())))
A=A.reshape(3,3)

n=int(input())

for i in range(n):
  x=int(input())
  B+=(A==x)*1
  
for i,j in zip(sum(B),sum(B.T)):
  f=f or (i//3) or (j//3) 
f = f or (sum(np.diag(B))//3)
f = f or (sum(np.diag(np.fliplr(B)))//3)
print("Yes" if f else "No")
# Judge status: Accepted
from decimal import *

a, b = input().split()
a = Decimal(a)
b = Decimal(b)
ans = a * b
ans = Decimal(str(ans)).quantize(Decimal(str(0)), rounding=ROUND_DOWN)
print(ans)
# Judge status: Accepted
N = int(input())
L = list(map(int,input().split()))
count = 0
for i in range(N):
  for j in range(i+1,N):
    for k in range(j+1,N):
      if L[i] != L[j] and L[i] != L[k] and L[j] != L[k]:
        if L[i]+L[j] > L[k] and L[i]+L[k] > L[j] and L[j]+L[k] > L[i]:
          count += 1

print(count)
# Judge status: Wrong Answer
N,K=map(int,input().split())
A=list(map(int,input().split()))
point=[1.0]*(N+1)
for i in range(K):
    point[K]=point[K]*A[i]
M=N-K+1
for i in range(1,M):
    point[K+i]=point[K+i-1]*A[K+i-1]/A[i-1]
for i in range(M-1):
    if point[K+i]<point[K+i+1]:
        print("Yes")
    else:
        print("No")
# Judge status: Accepted
import sys
input = sys.stdin.readline

N = int(input())
points = [0] * N
rx = []
ry = []
for i in range(N):
    x, y = map(int, input().split())
    rx.append(x - y)
    ry.append(x + y)
xm = max(rx)
xn = min(rx)
ym = max(ry)
yn = min(ry)
ans = max(max(xm - x, x - xn, ym - y, y - yn) for x, y in zip(rx, ry))
print(ans)
# Judge status: Accepted
from math import ceil
n, k = map(int, input().split())
nums = list(map(int, input().split()))
same = k
ans = 1
if same < n:
    ans += ceil((n - same) / (k - 1))
print(ans)
# Judge status: Wrong Answer
n = int(input())
c = [[0 for i in range(10)] for i in range(10)]
ans = 0

for i in range(n):
    s = str(i)
    c[int(s[0])][int(s[-1])] += 1

for i in range(1,10):
    for j in range(1,10):
        ans += c[i][j]*c[j][i]

print(ans)
# Judge status: Accepted
n = int(input())
a = map(int, input().split())

m = 0
ans = []
for i in a:
  if i < 0:
    m += 1
    ans.append(abs(i))
  else:
    ans.append(i)
if m % 2 == 0:
  print(sum(ans))
else:
  x = min(ans)
  print(sum(ans)-x*2)
# Judge status: Accepted
n=int(input())
c=list(input())
if len(set(c))==1:
    print('0')
else:
    r=c.count('R')
    w=c.count('W')
    rc=c[:r].count('R')
    wc=c[:r].count('W')
    if rc==0:
        if r<w:
            print(r)
        else:
            print(w)
    else:
        if r-rc<wc:
            print(r-rc)
        else:
            print(wc)
# Judge status: Accepted
n,k=map(int,input().split())
s=[0]*10**5
for i in range(n):
    a,b=map(int,input().split())
    s[a-1]+=b
i=0
while k>0:
    k-=s[i]
    i+=1
print(i)
# Judge status: Wrong Answer
import re
s = input()
pattern={
    '.*keyence'
    ,'k.*eyence'
    ,'ke.*yence'
    ,'key.*ence'
    ,'keye.*nce'
    ,'keyen.*ce'
    ,'keyenc.*e'
    ,'keyence.*'
    ,'keyence'
    }

for p in pattern:
    if re.match(p, s):
        print('YES')
        break
else:
    print('NO')
# Judge status: Accepted
from collections import Counter

N = int(input())
A = [int(input()) for _ in range(N)]
CA = Counter(A)
ans = 0
for value in CA.values():
    if value % 2 == 1:
        ans += 1
print(ans)
# Judge status: Accepted
n, k = map(int, input().split())
s = list(input())
s[k-1] = s[k-1].lower()
print("".join(s))
# Judge status: Accepted
import math

N, X = list(map(lambda n:int(n), input().split(" ")))
x = list(map(lambda y:int(y), input().split(" ")))
x.append(X)
x.sort()
d = list(filter(lambda r: r != 0, [abs(x[i + 1] - x[i]) for i in range(len(x) - 1)]))

gcd = d[0]
for i in range(len(d)):
  gcd = math.gcd(d[i], gcd)

print(gcd)
# Judge status: Accepted
a_1=int(input())
a=[a_1]
for i in range(1000000):
    if a[-1]%2==0:
        a_next=a[-1]//2
    else:
        a_next=3*a[-1]+1
    if a_next in a:
        print(i+2)
        break

    a.append(a_next)
# Judge status: Accepted
import sys
import itertools

n = int(input())
# = map(int, input().split())
l = sorted(list(map(int, input().split())))
if n < 3 or len(set(l)) < 3:
    print(0)
    sys.exit()
c = list(itertools.combinations(l, 3))
ans = 0
for i in range(len(c)):
    if len(set(c[i])) < 3:
        continue
    if c[i][0] + c[i][1] <= c[i][2]:
        continue
    ans += 1
print(ans)
# Judge status: Accepted
A, B, C = map(int, input().split())

if (C >= A) & (C <= B):
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
N=int(input())

nums=[]
for _ in range(N):
    nums.append(list(map(int, input().split())))

dp = [[0 for _ in range(3)] for _ in range(N)]


for i in range(N):
    a,b,c=nums[i]
    dp[i][0]=max(dp[i-1][1]+a,dp[i-1][2]+a)
    dp[i][1]=max(dp[i-1][0]+b,dp[i-1][2]+b)
    dp[i][2]=max(dp[i-1][0]+c,dp[i-1][1]+c)
print(max(dp[-1]))
# Judge status: Accepted

N = int(input())
S = input()

r = S.count("R")
g = S.count("G")
b = S.count("B")

all_case = r*g*b

excluded_case = 0
for i in range(N):
    for j in range(i+1, N):
        if S[i] == S[j]: continue
        k = j*2-i
        if k>= N or S[k] == S[i] or S[k] == S[j]: continue
        excluded_case += 1

print(all_case-excluded_case)
# Judge status: Wrong Answer
N = int("".join(map(str,input().split())))
print(("No","Yes")[N % 4 == 0])
# Judge status: Accepted
import sys
N = int(input())
test = lambda x: [ x[0],int(x[1]) ]
array = [ [test(input().split()),int(x+1)] for x in range(N) ]

if not ( 1 <= N <= 100 ): sys.exit()
for I in array:
    if not ( 1 <= len(I[0][0]) <= 10 ): sys.exit()
    if not I[0][0].islower(): sys.exit()
    if not ( 0 <= I[0][1] <= 100 ): sys.exit()
    if not isinstance(I[0][1],int): sys.exit()

array.sort(key=lambda x: x[0][1], reverse=True)
array.sort(key=lambda x: x[0][0])

for I in array:
    print(I[1])
# Judge status: Accepted
from collections import Counter

print('Yes' if sorted(list(Counter(input()).values())) == 
       sorted(list(Counter(input()).values())) else 'No')
# Judge status: Accepted
a,b,c,d=map(int,input().split())
if abs(a-c)<=d:
    print("Yes")
elif abs(a-b)<=d and abs(b-c)<=d:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
from math import *
from sys import stdin,stdout
input=stdin.buffer.readline

n=int(input())
d=n%10
if d==2 or d==4 or d==5 or d==7 or d==9:
	print("hon")
elif d==0 or d==1 or d==6 or d==8:
	print("pon")
else:
	print("bon")
# Judge status: Accepted
n = int(input())
ans = [0 for _ in range(10050)]
for i in range(1, 105):
    for j in range(1, 105):
        for k in range(1, 105):
            v = i * i + j * j + k * k + i * j + j * k + k * i
            if v < 10050:
                ans[v] += 1

for i in range(n):
    print(ans[i + 1])
# Judge status: Accepted
a,b,c=map(int,input().split())
ans="NO"
for i in range(1,b+1):
  if a*i%b==c:
    ans="YES"
    break

print(ans)
# Judge status: Accepted
MOD = 10**9+7

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

if abs(N-M)>1:
    print(0)
    exit()

#N=Mなら最後に2をかける
dog = 1
monkey = 1
for i in range(1,N+1):
    dog = (dog*i)%MOD
for j in range(1,M+1):
    monkey = (monkey*j)%MOD

ans =(dog*monkey)%MOD
if N==M:
    ans=(ans*2)%MOD

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

def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()

n = readInt()
a = readInts()

v = sum(a)/2
t = 0
for i in range(len(a)):
	t+=a[i]
	if t>v:
		break
z1 = sum(a[:i])
k1 = sum(a[i:])
z2 = sum(a[:i+1])
k2 = sum(a[i+1:])
if abs(z1-k1)<abs(z2-k2):
	z = z1
	k = k1
else:
	z = z2
	k = k2

print(abs(z-k))
# Judge status: Accepted
##E
X,Y,A,B,C = map(int,input().split())
p = list(map(int,input().split()))
q = list(map(int,input().split()))
r = list(map(int,input().split()))

p.sort(reverse=True)
q.sort(reverse=True)
r.sort(reverse=True)

psum = 0

for i in range(X):
        r.append(p[i])
for i in range(Y):
        r.append(q[i])
        
r.sort(reverse=True)
ans = 0

for i in range(X+Y):
		ans += r[i]

        
print(ans)
# Judge status: Wrong Answer
import collections
N = int(input())
A = list(map(int, input().split()))
A.sort(reverse=True)

c = collections.Counter(A)

area = []
for key in c.keys():
    if(c[key] >= 2):
        if(c[key] == 2 or c[key] == 3):
            area.append(key)
            if(len(area) == 2):
                print(area[0]*area[1])
                break
        else:
            print(key*key)
            break
else:
    print(0)
# Judge status: Accepted
N, K = map(int, input().split())
R, S, P = map(int, input().split())
T = str(input())

ans = 0
win = [1] * N

for i in range(N):
  if T[i] == "r":
    ans += P
    x = P
  elif T[i] == "s":
    ans += R
    x = R
  else:
    ans += S
    x = S
  if i >= K:
    if (T[i] == T[i - K]) and (win[i - K] == 1):
      ans -= x
      win[i] = 0
  #print(ans)
print(ans)
# Judge status: Accepted
n = int(input())
h = list(map(int, input().split()))

ans = 0
count = 0
for i in range(n-1):
    if h[i] >= h[i+1]:
        count += 1
    else:
        ans = max(ans, count)
        count = 0

ans = max(ans, count)
print(ans)
# Judge status: Accepted
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools,fractions,copy
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

n = inp()
if n%2:
    print(0)
    quit()
res = 0
now = 10
while now <= n:
    res += n//now
    now *= 5
print(res)
# Judge status: Wrong Answer
n,k = map(int,input().split())
s = list(input())
c = 0
a = 0
	
for i in range(n-1):
	if s[i] == s[i+1]:
		c += 1
	if a < k:
		if s[i] == 'R' and s[i+1] == 'L':
			c += 2
			a += 1
if a < k and a + 2 <= k:
	if s[0] == 'L':
		c += 1
	if s[-1] == 'R':
		c += 1
if a < k and a + 1 >= k:
	if s[0] == 'L' or s[-1] == 'R':
		c += 1
print(c)
# Judge status: Accepted
# coding: utf-8
# Your code here!
a,b=map(int,input().split())
if  (1<=a<=9) and (1<=b<=9):
    print(a*b)
else:
    print(-1)
# Judge status: Accepted
a, b, c = map(int, input().split())
print(min(b//a, c))
# Judge status: Accepted
a,b,c,x=[int(input()) for _ in range(4)]
print([500*x+100*y+50*z for z in range(c+1) for y in range(b+1) for x in range(a+1)].count(x))
# Judge status: Accepted
n,k = map(int,input().split())
i = 0
if n == 0:
    print(1)
    exit()
else:
    while k ** i <= n:
        i += 1

print(i)
# Judge status: Accepted
a, b, x = map(int, input().split())
print((b // x) - ((a - 1) // x))
# Judge status: Wrong Answer
N = int(input())
nums = [int(i) for i in input().split()]

while min(nums) > 1:
    monster_index = nums.index(min(nums))
    monster = nums.pop(monster_index)
    nums = [n-monster for n in nums]
    nums.append(monster)

nums = [n for n in nums if n != 0]
print(min(monster,min(nums)))
# Judge status: Accepted
def INT():
    return int(input())

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

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

N, M = MI()
city = [[] for _ in range(N)]

for _ in range(M):
    a, b = MI()
    city[a - 1].append(b - 1)
    city[b - 1].append(a - 1)
    
for c in city:
    print(len(c))
# Judge status: Accepted
N = int(input())
A = map(int, input().split())

# N が 2 で何回割れるか
def how_many_times(N):
    exp = 0
    while N % 2 == 0:
        N //= 2
        exp += 1
    return exp

result = min(map(how_many_times, A))
print(result)
# Judge status: Wrong Answer
n = int(input())
t,a = map(int, input().split())
h = list(map(int, input().split()))
best = float("inf")
ind = 0
for i in range(n):
    temp = abs(a-t- h[i]*0.006)
    if temp < best:
        ind = i
        best = temp
print(ind+1)
# Judge status: Wrong Answer
A, B = map(int, input().split())
K = A + B
if K % 2 == 0:
    print(K)
else:
    print("IMPOSSIBLE")
# Judge status: Accepted
from bisect import bisect_left

n = int(input())
l = list(map(int, input().split()))
l.sort()
triangle = 0
for i in range(n-2):
  for j in range(i+1, n-1):
    index = bisect_left(l, l[i] + l[j], j + 1, n) - 1
    triangle += index - j
print(triangle)
# Judge status: Accepted
S=input()
cou=0
for i in range (len(S)//2):
  if S[i]!=S[i*(-1)-1]:
    cou+=1
print(cou)
# Judge status: Accepted
N, A, B = map(int, input().split())
if (A - B) % 2 == 0:
    print((B - A) // 2)
else:
    print(min(A - 1, N - B) + 1 + (B - A - 1) // 2)
# Judge status: Accepted
N = int(input())
S = input()

ans = 0
for i in range(N-1):
    S1 = S[:i+1]
    S2 = S[i+1:]
#    print(S1, S2)
    ans = max(ans, len(set(list(S1)) & set(list(S2))))
print(ans)
# Judge status: Accepted
def main():
    N, M = (int(i) for i in input().split())
    ans = 0
    if N == 1 and M == 1:
        ans = 1
    elif N == 1:
        ans = M-2
    elif M == 1:
        ans = N-2
    else:
        h = N-2
        w = M-2
        ans = h*w
    print(ans)


if __name__ == '__main__':
    main()
# Judge status: Accepted
n=int(input())
list1 = []
sum: int = 0
for i in str(n):
    list1.append(int(i))
    sum +=int(i)
print("Yes" if n % 9 == 0 and sum % 9 == 0 else "No")
# Judge status: Accepted
n, p = map(int, input().split())
A = list(map(int, input().split()))
A = [a%2 for a in A]
if sum(A) == 0:
    print(pow(2, n) if p==0 else 0)
elif n>=2:
    print(pow(2, n)//2)
else:
    print(1 if A[0]==p else 0)
# Judge status: Wrong Answer
def main():
  n = int(input())
  dict = {}
  for i in range(n):
    s = input()
    dict.setdefault(s, 0)
    dict[s] += 1
  max_val = 0
  ans_ls = []
  for kv in dict.items():
    if kv[1] > max_val:
      max_val = kv[1]
      ans_ls = [kv[0]]    
    elif kv[1] == max_val:
      ans_ls.append(kv[0])


if __name__ == '__main__':
  main()
# Judge status: Accepted
import bisect, collections, copy, heapq, itertools, math, numpy, string
import sys
from bisect import bisect_left, bisect_right, insort
from collections import deque
def S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int, sys.stdin.readline().rstrip().split())
def MS(): return map(str, sys.stdin.readline().rstrip().split())
def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
# N = I()
# A = [LI() for _ in range(N)]
s = S()
print(s[:3])
# Judge status: Accepted
N,D=map(int,input().split())
cnt=1
while True:
  if cnt*(2*D+1)>=N:
    print(cnt)
    break
  cnt+=1
# Judge status: Accepted
n,m = map(int,input().split())

red = [0 for i in range(n)]
amount = [1 for i in range(n)]
red[0] = 1
for _ in range(m):
    x,y = map(int,input().split())
    amount[x-1] -= 1
    amount[y-1] += 1
    if red[x-1]:
      red[y-1] = 1
    if amount[x-1] == 0:
      red[x-1] = 0
ans = 0
for r,a in zip(red, amount):
  if r > 0 and a > 0:
    ans += 1



print(ans)
# Judge status: Accepted
N = int(input())
A = [0]*N
for i in range(N):
  A[i] = int(input())
B = sorted(A)
for i in range(N):
  if A[i] == B[-1]:
    print(B[-2])
  else:
    print(B[-1])
# Judge status: Accepted
n = int(input())
h = list(map(int, input().split()))

memo = 0
for i in range(n-1):
  if h[i] > h[i+1]:
    memo = max(memo, h[i] - 1)
    if h[i] - h[i+1] > 2 or h[i+1] < memo:
      print("No")
      exit()
print("Yes")
# Judge status: Accepted
N,K = (int(T) for T in input().split())
X = [int(T) for T in input().split()]
Cost = [0]*(N-K+1)
for T in range(0,N-K+1):
    Left  = X[T]
    Right = X[T+K-1]
    Cost[T] = min(abs(Left)+abs(Left-Right),abs(Right)+abs(Right-Left))
print(min(Cost))
# Judge status: Accepted
import sys
from collections import Counter
c = Counter(input())
for i in c.most_common():
    if i[1]%2 == 1:
        print('No')
        sys.exit()
print('Yes')
# Judge status: Accepted
n=int(input())
a=[int(j)for j in input().split()]
ans=0
s=sum(a)
p=1
b=True
for i,j in enumerate(a):
    if p<j:
        print(-1)
        exit()
    ans+=p
    p-=j
    s-=j
    if i==n:
        continue
    if p<s and b:
        if p*2<s:
            p*=2
        else:
            p=s
    if p==s:
        b=False

print(ans)
# Judge status: Wrong Answer
import math

n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

print(math.ceil(n // min([a,b,c,d,e])) + 4)
# Judge status: Wrong Answer
import math

h = int(input())
w = int(input())
n = int(input())

print(math.floor(n / max(h, w)) + 1)
# Judge status: Accepted
s = list(input())
k = int(input())
for i in range(len(s)):
    if s[i] != "a" and (123-ord(s[i])) <= k:
        k -= (123-ord(s[i]))
        s[i] = "a"
    if i == len(s)-1:
        s[i] = (chr((((ord(s[i])+(k%26))-97)%26)+97))

print("".join(s))



# a = "z"
# a = ord(a)
# print(a)
# Judge status: Accepted
import math
A,B,H,M=map(int,input().split())
R1=(H*60+M)*(0.5)
R2=M*6
R=R1-R2
R=abs(R)
if(R>180):
  R=360-R
COS=math.cos(math.radians(R))
ans=A**2+B**2-2*A*B*COS
print(ans**(1/2))
# Judge status: Accepted
N, L = map(int, input().split())
table = [input() for _ in range(N)]
table.sort()

print("".join(table))
# Judge status: Accepted
N = int(input())
H = list(map(int, input().split()))

H.append(10**10) 
r, ans = 0, 0
for l in range(N):
    while r < N and H[r] >= H[r+1]:
        r += 1
    ans = max(ans, r-l)
    if l == r:
        r += 1
print(ans)
# Judge status: Accepted
n=int(input())
p=list(map(int,input().split()))
num1=0
num=[]
for i in range(1,n+1):
    if p[i-1]==i:
        num1+=1
    else:
        if num1!=0:
            num.append(num1)
            num1=0
if num1!=0:
    num.append(num1)
ans=0
for i in range(len(num)):
    ans+=-(num[i]//-2)
print(ans)
# Judge status: Accepted
n=int(input())
while True:
    if n%111==0:
        print(n)
        break
    n+=1
# Judge status: Accepted
N, A, B = map(int, input().split())
print (A * (N // (A+B)) + min(N % (A+B), A))
# Judge status: Wrong Answer
A,B,C,num = map(int, input().split())
if num <= A+B:
    print(A)
else:
    ans = A-(num-A-B)
    print(ans)
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
sm = sum(A)
t = 0
for i in range(N):
    if t > sm/2:
        break
    else:
        t += A[i]
        s = t-A[i]
u = 2*t - sm
v = sm - 2*s
print(min(u,v))
# Judge status: Wrong Answer
il = input().split()

A = float(il[0])
B = float(il[1])

import math

print(math.floor(A*B))
# Judge status: Accepted
a,b = map(int,input().split())

if a>=13:print(b)
elif a>=6:print(b//2)
else:print(0)
# Judge status: Accepted
import math
n, x, t = map(int,input().split())
print(math.ceil(n/x)*t)
# Judge status: Accepted
#関数リスト
import sys
input = sys.stdin.readline

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

q = I()
mylist = LI()
result = 0
for i in mylist:
    result = result ^ i

for i in mylist:
    print(result ^ i)
# Judge status: Accepted
from math import factorial

def resolve():
	n, m = map(int, input().split())
	mod = 10**9+7
	if abs(n - m) > 1:
		print(0)
		return
	a = factorial(m) % mod * factorial(n) % mod
	if (n + m) % 2 == 0:
		a = a * 2 % mod
	print(a)
resolve()
# Judge status: Accepted
X, Y = map(int, input().split())
x = X
ans = 1
while x * 2 <= Y:
    x *= 2
    ans += 1
print(ans)
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
mod = 10**9+7
D = {}
for a in A:
    bit = bin(a)[2:][::-1]
    for i in range(len(bit)):
        if bit[i] == '1':
            if i not in D:
                D[i] = 1
            else:
                D[i] += 1

ans = 0
for k, v in D.items():
    ans += (N-v)*v*2**k % mod
    ans = ans % mod

print(ans)
# Judge status: Accepted
lists=list((input().split()))
print(lists[1]+lists[0])
# Judge status: Wrong Answer
import sys
n = int(input())
s = input()
if (n % 2 == 1):
    print('No')
    sys.exit()
if (s[0:n//2-1] == s[n//2:n-1]):
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
def actual(N):
    return ((N + 1) * N) / 2

N = int(input())
print(actual(N))
# Judge status: Wrong Answer
s = int(input())
check = [0]*(10**6)
check[s] == 1
i = 2
while True:
  if s % 2 == 0:
    s //= 2
  else:
    s = 3*s+1
  if check[s]:
    break
  check[s] = 1
  i += 1
print(i)
# Judge status: Accepted
S=input()
ans=10**9
for i in range(len(S)):
  ans=min(ans,abs(int(S[i:i+3])-753))
print(ans)
# Judge status: Wrong Answer
N = int(input())
numodd = N%2
print(numodd/N)
# Judge status: Accepted
S = input()
T = input()
ans = 'Yes'
dic1,dic2 = {},{}

for i,j in zip(S,T):
    if i in dic1:
        if dic1[i] != j:
            ans = 'No'
    else:
        dic1[i] = j
        
    if j in dic2:
        if dic2[j] != i:
            ans = 'No'
    else:
        dic2[j] = i

#print(dic1)
#print(dic2)
print(ans)
# Judge status: Wrong Answer
n,k,q = map(int,input().split())
p_lis = [k-q] * n
print(p_lis)
for i in range(q):
    x = int(input())
    p_lis[x-1] += 1
for j in p_lis:
    if j > 0:
        print("Yes")
    else:
        print("No")
# Judge status: Accepted
A,B,C=map(int,input().split())
ans=0
while A%2==0 and B%2==0 and C%2==0:
    if A == B == C:
        print(-1)
        exit()
    A1=A
    B1=B
    C1=C
    A = B1/2+C1/2
    B = A1/2+C1/2
    C = A1/2+B1/2
    ans +=1
print(ans)
# Judge status: Accepted
n = int(input())
s = str(input())
mod = 10**9+7
d = {}
for i in range(n):
    if s[i] not in d:
        d[s[i]] = 1
    else:
        d[s[i]] += 1
ans = 1
for v in d.values():
    ans *= (v+1)%mod
ans -= 1
print(ans%mod)
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))
a=sorted(a)
print(sum(a[-n*3+n:-1:2]))
# Judge status: Accepted
K,S = map(int,input().split())
C = 0

for x in range(K+1):
  for y in range(K+1):
    if K>=S-x-y>=0:
      C+=1
        
print(C)
# Judge status: Accepted
a,b = map(int,input().split())
count = 0
for i in range(a,b+1):
    moji = str(i)
    flag = True
    for j in range(1,len(moji)//2+1):
        if moji[j-1]!=moji[-j]:
            flag = False
            break
    if flag:
        count += 1
print(count)
# Judge status: Accepted
n = int(input())
arr = list(map(int, input().split()))
s = sum(arr)
m = {}
for e in arr:
    m[e] = m.get(e, 0)+1
for _ in range(int(input())):
    a, b = map(int, input().split())
    if a not in m:
        print(s)
        continue
    s += (b-a) * m[a]
    if b not in m:
        m[b] = 0
    m[b] += m[a]
    m[a] = 0
    print(s)
# Judge status: Accepted
A = "abcdefghijklmnopqrstuvwxyz"
n = int(input())
N = input()
for i in range(len(N)):
  a = A.index(N[i].lower())
  a += n
  if a >= 26:
    a -= 26
  print(A[a].upper(),end="")
print("")
# Judge status: Wrong Answer
K = input()
A, B = map(int, input().split())

if int(B) - int(A) + 1 >= int(K):
  print('OK')
else:
  i = int(A)
  while i < int(B) + 1:
    if i % int(K) == 0:
      print('OK')
      break
    else:
      i = i+1
  print('NG')
# Judge status: Accepted
a, b = map(int, input().split())

squares = [i ** 2 for i in range(1000)]
if int(str(a) + str(b)) in squares:
    print("Yes")
else:
    print("No")