Harryxun/stf_run huggingface dataset:
N ,A ,B ,C ,D = list(map(int,input().split()))
S = input()
 
def judgeArrive(S, x, y):
    flag = "Yes"
    for i in range(x-1 ,y-2):
        if S[i] ==  S[i+1] == "#":
            flag = "No"
  return flag

def judgeJumpOver(S, x , y):
    flag = "No"
    for i in range(x-1 ,y):
        if S[i-1] ==  S[i] ==  S[i+1] == ".":
            flag = "Yes"
        break
 
  return flag
 
result = "Yes"
if(C > D):
    result = judgeJumpOver(S, B, D)
if(result == "Yes"):
    result = judgeArrive(S, B, D)
if(result == "Yes"):
    result = judgeArrive(S, A, C)
print(result)

### FIXED CODE ###

n, a, b, c, d = list(map(int, input().split()))
s = input()
if d > c:
    for i in range(a, d-1):
        if (s[i-1] == "#") & (s[i] == "#"):
            print("No")
            break
    else:
        print("Yes")
else:
    for i in range(a, d):
        if (s[i-1] == "#") & (s[i] == "#"):
            print("No")
            break
    else:
        for j in range(b-1, d):
            if (s[j-1] == ".") & (s[j] == ".") & (s[j+1] == "."):
                print("Yes")
                break
        else:
            print("No")
X = int(input())
Y = int(input())

x = round(X + Y/2)

print(x)    

### FIXED CODE ###

