Harryxun/stf_run huggingface dataset:
N = int(input())
d = []
d.append([])
d.append([".",",","!","?"])
d.append(["a","b","c"])
d.append(["d","e","f"])
d.append(["g","h","i"])
d.append(["j","k","l"])
d.append(["m","n","o"])
d.append(["p","q","r","s"])
d.append(["t","u","v"])
d.append(["w","x","y","z"])
for _ in range(N):
    nn = input()
    output = ""
    b = 0
    c = 0
    for n in nn:
        n = int(n)
        if n == 0:
            output += d[b][c]
            c = 0
        c += 1
    print(output)       


### FIXED CODE ###

def solve(mm, cmd):
	bf = cmd[0]
	c = 0
	ans = ""
	for s in cmd[1::]:
			if bf == s:
				c += 1
			else:
				if s == '0':
					ans += mm[bf][c%len(mm[bf])]
				c = 0
				bf = s
	return ans

def main():
	N = int(input())
	cc = [
		[".",",","!","?"," "],
		["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"]]
	mm = dict(zip(
		[str(i) for i in range(1,10)],
		cc
	))
	for _ in range(N):
		cmd = input()
		print(solve(mm,cmd))

if __name__ == '__main__':
	main()
a=0
s=input()
for i in s:
    if s[i]=='-':
        a-=1
    else:
        a+=1
print(a)

### FIXED CODE ###

a=0
s=input()
for i in range(4):
    if s[i]=="-":
        a-=1
    else:
        a+=1
print(a)
import heapq

n,m,s=map(int,input().split())
limit=7
S=min(s,limit)
path=[[] for _ in range(n+1)]
coin=[(0,0)]
time=[[float("inf") for _ in range(limit+1)] for _ in range(n+1)]
queue=[]

for i in range(m):
    u,v,a,b=map(int,input().split())
    path[u].append((v,a,b))
    path[v].append((u,a,b))

for i in range(n):
    c,d=map(int,input().split())
    coin.append((c,d))

for k in range(s+1):
    time[1][k]=0

heapq.heappush(queue,(0,1,s))
while len(queue)!=0:
    t,v,c=heapq.heappop(queue)
    for nv,na,nb in path[v]:
        if na>c:
            continue
        elif time[nv][c-na]<=t+nb:
            continue
        else:
            time[nv][c-na]=t+nb
            heapq.heappush(queue,(t+nb,nv,c-na))

    nc=min(c+coin[v][0],limit)
    nt=t+coin[v][1]
    if time[v][nc]<=nt:
        continue
    else:
        time[v][nc]=nt
        heapq.heappush(queue,(nt,v,nc))
    
for i in range(2,n+1):
    print(min(time[i]))

### FIXED CODE ###

import heapq

n,m,s=map(int,input().split())
limit=2500
s=min(s,limit)
path=[[] for _ in range(n+1)]
coin=[(0,0)]
time=[[float("inf") for _ in range(limit+1)] for _ in range(n+1)]
queue=[]

for i in range(m):
    u,v,a,b=map(int,input().split())
    path[u].append((v,a,b))
    path[v].append((u,a,b))

for i in range(n):
    c,d=map(int,input().split())
    coin.append((c,d))

time[1][s]=0
heapq.heappush(queue,(0,1,s))

while len(queue)!=0:
    t,v,c=heapq.heappop(queue)
    for nv,na,nb in path[v]:
        if na>c:
            continue
        elif time[nv][c-na]<=t+nb:
            continue
        else:
            time[nv][c-na]=t+nb
            heapq.heappush(queue,(t+nb,nv,c-na))

    nc=min(c+coin[v][0],limit)
    nt=t+coin[v][1]
    if time[v][nc]<=nt:
        continue
    else:
        time[v][nc]=nt
        heapq.heappush(queue,(nt,v,nc))
    
for i in range(2,n+1):
    print(min(time[i]))
import math

P=[]
n=int(input())
N=int(math.sqrt(n))

for i in range(1,n+1):
  if n%i==0:
    p=max(len(str(i)),len(str(int(n/i))))
    P.append(p)
    
print(min(P))

### FIXED CODE ###

a,b=map(int,input().split())
if a+b<24:
  print(a+b)
