Harryxun/stf_run huggingface dataset:
while True:
    num = input()
    for i in range(num): print raw_input().replace("Hoshino", "Hoshina")

### FIXED CODE ###

for i in range(input()): print raw_input().replace("Hoshino", "Hoshina")
N=int(input())
for h in range(1,3501):
	for n in range(1,3501):
		A=N*h*n
		B=4*h*n-N*n-N*h
		if A%B==0 and B>0:
			print(h,n,A//B)
			exit()


### FIXED CODE ###

N=int(input())
for h in range(1,3501):
	for n in range(1,3501):
		A=N*h*n
		B=4*h*n-N*n-N*h
		if B<=0:
			continue
		if A%B==0:
			print(h,n,A//B)
			exit()
while True:
    a,b=map(int,input().split())
    if a==0 and b==0:break
    f=[[0 for i in range(a)]for j in range(b)]
    for i in range(a):
        for j in range(b):
            if i==0 or i==a-1 or j==0 or j==b-1:
                f[i][j]=1
    for i in range(a):
        for j in range(b):
            if f[i][j]==1:
                print('#')
            else :
                print('.')
        print()
    print()

### FIXED CODE ###

while True:
    a,b=map(int,input().split())
    if a==0 and b==0:break
    f=[[0 for i in range(b)]for j in range(a)]
    for i in range(a):
        for j in range(b):
            if i==0 or i==a-1 or j==0 or j==b-1:
                f[i][j]=1
    for i in range(a):
        for j in range(b):
            if f[i][j]==1:
                print('#',end='')
            else :
                print('.',end='')
        print()
    print()
N = int(input())
R = int(input())
if 10 < N <= 100 and 0 <= R <= 4111:
    print(R)
if 1<= N < 10 and 0 <= R <= 4111:
    K = 100 * (10 - N)
    M = R + K
    print(M)

### FIXED CODE ###

N,R=input().split()
n,r=int(N),int(R)

if n>=10:
    print(r)
else:
    print(r+100*(10-n))
from math import gcd

K = int(input())
ans = 0
for a in range(1,K+1):
    for b in range(1,K+1):
        g = gcd(a,b)
        if g == 1:
            ans += K
        else:
            for c in range(1,K+1):
                ans += gcd(g,c)
                cnt += 1
print(ans)

### FIXED CODE ###

from math import gcd

K = int(input())
ans = 0
for a in range(1,K+1):
    for b in range(1,K+1):
        g = gcd(a,b)
        if g == 1:
            ans += K
        else:
            for c in range(1,K+1):
                ans += gcd(g,c)

print(ans)
import array
import itertools
from collections import defaultdict, deque


def log(s):
    # print("| " + str(s), file=sys.stderr)
    pass


def output(x):
    print(x, flush=True)


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


def solve():
    def fill(queue):
        footsteps = [[None] * width for _ in range(height)]
        for p, s in queue:
            footsteps[p[1]][p[0]] = -1

        while queue:
            p, s = queue.popleft()
            x, y = p
            footsteps[y][x] = s

            if x > 0 and footsteps[y][x - 1] is None:
                queue.append(((x - 1, y), s + 1))
                footsteps[y][x - 1] = -1
            if x < width - 1 and footsteps[y][x + 1] is None:
                queue.append(((x + 1, y), s + 1))
                footsteps[y][x + 1] = -1
            if y > 0 and footsteps[y - 1][x] is None:
                queue.append(((x, y - 1), s + 1))
                footsteps[y - 1][x] = -1
            if y < height - 1 and footsteps[y + 1][x] is None:
                queue.append(((x, y + 1), s + 1))
                footsteps[y + 1][x] = -1

        return s

    height, width = tuple(input_ints())
    # field = [input() for _ in range(height)]
    queue = deque()

    # for y, line in enumerate(field):
    #     for x, c in enumerate(line):
    #         if c == '#':
    #             queue.append(((x, y), 0))
    queue.append(((10, 10), 0))

    return fill(queue)


def main():
    print(solve())


main()


### FIXED CODE ###

import array
import itertools
from collections import defaultdict, deque


def log(s):
    # print("| " + str(s), file=sys.stderr)
    pass


def output(x):
    print(x, flush=True)


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


def solve():
    def fill(queue):
        footsteps = [[None] * width for _ in range(height)]

        for x, y in queue:
            footsteps[y][x] = 0

        s = 0
        while queue:
            queue2 = deque()
            s += 1
            while queue:
                x, y = queue.popleft()

                if x > 0 and footsteps[y][x - 1] is None:
                    queue2.append((x - 1, y))
                    footsteps[y][x - 1] = s
                if x < width - 1 and footsteps[y][x + 1] is None:
                    queue2.append((x + 1, y))
                    footsteps[y][x + 1] = s
                if y > 0 and footsteps[y - 1][x] is None:
                    queue2.append((x, y - 1))
                    footsteps[y - 1][x] = s
                if y < height - 1 and footsteps[y + 1][x] is None:
                    queue2.append((x, y + 1))
                    footsteps[y + 1][x] = s

            queue = queue2

        return s - 1

    height, width = tuple(input_ints())
    field = [input() for _ in range(height)]
    queue = deque()

    for y, line in enumerate(field):
        for x, c in enumerate(line):
            if c == '#':
                queue.append((x, y))
    # queue.append((10, 10))


    return fill(queue)


def main():
    print(solve())


main()
import numpy as np
n,k=map(int,input().split())
a=list(map(int,input().split()))
a.sort()
s=1
c=0
l=0
r=-1
while True:
    if k-c>=2:
        if a[r]*a[r-1]>=a[l]*a[l+1]:
            s*=a[r]*a[r-1]
            r-=2
            c+=2
        else:
            s*=a[l]*a[l+1]
            l+=2
            c+=2
    else:
        if a[r]<0:
            s=1
            a=np.absolute(a)
            a=list(a)
            a.sort()
            while True:
                s*=a[c1]
                c1+=1
                s%=10**9+7
                if c1==k:
                    s=-s
                    print(s%10**9+7)
                    exit()
        else:s*=a[r]
        c+=1
    s%=10**9+7
    if k==c:break
print(s)

### FIXED CODE ###

import numpy as np
n,k=map(int,input().split())
a=list(map(int,input().split()))
a.sort()
s=1
c=0
l=0
r=-1
c1=0
while True:
    if k-c>=2:
        if a[r]*a[r-1]>a[l]*a[l+1]:
            s*=a[r]*a[r-1]
            r-=2
            c+=2
        else:
            s*=a[l]*a[l+1]
            l+=2
            c+=2
    else:
        if a[r]<0:
            s=1
            a=np.absolute(a)
            a=list(a)
            a.sort()
            while True:
                s*=a[c1]
                c1+=1
                s%=10**9+7
                if c1==k:
                    s=-s
                    print(s%10**9+7)
                    exit()
        else:s*=a[r]
        c+=1
    s%=10**9+7
    if k==c:break
print(s)
# -*- coding: utf-8 -*-
# 正の整数の入力
a = int(input())
b = int(input())

if a*b % 2 == 1:
    ans = 'Even'
else:
    ans = 'Odd'

print(str(ans))

### FIXED CODE ###

# -*- coding: utf-8 -*-
# 正の整数の入力
a, b = map(int, input().split())

if a*b % 2 == 0:
    ans = 'Even'
else:
    ans = 'Odd'

print("{}".format(ans))
import sys
input = lambda: sys.stdin.readline().rstrip()
input_nums = lambda: list(map(int, input().split()))
import numpy as np

def main():
    N, D = input_nums()
    Xs = {}
    for i in range(N):
        Xs[i] = np.array(input_nums())
    cnt = 0
    for i in range(N):
        for j in range(i+1, N):
            a = np.sqrt(np.sum(np.square(Xs[i] - Xs[j])))
            if a == int(a):
                cnt += 1
    print(cnt)


if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys
input = lambda: sys.stdin.readline().rstrip()
input_nums = lambda: list(map(int, input().split()))
import numpy as np

def main():
    N, D = input_nums()
    Xs = {}
    for i in range(N):
        Xs[i] = np.array(input_nums())
    cnt = 0
    for i in range(N):
        for j in range(i+1, N):
            a = np.sqrt(np.sum(np.square(Xs[i] - Xs[j])))
            if a == int(a):
                cnt += 1
    print(cnt)


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

def cmb(n, r):
    r = min(n - r, r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1, r + 1))
    return over // under

N, K = map(int, input().split())
for i in range(K):
    # a = factorial(N-K+1) / factorial(i+1) / factorial(N-K+1 - (i+1))
    a = cmb(N-K+1, i + 1)
    # b = factorial(K-1) / factorial(i) / factorial(K-1 - i)
    b = cmb(K-1, i)

    print((a*b) % (10**9+7))

### FIXED CODE ###

from operator import mul
from functools import reduce

def cmb(n, r):
    r = min(n - r, r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1, r + 1))
    return over // under % (10 ** 9 + 7)