X,Y = map(int,input().split())
print(X+Y//2)
n = int(input())

zombies = [int(c) for c in input().split()]


def gcd(a, b):
    mod = a % b
    if mod == 0:
        return b
    else:
        return gcd(b, mod)


def saidai_koyakusu(n, ns):
    if len(ns) == 1:
        return ns[0]
    return gcd(n, saidai_koyakusu(ns[0], ns[1:]))


if len(zombies) == 1:
    print(zombies[0])
else:
    print(saidai_koyakusu(zombies[0], zombies[1:]))


### FIXED CODE ###

n = int(input())

zombies = [int(c) for c in input().split()]


def gcd(a, b):
    c = a % b
    if c == 0:
        return b
    else:
        return gcd(b, c)


m = zombies[0]
for i in range(1, len(zombies)):
    m = gcd(m, zombies[i])

print(m)
s = input()
k = int(input())

if len(s)>k and all(s[i]=="1" for i in range(k)):
    print(1)
else:
    while s[0]=="1":
        s.pop(0)
    print(s[0])


### FIXED CODE ###

s = input()
k = int(input())

if all(s[i]=="1" for i in range(min(len(s),k))):
    print(1)
else:
    while s[0]=="1":
        s = s[1:]
    print(s[0])
friends=input()
friends.split(' ')
friends_all=friends[0]
friends_cake=friends[1]
cakes=input()
cakes_amount(sum(cakes.split(' ')))
one_person=cakes_amount//friends_all
if cakes_amount%friends_all==0:
        pass
else:
        one_person+=1
preint(one_person)



### FIXED CODE ###

friends=input()
friends=friends.split()
friends_all=friends[0]
person=int(friends_all)+1
cakes=input()
cakes_amount=0
for a in cakes.split():
        cakes_amount+=int(a)
one_person=cakes_amount//person

if cakes_amount%person!=0:
        one_person+=1
else:
        pass
print(one_person)
x, a, b = map(int, input().split())
if b - a < 0:
    print("delicious")
elif 0 <= b - a =< x:
    print("safe")
else:
    print("dangerous")


### FIXED CODE ###

x, a, b = map(int, input().split())
if b - a <= 0:
    print("delicious")
elif 0 < b - a <= x:
    print("safe")
else:
    print("dangerous")
import sys
import socket

if socket.gethostname() in ['N551J', 'F551C']:
    sys.stdin = open('c1.in')


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


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


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


def read_str():
    return input()


def solve():
    n = read_int()
    rows = [read_int_list() for i in range(n)]
    a, b = map(list, zip(*rows))
    res = sum(a)
    res = min(res, sum(b))
    all_values = [(a[i], i, 0) for i in range(n)]
    all_values.extend([(b[i], i, 1) for i in range(n)])
    all_values.sort()
    index_of_value = {v: i for i, v in enumerate(all_values)}
    first_values = [
        set(all_values[:n - 2]),
        set(all_values[:n - 1]),
        set(all_values[:n]),
    ]

    s = [sum([t[0] for t in v]) for v in first_values]

    for i in range(n):
        rest = []
        k = 0
        if index_of_value[(a[i], i, 0)] < n:
            k += 1
        else:
            rest.append(a[i])
        if index_of_value[(b[i], i, 1)] < n:
            k += 1
        else:
            rest.append(b[i])
        t = s[k] + sum(rest)
        res = min(res, t)
    return res


def main():
    res = solve()
    print(res)


if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
import socket

if socket.gethostname() in ['N551J', 'F551C']:
    test_case = 'c1.in'
    sys.stdin = open(test_case)


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


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


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


def read_str():
    return input()


def solve():
    n = read_int()
    rows = [read_int_list() for i in range(n)]
    a, b = map(list, zip(*rows))
    res = sum(a)
    res = min(res, sum(b))
    all_values = [(a[i], i, 0) for i in range(n)]
    all_values.extend([(b[i], i, 1) for i in range(n)])
    all_values.sort()
    index_of_value = {v: i for i, v in enumerate(all_values)}
    first_values = [
        set(all_values[:n - 2]),
        set(all_values[:n - 1]),
        set(all_values[:n]),
    ]

    s = [sum([t[0] for t in v]) for v in first_values]
    for i in range(n):
        rest = []
        k = 0
        last = n - 2
        indices = sorted([(index_of_value[(a[i], i, 0)], a[i]),
                          (index_of_value[(b[i], i, 1)], b[i])])

        for index, value in indices:
            if index < last:
                last += 1
                k += 1
            else:
                rest.append(value)
        t = s[k] + sum(rest)
        res = min(res, t)
    return res


def main():
    res = solve()
    print(res)


if __name__ == '__main__':
    main()
import functools
import operator

N = int(input())
A = list(map(int, input().split()))
mod = 10**9+7
ans = 0

for i in range(2**len(A)):\
    list2 = []
    for j in range(len(A)):
        if (i >> j) &1 == 1:
            list2.append(A[j])
    if len(list2) == 2:
        ans += list2[0]*list2[1]
#        print(ans)
#    print(list2)
    ans = ans%mod
print(ans)


### FIXED CODE ###

import functools
import operator

N = int(input())
A = list(map(int, input().split()))
mod = 10**9+7
ans = 0
v = sum(A)
for i in range(N-1):
    v -= A[i]
    ans += A[i]*v
print(ans%mod)
n=int(input())
x,y=[int(input()) for _ in range(n)],[int(input()) for _ in range(n)]
d=0
for i,j in zip(x,y):
  for k,l in zip(x,y):
    m1,m2=i-k,j-l
    o=m1**2+m2**2
    d+=o**0.5
print(d/n)

### FIXED CODE ###

n=int(input())
x=[0]*n
y=[0]*n
for i in range(n):
  x[i],y[i]=map(int, input().split())
d=0
for i,j in zip(x,y):
  for k,l in zip(x,y):
    m1,m2=i-k,j-l
    o=m1**2+m2**2
    d+=o**0.5
print(d/n)
n=int(input())
x=input()
p=x.count('1')

#popcount(x)が0,1だった場合に対応
#if p==0:
#    for i in range(n):
#        print(1)
#    exit()
#elif p==1:
#    z=x.index('1')
#    for i in range(n):
#        if i==z:
#            print(0)
#        else:
#            print(1)
#    exit()

#愚直に解く関数を定義
def solve(n):
    count=0
    while n:
        popcount=bin(n).count('1')
        n%=popcount
        count+=1
    return count

#2^i mod(p+1),2^i mod(p-1)のリストを作成
a,b=[],[]
for i in range(n):
    a.append(pow(2,i,p+1))
    b.append(pow(2,i,p-1))

#x mod(p+1),x mod(p-1)を計算
a1,b1=0,0
for i in range(n):
    if x[-1-i]=='1':
        a1+=a[i]
        b1+=b[i]

#本計算
for i in range(n):
    if x[i]=='1':
        tmp=(b1-b[-1-i])%(p-1)
    else:
        tmp=(a1+a[-1-i])%(p+1)
    print(solve(tmp)+1)

### FIXED CODE ###

n=int(input())
x=input()
p=x.count('1')

#愚直に解く関数を定義
def solve(n):
    count=0
    while n:
        popcount=bin(n).count('1')
        n%=popcount
        count+=1
    return count+1

#popcount(x)が0,1だった場合に対応
if p==0:
    for i in range(n):
        print(1)
    exit()
elif p==1:
    z=x.index('1')
    t=pow(2,n-z-1,p+1)
    for i in range(n):
        if i==z:
            print(0)
        else:
            tmp=(t+pow(2,n-i-1,p+1))%(p+1)
            print(solve(tmp))
    exit()


#2^i mod(p+1),2^i mod(p-1)のリストを作成
a,b=[],[]
for i in range(n):
    a.append(pow(2,i,p+1))
    b.append(pow(2,i,p-1))

#x mod(p+1),x mod(p-1)を計算
a1,b1=0,0
for i in range(n):
    if x[-1-i]=='1':
        a1+=a[i]
        b1+=b[i]

#本計算
for i in range(n):
    if x[i]=='1':
        tmp=(b1-b[-1-i])%(p-1)
    else:
        tmp=(a1+a[-1-i])%(p+1)
    print(solve(tmp))
n = int( input())
a = list ( map( int, input().split()))

def swap(a,i,j):
  c = a[i]
  d = a[j]
  if a[i]>a[j]:
    a[j] = c
    a[i] = d
  return a

for i in range (int(n/2)+1):
  for j in range (i+1,n):
    swap(a,i,j)
    
print(a[int(n/2)+1]-a[int(n/2)])



  

### FIXED CODE ###

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

a.sort()
k = int(n/2)    
print(a[k]-a[k-1])
# -*- coding: utf-8 -*-

n, m = map(int, input().split())
friend_list = []
friend_list2 = []
for i in range(m):
  a, b = map(int, input().split())
  friend_list.append([a, b])
while friend_list:
  friend = friend_list.pop()
  if not friend_list2:
    friend_list2.append(friend)
  else:
    temp_list = friend_list2.copy()
    for i in temp_list:
      if friend[0] in i and friend[1] not in i:
        i.append(friend[1])
        break
      elif friend[1] in i and friend[0] not in i:
        i.append(friend[0])
        break
      elif friend[0] in i and friend[1] in i:
        break
      else:
        friend_list2.append(friend)

print(max(map(len, friend_list2)))

### FIXED CODE ###

# -*- coding: utf-8 -*-
import numpy
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

n, m = map(int, input().split())
uf = UnionFind(n)
for i in range(m):
    a, b = map(int, input().split())
    uf.union(a-1, b-1)
answer = []
for i in range(n):
    answer.append(uf.size(i))
print(max(answer))
from collections import defaultdict as dedict
counter = dedict(int)

a = input()
for i in list(a):
  counter[i] += 1
  
if ( len(counter) == 2) and (  counter [counter.keys()[0]] == 2):
  print ("Yes")
  
else:
  print('No')
  
  

### FIXED CODE ###

from collections import defaultdict as dedict
counter = dedict(int)

a = input()
for i in list(a):
  counter[i] += 1
  
if ( len(counter) == 2) and (  counter [a[0]] == 2):
  print ("Yes")
  
else:
  print('No')
n,q=map(int,input().split())
ab=[[_] for _ in range(n)]
for i in range(n-1):
    a,b=map(int,input().split())
    ab[max(a,b)-1].append(min(a,b))
ab[0].append(-1)
ans=[0]*n
for i in range(q):
    p,x=map(int,input().split())
    ans[p-1]+=x
ab.sort(key=lambda x: x[1])
for i in range(1,n):
    for j in range(1,len(ab[i])):
        ans[ab[i][0]]+=ans[ab[i][j]-1]
print(*ans)


### FIXED CODE ###

from collections import deque
n,q=map(int,input().split())
num=[[] for _ in range(n)]
for i in range(n-1):
    a,b=map(int,input().split())
    num[a-1].append(b)
    num[b-1].append(a)
ans=[0]*n
for i in range(q):
    p,x=map(int,input().split())
    ans[p-1]+=x
queue=deque()
queue.append(0)
seen=[False]*n
for i in range(n):
    if len(queue)==0:
        break
    num1=queue.popleft()
    seen[num1]=True
    num2=num[num1]
    for j in range(len(num2)):
        if seen[num2[j]-1]==False:
            ans[num2[j]-1]+=ans[num1]
            queue.append(num2[j]-1)
for i in ans:
    print(i)
n = int(input())
a = [input() for i in range(n)]
b = []
for i in range(n):
  if a[i] in b:
    b.pop(a[i])
  else:
    b.append(a[i])
print(len(b))

### FIXED CODE ###

n = int(input())
a = [input() for i in range(n)]
d = {}
ans = 0
for i in a:
  if i in d:
    d[i] += 1
  else:
    d[i] = 1
for i in d.keys():
  if d[i] % 2 == 1:
    ans += 1
print(ans)
r = float(input())
print(2*r*np.pi, (r**2)*np.pi)


### FIXED CODE ###

r = float(input())

pi = 3.141592653589793
print(pi*r**2, 2*pi*r)
s = input()
a = []

for i in range(len(s)):
    if (s[i] == "B"):
        if(len(a) == 0):
            continue
        else:
            a.remove(a[i-1])
    else:
        a.append(s[i])
print(''.join(a))

### FIXED CODE ###

s = input()
a = []

for i in range(len(s)):
    if (s[i] == "B"):
        if(len(a) <= 0):
            continue
        else:
            a.pop()
    else:
        a.append(s[i])
print(''.join(a))
n = int(input())
s = {}
total = 0

for i in range(n):
    string = list(input())
    string.sort(reverse = False)
    if tuple(string) in s:
        s[tuple(string)] += 1
    else:
        s[tuple(string)] = 1

for i in s:
    if i != 1:
        total += sum([i for i in range(1,i)])

print(total)

### FIXED CODE ###

N = int(input())
s_dict = {}
ans = 0
for i in range(N):
  string = list(input())
  string.sort(reverse=False)
  if tuple(string) in s_dict:
    s_dict[tuple(string)] += 1
  else:
    s_dict[tuple(string)] = 1

for i in s_dict.values():
  if i != 1:
    ans += sum([i for i in range(1,i)])

print(ans)
n,k = map(int, input().split( ))

s = input()

if n ==1:
    print(0)
    sys.exit()

ans = n-1
tmp = 0
for i in range(n-1):
    if s[i] != s[i+1]:
        ans -= 1
        
ans += 2*k
print(min(ans,n-1))
        



### FIXED CODE ###

#import sys
n,k = map(int, input().split( ))

s = input()

#if n ==1:
#    print(0)
#    sys.exit()

ans = n-1
tmp = 0
for i in range(n-1):
    if s[i] != s[i+1]:
        ans -= 1
        
ans += 2*k
print(min(ans,n-1))
N,M=map(int,input().split())
a=list(map(int,input().split()))
S=sum(a)
a.sort()
print(S/4*M)
print(a)
if a[N-M+1] >= S/4*M:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

N,M=map(int,input().split())
a=list(map(int,input().split()))
S=sum(a)
a.sort()
if a[N-M] >= S/(4*M):
  print('Yes')
else:
  print('No')
n, q = map(int, input().split())
s = input()
for i in range(q):
    l, r = map(int, input().split())
    start_a = s[l-1:r].find('A')
    end_a = s[l-1:r].rfind('A')
    start_c = s[l-1:r].find("C")
    end_c = s[l-1:r].rfind("C")
    if start_a == end_a or start_a +1 == start_c:
        start = start_a
    elif start_a +1 < start_c
        start = start_c +1
       
    if start_c == end_c or end_a +1 == end_c:
        end = end_c
    elif end_a +1 < end_c
        end = end_a
        
    if start == -1 or end== -1 or end <= start:
        print(0)
        continue
    cand = s[l-1:r][start:end+1]
    print(cand.count("AC"))

### FIXED CODE ###

N, Q = map(int, input().split())
S = input()

t = [0] * (N)
for i in range(N-1):
    t[i+1] = t[i] + (1 if S[i:i+2]=="AC" else 0)

for j in range(Q):
    l, r = map(int, input().split())
    print(t[r-1] - t[l-1])
# -*- coding: utf-8 -*-
"""
Created on Sat May  9 01:31:32 2020

@author: shinba
"""
a,b = map(int,input().split())

if a >= b:
    print(f'{b}'*a)
else:
    print(f'{a}'*b)



### FIXED CODE ###

# -*- coding: utf-8 -*-
"""
Created on Sat May  9 01:31:32 2020

@author: shinba
"""
a,b = map(int,input().split())

if a >= b:
    print("{}".format(b)*a)
else:
    print("{}".format(a)*b)
A, B = map(int, input().split())

print((A * (B * 100)) / 100) 

### FIXED CODE ###

A, B = input().split()

A = int(A)
B = int(float(B) * 100 + 0.5)
ans = A * B // 100

print(ans)
x = input()
print(x**3)

### FIXED CODE ###

x = (int)(input())
print(x**3)
import copy
import math

a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]

