Harryxun/stf_run huggingface dataset:
s=input()
t=input()
if len(s)==len(t):
    mc=0
    for i in range(len(s)):
        if s[i]!=t[i]:
            mc=c+1
else:
    c=[0 for i in range(len(s)-len(t))]
    for i in range(len(s)-len(t)):
        for j in range(len(t)):
            if s[i+j]!=t[j]:
                c[i]=c[i]+1

    mc=min(c)

print(mc)


### FIXED CODE ###

s=input()
t=input()
if len(s)==len(t):
    cm=0
    for i in range(len(s)):
        if s[i]!=t[i]:
            cm+=1
else:
    cm=1000
    for i in range(len(s)-len(t)):
        cn=0
        for j in range(len(t)):
            if s[i+j]!=t[j]:
                cn+=1
        cm=min(cm,cn)

print(cm)
import sys
sys.setrecursionlimit(200000)
class UnionFind():
    def __init__(self,n):
        self.n=n
        self.parents = [i for i in range(n+1)]
        #dist[x]はxとその親との間の距離を保持している
        self.dist = [0]*(n+1)
    def find(self,x):
        if self.parents[x]==x:
            return x
        else:
            a = self.parents[x]
            self.parents[x]=self.find(self.parents[x])
            self.dist[x] += self.dist[a]
            return self.parents[x]
    def unite(self,l,r,d):
        rRoot = self.find(r)
        lRoot = self.find(l)
        if rRoot == lRoot:
            if self.dist[l] - self.dist[r] != d:
                print("No")
                exit()
        else:
            #rRootとlRoot、どちらが親になるべきか決める
            newLDist = d + self.dist[r]
            if newLDist>=self.dist[l]:
                self.parents[lRoot] = rRoot
                self.dist[lRoot] = newLDist-self.dist[l]
            else:
                self.parents[rRoot] = LRoot
                self.dist[rRoot] = self.dist[l]-newLDist

N,M = map(int,input().split())
tree = UnionFind(N)
for _ in range(M):
    l,r,d = map(int,input().split())
    tree.unite(l,r,d)
print("Yes")

### FIXED CODE ###

"""
unionFind木を使う。
根に対する距離を記録していく。
"""
import sys
sys.setrecursionlimit(2000000)
input = sys.stdin.readline
class UnionFind():
    def __init__(self,n):
        self.n=n
        self.parents = [i for i in range(n+1)]
        self.distance = [0]*(n+1)

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

    def union(self,l,r,dist):
        lRoot,lDist = self.find(l)
        rRoot,rDist = self.find(r)
        #まず、位置関係に矛盾がないかを調べる
        #lRootはlよりlDist右にいる
        #rRootはrよりrDist右にいる
        #lRoot=rRootのとき、lDist-rDist != distなら矛盾。
        if lRoot==rRoot and lDist-rDist != dist:
            print("No")
            exit()

        #より左にいる根を右にいる根にマージする
        if lDist < dist+rDist:
            #lRootがrRootよりも左の場合
            self.parents[lRoot]=rRoot
            self.distance[lRoot]=(dist+rDist)-lDist
        else:
            self.parents[rRoot]=lRoot
            self.distance[rRoot]=lDist-(dist+rDist)

N,M = map(int,input().split())
tree = UnionFind(N)
for i in range(M):
    L,R,D = map(int,input().split())
    tree.union(L,R,D)

print('Yes')
info = list(map(int, input().split(' ')))
array = list(map(int, input().split(' ')))

