Harryxun/stf_run huggingface dataset:
x = [input() for i in range(N)]
AC = 0
WA = 0
TLE = 0
RE = 0
for t in range(N):
    if x[t] == 'AC':
        AC += 1
    elif x[t] == 'WA':
        WA += 1
    elif x[t] == 'TLE':
        TLE += 1
    else:
        RE += 1
print('AC x',AC)
print('WA x',WA)
print('TLE x',TLE)
print('RE x',RE)

### FIXED CODE ###

N = int(input())
x = [input() for i in range(N)]
AC = 0
WA = 0
TLE = 0
RE = 0
for t in range(N):
    if x[t] == 'AC':
        AC += 1
    elif x[t] == 'WA':
        WA += 1
    elif x[t] == 'TLE':
        TLE += 1
    else:
        RE += 1
print('AC x',AC)
print('WA x',WA)
print('TLE x',TLE)
print('RE x',RE)
ws = input()
ans = 0
i = 0
r = 0
while i < 3:
  if ws[i] == "R":
  	r += 1
    ans = max(ans, r)
  else
	r = 0
  i += 1

print(ans)



### FIXED CODE ###

ws = input()

i, r, ans = 0, 0, 0

while i < 3:
    if ws[i] == "R":
        r += 1
        ans = max(ans, r)
    else:
        r = 0
    i += 1
print(ans)
import sys
input = sys.stdin.readline

N,M,P = map(int,input().split())
edge = [[] for _ in range(M)]
for i in range(M):
    A,B,C = map(int,input().split())
    edge[i].append(A-1,B-1,-(C-P))

def Bellman_Ford(edges, start, N):
    inf = float("inf")
    # dist[i]: 頂点iまでの最短距離
    dist = [inf for i in range(N)]
    dist[start] = 0

    for i in range(N+N):
        for a,b,c in edges:
            if a != inf and dist[b] > dist[a] + c:
                dist[b] = dist[a] + c
                # startからgoalまでに負閉路がある場合
                if i >= N:
                    dist[b] = -float("inf")
        # 一回目のベルマンフォード法の結果
        if i == N-1:
            first_time = dist[-1]
    # (一回目,二回目)
    return (first_time, dist[-1])

first,second = Bellman_Ford(edge, 0, N)
if first != second:
    answer = -1
else:
    answer = max(0,-second)

print(answer)

### FIXED CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)

N,M,P = map(int,input().split())
edge = []
for i in range(M):
    A,B,C = map(int,input().split())
    edge.append([A-1,B-1,P-C])

def Bellman_Ford(edges, start, N):
    inf = float("inf")
    # dist[i]: 頂点iまでの最短距離
    dist = [inf for i in range(N)]
    dist[start] = 0

    for i in range(N+N):
        for a,b,c in edges:
            if a != inf and dist[b] > dist[a] + c:
                dist[b] = dist[a] + c
                # startからgoalまでに負閉路がある場合
                if i >= N:
                    dist[b] = -inf
        # 一回目のベルマンフォード法の結果
        if i == N-1:
            first_time = dist[-1]
    # (一回目,二回目)
    return first_time, dist[-1]

first,second = Bellman_Ford(edge, 0, N)
if first != second:
    answer = -1
else:
    answer = max(0,-second)

print(answer)
N, M = map(int, input().split())
L = []
for i in range(M):
  P, Y = map(int, input().split())
  L.append((P, Y, i))
ans = ['']*(N)

L.sort(key=lambda x:(x[0], x[1]))
before = L[0][0]
num = 1
for i in range(M):
  if L[i][0] == before:
    num += 1
    id = '{:06d}'.format(L[i][0]) + '{:06d}'.format(num)
    ans[L[i][2]] = id
  else:
    num = 1
    id = '{:06d}'.format(L[i][0]) + '{:06d}'.format(num)
    ans[L[i][2]] = id
    before = L[i][0]
for city in ans:
  print(city)
    
  
  

### FIXED CODE ###

N, M = map(int, input().split())
L = []
for i in range(M):
  P, Y = map(int, input().split())
  L.append((P, Y, i))
ans = ['']*(M)
L.sort(key=lambda x:(x[0], x[1]))
before = L[0][0]
num = 0
for i in range(M):
  if L[i][0] == before:
    num += 1
    id = '{:06d}'.format(L[i][0]) + '{:06d}'.format(num)
    ans[L[i][2]] = id
  else:
    num = 1
    id = '{:06d}'.format(L[i][0]) + '{:06d}'.format(num)
    ans[L[i][2]] = id
    before = L[i][0]