L = math.inf
for i in b:
    b_1 = copy.deepcopy(b)
    j = copy.deepcopy(i)
    H = 0
    
    
    while True:
        if i in b_1:
            b_1.remove(i)
        if b_1 == []:
            break
        if H > L:
            break
        i += 1
        if i == a[0]:
            i = 0
        H += 1
    
    if L > H:
        L = H
        
    b_1 = copy.deepcopy(b)
    H = 0
    
    while True:
        if j in b_1:
            b_1.remove(j)
        if b_1 == []:
            break
        if H > L:
            break
        j -= 1
        if j == 0:
            j = a[0]
        H += 1
    
    if L > H:
        L = H
print(L)

### FIXED CODE ###

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

L =[]
for i in range(1,n):
    L.append(A[i]-A[i-1]) #A[0],A[-1]以外のの道
L.append(k-A[-1] + A[0])#A[0],A[-1]の道
print(k - max(L))#一つだけ通らなくてもいい
N, X = map(int, input().split())
L = list(map(int, input().split()))

coordinate = 0
count = 1

while True:
    coordinate += L[count-1]
    if coordinate > X:
        break
    else:
        count += 1

print(count)


### FIXED CODE ###

N, X = map(int, input().split())
L = list(map(int, input().split()))

coordinate = 0
count = 0