print((info[0]-1)//(info[1]-1))

### FIXED CODE ###

calc = input()
result = 0
for letter in calc:
    if letter == '+':
        result = result+1
    else:
        result = result-1
print(result)
import math

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

p = 0.0

if K>N:
    tp = 0.0
    for i in range(1,N+1):#1~N
        #deme i
        tp += 0.5**math.ceil(math.log2(K/i))
    tp = tp / N
    print(tp)
else:
    p = (N-K+1.0)/N#No coin
    tp = 0.0
    for i in range(1,K):#1~K-1
        #deme i
        tp += 0.5**math.ceil(math.log2(K/i))
    tp = tp / (K-1.0)
    print(p+(1.0-p)*tp)



### FIXED CODE ###

import math

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

p = 0.0

if K>N:
    tp = 0.0
    for i in range(1,N+1):#1~N
        #deme i
        tp += 0.5**math.ceil(math.log2(K/i))
    tp = tp / N
    print(tp)
elif K == 1:
    print(1.0)
else:
    p = (N-K+1.0)/N#No coin
    tp = 0.0
    for i in range(1,K):#1~K-1
        #deme i
        tp += 0.5**math.ceil(math.log2(K/i))
    tp = tp / (K-1.0)
    print(p+(1.0-p)*tp)
n = int(input()[len(n - 1)])
a = [2, 4, 5, 7, 9]
b = [0, 1, 6, 8]

if n in a:
  print("hon")
elif n in b:
  print("pon")
else:
  print("bon")

### FIXED CODE ###

n = input()
n = int(n[len(n) -1])
a = [2, 4, 5, 7, 9]
b = [0, 1, 6, 8]

if n in a:
  print("hon")
elif n in b:
  print("pon")
else:
  print("bon")
m, k = map(int, input().split())

u = [0, 2, 3, 0, 1, 3, 2, 1]
x = 2**m
a = []
if k == 0:
    for i in range(x):
        a.append(i)
        a.append(i)
    print(*a)
    exit()

if x % (2 * k) != 0:
    print(-1)
    exit()

check = [False] * x
t = 0

while t < x:
    y = []
    for _ in range(2):
        while t < x:
            if check[t]:
                t += 1
            else:
                break
        if t >= x:
            break
        if t ^ k >= x:
            break
        if check[t ^ x]:
            break
        check[t] = True
        check[t ^ k] = True
        y.append(t)
        y.append(t ^ k)

    if len(y) != 4:
        break
    for r in u:
        a.append(y[r])

if len(a) == 2 * x:
    print(*a)
else:
    print(-1)


### FIXED CODE ###

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

if m*k == 1:
    print(-1)
    exit()

if 1 << m <= k:
    print(-1)
    exit()

if k == 0:
    t = []
    for i in range(1 << m):
        for _ in range(2):
            t.append(i)
    print(*t)
    exit()

b = []
for i in range(1 << m):
    if i != k:
        b.append(i)

c = b[::-1]

a = b + [k] + c + [k]
print(*a)
from collections import deque
S = list(map(str,input().split()))
Q = int(input())
Query = [list(map(str,input().split())) for _ in range(Q)]
d = deque(S)
for i in range(Q):
  if Query[i][0] == "1":
    d = ''.join(list(reversed(d)))
  elif Query[i][0] == "2":
    if Query[i][1] == "1":
      d.append(Query[i][2])
    elif Query[i][1] == "2":
      d.appendleft(Query[i][2])
ans = ''.join(d)
print(ans)

### FIXED CODE ###

from collections import deque
S = str(input())
Q = int(input())
d = deque()
reverse = 1
for i in S:
    d.append(i)
for j in range(Q):
  Query = input().split()
  if len(Query) == 1:
    reverse *= -1
  else:
    F = int(Query[1])
    C = str(Query[2])
    if reverse == 1:
      if F == 1:
        d.appendleft(C)
      elif F == 2:
        d.append(C)
    elif reverse == -1:
      if F == 1:
        d.append(C)
      elif F == 2:
        d.appendleft(C)
if reverse == -1:
    d.reverse()
ans = ''.join(d)
print(ans)
def median(l):
    n = len(l)
    ls = sorted(l)
    if n == 1: return ls[0]
    if n%2 == 0:
        m1 = ls[int(n/2)-1]
        m2 = ls[int(n/2)]
        return (m1+m2)/2
    
    return ls[int(n/2)-1]

N = int(input())
A = [int(i) for i in input().split()]

A_ = [A[i] - i - 1 for i in range(N)]

A_m = median(A_)
A_m1 = math.floor(A_m)
A_m2 = math.ceil(A_m)

A_b = [sum([abs(a - i) for a in A_]) for i in (A_m1, A_m2)]

print(min(A_b))

### FIXED CODE ###

import math

def median(l):
    n = len(l)
    ls = sorted(l)
    if n%2 == 0:
        m1 = ls[int(n/2)-1]
        m2 = ls[int(n/2)]
        return (m1+m2)/2
    
    return ls[int(n/2)]

N = int(input())
A = [int(i) for i in input().split()]

A_ = [A[i] - i - 1 for i in range(N)]

A_m = median(A_)
A_m1 = math.floor(A_m)
A_m2 = math.ceil(A_m)

A_b = [sum([abs(a - i) for a in A_]) for i in (A_m1, A_m2)]

print(min(A_b))
#-*- coding: utf-8 -*-
import math

a, b = [int(x.strip()) for x in input().split()]
#print((a * b) // math.gcd(a, b))
print(6)









### FIXED CODE ###

from collections import defaultdict
import sys
import math
from datetime import datetime

def sol(a, b):
    return 1 + 2 + 3 - a - b
    #if a + b + c <= 21: return 'win'
    #else: return 'bust'



do_submit = True
#do_submit = False

def input_parse(input_str):
    lines = [x.strip() for x in input_str.split("\n") if x.strip()]
    parsed_lines = [list(map(str, line.split())) for line in lines]
    print(parsed_lines)
    n = int(parsed_lines[0][0])
    k = int(parsed_lines[0][1])
    S = parsed_lines[1][0]
    return n, k, S


if not do_submit:
    a, b, c = input_parse("""
    3 1
    ABC
    """)
    print(sol(a, b, c))

    a, b, c = input_parse("""
    4 3
    CABA
    """)
    print(sol(a, b, c))

else:
    #a, b, c = list(map(int, input().split()))
    # S = input().split()
    a = int(input())
    b = int(input())
    # T = input()
    print(sol(a, b))
    # S = input().strip()
    # print(sol(S))
N = int(input())
values = list(map(int,input().split()))
costs = list(map(int,input().split()))
dictionary = {}
for v in range(N):
  dictionary.setdefault(values[v], []).append(costs[v])
revarse_keys = sorted(dictionary, reverse=True, key=int)
x,y = 0,0
for i in range(N):
  if revarse_keys[i] > int(dictionary[revarse_keys[i]][0]) and (i+1)<=N:
    x = revarse_keys[i]+revarse_keys[i+1]
    y = dictionary[revarse_keys[i]][0]+dictionary[revarse_keys[i+1]][0]
    break
print(x-y)



### FIXED CODE ###

N = int(input())
values = list(map(int,input().split()))
costs = list(map(int,input().split()))
dictionary = []
for v in range(N):
  dictionary.append([values[v],costs[v]])
x,y=0,0
result = []
for i in range(N):
  if dictionary[i][0] - dictionary[i][1]>0:
    result.append(dictionary[i][0]-dictionary[i][1])
print(sum(result))
import fractions
N, M = map(int, input().split())
S = input()
T = input()
if S[0] != T[0]:
    print(-1)
elif N == M and S != T:
    print(-1)
else:
    lcm = N*M // fractions.gcd(N, M)
    count = 1
    tmp = lcm // N
    tmp2 = lcm // M
    flag = False

    tmp_s = [""] * (lcm)
    for i in range(N):
        tmp_s[tmp * i] = S[i]
    for i in range(M):
        if tmp_s[tmp2 * i] != "" and tmp_s[tmp2 * i] != T[i]:
            count += 1
            print(-1)
            exit(0)
    print(lcm)


### FIXED CODE ###

import collections
import fractions
N, M = map(int, input().split())
S = input()
T = input()
lcm = (N*M) // fractions.gcd(N, M)
if S[0] != T[0]:
    print(-1)
elif N == M and S != T:
    print(-1)
else:
    tmp = lcm // N
    tmp2 = lcm // M
    tmp_s = collections.defaultdict(str)
    for i in range(N):
        tmp_s[tmp*i] = S[i]

    for i in range(M):
        if tmp2*i in tmp_s:
            if T[i] != tmp_s[tmp2*i]:
                print(-1)
                exit(0)
    print(lcm)
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np
from functools import reduce

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

n, m = rm()
if n == m:
    print((math.factorial(n) * math.factorial(m) * 2) % mod)
elif abs(n-m) == 1:
    print((math.factorial(n) * math.factorial(m) % mod)
else:
    print(0)




















### FIXED CODE ###

import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np
from functools import reduce

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

n, m = rm()
if n == m:
    print((math.factorial(n) * math.factorial(m) * 2) % mod)
elif abs(n-m) == 1:
    print((math.factorial(n) * math.factorial(m)) % mod)
else:
    print(0)
import sys



argv=sys.argv

if argv[2] == "+":
    print(int(argv[1]) + int(argv[3]))
elif argv[2] =="-":
    print(int(argv[1]) - int(argv[3]))

### FIXED CODE ###

argv=input().split()


if argv[1] == "+":
    print(int(argv[0]) + int(argv[2]))
elif argv[1] =="-":
    print(int(argv[0]) - int(argv[2]))
a=input()
b=input()
if a==b.reverse():
    print("YES")
else:
    print("NO")

### FIXED CODE ###

a=input()
b=input()
if a==b[::-1]:
    print("YES")
else:
    print("NO")
N, K = map(int, input().split())
S = set()

MOD = 998244353
for _ in range(K):
    L, R = map(int, input().split())
    S |= set(range(L, R + 1))
# print(f'{S=}')

DP = [-1] * (N + 1)
DP[0] = 0
DP[1] = 1


def f(idx):
    ans = 0
    for s in S:
        if idx - s < 1:
            continue
        if DP[idx - s] == -1:
            DP[idx - s] = f(idx - s)
        ans += DP[idx - s]
    return ans % MOD


ans = f(N)
# print(f'{DP=}')
print(ans)


### FIXED CODE ###

N, K = map(int, input().split())
MOD = 998244353
LR = []
for _ in range(K):
    L, R = map(int, input().split())
    LR.append((L, R))
# print(f'{LR=}')

DP = [0] * (N + 1)
DP[1] = 1
S = [0] * (N + 1)

for i in range(1, len(DP)):
    for L, R in LR:
        v = S[max(i - L, 0)] - S[max(i - R - 1, 0)]
        DP[i] += v
    DP[i] %= MOD
    S[i] = (S[i - 1] + DP[i]) % MOD

# print(f'{DP=}')
# print(f'{S=}')
print(DP[-1])
#!/usr/bin/env python
# -*- coding: utf-8 -*-


def main():
  n = int(input())
  prev = -1
  nums = []
  table = {}

  for _ in range(n):
    v = int(input())

    if v != prev:
      nums.append(v)
      prev = v

  for i, n in enumerate(nums):
    if n not in table:
      table[n] = []

    table[n].append(i)

  values = [0] * len(nums)
  value = 1

  for i in range(len(nums)):
    values[i] += value

    for j in table[nums[i]]:
      if j <= i:
        continue

      values[j] += value

    value = values[i] % int(1e+9 + 7)

  print(value, flush=True)


if __name__ == '__main__':
  main()



### FIXED CODE ###

#!/usr/bin/env python
# -*- coding: utf-8 -*-


def main():
  input()
  string = input().strip()

  count = [0] * 26

  for c in string:
    count[ord(c) - 97] += 1

  table = count[:]
  value = sum(count)

  for _ in range(len(count) - 1):
    for i in range(len(count)):
      table[i] = count[i] * sum(table[i + 1:])

    value = (value + sum(table)) % int(1.0e+9 + 7)

  print(value, flush=True)


if __name__ == '__main__':
  main()
N, M = map(int, input().split())
print(N*(N-1)//2 + M*(M-1)//2))

### FIXED CODE ###

N, M = map(int, input().split())
print(N*(N-1)//2 + M*(M-1)//2)
n=int(input())  
h=list(map(int, input().split()))
count = 0
max_count = 0
for i in range(n-1):
    if h[i+1] <= h[i]:
        count = count + 1
    elif max_count < count:
        max_count = count
        count = 0
    else:
        count = 0
      
print(max(max_count,count))

### FIXED CODE ###

s = input()
t = input()
count = 0
for i in range(3):  
  if s[i] == t[i]:
       count = count+ 1
print(count)
import math
a,b=[int(i) for i in input().split()]
print(math.gcd(a, b))

### FIXED CODE ###

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

def gcd(a, b):
	while b:
		a, b = b, a % b
	return a
def lcm(a, b):
	return a * b // gcd (a, b)
  
print(lcm(A,B))
n,k = map(int, input().split())
a = list(map(lambda x : int(x) -1,  map(int, input().split())))

s = {0}
loop = [0]

while a[loop[-1]] not in s:
    loop.append(a[loop[-1]])
    s.add(loop[-1])

    
idx = loop.index(a[loop[-1]])

if k <= len(loop):
    print(loop[k]+1)
else:
    print(loop[(k - idx)% (len(loop) - idx) + idx] + 1)


### FIXED CODE ###

n,k = map(int, input().split())
a = list(map(lambda x : int(x) -1,  map(int, input().split())))

s = {0}
loop = [0]

while a[loop[-1]] not in s:
    loop.append(a[loop[-1]])
    s.add(loop[-1])

    
idx = loop.index(a[loop[-1]])

if k < len(loop):
    print(loop[k]+1)
else:
    print(loop[(k - idx)% (len(loop) - idx) + idx] + 1)
x = input().split()[1]
ans = 0
 
a = input().split()
a.sort()
 
for i in len(a):
  if a[i] > x:
    print ans
    break
  else:
    x-=a[i]
    ans+=1
print ans

### FIXED CODE ###

line = input().split()
N = int(line[0])
x = int(line[1])
ans = 0

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

for i in range(N):
    if a[i] > x:
        print(ans)
        break
    else:
        x -= a[i]
        if i != (N - 1):
            ans += 1
        else:
            if x == 0:
                ans += 1
            print(ans)
n = int(input())
li = list(map(int, input().split()))
mod = 10**9 + 7
ans = 0

for i in range(1, n):
    ans += li[0]*li[i]

check = ans%mod
for i in range(1, n):
    check -= li[i] * li[i-1]
    if check < 0:
        check += 10**9 + 7
    check //= li[i-1]
    check *= li[i]
    ans += check
    ans %= mod

print(ans)


### FIXED CODE ###

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

for i in range(1, n):
    ans += li[0]*li[i]

check = ans
for i in range(1, n):
    if li[i-1] == 0:
        continue
    check -= li[i] * li[i-1]
    check //= li[i-1]
    check *= li[i]
    ans += check
    ans %= mod

print(ans)
def gcd(x, y): 
  
   while(y): 
       x, y = y, x % y 
  
   return x 
n = int(input())
a = list(map(int,input().split()))
g = 0
for i in range(len(a)):
    g = gcd(g,a[i])
print(g)


### FIXED CODE ###

def gcd(x, y): 
  
   while(y): 
       x, y = y, x % y 
  
   return x 
n = int(input())
a = list(map(int,input().split()))
g = 0
for i in range(len(a)):
    g = gcd(g,a[i])
print(g)
import collections 
N=int(input())
A=list(map(int,input().split()))
s=0
cnt=collections.Counter(A)
for key in cnt.keys():
  s+=(cnt[key]*(cnt[key]-1))//2
for i in range(N):
  tmp=s
  tmp-=cnt(A[i])*(cnt(A[i])-1)//2
  tmp+=(cnt(A[i])-1)*(cnt(A[i])-2)//2
  print(tmp)
  
    

### FIXED CODE ###

import collections 
N=int(input())
A=list(map(int,input().split()))
s=0
cnt=collections.Counter(A)
for key in cnt.keys():
  s+=(cnt[key]*(cnt[key]-1))//2
for i in range(N):
  tmp=s
  tmp-=cnt[A[i]]*(cnt[A[i]]-1)//2
  tmp+=(cnt[A[i]]-1)*(cnt[A[i]]-2)//2
  print(tmp)
a,b,c=input()
  print("Yes" if a==c else "No")

### FIXED CODE ###

n=input()
print("Yes" if n[0]==n[2] else "No")
def main():
	# n,m = map(int,input().split())
	n = int(input())
	s = str(intpu())
	# a = list(map(int,input().split()))
	# l = [list(map(int, input().split())) for _ in range(n)]

	if s[:(n/2)] == s+s:
		print("Yes")

	else:
		print("No")
	
	






if __name__ == '__main__':
	main()

### FIXED CODE ###

def main():
	# n,m = map(int,input().split())
	n = int(input())
	s = str(input())
	# a = list(map(int,input().split()))
	# l = [list(map(int, input().split())) for _ in range(n)]
	# print(s+s)
	if s[:(int(n/2))] + s[:int(n/2)] == s:
		print("Yes")

	else:
		print("No")


if __name__ == '__main__':
	main()
class combination():
    #素数のmod取るときのみ　速い
    def __init__(self, n, mod):
        self.n = n
        self.fac = [1] * (n + 1)
        self.inv = [1] * (n + 1)
        for j in range(1, n + 1):
            self.fac[j] = self.fac[j - 1] * j % mod

        self.inv[n] = pow(self.fac[n], mod - 2, mod)
        for j in range(n - 1, -1, -1):
            self.inv[j] = self.inv[j + 1] * (j + 1) % mod

    def comb(self, n, r, mod):
        if r > n or n < 0 or r < 0:
            return 0
        return self.fac[n] * self.inv[n - r] * self.inv[r] % mod


import sys
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
mod = 10**9 + 7
inf = float('inf')
ans = int(0)

N, M, K = LI()

cou = int(0)
#maxL = N + M -2
L = int(0)
#距離i+1の組み合わせ

#for i in range(maxL):
for j in range(N):
    L += (N - j - 1) * (M ** 2) * (j + 1)
    L %= mod
for j in range(M):
    L += (M - j - 1) * (N ** 2) * (j + 1)
    L %= mod
#    for j in range(i+2):
#        if i>1 and i+1>j>0:
#            L[i] += max((N-j)*(M-(1+i)+j),0)*(i+1)*2
#        else:
#            L[i] += max(((N - j) * (M - (1 + i) + j)), 0) * (i + 1)
C = combination(N*M-2,mod)
cou = C.comb(N*M-2,K-2)*L%mod

print(cou)

### FIXED CODE ###

def comb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

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

C = comb(N*M-2, K-2)
#print(int(C))

A = int(0)
for d in range(N):
    a = (N-d)*(M**2)

    A += int(d*a)

B = int(0)
for d in range(M):
    b = (M-d)*(N**2)
    B += int(d*b)

ans = int((A+B)*C)
ans = ans%(1000000007)
print(ans)
import heapq

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

a = list(map(int, input().split(" ")))
heapq._heapify_max(a)

for _ in range(m):
    largest = heapq._heappop_max(a)
    heapq.heappush(a, largest // 2)

print(sum(a))

### FIXED CODE ###

import heapq

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

a = [- int(i) for i in input().split(" ")]
heapq.heapify(a)

for _ in range(m):
    largest = heapq.heappop(a)
    heapq.heappush(a, int(largest / 2))

print(- sum(a))
import sys
import fractions
input = sys.stdin.readline
import heapq


def main():
    N = int(input())
    A = [int(x) for x in input().split()]

    A_sorted = sorted(list(set(A)))

    if len(A_sorted) <= 2:
        print(max(A_sorted))
        exit()

    min = 10 ** 10
    min_index = -1
    for i in range(N - 1):
        x = fractions.gcd(A_sorted[i], A_sorted[i + 1])
        if min > x:
            min = x
            min_index = i

    gcd = A_sorted[0]
    if min_index == 0:
        gcd = A_sorted[2]

    for i in range(N):
        if i == min_index or i == min_index + 1:
            continue
        gcd = fractions.gcd(gcd, A_sorted[i])

    x = fractions.gcd(gcd, A_sorted[min_index])
    y = fractions.gcd(gcd, A_sorted[min_index + 1])

    print(max([x, y]))

if __name__ == '__main__':
    main()



### FIXED CODE ###

import sys
import fractions
input = sys.stdin.readline
import heapq

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():
    N = int(input())
    A = [int(x) for x in input().split()]

    A_sorted = sorted(A)
    div0 = make_divisors(A_sorted[0])
    ans = 1
    for d in div0[1:]:
        count = 0
        isAns = True
        for i in A_sorted[1:]:
            if i % d != 0:
                count += 1
                if count == 2:
                    isAns = False
                    break
        if isAns:
            ans = max(ans, d)
    div1 = make_divisors(A_sorted[1])
    for d in div1[1:]:
        count = 0
        isAns = True
        for i in A_sorted[2:]:
            if i % d != 0:
                isAns = False
                break
        if isAns:
            ans = max(ans, d)

    print(ans)

if __name__ == '__main__':
    main()