for city in ans:
  print(city)
a,b,c=map(int,input())
t=a+b+c
if t<=21:
  print('win')
else:
  print('bust')

### FIXED CODE ###

a,b,c=map(int,input().split())
t=a+b+c
if t<=21:
  print('win')
else:
  print('bust')
n, k = map(int, input().split())

li = [0]
li.extend(list(map(int, input().split())))

def search(town, li, times):
  if times == 0:
    return town
  else:
    return search(li[town], li, times-1)

tuita = [0]*(n+1)
cnt = 0
town = 1

while True:
  town = li[town]
  cnt += 1
  if tuita[town] == 0:
    tuita[town] = cnt
  else:
    if k < tuita[town]:
      print(search(1, li, k))
    elif k == tuita[town]:
      print(town)
    else:
      print(search(town, li, (k - tuita[town]) % (cnt - tuita[town])))
    break
 

  
    

### FIXED CODE ###

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

li = [0]
li.extend(list(map(int, input().split())))
tuita = [0]*(n+1)
cnt = 0
town = 1

lastTown = 1
while True:
  town = li[town]
  cnt += 1
  if tuita[town] == 0:
    tuita[town] = cnt
  else:
    if k < tuita[town]:
      lastTown = 1
      times = k
    elif k == tuita[town]:
      lastTown = town
      times = 0
    else:
      lastTown = town
      times = (k - tuita[town]) % (cnt - tuita[town])
    break

town = lastTown
while times > 0:
  if times <= 0:
    break
  times -= 1
  town = li[town]
print(town)
import math


def main():
    N = int(input())

    if N % 2 == 0:
        B = N // 2
        n = math.floor(math.log(B) / math.log(5))

        ans = 0
        for i in range(1, n + 1):
            ans += B // (5**i)

    else:
        ans = 0

    print(int(ans))


main()


### FIXED CODE ###

import math


def main():
    N = int(input())

    if N == 0 or N == 1:
        ans = 0

    elif N % 2 == 0:
        B = N // 2
        n = math.floor(math.log(B) / math.log(5))

        ans = 0
        for i in range(1, n + 1):
            ans += B // (5**i)

    else:
        ans = 0

    print(int(ans))


main()
N=int(input())
v=list(map(int, input().split()))
v.sort()
for i in range(N-2):
  v1=v
  v=[(v1[0]+v1[1])/2]
  v.extend(v[2:])
print(sum(v)/2)

### FIXED CODE ###

N=int(input())
v=list(map(int, input().split()))
v.sort()
for i in range(N-2):
  v1=v
  v=[(v1[0]+v1[1])/2]
  v.extend(v1[2:])
print(sum(v)/2)
import itertools


def solve():
    N = int(input())
    A = list(map(int, input().split(" ")))
    matrix = [[] for _ in range(N)]
    for i in range(N):
        matrix[i].append(A[i] - 1)
        matrix[i].append(A[i])
        matrix[i].append(A[i] + 1)

    cnt = 0
    for element in list(itertools.product(*matrix)):
        for i in range(N):
            if element[i] % 2 == 0:
                cnt += 1
                break

    print(cnt)


 solve()

### FIXED CODE ###

import itertools


def solve():
    N = int(input())
    A = list(map(int, input().split(" ")))
    matrix = [[] for _ in range(N)]
    for i in range(N):
        matrix[i].append(A[i] - 1)
        matrix[i].append(A[i])
        matrix[i].append(A[i] + 1)

    cnt = 0
    for element in list(itertools.product(*matrix)):
        for i in range(N):
            if element[i] % 2 == 0:
                cnt += 1
                break

    print(cnt)


solve()
#133_E
mod = 10 ** 9 + 7
n, k = map(int, input().split())
edges = [[] for _ in range(n)]
for _ in range(n-1):
    a, b = map(int, input().split())
    edges[a-1].append(b-1)
    edges[b-1].append(a-1)
    
def dfs(frm, cur):
    if frm == -1:
        color_num = k - 1
    else:
        color_num = k - 2
        
    if k < len(edges[cur]):
        return 0
    
    mul = 1
    for to in edges[cur]:
        if to == frm:
            continue
        mul *= color_num * dfs(cur, to)
        mul %= mod
        color_num -= 1
    
    return mul