while count < N:
    coordinate += L[count]
    if coordinate > X:
        break
    else:
        count += 1

print(count+1)
n=int(input())
l=[int(input()) for i in range(n)]

l_5=[i for i in l if i%5==0 and i%10!=0]
l_10=[i for i in l if i%10==0]

sum_l=sum(l)

if sum_l%10!=0:
  print(sum_l)
else:
  if len(l_10)==n:
    print(0)
  else:
    print(sum_l-min(l_5))

### FIXED CODE ###

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

lis=[i for i in l if i%10!=0]

sum_l=sum(l)

if sum_l%10!=0:
  print(sum_l)
else:
  if len(lis)==0:
    print(0)
  else:
    print(sum_l-min(lis))
N, M = list(map(int, input().split(' ')))
sc = [list(map(int, input().split(' '))) for i in range(M)]


ans_l = [0 for i in range(N)]

ans_final = 0

for s, c in sc:
    if (not ans_l[s-1]) or ans_l[s-1] == str(c):
        ans_l[s-1] = str(c)
    else:
        ans_final = -1
        break

ans_l = list(map(str, ans_l))

ans_n = 0

if not ans_final:
    ans_n = int(''.join(ans_l))

ans_final = ans_n
if len(str(ans_n)) != n:
    ans_final = -1