N, K = map(int, input().split())
for i in range(K):
    if N-K+1 >= i + 1 and K-1 >= i:
        # a = factorial(N-K+1) / factorial(i+1) / factorial(N-K+1 - (i+1))
        a = cmb(N-K+1, i + 1)
        # b = factorial(K-1) / factorial(i) / factorial(K-1 - i)
        b = cmb(K-1, i)
        print((a*b) % (10**9+7))
    else:
        print(0)
#166d
x = int(input())
for i in range(-73,73):
    for j in range(-73,73):
        print(i,j)
        if i**5-j**5==x:
            a = i
            b = j
            break
        
print(a,b)

### FIXED CODE ###

#166d
x = int(input())
for i in range(-120,120):
    for j in range(-120,120):
        if i**5-j**5==x:
            a = i
            b = j
            break
        
print(a,b)
N, M, X = map(int,input().split())

CAM = list([list(map(int,input().split())) for i in range(N)])
# print(CAM)
minn = 10**6
b = False

for i in range(2 ** N):
    bag = []
    s = 0
    x=0
    y=0
    z=0
    for j in range(N):  # このループが一番のポイント
        if ((i >> j) & 1):  # 順に右にシフトさせ最下位bitのチェックを行う
          s += CAM[j][0]
          x += CAM[j][1]
          y += CAM[j][2]
          z += CAM[j][3]
    if x >= X and y >= X and z >= X:
      minn = min(s,minn)
      b = True