print(k * dfs(-1, 0) % mod)

### FIXED CODE ###

#133_E
import sys
sys.setrecursionlimit(100000)
mod = 10 ** 9 + 7
n, k = map(int, input().split())
edges = [[] for _ in range(n)]
for _ in range(n-1):
    a, b = map(int, input().split())
    edges[a-1].append(b-1)
    edges[b-1].append(a-1)
    
def dfs(frm, cur):
    if frm == -1:
        color_num = k - 1
    else:
        color_num = k - 2
        
    if k < len(edges[cur]):
        return 0
    
    mul = 1
    for to in edges[cur]:
        if to == frm:
            continue
        mul *= color_num
        mul %= mod
        color_num -= 1
        
    for to in edges[cur]:
        if to == frm:
            continue
        mul *= dfs(cur, to)
        mul %= mod
    
    return mul

print(k * dfs(-1, 0) % mod)
a, b, c, d = input() # 1114
print("Yes" if a==b==c or b==c==d else "No")

n=input()
print("Yes" if n[0]==n[1]==n[2] or n[0]==n[1]==n[2] else "No")

### FIXED CODE ###

a, b, c, d = input() # 1114
print("Yes" if a==b==c or b==c==d else "No")
import fractions,itertools
N,S = [int(hoge) for hoge in input().split()]
X = [int(hoge) - S for hoge in input().split()]
print(list(itertools.accumulate(X,math.gcd))[-1])

### FIXED CODE ###

import fractions,itertools
N,S = [int(hoge) for hoge in input().split()]
X = [int(hoge) - S for hoge in input().split()]
print(abs(list(itertools.accumulate(X,func = fractions.gcd))[-1]))
a = int(input())
b = int(input())

print(a*b)
print( (a*2) + (b*2) )



### FIXED CODE ###

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

print( a*b, 2*(a+b) )
import urllib.request
from bs4 import BeautifulSoup
import re
import sys
import os
import time
import subprocess
import datetime


def gcd(a, b):
    if a < b:
        c = a
        a = b
        b = c

    r = a % b

    while r > 0:
        a = b
        b = r
        r = a % b

    return b

    # ll gcd(ll a, ll b) {
    #   if (a < b)
    #     swap(a, b);
    #   ll r = a % b;
    #
    #   while (r) {
    #     a = b;
    #     b = r;
    #     r = a % b;
    #   }
    #
    #   return b;
    # }


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

ans = a[0]

for i in range(N):
    if i == 0:
        continue

    g = gcd(ans, a[i])
    ans = ans * a[i] // g

print(ans)


### FIXED CODE ###


def gcd(a, b):
    if a < b:
        c = a
        a = b
        b = c

    r = a % b

    while r > 0:
        a = b
        b = r
        r = a % b

    return b

    # ll gcd(ll a, ll b) {
    #   if (a < b)
    #     swap(a, b);
    #   ll r = a % b;
    #
    #   while (r) {
    #     a = b;
    #     b = r;
    #     r = a % b;
    #   }
    #
    #   return b;
    # }


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

ans = a[0]

for i in range(N):
    if i == 0:
        continue

    g = gcd(ans, a[i])
    ans = ans * a[i] // g

print(ans)
s = list(map(int, input().split()))
K = int(input())
s = sorted()
for i in range(K):
    s[2] *= 2
print(sum(s))

### FIXED CODE ###

s = list(map(int, input().split()))
K = int(input())
s = sorted(s)
for i in range(K):
    s[2] *= 2
print(sum(s))
N=int(input())
D,X=list(map(int,input().split(" ")))
A=[]

for i in range(N):
  A.append(int(input()))

S=0
  
for i in range(N):
  for j in range(1000):
    if (1+j*A[i])>D:
      S+=j
      break
  
print(S+X)

### FIXED CODE ###

A=int(input())
B=int(input())
C=int(input())
D=int(input())

S=0

if A>=B:
  S+=B
else:
  S+=A

if C>=D:
  S+=D
else:
  S+=C

print(S)
a,b=raw_input().split(" ")
if a<b: print("a < b")
elif a==b: print("a == b")
else a>b: print("a > b")

### FIXED CODE ###

a,b = input().split(" ")
a=int(a)
b=int(b)
if a<b :
	print("a < b")