print(str(ans_final))

### FIXED CODE ###

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

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

def solve():
    global n, m, sc
    for i in range(1000):
        tmp = str(i)
        if len(tmp) != n:
            continue
        check = True
        for s, c in sc:
            if int(tmp[s-1]) != c:
                check = False
        if check:
            return tmp
    return -1
print(solve())
total = int(input())
s = input()
 
if total%2 == 1:
  print("No")
else:
  if(s[:total/2] is s[total/2:]):
    print("Yes")
  else:
      print("No")

### FIXED CODE ###

total = int(input())
s = input()
 
if total%2 == 1:
  print("No")
else:
  if(s[:int(total/2)] == s[int(total/2):]):
    print("Yes")
  else:
      print("No")
S=input()

ans="NO"
n=0
w=0
e=0
s=0

for str in S:
  if str=="N":
    n +=1
  elif str=="E":
    e +=1
  elif str=="S":
    s +=1
  else:
    w +=1

if (n>0 and s>0) or (n==0 and s==0):
  tate=True
if (e>0 and w>0) or (e==0 and w==0):
  yoko=True
  
if tate and yoko:
  ans="Yes"
  
print(ans)

### FIXED CODE ###

S=input()

ans="No"
n=0
w=0
e=0
s=0
tate=0
yoko=0

