Harryxun/stf_run huggingface dataset:
S = input()
T = input()
flag = False
for i in range(len(S) - len(T) + 1):
    k = i
    for j in range(len(T)):
        if S[k] == T[j] or S[k] == '?':
            k += 1
        else:
            break
    if k == i + len(T):
        flag = True
        st = i
        break
ret = ""
print(st)
if flag:
    for i in range(st):
        if S[i] == '?':
            ret += 'a'
        else:
            ret += S[i]
    ret += T
    for i in range(st + len(T), len(S)):
        if S[i] == '?':
            ret += 'a'
        else:
            ret += S[i]
else:
    ret = "UNRESTORABLE"
print(ret)

### FIXED CODE ###

S = input()
T = input()
flag = False
for i in range(len(S)):
    k = len(S) - i - len(T)
    for j in range(len(T)):
        if k >= 0 and (S[k] == T[j] or S[k] == '?'):
            k += 1
            if j == len(T) - 1:
                flag = True
                st = len(S) - len(T) - i
        else:
            break
    if flag:
        break
ret = ""
if flag:
    for i in range(st):
        if S[i] == '?':
            ret += 'a'
        else:
            ret += S[i]
    ret += T
    for i in range(st + len(T), len(S)):
        if S[i] == '?':
            ret += 'a'
        else:
            ret += S[i]
else:
    ret = "UNRESTORABLE"