elif a>b :
	print("a > b")
else :
	print("a == b")
K = int(input())

odd_number = K // 2　+ 1
even_number = K // 2

print(odd_number*even_number)


### FIXED CODE ###

K = int(input())
if K%2 == 0:
    odd_number = K // 2
elif K%2 == 1:    
    odd_number = K // 2 + 1
even_number = K // 2 

print(odd_number*even_number)
s=input()
t=input()

st=[]
for i in range(len(s)):
    st.append([s[i],t[i]])
#print(st)
st.sort()
#print(st)
    
for i in range(len(st)-1):
    if st[len(st)-i-1]==st[len(st)-i-2]:
        del st[len(st)-i-1]
        
#print(st)

yesno="Yes"
for i in range(len(st)-1):
    sj,tj=st[len(st)-i-1]
    sk,tk=st[len(st)-i-2]
    if sj==sk and tj!=tk:
        yesno="No"
        break
    
print(yesno)

### FIXED CODE ###

s=input()
t=input()

st=[]
ts=[]
for i in range(len(s)):
    st.append([s[i],t[i]])
    ts.append([t[i],s[i]])
#print(st)
st.sort()
ts.sort()
#print(st)
    
yesno="Yes"
for i in range(len(st)-1):
    sj,tj=st[len(st)-i-1]
    sk,tk=st[len(st)-i-2]
    if sj==sk and tj!=tk:
        yesno="No"
        break
    tj,sj=ts[len(ts)-i-1]
    tk,sk=ts[len(ts)-i-2]
    if tj==tk and sj!=sk:
        yesno="No"
        break
    
print(yesno)
n = int(input())
w = list(map(int,input().split()))
ans = 1000000000
for t in range(1, n):
    left = sum(w[:t])
    right = sum(w[t:])
    ans = min(ans , abs(left - right))
print(ans)
        

### FIXED CODE ###