for str in S:
  if str=="N":
    n +=1
  elif str=="E":
    e +=1
  elif str=="S":
    s +=1
  else:
    w +=1

if (n>0 and s>0) or (n==0 and s==0):
  tate=True
if (e>0 and w>0) or (e==0 and w==0):
  yoko=True
  
if tate and yoko:
  ans="Yes"
  
print(ans)
a,b,c=map(int,input().split())
l=list(range(a,a+c))
m=list(range(b,a-1,-1))
ans=sort(set(l+M))
print(ans)

### FIXED CODE ###

a,b,c=map(int,input().split()) 
l=list(range(a,b+1)[0:c]) 
m=list(range(b,a-1,-1)[0:c]) 
ans=sorted(set(l+m)) 
print(*ans)
A, B, C, X, Y = [int(i) for i in input().split()]

mincost = 10000000000

for a in range(X + 1):
    for b in range(Y + 1):
        c = max[(X - a) * 2, (Y - b) * 2]
        cost = a * A + b * B + c * C
        if (cost < mincost):
            mincost = cost

print(mincost)


### FIXED CODE ###

A, B, C, X, Y = [int(i) for i in input().split()]

cost1 = X * A + Y * B

c = X * 2
a = 0
b = max([0, Y - c / 2])
cost2 = a * A + b * B + c * C

c = Y * 2
a = max([0, X - c / 2])
b = 0
cost3 = a * A + b * B + c * C

print(int(min([cost1, cost2, cost3])))
total_cost = 0

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

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

AB_list = sorted(AB_list)

for i in range(N):
    if AB_list[i][1]<M:
        M = M - AB_list[i][1]
        total_cost =  total_cost + AB_list[i][0] * AB_list[i][1]
    else:
        total_cost = total_cost + M * AB_list[i][0]
        break