print(ret)
N = int(input())
A = list(map(int, input().split()))
IND = list(set(A))
CNT = [A.count(x) for x in IND]
# print(IND)
# print(CNT)
# CONB = [A.count(x)*(A.count(x)-1)//2 for x in IND]
CONB = [CNT[x]*(CNT[x]-1)//2 for x in range(len(CNT))]
# print(CONB)
SUM = sum(CONB)
for i in A:
    ans = SUM - CNT[i-1] + 1
    print(ans)

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
CNT = [0]*(N+1)
# IND = list(set(A))
# CNT = [A.count(x) for x in IND]
for i in A:
    CNT[i] += 1
# print(IND)
# print(CNT)
# CONB = [A.count(x)*(A.count(x)-1)//2 for x in IND]
CONB = [CNT[x]*(CNT[x]-1)//2 for x in range(len(CNT))]
# print(CONB)
SUM = sum(CONB)
for i in A:
    ans = SUM - CNT[i] + 1
    print(ans)
def solve():
    N, M = map(int, input().split())
    
    num = []
    red = []
    for i in range(N+1):
        num.append(1)
        red.append(0)
    red[1] = 1
    
    for _ range(M):
        x, y = map(int, input().split())
        if red[x] == 1:
            red[y] = 1
        num[x] -= 1
        num[y] += 1
        if num[x] == 0:
            red[x] = 0
    
    return sum(red)

print(solve())

### FIXED CODE ###

def solve():
    N, M = map(int, input().split())
    
    num = []
    red = []
    for i in range(N+1):
        num.append(1)
        red.append(0)
    red[1] = 1
    
    for _ in range(M):
        x, y = map(int, input().split())
        if red[x] == 1:
            red[y] = 1
        num[x] -= 1
        num[y] += 1
        if num[x] == 0:
            red[x] = 0
    
    return sum(red)

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

if n == 1:
  print(1)
  exit()

f = [0 for i in range(n+1)]
f[-2:] = [1, 1]
for i in range(m):
  f[int(input())-1] = -1

div_num = 1000000007

for index in range(n-1)[::-1]:
  i = index + 1
  if f[i] == -1:
    continue
  if f[i+1] == -1 and f[i+2] == -1:
    print(0)
    exit()
  elif f[i+1] == -1 and f[i+2] != -1:
    f[i] = f[i+2]
  elif f[i+1] != -1 and f[i+2] == -1:
    f[i] = f[i+1]
  else:
    f[i] = f[i+1]+f[i+2]

print(int(f[0]%div_num))

### FIXED CODE ###

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

if n == 1:
  print(1)
  exit()

f = [0 for i in range(n)]
f[-2:] = [1, 1]
for i in range(m):
  f[int(input())-1] = -1

div_num = 1000000007

for i in range(n-2)[::-1]:
  if f[i] == -1:
    continue
  if f[i+1] == -1 and f[i+2] == -1:
    print(0)
    exit()
  elif f[i+1] == -1 and f[i+2] != -1:
    f[i] = f[i+2]
  elif f[i+1] != -1 and f[i+2] == -1:
    f[i] = f[i+1]
  else:
    f[i] = f[i+1]+f[i+2]

if f[0] != -1 and f[1] != -1:
  print(int((f[0]+f[1])%div_num))
elif f[0] == -1 and f[1] != -1:
  print(int(f[1]%div_num))
elif f[0] != -1 and f[1] == -1:
  print(int(f[0]%div_num))
else:
  print(0)
for i in range(n+1):
  for j in range(n-i+1):
    if 10000*i+5000*j+1000*(n-i-j)==y:
        print(i,j,n-i-j);exit()
print(-1,-1,-1)


### FIXED CODE ###

n,y=map(int,input().split())
for i in range(n+1):
  for j in range(n-i+1):
    if 10000*i+5000*j+1000*(n-i-j)==y:
        print(i,j,n-i-j)
        exit()
print(-1,-1,-1)
n = int(input())

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

c = [0]*9
for i in a:
  t = i // 400
  if t < 8:
    c[t] = 1
  else:
    c[8] += 1
cmin = max(sum(c[:-1]), min(c[8], 1))
cmax = min(sum(c))
print(cmin, cmax)

### FIXED CODE ###

n = int(input())

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

c = [0]*9
for i in a:
  t = i // 400
  if t < 8:
    c[t] = 1
  else:
    c[8] += 1
cmin = max(sum(c[:-1]), min(c[8], 1))
cmax = sum(c)
print(cmin, cmax)
print(f"A{RB[input()<"1200"]}C")

### FIXED CODE ###

x = int(input())

print("ABC" if x < 1200 else "ARC")
N = int(input())
A = list(map(int,input().split()))
l = [0]*N
for i in range(1,N):
  l[A[i-1]-1] += 1
for i in range(N):
  print(l[i])
  

### FIXED CODE ###

r = int(input())
print(6.3*r)
a = list(input())
b = []
for i in a:
  if i = "1":
    b.append("9")
  else:
    b.append("1")
print("".join(b))

### FIXED CODE ###

a = input()
print(a.replace("1","x").replace("9","1").replace("x","9"))
from math import ceil, log2, pow

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

def main():
    N, K = mi()
    ans = 0
    for i in range(1, N+1):
        ans += pow(0.5, max(0, ceil(log2(K)-log2(i))))/N
    print(ans)

if __name__ == '__main__':
    main()

### FIXED CODE ###

from math import ceil, log, pow

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

def main():
    N, K = mi()
    ans = 0
    for i in range(1, N+1):
        ans += pow(0.5, max(0, ceil(log(K, 2)-log(i, 2))))/N
    print(ans)

if __name__ == '__main__':
    main()
n = int(input())
for x in range(1, 10)
  for y in range(1, 10)
    if x * y == n:
      print("Yes")
      exit()
print("No")
  

### FIXED CODE ###

n = int(input())
for x in range(1, 10):
  for y in range(x, 10):
    if x * y == n:
      print("Yes")
      exit()
print("No")
if __name__ == "__main__":
  n = input()
  if n % 2 == 0:
    print(0.5)
  else:
    p = (n+1)/(2*n)
    print(p)

### FIXED CODE ###

if __name__ == "__main__":
    n = int(input())
    if n % 2 == 0:
        print(0.5)
    else:
        p = (n + 1) / (2 * n)
        print(p)
a, b = map(int,input().spilt())

if a < b:
    print("a > b")
elif a > b:
    print("a < b")
else a == b:
    print("a == b")

### FIXED CODE ###

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

if a < b:
    print("a < b")
elif a > b:
    print("a > b")
else:
    print("a == b")
N = int(input())
div,mod = divmod(N,5000)
div2 = (mod,5)
print(5000*div + 5*div2) 

### FIXED CODE ###

N = int(input())
div,mod = divmod(N,500)
div2 = mod//5
print(1000*div + 5*div2)
n=int(input())
kei = 0.0
for i in range (n):
    x,u=list(map(input().split()))
    if u[i]=="JPY":
        kei += float(int(x[i]))
    else:
        kei += float(x[i])*380000.0
print(kei)


### FIXED CODE ###

n=int(input())
kei = 0.0
for i in range(n):
    x,u=map(str,input().split())
    if u=="JPY":
        kei += float(x)
    else:
        kei += float(x)*380000.0
print(kei)
N = int(input())
d = []
visited = [False for _ in range(N+1)]
for _ in range(N):
  d.append(int(input())-1)
  
def dfs(i,cnt):
  if i == 1:
    return cnt
  elif visited[i]:
    return -1
  else:
    visited[i] = True
    return dfs(d[i],cnt+1)
  
print(dfs(0,0))

### FIXED CODE ###

N = int(input())
d = []
visited = [False for _ in range(N+1)]
for _ in range(N):
  d.append(int(input())-1)

i = 0
cnt = 0
while True:
  if i == 1:
    break
  elif cnt >= N:
    cnt = -1
    break
  elif visited[i]:
    cnt = -1
    break
  else:
    visited[i] = True
    cnt += 1
    i = d[i]
  
print(cnt)
import math
n = int(input())
x = []
for i in range(n):
    a,b,c,d = map(int,input().split())
    x.append((a,b,c,d))

def f(a,b,c,d):
    if a < b:
        print("No")
    elif b > d:
        print("No")
    elif c >= b:
        print("Yes")
    else:
        g = math.gcd(b,d)
        if b-g+(a%g) > c:
            print("No")
        else:
            print("Yes")

for i in range(n):
    a,b,c,d = x[i][0],x[i][1],x[i][2],x[i][3]
    f(a,b,c,d)

### FIXED CODE ###

def gcd(x,y):
    if x < y:
        tmp = y
        y = x
        x = tmp

    while x % y != 0:
        r = x % y
        x = y
        y = r
    return y

n = int(input())
x = []
for i in range(n):
    a,b,c,d = map(int,input().split())
    x.append((a,b,c,d))

def f(a,b,c,d):
    if a < b:
        print("No")
    elif b > d:
        print("No")
    elif c >= b:
        print("Yes")
    else:
        g = gcd(b,d)
        if b-g+(a%g) > c:
            print("No")
        else:
            print("Yes")

for i in range(n):
    a,b,c,d = x[i][0],x[i][1],x[i][2],x[i][3]
    f(a,b,c,d)
S = input()

f = int(S[:2])
e = int(S[2:])

if f==0 or e==0:
    print("NA")
    return 0

if f <13 and f>0:
    if e < 13:
        print("AMBIGUOUS")
    else:
        print("MMYY")
else:
    if e < 13:
        print("YYMM")

        


### FIXED CODE ###

def main(f, e):
    if 0 <f <13:
        if 0<e<13:
            print("AMBIGUOUS")
        else:
            print("MMYY")
    else:
        if 0<e<13:
            print("YYMM")
        else:
            print("NA")
if __name__ == "__main__":
    S = input()

    a = int(S[:2])
    b = int(S[2:])
    main(a, b)
N, Q = map(int, input().split())
A = []
B = []

for i in range(N - 1):
    a, b = map(int, input().split())
    A.append(a)
    B.append(b)

P = []
X = []
for i in range(Q):
    p, x = map(int, input().split())
    P.append(p)
    X.append(x)


T = {}
for i in range(len(A)):
    a = A[i]
    b = B[i]
    if a in T:
        T[a].append(b)
    else:
        T[a] = [b]

def subnode(n, l):
    l.append(n)
    if n in T:
        for n2 in T[n]:
            l = subnode(n2, l)
    return l

T2 = {}
for i in range(1, N + 1):
    T2[i] = subnode(i, [])

d = [0] * N

for i in range(len(P)):
    p = P[i]
    x = X[i]
    l = T2[p]
    for i in l:
        d[i - 1] += x


print(' '.join(map(str, d)))


### FIXED CODE ###

from sys import stdin,setrecursionlimit
input = stdin.readline
setrecursionlimit(1000000) 

N, Q = map(int, input().split())
T = [[] for _ in range(2 * (10 ** 5))]
for _ in range(N - 1):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    T[a].append(b)
    T[b].append(a)

d = [0] * N

for _ in range(Q):
    p, x = map(int, input().split())
    d[p - 1] += x

def dfs(u, v):
    global d
    for p in T[u]:
        if p == v:
            continue
        d[p] += d[u]
        dfs(p, u)

dfs(0, -1)

for v in d:
    print(v)
import math
 
def lcm(a, b):
    return abs(a*b) // math.gcd(a, b)
  
a, b = [int(x) for x in input().split()]
print(lcm(a,b))

### FIXED CODE ###

from fractions import gcd
 
def lcm(a, b):
    return abs(a*b) // gcd(a, b)
  
a, b = [int(x) for x in input().split()]
print(lcm(a,b))
i = list(map(int,input().split()))
K = i[0]
X = i[1]
print(range(X-K+1,X-K-1)

### FIXED CODE ###

i = list(map(int,input().split()))
K = i[0]
X = i[1]
C = range(X-K+1,X+K)
print(' '.join(map(str,list(C))))
import math
n = int(input())
x = list(map(int, input().split()))
y = list(map(int, input().split()))

for p in range(1, 4):
 sum = 0
 for i in range(n):
  sum += math.fabs(x[i]-y[i])**p
 print(sum**(1/p))

a = []
for i in range(n):
 a.append(math.fabs(x[i]-y[i]))
a = a.sort()
print(a[n])

### FIXED CODE ###

import math
n = int(input())
x = list(map(int, input().split()))
y = list(map(int, input().split()))

for p in range(1, 4):
 sum = 0
 for i in range(n):
  sum += math.fabs(x[i]-y[i])**p
 print(sum**(1/p))

a = []
for i in range(n):
 a.append(math.fabs(x[i]-y[i]))
a.sort()
print(a[n-1])
a,b=map(int,input(.split()))
aa=max(map(int,input().split()))
if aa>=a:
    print("yes")
else:
    print('No')


### FIXED CODE ###

a,b=map(int,input().split())
l=list(map(int,input().split()))
if sum(l)>=a:
	print('Yes')
else:
	print("No")
import numpy as np
N,M = (int(x) for x in input().split())
H   = np.array([int(x) for x in input().split()])
Way = np.zeros((N,N),dtype=bool)
for T in range(0,M):
    A,B = (int(x) for x in input().split())
    Way[A-1,B-1] = True
    Way[B-1,A-1] = True
    
Count = 0
for TT in range(0,N):
    TrueIndex = [n for n,v in enumerate(Way[TT,:]) if v==True]
    if np.all(H[TT]>H[TrueIndex]):
        Count = Count+1
print(Count)

### FIXED CODE ###

N,M = (int(x) for x in input().split())
H   = [int(x) for x in input().split()]
Way = [[] for I in range(N)]
for T in range(0,M):
    A,B = (int(x) for x in input().split())
    Way[A-1].append(B)
    Way[B-1].append(A)
    
Count = 0
for TT in range(0,N): 
    if all(H[TT]>Ele for Ele in [H[I-1] for I in Way[TT]]):
        Count = Count+1
print(Count)
# セル3(変数のリセット)
input_count = 0

def func(i, d, marks):
    rooms = numpy.nonzero(d[i])[0]
    new_room = []
    if rooms.size == 0:
        return marks
    for j in rooms:
        room_idx = j
        if room_idx in marks:
            continue
        marks[room_idx] = i
        new_room.append(room_idx)
    for j in new_room:
        marks = func(j, d, marks)
    return marks

def get_input():
    N, M =  list(map(int, input().split()))
    d = numpy.zeros((N,M))
    for i in range(M):
        a, b =  list(map(int, input().split()))
        d[a-1, b-1] = 1
        d[b-1, a-1] = 1
    return N, M, d

def write_result(marks, N):
    flag = True
    output_str = ''
    for i in range(1, N):
        if i not in marks:
            flag = False
            break
        output_str += f'{marks[i]+1}\n'
    if flag:
        print('Yes')    
        print(output_str)
    else:
        print('No')

import numpy


N, M, d = get_input()

marks = {0:0}
try:
    marks = func(0, d, {0: 0})
except:
    pass

write_result(marks, N)

### FIXED CODE ###


def get_input():
    N, M =  list(map(int, input().split()))
    routes = {}
    for i in range(M):
        a, b =  list(map(int, input().split()))
        a_idx = a - 1
        b_idx = b - 1
        if a_idx in routes:
            routes[a_idx].append(b_idx)
        else:
            routes[a_idx] = [b_idx]
        
        if b_idx in routes:
            routes[b_idx].append(a_idx)
        else:
            routes[b_idx] = [a_idx]

    return N, M, routes

def write_result(marks, N):
    flag = True
    output_str = ''
    for i in range(1, N):
        if i not in marks:
            flag = False
            break
        output_str += f'{marks[i]+1}\n'
    if flag:
        print('Yes')    
        print(output_str)
    else:
        print('No')

import numpy


marks = {0:0}

N, M, routes = get_input()
mark = {0:0}
start_nodes = [0]
while start_nodes:
    next_nodes = []
    for i in start_nodes:
        for n in routes[i]:
            if n in marks:
                continue
            marks[n] = i
            next_nodes.append(n)
    start_nodes = next_nodes   
write_result(marks, N)
if x:
    print 0
else:
    print 1

### FIXED CODE ###

x = int(input())
 
if x:
    print(0)
else:
    print(1)
a=ord(input());print('YNeos'[a[0]^a[1]^a[2]=='`'])

### FIXED CODE ###

print("YNeos"[len(set(input()))<3::2])
from sympy import nextprime
X=int(input())
print(nextprime(X))

### FIXED CODE ###

import math

X=int(input())

def isprime(n):
    if n == 2:
        return True
    if n % 2 == 0:
        return False
    m = int(math.sqrt(n)) +1
    for p in range(3, m, 2): 
        if n % p == 0:
            return False
    return True

def nextprime(n):
    if n < 2:
        return 2
    if n < 7:
        return {2: 3, 3: 5, 4: 5, 5: 7, 6: 7}[n]
    nn = 6*(n//6)
    if nn == n:
        n += 1
        if isprime(n):
            return n
        n += 4
    elif n - nn == 5:
        n += 2
        if isprime(n):
            return n
        n += 4
    else:
        n = nn + 5
    while 1:
        if isprime(n):
            return n
        n += 2
        if isprime(n):
            return n
        n += 4

print(X if isprime(X) else nextprime(X))
while 1:
   x,y = map(raw_input().split())
   if x == 0 and y == 0:
      break
   if y >= x:
      print '%s %s' % (x, y)
   else:
      print '%s %s' % (y, x)

### FIXED CODE ###

while 1:
   x,y = map(int, raw_input().split())
   if x == 0 and y == 0:
      break
   if y >= x:
      print '%s %s' % (x, y)
   else:
      print '%s %s' % (y, x)
jh

### FIXED CODE ###

A,B=map(int, input().split())
print(max(A+B,A-B,A*B))
n = int(input())
a = input()
b = input()
c = input()

ans = 0
for i in range(n):
  cnt = len(set(a[i],b[i],c[i]))-1
  ans += cnt

print(ans)


### FIXED CODE ###


n = int(input())
a = input()
b = input()
c = input()

ans = 0
for i in range(n):
    cnt = 2
    if a[i]==b[i]: cnt -= 1
    if b[i]==c[i]: cnt -= 1
    if c[i]==a[i]: cnt -= 1
    if cnt<0: cnt = 0
    ans += cnt

print(ans)
N=int(input())
A=list(map(int,input().split()))
before=0
state=-1
ans=0
for a in A:
  
  if a==before:
    continue
  elif a-before>0:
    if state==-1:
      state=1
      ans+=1
    if state==0:
      state=-1
  else:
    if state==-1:
      state=0
      ans+=1
    if state==1:
      state=-1
  before=a
if (A[-1]-A[-2])*(A[-2]-A[-3])<0:
  ans+=1
print(ans)

### FIXED CODE ###

N=int(input())
A=list(map(int,input().split()))
before=0
state='minus'
ans=0

for i in range(N):
  if A[i]==before:
    continue
  elif A[i]-before>0:
    if state=='minus':
      ans+=1
      state='None'
    elif state=='None':
      state='plus'
  else:
    if state=='plus':
      state='None'
      ans+=1
    elif state=='None':
      state='minus'
  before=A[i]
print(ans)
def warshall_floyd(d):
    for k in range(n):
        for i in range(n):
            for j in range(n):
                d[i][j] = min(d[i][j],d[i][k] + d[k][j])
    return d
n = int(input())
d = [[float("inf") for i in range(n)] for i in range(n)] 
l=[[] for i in range(n)]
#d[u][v] : 辺uvのコスト(存在しないときはinf)
for i in range(n):
    s=input()
    for j in range(n):
        if s[j]=="1":
            d[i][j] = 1
            l[i].append([i,j])
for i in range(n):
    d[i][i] = 0
wf=warshall_floyd(d)
visited = [1]+[0 for i in range(n-1)]
while 0 in visited:
    for i in l:
        if visited[i[0]]!=0:
            if visited[i[0]]==1:
                if visited[i[1]]==1:
                    print(-1)
                    exit()
                elif visited[i[1]]==0:
                    visited[i[1]]=-1
            else:
                if visited[i[1]]==-1:
                    print(-1)
                    exit()
                elif visited[i[1]]==0:
                    visited[i[1]]=1
ans=0
for i in wf:
    ans=max(ans,max(i)+1)
print(ans)

### FIXED CODE ###

#warshall_floyd法
def warshall_floyd(d):
    for k in range(n):
        for i in range(n):
            for j in range(n):
                d[i][j] = min(d[i][j],d[i][k] + d[k][j])
    return d
n = int(input())
d = [[float("inf") for i in range(n)] for i in range(n)] 
l=[]
#d[u][v] : 辺uvのコスト(存在しないときはinf)
for i in range(n):
    s=input()
    for j in range(n):
        if s[j]=="1":
            d[i][j] = 1
            l.append([i,j])
for i in range(n):
    d[i][i] = 0
wf=warshall_floyd(d)
visited = [1]+[0 for i in range(n-1)]
for _ in range(1000):
    for i in l:
        if visited[i[0]]!=0:
            if visited[i[0]]==1:
                if visited[i[1]]==1:
                    print(-1)
                    exit()
                elif visited[i[1]]==0:
                    visited[i[1]]=-1
            else:
                if visited[i[1]]==-1:
                    print(-1)
                    exit()
                elif visited[i[1]]==0:
                    visited[i[1]]=1
ans=0
for i in wf:
    ans=max(ans,max(i)+1)
print(ans)
N, K = map(int,input().split())
H=10 ** 9 + 7
ans=N-K+1
print(ans)
for i in range(1,K):
    P=(N-K-i+1)/(i+1)
    Q=(K-i)/i
    if ans< H :
        ans=int(ans*P*Q)
        print(ans)
    else:
        ans=int(ans*P*Q % H)
        print(ans)

### FIXED CODE ###

S=input()
if len(set(S)) == 2 and S.count(S[0]) ==2:
    print("Yes")     
else:
    print("No")
print(800*int(input())-200*(n//15))

### FIXED CODE ###

n = int(input())
print(800*n-200*(n//15))
n = int(input())
a = int(input())
b = int(input())

if n == 1:
    print("Hello World")
elif n == 2:
    print(a + b)

### FIXED CODE ###

n = input()

if n == "1":
  print("Hello World")
  
elif n == "2":
  a = int(input())
  b = int(input())
  print(a + b)
from itertools import product
import numpy as np

N, M, X = list(map(int, input().split()))
conditions = product([0, 1], repeat=N)
A = np.array([list(map(int, input().split())) for i in range(N)])
succeed = []
for c in conditions:
    p = A * np.array(c).reshape((N, 1))
    res = p.sum(axis=0)
    if np.all(res[1:] >= X):
        succeed.append(res[0])
print(min(succeed) if len(succeed) > 0 else -1)

### FIXED CODE ###

S = input()
T = input()
print('Yes' if T[:-1] == S else 'No')
import math
from functools import reduce

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

def gcd(numbers):
    return reduce(math.gcd, numbers)

ans = 0
if n == 2:
    ans = max(aList)
else:
    for i in range(0,n-1):
        tmp = aList.pop(0)
        r = gcd(aList)
        if ans < r:
            ans = r
        aList.append(tmp)

print(ans)
    

### FIXED CODE ###

import fractions

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

def gcd3(nums):
    ans1 = fractions.gcd(nums[0], nums[1])
    ans2 = fractions.gcd(nums[0], nums[2])
    ans3 = fractions.gcd(nums[1], nums[2])

    if ans1 >= ans2 and ans1 >= ans3:
        return ans1, nums[2]
    if ans2 >= ans1 and ans2 >= ans3:
        return ans2, nums[1]
    if ans3 >= ans1 and ans3 >= ans2:
        return ans3, nums[0]

ans = 0
if n == 2:
    ans = max(aList)
else:
    sList = []
    sList.append(aList.pop(0))
    sList.append(aList.pop(0))
    sList.append(aList.pop(0))
    ans, v = gcd3(sList)

    for i in range(len(aList)):
        tmp = aList.pop(0)
        tmp1 = fractions.gcd(ans, v)
        tmp2 = fractions.gcd(ans, tmp)
        if tmp1 >= tmp2:
            ans = tmp1
            v = tmp
        else:
            ans = tmp2

print(ans)
N = int(input())
A = int(input())
B = int(input())
if N == 1:
  print('Hello World')
elif N == 2:
  S = A + B
  print(S)

### FIXED CODE ###

N = int(input())
if N == 1:
  print('Hello World')
elif N == 2:
  A = int(input())
  B = int(input())
  S = A + B
  print(S)
N = int(input())
print(max(i if 2 ** i <= N else 0 for i in range(10))

### FIXED CODE ###

N = int(input())
print(max(2 ** i if 2 ** i <= N else 0 for i in range(10)))
import bisect
from itertools import *
n=range(49994);a=list(n);a[1]=0
for i in range(2,224):a[i*2::i]=[0]*len(a[i*2::i])
p=list(compress(n,a))
for x in iter(input,'0'):
 x=int(x)
 if x%2:print(sum(2+c==x for c in p[:bisect.bisect(p,x)-1]))
 elif x-4:print(sum(1 for c in p[:bisect.bisect(p,x//2)]if a[x-c]))
 else:print(1)


### FIXED CODE ###

import bisect,sys
from itertools import *
n=range(50001);a=list(n);a[1]=0
for i in range(2,224):a[i*2::i]=[0]*len(a[i*2::i])
p=list(compress(n,a))
for x in map(int,sys.stdin):
 if x:print(len([1 for d in p[:bisect.bisect(p,x//2)]if a[x-d]]))