print(minn if b == True else -1)

### FIXED CODE ###

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

CAM = list([list(map(int,input().split())) for i in range(N)])
# print(CAM)
minn = 10**18
b = False

for i in range(2 ** N):
  s = 0
  am = []

  for j in range(N):  # このループが一番のポイント
      if ((i >> j) & 1):  # 順に右にシフトさせ最下位bitのチェックを行う
        am.append(CAM[j])

  j = False
  sss = [0] * (M+1)
  for kk in range(len(am)):
    s += am[kk][0]
    for m in range(0, M):
      sss[m+1] += am[kk][m+1]
  
  if len([i for i in sss[1:] if i >= X] ) == len(sss[1:]):
    b = True
    minn = min(s,minn)
  
  # print(sss)
  # if x >= X and y >= X and z >= X:
  #   minn = min(s,minn)
  #   b = True

print(minn if b == True else -1)
import sys
lines = sys.stsin.readlines()
K, N = map(int, lines[0].srtip().split())
As = map(int, lines[1].strip().split())

range = max(As)-min(As)

if range*2<K:
  print(range)
else:
  print(K-range)

### FIXED CODE ###

K, N = list(map(int, input().split()))
As = list(map(int, input().split()))
diffs =[]
for base, switch in zip(As[:-1], As[1:]):
  diffs.append(switch-base)