P,Q,R =map(int,input().split())
print(P+Q+R-max(P,Q,R))
print((int(input())+int(input()))//2+1)

### FIXED CODE ###

import math
a, b = map(int, input().split())
print(math.ceil((a+b)/2))
N, M = map(int, input().split())

dic = { m:0for m in range(M)}
for n in range(N):
  a,b = map(int,input().split())
  dic[a-1] += 1
  dic[b-1] += 1

for m in range(M):
  print(dic[m])

### FIXED CODE ###

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

dic = { n:0for n in range(N)}
for m in range(M):
  a,b = map(int,input().split())
  dic[a-1] += 1
  dic[b-1] += 1

for n in range(N):
  print(dic[n])
import math
menu = []
for i in range(0, 5):
        menu.append(int(input()))
df = max([10 - i % 10 for i in menu if i%10!=0 ])
sum = 0
for i in menu:
        sum += ((i + 9) // 10) * 10
print(sum-df)

### FIXED CODE ###

import math
menu = []
for i in range(0, 5):
        menu.append(int(input()))
df = max([10 - i % 10 for i in menu if i % 10 != 0 ],default=0)
sum = 0
for i in menu:
        sum += ((i + 9) // 10) * 10
if(df == 0):
        print(sum)
else:
        print(sum-df)
a,b,c= map(int, input())
if(a+b+c)>=22:
    print("bust")
else:
    print("win")

### FIXED CODE ###

a = [int(i) for i in input().split(" ")]
print("bust") if sum(a) >= 22 else print("win")
N=int(input())
a=list(map(int,input().split()))
def cond(n):
    L=(0,-1)
    for i in range(1,N):
        if a[i]>=n and a[i-1]>=n:
            L=(i,1)
        elif a[i]<n and a[i-1]<n:
            L=(i,0)

    R=(2*N-1,-1)
    for i in range(2*N-3,N-2,-1):
        if a[i]>=n and a[i+1]>=n:
            R=(i,1)
        elif a[i]<n and a[i+1]<n:
            R=(i,0)

    if L[1]==-1 and R[1]==-1:
        return a[0]>=n
    elif L[1]==-1:
        return R[1]==1
    elif R[1]==-1:
        return L[1]==1
    elif L[1]==R[1]:
        return R[1]==1
    else:
        if L[1]==0:
            return N-1-L[0]>R[0]-(N-1)
        else:
            return N-1-L[0]<R[0]-(N-1)


start=1
end=2*N-1
while end-start>1:
    test=(end+start)//2
    if cond(test):
        start=test
    else:
        end=test
if cond(end):
    print(end)
else:
    print(start)

### FIXED CODE ###

N,x=map(int,input().split())
if N==2:
    if x==2:
        print('Yes')
        for i in range(1,4):
            print(i)
    else:
        print('No')
else:
    if x==1 or x==2*N-1:
        print('No')
    elif x==2:
        print('Yes')
        S=[]
        T=[2*N-1,1,2,3,2*N-2]
        U=[]
        count=0
        for i in range(1,2*N):
            if (not i in T) and N-3>count:
                S.append(i)
                count+=1
                continue
            if (not i in T) and count>=N-3:
                U.append(i)
                continue
        ans=S+T+U
        for i in range(0,2*N-1):
            print(ans[i])
    elif x==2*N-2:
        print('Yes')
        S=[]
        T=[3,1,2*N-2,2*N-1,2]
        U=[]
        count=0
        for i in range(1,2*N):
            if (not i in T) and N-3>count:
                S.append(i)
                count+=1
                continue
            if (not i in T) and count>=N-3:
                U.append(i)
                continue
        ans=S+T+U
        for i in range(0,2*N-1):
            print(ans[i])
    else:
        print('Yes')
        S=[]
        T=[2*N-1,2,x,2*N-2,1]
        U=[]
        count=0
        for i in range(1,2*N):
            if (not i in T) and N-3>count:
                S.append(i)
                count+=1
                continue
            if (not i in T) and count>=N-3:
                U.append(i)
                continue
        ans=S+T+U
        for i in range(0,2*N-1):
            print(ans[i])
from collections import defaultdict
from collections import deque
from collections import Counter
import math
import itertools

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

n = readInt()
data = []
for i in range(n):
	x,y = readInts()
	data.append([x+y,x,y])

data.sort(key=lambda x:x[0])
ans = max(ans,abs(data[-1][1]-data[0][1])+abs(data[-1][2]-data[0][2]))
data.sort(key=lambda x:x[1])
ans = max(ans,abs(data[-1][1]-data[0][1])+abs(data[-1][2]-data[0][2]))
data.sort(key=lambda x:x[2])
ans = max(ans,abs(data[-1][1]-data[0][1])+abs(data[-1][2]-data[0][2]))
print(ans)

### FIXED CODE ###

from collections import defaultdict
from collections import deque
from collections import Counter
import math
import itertools

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

n = readInt()
data = []
for i in range(n):
	x,y = readInts()
	data.append([x+y,x,y,x-y])
ans = 0
data.sort(key=lambda x:x[0])
ans = max(ans,abs(data[-1][1]-data[0][1])+abs(data[-1][2]-data[0][2]))
data.sort(key=lambda x:x[1])
ans = max(ans,abs(data[-1][1]-data[0][1])+abs(data[-1][2]-data[0][2]))
data.sort(key=lambda x:x[2])
ans = max(ans,abs(data[-1][1]-data[0][1])+abs(data[-1][2]-data[0][2]))
data.sort(key=lambda x:x[3])
ans = max(ans,abs(data[-1][1]-data[0][1])+abs(data[-1][2]-data[0][2]))
print(ans)
import collections
LX=[]
LY=[]
N=int(input())
for i in range(N):
    x,y=(int(t) for t in input().split())
    LX.append(x)
    LY.append(y)

LLX=[]
LLY=[]
for i,x1 in enumerate(LX):
    for j,x2 in enumerate(LX):
        if i==j:
            continue
        LLX.append(x2-x1)

for i,y1 in enumerate(LY):
    for j,y2 in enumerate(LY):
        if i==j:
            continue
        LLY.append(y2-y1)


LLL=[str(dx)+'&'+str(dy) for dx,dy in zip(LLX,LLY)]

print(N-collections.Counter(LLL).most_common(1)[0][1])


### FIXED CODE ###

import collections
LX=[]
LY=[]
def Solve():
    N=int(input())
    for i in range(N):
        x,y=(int(t) for t in input().split())
        LX.append(x)
        LY.append(y)
        
    if N==1:
        return 1
    
    LLX=[]
    LLY=[]
    for i,x1 in enumerate(LX):
        for j,x2 in enumerate(LX):
            if i==j:
                continue
            LLX.append(x2-x1)

    for i,y1 in enumerate(LY):
        for j,y2 in enumerate(LY):
            if i==j:
                continue
            LLY.append(y2-y1)


    LLL=[str(dx)+'&'+str(dy) for dx,dy in zip(LLX,LLY)]

    return N-collections.Counter(LLL).most_common(1)[0][1]

print(Solve())
# -*- coding: utf-8 -*-

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

sum = 0
while n > 9:
    sum += n % 10
    n = int(n / 10)

sum += int(n)
if sum % 9 == 0:
    print("Yes")
else:
    print("No")


# print("{}".format(ans))


### FIXED CODE ###

# -*- coding: utf-8 -*-

# Input#
n = list(input())
# n, k = map(int, input().split())
# a = list(map(int, input().split()))
sum = 0
for i in n:
    sum += int(i)

if sum % 9 == 0:
    print("Yes")
else:
    print("No")


# print("{}".format(ans))
n,x,t=map（int,input（）.split（））

if n%x==0 :
  print（（n//x）*t）
else :
  print（（n//x+1）*t）

### FIXED CODE ###

n,x,t=map(int,input().split())
if n%x!=0 :
    print((n//x+1) *t)
else:
    print((n//x)*t)
import numpy as np

n, q= map(int, input().split())
s = input()

masu = np.ones(n+2)
def my_index_multi(l, x):
    return [i+1 for i, _x in enumerate(l) if _x == x]

for i in range(q):
    t, d = map(str, input().split())
    
    index = my_index_multi(s, t)

    if d == "R":
        tmp = masu[index]
        masu[index] = 0
        t_index = list(map(lambda x: x + 1, index))
        masu[t_index] += tmp
    else:
        tmp = masu[index]
        masu[index] = 0
        t_index = list(map(lambda x: x - 1, index))
        masu[t_index] += tmp       

print(int(np.sum(masu[1:n+1])))

### FIXED CODE ###

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

if a == b == c:
    print("Yes")
else:
    print("No")
import sys
n=int(input())
arr=input().split(" ")
arr_s=set(arr)
if len(arr_s)==1:
    print(int(n/2))
    sys.exit()
#print(arr)
a=0
most_e=0
most_o=0
arr_e=[0 for i in range(int(n/2))]
arr_o=[0 for i in range(int(n/2))]
for i in range(int(n/2)):
    arr_e[i]=arr[a]
    arr_o[i]=arr[a+1]
    a+=2
#print(arr_e,arr_o)
arr_es=set(arr_e)
arr_os=set(arr_o)
#print(arr_es,arr_os)

for i in arr_es:
    cnt_e=arr_e.count(i)
    if cnt_e>most_e:
        most_e=cnt_e
        
for i in arr_os:
    cnt_o=arr_o.count(i)
    if cnt_o>most_o:
        most_o=cnt_o

#print(most_e,most_o)
else:
    print(n-most_e-most_o)

### FIXED CODE ###

num=input()
num_str=list(num)
lengh=len(num_str)
tmp=num_str
for i in range(lengh):
    if num_str[i]=="1":
        tmp[i]="9"
    elif num_str[i]=="9":
        tmp[i]="1"
ans="".join(tmp)
print(ans)
import sys
a,b = list(map(int, input().split()))
print("H" if a == b else "D")

### FIXED CODE ###

import sys
a,b = list(input().split())
print("H" if a == b else "D")
import fractions

n = int(input())
A = list(map(int, input().split()))
for i in range(0, n):
  for j in range(i + 1, n):
    g = fractions.gcd(A[i], A[j])
print(max(g))


### FIXED CODE ###

# import bisect
# import copy
from fractions import gcd


# import math
# import numpy as np
# from collections import Counter, deque
# from functools import reduce
# from itertools import accumulate, permutations, combinations, combinations_with_replacement, groupby, product
import sys
sys.setrecursionlimit(10**9)


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

    # A[0:i]の最大公約数
    L=[0]*N
    for i in range(1,N):
        L[i]=gcd(L[i - 1], A[i - 1])

    # A[i:]の最大公約数
    R=[0]*(N+1)
    for i in reversed(range(N)):
        R[i]=gcd(R[i + 1], A[i])


    maxgcd = 0
    for i in range(N):
        maxgcd = max(maxgcd, gcd(L[i], R[i + 1]))

    print(maxgcd)


resolve()