else:
  print(a+b-24)
import math
a,b,x = (int(num) for num in input().split())
suf2 = a*b
vol = a*a*b
if (vol/2)>=x:
    l = x*2 / suf2
    x = b/l
    ans = math.degrees(math.atan(x))
else:
    l = (vol-x) / (a*a)
    x = a/l
    ans = math.degrees(math.atan(x))
    
print(ans)

### FIXED CODE ###

import math

a,b,x = (int(num) for num in input().split())
suf2 = a*b
vol = a*a*b
if (vol/2)>=x:
    l1 = x*2 / suf2
    x = float(b)/l1
    ans = math.degrees(math.atan(x))
else:
    l2 = (vol-x)*2 / (a*a)
    x = l2/float(a)
    ans = math.degrees(math.atan(x))
    
print(round(ans,6))
coding: utf-8
# 文字列反転
def rev (s):
    _re=''.join(list(reversed(s)))
    return _re

name = ['dream','dreamer','eraser','erase']
S = input()
S_re = rev(S)
can2 = False
i= 0
while i < len(S_re):
    can = False
    can2 = False
    for div in name:
        if len(S_re[i:]) >= len(div):
            if S_re[i:i+len(div)]==rev(div) :
                i+=len(div)
                can = True
                break
    if can :
        can2 = True
    else:
        can2 = False
        break
if can2:
    print('YES')
else :
    print('No')



### FIXED CODE ###

import re
print("YES" if re.match("^(dream|dreamer|erase|eraser)+$",input()) else "NO")
s=input()
judge=True
if "W" in s:
    if "E" not in s: judge=False
if "E" in s:
    if "W" not in s: judge=False
if "S" in s:
    if "N" not in s: judge=False
if "N" in s:
    if "S" not in s: judge=False
print("Yes") if judge else prit("No")

### FIXED CODE ###

s=input()
judge=True
if "W" in s:
    if "E" not in s: judge=False
if "E" in s:
    if "W" not in s: judge=False
if "S" in s:
    if "N" not in s: judge=False
if "N" in s:
    if "S" not in s: judge=False
print("Yes") if judge else print("No")
s,t = map(int, input().split())

print(t+s)

### FIXED CODE ###

s,t = input().split()

print(t+s)
import sys
import numpy as np
from scipy.sparse.csgraph import shortest_path
sys.setrecursionlimit(10 ** 7)

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N = ir()
graph = np.zeros((N, N)) #0-indexed
for _ in range(N-1):
    a, b, c = lr()
    graph[a-1, b-1] = c

dist = shortest_path(graph, directed=False).astype(int)
Q, K = lr()
K_dist = dist[K-1].tolist()
for _ in range(Q):
    x, y = lr()
    print(K_dist[x-1] + K_dist[y-1])

# 20


### FIXED CODE ###

import sys
from collections import deque
sys.setrecursionlimit(10 ** 7)

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

def measure(x):
    dist = [INF] * (N)
    dist[x] = 0
    que = deque()
    que.append(x)
    while que:
        cur = que.popleft()
        cur_dist = dist[cur]
        for next, c in edges[cur]:
            if dist[next] == INF:
                dist[next] = cur_dist + c
                que.append(next)
    
    return dist

N = ir()
INF = 10 ** 15
edges = [[] for _ in range(N)]
for _ in range(N-1):
    a, b, c = lr()
    edges[a-1].append((b-1, c))
    edges[b-1].append((a-1, c))

Q, K = lr()
dist = measure(K-1)
for _ in range(Q):
    x, y = lr()
    print(dist[x-1] + dist[y-1])


# 20
st = [i for i in "AKIHABARA"]
input_st = [i for i in input()]
if input_st[-1] != "A":
    input_st.append("A")
for ind,str_ in enumerate(st):
    if str_ != input_st[ind]:
        input_st.insert(ind,"A")
    
if "".join(st) == "".join(input_st):
    print("YES")
else:
    print("NO")


### FIXED CODE ###

import re
pattern = r"^A?KIHA?BA?RA?$"
S = input()
if re.match(pattern,S):
    print("YES")
else:
    print("NO")
S = int(input())

result = 0
for i in range(len(S) - 1):
    if S[i] == S[i+1]:
        result += 1