diffs.append(As[0]+K-As[-1])
print(K-max(diffs))
def main():
    #Read stdin
    fl = input().split(" ")
    V = int(fl[0])
    E = int(fl[1])
    R = int(fl[2])
    #Adjacency list
    G = defaultdict(list)
    for i in range(int(E)):
        s, t, w = [int(x) for x in input().split(" ")]
        G[s].append((t,w))

    #initialized
    d = {}
    INF = float('inf')
    #INF = 10001
    for i in range(V):
        d[i] = INF
    d[R] = 0
    q = [R]
    while q:
        #u = heappop(q)
        u = q.pop(0)
        for v in G[u]:
            if d[v[0]] > d[u] + v[1]:
                d[v[0]] = d[u] + v[1]
                #heappush(q, v[0])
                q.append(v[0])


    for k in d.keys():
        if d[k] == float('inf'):
            print("INF")
        else:
            print(d[k])

if __name__ == '__main__':
    main()

### FIXED CODE ###

from collections import defaultdict
from collections import deque
from sys import stdin
#time 2.49
def sp(G,R,V):
    d = {}
    INF = float('inf')
    for i in range(V):
        d[i] = INF
    d[R] = 0
    q = deque([(0, R)])
    while q:
        (cost, v) = q.popleft()
        for (u, c) in G[v].items():
            if d[u] > d[v] + c:
                d[u] = d[v] + c
                q.append((d[u], u))
    return d

V, E, R = [int(x) for x in stdin.readline().split()]
G = defaultdict(dict)
for case in range(E):
    s, t, w = [int(x) for x in stdin.readline().split()]
    G[s][t] = w
d = sp(G, R, V)
for k in range(V):
        if d[k] == float('inf'):
            print("INF")
        else:
            print(d[k])
import sys

t = input()
n = t[3::]
point = range(len(n))
point = t[1]
for i in t[2]:
  point[n[i]]-=1
for j in point:
  if point[j]>0:
    print("Yes")
  else:
    print("No")


### FIXED CODE ###

#入力:N,M(int:整数)
def input2():
	return map(int,input().split())
  
n,k,q=input2()
A=[int(input()) for _ in range(q)]

P=[0]*n


for a in A:
	P[a-1]+=1

for p in P:
	if p >q-k:
		print("Yes")
	else:
		print("No")
N = int(input())
S = list(input() for _ in range(N))
X = []
for s in S:
    l,r = 0,0
    for c in s:
        if c == ")":
            if r > 0:
                r -= 1
            else:
                l += 1
        else:
            r += 1
    X.append([l,r])
X.sort(key = lambda x:(x[0],-x[1]))
Y = 0
for a,b in X:
    if a > Y:
        print(1/0)
        quit()
    Y -= a
    Y += b

if Y:
    print(1/0)
else:
    print("Yes")     

### FIXED CODE ###

N = int(input())
S = list(input() for _ in range(N))
X = []
for s in S:
    l,r = 0,0
    for c in s:
        if c == ")":
            if r > 0:
                r -= 1
            else:
                l += 1
        else:
            r += 1
    X.append([l,r])
X.sort(key = lambda x:x[0])
Y = []
L = 0
for p,q in X:
    if p > L:
        print("No")
        quit()
    if q >= p:
        L -= p
        L += q
    else:
        Y.append([p,q])
Y.sort(key = lambda x:-x[1])
for a,b in Y:
    if a > L:
        print("No")
        quit()
    L -= a
    L += b
if L:
    print("No")
else:
    print("Yes")
aa = input()
bb = input()
cc = input()
x = input()
count = 0

for a in range(aa):
  for b in range(bb):
    for c in range(cc):
      if 500*a + 100*b + 50*c == x:
        count+=1
print(count)


### FIXED CODE ###

aa = int(input()) + 1
bb = int(input()) + 1
cc = int(input()) + 1
x = int(input())
count = 0