print(total_cost)


### FIXED CODE ###


H, W = map(int, input().split())
h, w = map(int, input().split())

print((H-h)*(W-w))
for i in  s:
    if i =="Y":
        print ("Four")
        break

else:
    print ("Three")

### FIXED CODE ###

N=(int,input())
s = input().split()
for i in  s:
    if i =="Y":
        print ("Four")
        break
 
else:
    print ("Three")
'''
1 1 1
2 2 2
1
2
3
とあったら、1*1+1*2+1*3
          2*1+2*2+2*3
みたいな感じ。
'''

from operator import add
from functools import reduce

#テスト値
n = int(input())
m = int(input())
#a = [[1,1,1],[2,2,2]]
#b = [1,2,3]

a = [list(map(int, input().split())) for n in range(n)]
#print(a)

b = [int(input()) for n in range(m)]
#print(b)

#ベクトル積の計算。
#まず行ごとの値を計算。
c = []
for n in range(n):
    c.append([a[n][m]*b[m] for m in range(m)])
    
#print(c)#ここまでOK。

d=[reduce(add,c[n]) for n in range(len(c))]



#print(d)

[print(d[i]) for i in range(len(d))]



### FIXED CODE ###

'''
1 1 1
2 2 2
1
2
3
とあったら、1*1+1*2+1*3
          2*1+2*2+2*3
みたいな感じ。
'''

from operator import add
from functools import reduce

#テスト値
n,m = map(int,input().split())
#a = [[1,1,1],[2,2,2]]
#b = [1,2,3]

a = [list(map(int, input().split())) for n in range(n)]
#print(a)

b = [int(input()) for n in range(m)]
#print(b)

#ベクトル積の計算。
#まず行ごとの値を計算。
c = []
for n in range(n):
    c.append([a[n][m]*b[m] for m in range(m)])
    
#print(c)#ここまでOK。

d=[reduce(add,c[n]) for n in range(len(c))]



#print(d)

[print(d[i]) for i in range(len(d))]
from math import gcd, sqrt


def is_prime(n):
    flag = True
    for k in range(2, int(sqrt(n)) + 1):
        if n % k == 0:
            flag = False
            return

    if flag:
        return n


def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors


def main():
    a, b = map(int, input().split())
    coms = make_divisors(gcd(a, b))
    # print(coms)
    ans = [is_prime(i) for i in coms]
    # print(ans)
    ans2 = [a for a in ans if a is not None]
    print(len(ans2))


if __name__ == "__main__":
    main()


### FIXED CODE ###

def main():
    n = int(input())
    a = list(map(int, input().split()))
    ans = []
    a = {i: k for i, k in enumerate(a, start=1)}
    a = sorted(a.items(), key=lambda a: a[1])
    for i in a:
        ans.append(i[0])

    print(*ans)


if __name__ == "__main__":
    main()
a, b, c = map(int, input().split())
if a[-1]==b[0] and b[-1]==c[0]:
  print("YES")
else:
  print("NO")

### FIXED CODE ###

a, b, c = map(str, input().split())
if a[-1]==b[0] and b[-1]==c[0]:
  print("YES")
else:
  print("NO")
y = x
cnt = 0
for ai in a:
    if y - ai >= 0:
        y -= ai
        cnt += 1
if y and cnt == n:
    print(cnt - 1)
else:
    print(cnt)

### FIXED CODE ###

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

y = x
cnt = 0
for ai in a:
    if y - ai >= 0:
        y -= ai
        cnt += 1
if y and cnt == n:
    print(cnt - 1)
else:
    print(cnt)
a,b=map(int,input().split());print('Possible' if a%3==0 else 'Possible' if b%3==0 else 'Possible' (a+b)%3==0 else 'Impossible')

### FIXED CODE ###

a,b=map(int,input().split());print('Possible' if a%3==0 else 'Possible' if b%3==0 else 'Possible' if (a+b)%3==0 else 'Impossible')