if result == 0:
    print("Good")
else:
    print("Bad")
 

### FIXED CODE ###

S = input()

result = 0
for i in range(len(S) - 1):
    if S[i] == S[i+1]:
        result += 1

if result == 0:
    print("Good")
else:
    print("Bad")
num=int(x)

print(x*3)

### FIXED CODE ###

x=int(input())
print(x**3)
def shell_sort(array):
    n = len(array)
    h = 0
    k = 0
    cnt = 0
    g = []
    while h <= n/9:
        h = 3*h + 1
        g.append = h
    while g[k] > 0:
        for i in range(h,n):
            tmp = array[i]
            if tmp < array[i-g[k]]:
                j = i
                while True:
                    array[j] = array[j-g[k]]
                    j -= h
                    c += 1
                    if j < h or tmp >= array[j-g[k]]:
                        break
                array[j] = tmp
    print(len(g))
    print(*g)
    for i in range(array): print(array[i])

d = []
for i in range(int(input())):
    d.append(int(input()))
shell_sort(d)
    


### FIXED CODE ###

def insertionSort(A,n,g):
    cnt = 0
    for i in range(g,n):
        v = A[i]
        j = i - g
        while j >= 0 and A[j] > v:
            A[j+g] = A[j]
            j = j - g
            cnt += 1
            A[j+g] = v
    return cnt
    
def shellsort(A,n):
    cnt = 0
    h = 1
    G = []
    while h <= n:
        G.append(h)
        h = 3*h + 1
    G.reverse()
    m = len(G)
    print(m)

    print(" ".join(map(str,G)))
    for i in range(m):
        cnt += insertionSort(A,n,G[i])
    print(cnt)
    for i in A:
        print(i)
        
n = int(input())
A = []
for _ in range(n):
    A.append(int(input()))
shellsort(A,n)
import sys
def input():
    return sys.stdin.readline()[:-1]
mod=10**9+7
n=int(input())
xl=[list(map(int,input().split())) for i in range(n)]
ans=0
xl.sort()
if xl[0][0]+xl[0][1]>xl[1][0]-xl[1][1]:
    xl[1][0]=-1
    ans+=1

for i in range(1,n-1):
    if xl[i][0]==-1:
        continue
    else:
        if xl[i][0]+xl[i][1]>xl[i+1][0]-xl[i+1][1]:
            ans+=1
            xl[i+1][0]=-1
# print(xl)
print(n-ans)

### FIXED CODE ###

import sys
def input():
    return sys.stdin.readline()[:-1]
mod=10**9+7
n=int(input())
xl=[list(map(int,input().split())) for i in range(n)]
from collections import deque
# for i in range(n):
#     right.append(xl[i][0]+xl[i][1])
#     left.append(xl[i][0]-xl[i][1])
ans=0
xl.sort()
# right.sort()
# left.sort()
d=deque(xl)
while d:
    tmp=d.popleft()
    while d:
        if tmp[0]+tmp[1]>d[0][0]-d[0][1]:
            ans+=1
            if tmp[0]+tmp[1]>d[0][0]+d[0][1]:
                # d.popleft()
                break
            elif tmp[0]-tmp[1]>d[0][0]-d[0][1]:
                d.popleft()
            else:
                d.popleft()
        else:
            break
if n==1:
    print(1)
    quit()

print(n-ans)
a,b=map(int,input())
A=int(str(a)*b)
B=int(str(b)*a)
print(min(A,B))

### FIXED CODE ###

a,b=map(int,input().split())
if a<b:
    print(str(a)*b)
else:
    print((str(b)*a))
N, M = map(int, input().split())

I = [[] for _ in range(N)]
for i in range(M):
  a, b = map(int, input().split())
  a -= 1
  b -= 1
  I[a].append(b)
  I[b].append(a)

C = [-1 for _ in range(N)] 
visited = set()

def DFS(p, c):
  C[p] = c
  flag = True
  for q in I[p]:
    #print(p,q)
    if C[q] == c:
      return False
    elif C[q] == -1:
      if not DFS(q, 1-c):
        return False
  return True