for a in range(aa):
  for b in range(bb):
    for c in range(cc):
      if 500*a + 100*b + 50*c == x:
        count+=1
print(count)
n=int(input())
a=list(map(int,input().split()))
import numpy as np
dp=np.full((3,n+1),-pow(10,15))
dp[1,1]=a[0]
for i in range(2,n+1):
    #l,r=max(1,n//2-(n-i+1)//2),(i+1)//2+1
    l,r=max(1,i//2-1),(i+1)//2+1
    if i%3==2:
        now,pre,prepre=2,1,0
    elif i%3==0:
        now,pre,prepre=0,2,1
    elif i%3==1:
        now,pre,prepre=1,0,2
    dp[now,l:r]=np.maximum(dp[pre,l:r],dp[prepre,l-1:r-1]+a[i-1])
print(dp[now,n//2])

### FIXED CODE ###

from collections import defaultdict

n=int(input())
a=list(map(int,input().split()))
#n=2*pow(10,5)
#a=range(1,pow(10,5)+1)
# dp[i][j]:i番目の数字の中からj個数字を取った時の最大。(i//2)-1<=j<=(i+1)//2
# 求めるのはdp[n][n//2]
dp=defaultdict(lambda:-pow(10,18))
dp[(1,1)]=a[0]
for i in range(2,n+1): #i番目の数字はa[i-1]
      for j in range(i//2-1,(i+1)//2+1):
            if j==1:
                  dp[(i,j)]=max(dp[(i-1,1)],a[i-1])
            elif j==0:
                  dp[(i,j)]=0
            else:
                  dp[(i,j)]=max(dp[(i-2,j-1)]+a[i-1],dp[(i-1,j)])
print(dp[(n,n//2)])
N = int(input())
try:
    for h in range(1,3501):
        for n in range(1,3501):
            w1 = (N*h*n)//(4*h*n-N*(h+n))
            w2 = (N*h*n)/(4*h*n-N*(h+n))
            if w1==w2:
                raise(Exception)
except Exception:
    print(h,n,w1)

### FIXED CODE ###

N = int(input())
w1 = 10**5
w2 = 1
try:
    for h in range(1,3501):
        for n in range(1,3501):
            if (4*h*n-N*(h+n))>0:
                w1 = (N*h*n)//(4*h*n-N*(h+n))
                w2 = (N*h*n)/(4*h*n-N*(h+n))
            if w1==w2 and w1>0:
                raise(Exception)
except Exception:
    print(h,n,w1)
n = int(input())
s = str(input())
alp = 'abcdefghijklmnopqrstuvwxyz' * 2
lst = []

for i in range(len(s)):

    lst.append(str(alp[alp.index(s[i])+n]))

print(''.join(lst))

### FIXED CODE ###

n = int(input())
s = str(input())
alp = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'
ss = ''

for i in range(len(s)):

    ss += str(alp[alp.index(s[i])+n])

print(ss)
if __name__ == '__main__':
    t = (input().split(' '))
    t = [int(v) for v in t]
    for i in range(t[0]):
        for j in range(t[0] - i):
            for k in range(t[0] - j):
                if (10000 * i) + (5000 * j) + (k * 1000) == t[1]:
                    if i + j + k == t[0]:
                        print(i, j, k)
                        exit(1)

    print('-1 -1 -1')

### FIXED CODE ###

def main2():
    t = (input().split(' '))
    t = [int(v) for v in t]
    if t[0] * 10000 < t[1]:
        print('-1 -1 -1')
        exit(0)
    for i in range(t[0] + 1):
        for j in range((t[0] + 1) - i):
            if (10000 * i) + (5000 * j) + ((t[0] - i - j) * 1000) == t[1]:
                print(i, j, (t[0] - i - j))
                exit(0)

    print('-1 -1 -1')


if __name__ == '__main__':
    main2()
S= str(input())
cou = 0
for i in range(len(S)-1):
  if(S[i]==S[i+1]):
    cou += 1
  break
if(cou=1):
  print("Bad")
else:
  print("Good")

### FIXED CODE ###

s = str(input())
ans = "Good"
for i in range(10):
  k = str(i)+str(i)
  if(k in s):
    ans = "Bad"
    break
print(ans)
a, b = map(int, input().split())
if a<b: a,b=b,a
c = a*b
while a%b:
    a, b = b, a//b
print(c//b)

### FIXED CODE ###

a, b = map(int, input().split())
if a<b: a,b=b,a
c = a*b
while b: a, b = b, a%b
print(c//a)
s = input()
k = int(input())

def ones(s):
    ss = s[0]
    idx = 0
    while ss=="1":
        idx += 1
        ss = s[idx]
    return idx

if s[0]!="1":
    print(s[0])
else:
    idx = ones(s)
    if idx>k:
        print("1")
    else:
        print(s[idx])


### FIXED CODE ###

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

def ones(s):
    ss = s[0]
    idx = 0
    while ss=="1" and idx+1 < len(s):
        idx += 1
        ss = s[idx]
    return idx

if s[0]!="1":
    print(s[0])
else:
    idx = ones(s)
    if idx>=k:
        print("1")
    else:
        print(s[idx])
n = input()
k = int(input())

if "1" in n:
    one = n.rfind("1")-n.find("1")+1
    #print(n.rfind("1")+1)
    if one < k:
        print(n[n.rfind("1")+1])
    elif one >= k:
        print(1)
elif "1" not in n:
    print(n[0])

### FIXED CODE ###

from itertools import groupby
n = list(input())
k = int(input())
if n == 1:
    print(1)
    exit()
li = []
for key,v in groupby(n):
    li.append(list(v))

if li[0][0] == "1":
    if len(li[0])>= k:
        print(1)
        exit()

for i in range(len(n)):
    if n[i] != "1":
        print(n[i])
        break
a = int(input())
b = int(input())
X = b - a 
s = int((X*(X+1))/2 - b)
print(s)

### FIXED CODE ###

N = int(input())
if N > 999:
    print('ABD')
elif N <= 999:
    print('ABC')
input()
s = 0
a = input()
b = a.split(" ")
c = map(int,b)
for u in c:
    s=s+u

print(min(c),max(c),s)


### FIXED CODE ###

n = input()
s = 0
a = input()
b = a.split(" ")
c = []
for i in range(int(n)):
    c.append(int(b[i]))

for u in c:
    s=s+u

print(min(c),max(c),s)
import numpy as np
N,M = map(int,input().split())
R = M//N+1
R = sorted(np.arange(R),reverse=True)
for i in R :
    if M % i == 0 :
        if (M-i*(N-1))%i == 0 :
            print(i)
            break


### FIXED CODE ###

import numpy as np
from math import sqrt
ANS = []
N,M = map(int,input().split())
L = np.arange(1,int(sqrt(M))+1,dtype=int)
#L = sorted(L,reverse = True)
for i in L :
    if M % i == 0 :
        ANS.append(i)
        ANS.append(M//i)
ANS = sorted(ANS,reverse = True)
for j in ANS :
    if j * N <= M :
        print(j)
        break
import math

a,b = (int(x) for x in input().split())
print(math.floor(a*b))


### FIXED CODE ###

from decimal import Decimal

a,b = (Decimal(str(x)) for x in input().split())

c = a*b

print(int(c))
n,m = [int(x) for x in input().split()]
sc = {}
out = False
for _ in range(m):
    s,c = [x for x in input().split()]
    if s in sc.keys():
        if sc[s] != c:
            print("-1")
            out = True
        else:
            sc[s] = c
    else:
        sc[s] = c
        

if not out:
    if n == 1:
        print(sc["1"])
    elif n == 2:
        if "1" in sc.keys():
            if sc["1"] != "0":
                if "2" in sc.keys():
                    print(sc["1"],sc["2"],sep="")
                else:
                    sc["2"] = "0"
                    print(sc["1"],sc["2"],sep="")
            else:
                print("-1")
        else:
            sc["1"] = "1"
            if "2" in sc.keys():
                print(sc["1"],sc["2"],sep="")
            else:
                sc["2"] = "0"
                print(sc["1"],sc["2"],sep="")
    elif n == 3:
        if "1" in sc.keys():
            if sc["1"] != "0":
                if "2" in sc.keys():
                    if "3" in sc.keys():
                        print(sc["1"],sc["2"],sc["3"],sep="")
                    else:
                        sc["3"] = "0"
                        print(sc["1"],sc["2"],sc["3"],sep="")
                else:
                    sc["2"] = "0"
                    if "3" in sc.keys():
                        print(sc["1"],sc["2"],sc["3"],sep="")
                    else:
                        sc["3"] = "0"
                        print(sc["1"],sc["2"],sc["3"],sep="")
            else:
                print("-1")
        else:
            sc["1"] = "1"
            if not "2" in sc.keys():
                sc["2"] = "0"
            if not "3" in sc.keys():
                sc["3"] = "0"
            print(sc["1"],sc["2"],sc["3"],sep="")

### FIXED CODE ###

n,m = [int(x) for x in input().split()]
sc = {}
out = False
for _ in range(m):
    s,c = [x for x in input().split()]
    if s in sc.keys():
        if sc[s] != c:
            print("-1")
            out = True
        else:
            sc[s] = c
    else:
        sc[s] = c
        

if not out:
    if n == 1:
        if not "1" in sc.keys():
            sc["1"] = "0"
        print(sc["1"])
    elif n == 2:
        if not "1" in sc.keys():
            sc["1"] = "1"
            if not "2" in sc.keys():
                sc["2"] = "0"
            print(sc["1"],sc["2"],sep="")
        else:
            if sc["1"] == "0":
                print("-1")
            else:
                if not "2" in sc.keys():
                    sc["2"] = "0"
                print(sc["1"],sc["2"],sep="")
    elif n == 3:
        if not "1" in sc.keys():
            sc["1"] = "1"
            if not "2" in sc.keys():
                sc["2"] = "0"
            if not "3" in sc.keys():
                sc["3"] = "0"
            print(sc["1"],sc["2"],sc["3"],sep="")
        else:
            if sc["1"] == "0":
                print("-1")
            else:
                if not "2" in sc.keys():
                    sc["2"] = "0"
                if not "3" in sc.keys():
                    sc["3"] = "0"
                print(sc["1"],sc["2"],sc["3"],sep="")
def total(inlist,k):
    print(sum([ abs(i-k) for i in inlist ]))
    return
n = int(input())
a_list = [ int(v) for v in input().split() ]
a_list = [ v-i for i, v in enumerate(a_list,1) ]
a_list.sort()

total(a_list,a_list[n//2])ｖ

### FIXED CODE ###

def total(inlist,k):
    print(sum([ abs(i-k) for i in inlist ]))
    return
n = int(input())
a_list = [ int(v) for v in input().split() ]
a_list = [ v-i for i, v in enumerate(a_list,1) ]
a_list.sort()

total(a_list,a_list[n//2])
N = int(input())
A = list(map(int, input().split()))

L = [0]*(N+2)
R = [0]*(N+2)
M = [0]*(N+2)

import fractions

for i in range(1,N+1):
    L[i] = fractions.gcd(L[i-1],A[i-1])
for i in range(0,N)[::-1]:
    R[i] = fractions.gcd(R[i+1],A[i])

M = [gractions.gcd(L[i-1],R[i]) for i in range(1,N+1)]
print(max(M))

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
 
L = [0]*(N+2)
R = [0]*(N+2)
 
import fractions
 
for i in range(1,N+1):
    L[i] = fractions.gcd(L[i-1],A[i-1])
for i in range(0,N)[::-1]:
    R[i] = fractions.gcd(R[i+1],A[i])
 
M = [fractions.gcd(L[i-1],R[i]) for i in range(1,N+1)]
print(max(M))