#print(DFS(0, 0))
#print(C)
print(C.count(0)*C.count(1)-M if DFS(0, 0) else N*(N-1)//2-M)
      
      
  
  
  
  

### FIXED CODE ###

from collections import deque

N, M = map(int, input().split())
adj = [ [] for _ in range(N)]
clr = [-1 for _ in range(N)]

#グラフ構築
for _ in range(1,M+1):
  u, v = map(int, input().split())
  u -= 1
  v -= 1
  adj[u].append((v,1))
  adj[v].append((u,1))

#二部グラフか否か判定  
vis = [0 for _ in range(N)]
q = deque([(0,0)])
is_bip = True
#print(clr)
while q:
  p, c = q.popleft()
  clr[p] = c
  vis[p] = 1
  for x, w in adj[p]:
    if vis[x] == 0:
      q.append((x,(w+c)%2))
      #print((x,(w+c)%2))
    else: 
      if (clr[x] + c) % 2 == 0:
        is_bip = False
        break
  if not is_bip:
    break
    
#ここから問題特有の処理
if is_bip:#二部グラフの場合
  apple = clr.count(0)
  orange = clr.count(1)
  #print(apple,orange,M)
  print(apple*orange-M)
  
else:#二部グラフでない場合
  print(N*(N-1)//2-M)
import sys
import math

def main():
    # a = sys.stdin.readline().strip()
    a, b, c, d = [int(i) for i in sys.stdin.readline().strip().split()]
    # [[int(i) for i in sys.stdin.readline().strip().split()] for _ in range(2)]
    n = b - a + 1
    # print(n)
    if a % c == 0:
        mi_c = a // c
    else:
        mi_c = a // c + 1
    ma_c = b // c
    n -= (ma_c - mi_c + 1)
    # print(ma_c, mi_c, n)

    if a % d == 0:
        mi_d = a // d
    else:
        mi_d = a // d + 1
    ma_d = b // d
    n -= (ma_d - mi_d + 1)
    # print(ma_d, mi_d, n)

    cd = (c * d) // math.gcd(c, d)
    if a % cd == 0:
        mi_cd = a // cd
    else:
        mi_cd = a // cd + 1
    ma_cd = b // cd
    n += (ma_cd - mi_cd + 1)
    # print(ma_cd, mi_cd, n)
    print(n)
    
main()


### FIXED CODE ###

import sys
import fractions

def main():
    # a = sys.stdin.readline().strip()
    a, b, c, d = [int(i) for i in sys.stdin.readline().strip().split()]
    # [[int(i) for i in sys.stdin.readline().strip().split()] for _ in range(2)]
    n = b - a + 1
    # print(n)
    if a % c == 0:
        mi_c = a // c
    else:
        mi_c = a // c + 1
    ma_c = b // c
    n -= (ma_c - mi_c + 1)
    # print(ma_c, mi_c, n)

    if a % d == 0:
        mi_d = a // d
    else:
        mi_d = a // d + 1
    ma_d = b // d
    n -= (ma_d - mi_d + 1)
    # print(ma_d, mi_d, n)

    cd = (c * d) // fractions.gcd(c, d)
    if a % cd == 0:
        mi_cd = a // cd
    else:
        mi_cd = a // cd + 1
    ma_cd = b // cd
    n += (ma_cd - mi_cd + 1)
    # print(ma_cd, mi_cd, n)
    print(n)
    
main()
from functools import reduce
from operator import mul
import heapq

mod = 10**9 + 7

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

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

if N == K:
    print(reduce(mul, A)%mod)

else:

    AP = []
    AM = []
    for i in A:
        if i < 0:
            AM.append(-abs(i)%mod)
        else:
            AP.append(i%mod)
            
    if len(AP) == 0 and K%2 != 0:
        AM.sort(reverse=True)
        AM = AM[:K]
        print(reduce(mul, AM)%mod)

    else:
        AP = list(map(lambda x: x*(-1), AP))
        heapq.heapify(AP)
        heapq.heapify(AM)
        
        ans = 1
        cnt = 0
        while True:
            if (K - cnt) == 1:
                ans *= AP[0]
                print(ans%mod)
                break
                
            if 2 <= len(AP):
                AP2 = heapq.heappop(AP)*(-1)
                AP1 = heapq.heappop(AP)*(-1)
                

            if 2 <= len(AM):
                AM1 = heapq.heappop(AM)
                AM2 = heapq.heappop(AM)

                
            if AP1*AP2 >= AM1*AM2:
                ans *= AP1*AP2
                cnt += 2
                
            else:
                ans *= AM1*AM2
                m += 2
                cnt += 2 
                    
            if 1 >= len(AP) and 2 <= len(AM):
                ans *= AM1*AM2
                cnt += 2 
            
            if 2 <= len(AP) and 1 >= len(AM):
                ans *= AP1*AP2
                cnt += 2
            
            if cnt == K:
                print(ans%mod)
                break

    



    
      
    

### FIXED CODE ###

from bisect import bisect_left,bisect_right
p=10**9+7
n,k=map(int,input().split())
a=sorted(list(map(int,input().split())))
pi=1
ni=0
ans=1
i=0
while i<k-1:
  if a[ni]*a[ni+1]>a[-pi]*a[-pi-1]:
    ans=ans*a[ni]*a[ni+1]%p
    ni+=2
    i+=2
  else:
    ans=ans*a[-pi]%p
    pi+=1
    i+=1
if i==k-1:
  ans=ans*a[-pi]%p
if a[-1]<0 and k%2==1:
  ans=1
  for i in a[n-k:]:
    ans=ans*i%p
print(ans)
N=int(input())
h=list(map(int,input().split()))
DP=[0]*N
DP[0]=0
DP[1]=abs(h[0]-h[1])
for i in raange(1,N-1):
  DP[i+1]=min(DP[i]+abs(h[i]-h[i+1]),DP[i-1]+abs(h[i-1]-h[i+1]))
print(DP[N-1])
  

### FIXED CODE ###

N=int(input())
h=list(map(int,input().split()))
DP=[0]*N
DP[0]=0
DP[1]=abs(h[0]-h[1])
for i in range(1,N-1):
  DP[i+1]=min(DP[i]+abs(h[i]-h[i+1]),DP[i-1]+abs(h[i-1]-h[i+1]))
print(DP[N-1])
import math
from functools import reduce


def lcm(a,b):
    return (a*b)//math.gcd(a,b)


def lcm_list(a):
    return reduce(lcm,a)


if __name__ == '__main__':
    n = int(input())
    t = [int(input()) for i in range(n)]

    print(lcm_list(t))


### FIXED CODE ###

import fractions
from functools import reduce


def lcm(a,b):
    return (a*b)//fractions.gcd(a,b)


def lcm_list(a):
    return reduce(lcm,a)


if __name__ == '__main__':
    n = int(input())
    t = [int(input()) for i in range(n)]

    print(lcm_list(t))
x=int(input())
if x>=30 : 
  put('Yes')
else :
  put('No')

### FIXED CODE ###

x=int(input())
if x>=30:
  print('Yes')   
else:
  print('No')
n, x = map(int, input().split())

def make_burger(n):
    if n == 0:
        return "P"
    else:
        L = make_burger(n - 1)
        return "B" + L + "P" + L + "B"
    

b = make_burger(n)
ans = 0
for i in range(len(b) - 1, len(b) - x - 1, -1):
    if b[i] == "P":
        ans += 1
print(ans)

### FIXED CODE ###


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

a, p = [1], [1]

for i in range(n):
    a.append(a[i] * 2 + 3)
    p.append(p[i] * 2 + 1)

def cnt_p(n, x):
    if n == 0:
        if x <= 0:
            return 0
        return 1
    elif x <= 1 + a[n - 1]:
        return cnt_p(n - 1, x - 1)
    else:
        return p[n - 1] + 1 + cnt_p(n - 1, x - 2 - a[n - 1])


print(cnt_p(n, x))
while True:
    line = [int(i) for i in input().split(" ")]
    b = line[0]
    flag = 0
    for i in line:
        if i != b:
            flag = 1
    if flag == 1:
        print("No")
    else:
        print("Yes")

### FIXED CODE ###


line = [int(i) for i in input().split(" ")]
b = line[0]
flag = 0
for i in line:
    if i != b:
        flag = 1
if flag == 1:
    print("No")
else:
    print("Yes")
if __name__ == '__main__':
    a = [float(i) for i in input().split()]
    b= int(a[0])
    c = int(a[1]*100)
    d = Decimal(a[0]) * Decimal(a[1])
    e = int(d)
    print(e)



### FIXED CODE ###

import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque
from decimal import *

import numpy as np

import math

if __name__ == '__main__':
    a = [str(i) for i in input().split()]
    b = int(a[0])
    c = int(a[1].replace(".",""))
    d = Decimal(a[0]) * Decimal(c) / Decimal(100)
    e = int(d)
    print(e)
n = int(input())
a = list(map(int,input().split()))
a.sort()
b = [2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 
     131072, 262144, 524288, 1048576, 2097152, 4194304, 8388608, 16777216, 33554432, 
     67108864, 134217728, 268435456, 536870912]

t = []
bIdx = 0
for aa in a :
    while b[bIdx] <= aa:
        bIdx += 1   
    t.append(b[bIdx]-aa)

t.reverse()
a.sort(reverse=True)

sum = 0
i = 0

u = [0 for i in range(len(a))]

for i in range(len(a)-1):

    for j in range(i+1,len(a)):
        if a[j] == t[i] and u[j] <= 0:
            sum += 1
            u[j] += 1
    #print(a)
    
print(sum)

### FIXED CODE ###

from bisect  import bisect_left

n = int(input())
a = list(map(int,input().split()))
a.sort()
#print(a)

sum = 0
for i in range (len(a)-1,-1,-1):

    b = 1
    while b <= a[i]:
        b = b<<1
    t = b - a[i]
    #print("2^",t)

    k = bisect_left(a,t)
    if a[k] == t and k < i:
        sum += 1
        a[k] -= 0.1
        a[i] += 0.1
print(sum)
#ABC046.A
a = int(input())
b = int(input())
c = int(input())

if a == b==c:
    print(1)
elif a == b !=c:
    print(2)
elif a ==c !=b:
    print(2)
elif b ==c!=a:
    print(2)
else:
    print(3)

### FIXED CODE ###

#ABC046.A
a,b,c=map(int,input().split())

if a == b==c:
    print(1)
elif a == b !=c:
    print(2)
elif a ==c !=b:
    print(2)
elif b ==c!=a:
    print(2)
else:
    print(3)
import math

N, Q = list(map(int, input().split()))
c = list(map(int, input().split()))
query = [tuple(list(map(int, input().split())) + [i]) for i in range(Q)]
query_result = [0 for i in range(Q)]

collar_pos = [-1] * N
bit = [0] * (N + 1)

def bit_add(index, num):
    while (index <= N):
        bit[index] += num
        index += index & -index
    return

def bit_sum(index):
    result = 0
    while (index > 0):
        result += bit[index]
        index -= index & -index
    return result

sorted_query = sorted(query, key=lambda query: query[1]) # sort by right

index = 1
for query in sorted_query:
    while (index <= query[1]):
        # update BIT
        if (collar_pos[c[index-1]] != -1):
            bit_add(collar_pos[c[index-1]], -1)
        bit_add(index, 1)
        # update collar_pos
        collar_pos[c[index-1]] = index
        index += 1
    query_result[query[2]] = bit_sum(query[1]) - bit_sum(query[0]-1)

for q in query_result:
    print(q)

### FIXED CODE ###

class BinaryIndexedTree(object):
    def __init__(self, N):
        self.N = N
        self.bit = [0] * (N + 1)

    def bit_add(self, index, num):
        while (index <= self.N):
            self.bit[index] += num
            index += index & -index
        return

    def bit_sum(self,index):
        result = 0
        while (index > 0):
            result += self.bit[index]
            index -= index & -index
        return result

    def bit_sum_range(self, l, r):
        if (l == r):
            return 1
        else:
            return self.bit_sum(r) - self.bit_sum(l - 1)

def main():
    from sys import stdin
    N, Q = list(map(int, input().split()))
    c = list(map(int, input().split()))
    readline = stdin.readline
    query = [list(map(int, readline().split())) + [i] for i in range(Q)]
    query_result = [0 for i in range(Q)]
    collar_pos = [-1] * (N + 1)
    bit = BinaryIndexedTree(N)

    sorted_query = sorted(query, key=lambda query: query[1])

    index = 1
    for query in sorted_query:
        l, r, q = query
        while (index <= r):
            # update BIT
            if (collar_pos[c[index-1]] != -1):
                bit.bit_add(collar_pos[c[index-1]], -1)
            bit.bit_add(index, 1)
            # update collar_pos
            collar_pos[c[index-1]] = index
            index += 1
        query_result[q] = bit.bit_sum_range(l, r)

    print(*query_result, sep='\n')

if __name__ == '__main__':
    main()
import queue
INF=10**8
R=10**9+7
h,w=map(int,input().split())
maze=[input() for _ in range(h)]
d=[[0 for i in range(h)] for _ in range(w)]
sx=0
sy=0
gx=w-1
gy=h-1
q=queue.Queue()
dx=[1,0]
dy=[0,1]
q.put((sx,sy))
d[sy][sx]=1
while not q.empty():
  x,y=q.get()
  if (x,y)==(gx,gy):break
  for i in range(2):
    nx=x+dx[i]
    ny=y+dy[i]
    if nx<w and ny<h:
      if maze[ny][nx]=='.':
        if d[nx][ny]==0:
          q.put((nx,ny))
          d[nx][ny]=d[x][y]
        else:d[nx][ny]+=d[x][y]
print(d[gy][gx]%R)

### FIXED CODE ###

import queue
INF=10**8
R=10**9+7
h,w=map(int,input().split())
maze=[input() for _ in range(h)]
d=[[0 for i in range(h)] for _ in range(w)]
sx=0
sy=0
gx=w-1
gy=h-1
q=queue.Queue()
dx=[1,0]
dy=[0,1]
q.put((sx,sy))
d[sy][sx]=1
while not q.empty():
  x,y=q.get()
  if (x,y)==(gx,gy):break
  for i in range(2):
    nx=x+dx[i]
    ny=y+dy[i]
    if nx<w and ny<h:
      if maze[ny][nx]=='.':
        if d[nx][ny]==0:
          q.put((nx,ny))
          d[nx][ny]=d[x][y]
        else:d[nx][ny]+=d[x][y]
print(d[gx][gy]%R)
import math
def unchi(x,m,n):
  r=x//m+x//n-x//math.lcm(m,n)
  return r
a,b,c,d=(int(i) for i in input().split())
print(b-a+1-(unchi(b,c,d)-unchi(a-1,c,d)))

### FIXED CODE ###

def gcd(a, b):
	while b:
		a, b = b, a % b
	return a
def unchi(x,m,n):
  r=x//m+x//n-x//(m*n//(gcd(m,n)))
  return r
a,b,c,d=(int(i) for i in input().split())
print(b-a+1-(unchi(b,c,d)-unchi(a-1,c,d)))
def main():
    N = int(input())
    an = sorted(map(int, input().split(' ')))
    
    # N = 6
    # an = [2, 7, 1, 8, 2, 8]
    # an = [1, 2, 3, 4]
    
    # a = [i % 4 for i in an]
    
    for i in range(len(N)-1):
        a = an[i]
        b = an[i+1]
        c = a * b
        if c % 4 != 0:
            print('No')
            
    print('Yes')
    
    
    
    
    
    
main()

### FIXED CODE ###

from collections import Counter

def main():
    N = int(input())
    an = sorted(map(int, input().split(' ')))
    
    # N = 6
    # an = [1, 10, 100]
    # an = [2, 7, 1, 8, 2, 8]
    # an = [1, 2, 3, 4]
    # an = [1, 4, 1]
    # an = [846579189, 56223110]
    
    out = []
    
    for a in an:
        if a % 2 != 0:
            out.append('A')
        elif a % 4 != 0:
            out.append('B')
        else:
            out.append('C') 
    # print(out)
    counter = Counter(out)
    # print(counter)
    num_A = counter['A']
    num_B = counter['B']
    num_C = counter['C']
    # print(num_A, num_B, num_C)
    
    if num_A == 1 and num_B == 1 and num_C ==0:
        print('No')
        return
    
    if not ('B' in out):
        if (num_C + 1) >= num_A:
            print('Yes')
            # return
        else:
            print('No')
            # return
    else:
        if num_B >= num_A:
            print('Yes')
        else:
            print('No')
        
        
        
        
    
main()