Harryxun/stf_run huggingface dataset:
n,a,b,c = map(int, input().split())
s = [input() for _ in range(n)]

d = {'A':a,'B':b,'C':c}

ans = ['Yes']

for i in range(n):
    if d[s[i][0]] == 0 and d[s[i][1]] == 0:
        print('No')
        exit()
    if d[s[i][0]] == 1 and d[s[i][1]] == 1:
        d[s[i][0]] = 2
        d[s[i][1]] = 0
        if d[s[i+1][0]] == 0 and d[s[i+1][1]] ==0:
            d[s[i][0]] = 0
            d[s[i][1]] = 2
            ans.append(s[i][1])
        else:
            ans.append(s[i][0])
    elif d[s[i][0]] >= d[s[i][1]]:
        d[s[i][0]] = d[s[i][0]] - 1
        d[s[i][1]] = d[s[i][1]] + 1
        ans.append(s[i][1])
    else:
        d[s[i][0]] = d[s[i][0]] + 1
        d[s[i][1]] = d[s[i][1]] - 1
        ans.append(s[i][0])

for i in range(n+1):
    print(ans[i])

### FIXED CODE ###

n,a,b,c = map(int, input().split())
s = [input() for _ in range(n)]

d = {'A':a,'B':b,'C':c}

ans = ['Yes']

for i in range(n):
    if d[s[i][0]] == 0 and d[s[i][1]] == 0:
        print('No')
        exit()
    if d[s[i][0]] == 1 and d[s[i][1]] == 1 and n-i > 1:
        d[s[i][0]] = 2
        d[s[i][1]] = 0
        if d[s[i+1][0]] == 0 and d[s[i+1][1]] ==0:
            d[s[i][0]] = 0
            d[s[i][1]] = 2
            ans.append(s[i][1])
        else:
            ans.append(s[i][0])
    elif d[s[i][0]] >= d[s[i][1]]:
        d[s[i][0]] = d[s[i][0]] - 1
        d[s[i][1]] = d[s[i][1]] + 1
        ans.append(s[i][1])
    else:
        d[s[i][0]] = d[s[i][0]] + 1
        d[s[i][1]] = d[s[i][1]] - 1
        ans.append(s[i][0])

for i in range(n+1):
    print(ans[i])
import sys
input = sys.stdin.readline

n = int(input())
A = list(map(int, input().split()))
a = sorted(list(set(A)),reverse = True)
B = []
for i in a:
    if A.count(B[0]) >= 4:
        print(i**2)
        exit()
    if A.count(i) >= 2:
        B.append(i)
        if len(B) >= 2:
            print(B[0]*B[1])
            exit()
if len(B) <= 1:
    print(0)

### FIXED CODE ###

import sys
input = sys.stdin.readline
import collections

n = int(input())
A = list(map(int, input().split()))
c = collections.Counter(A)
l = c.most_common()
L = [ l[i] for i in range(len(l)) if l[i][1] >= 2 ]
b = sorted(L,reverse = True)
if len(b) == 0:
    ans = 0
elif len(b) == 1 and b[0][1] < 4:
    ans = 0
else:
    if b[0][1] >= 4:
        ans = b[0][0]**2
    else:
        ans = b[0][0]*b[1][0]
print(ans)
del = list(map(int, input().split()))
n = len(del)
sum = 0
i = 0

while i < n - 1:
  k = i
  while k < n - 1:
    k += 1
    sum += del[i] * del[k]
  i += 1
  
print(sum)



### FIXED CODE ###

n = int(input())
deliciousness = list(map(int, input().split()))
sum = 0
i = 0

while i < n - 1:
  k = i
  while k < n - 1:
    k += 1
    sum += deliciousness[i] * deliciousness[k]
  i += 1
  
print(sum)
import sys
stdin = sys.stdin 
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()
N,K=na();S=ns()
l=[]
N=len(S)
if(S[0]=="0"):
    l.append(0)
b=S[0]
ct=1
for i in S[1:]:
    if(b!=i):
        l.append(ct)
        ct=1
        b=i
    else:
        ct+=1
l.append(ct)

len_l=len(l)
if(len_l//2 <= K):
    print(sum(l))
    exit()
res = sum(l[:2*K+1])
ans=res
if(len_l%2==0):
    l.append(0)
    len_l+=1
g = K * 2 + 1
for i in range(K*2+1,len_l-1,2):
    ans -= l[i-g] + l[i+1-g]
    ans += l[i] + l[1+i]
    res = max(ans,res)
#print(l)
print(res)

### FIXED CODE ###

import sys
 
stdin = sys.stdin
 
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

A,B=na()
if(A==B):
    print(A+B)
elif(A>B):
    if(A-1>B):
        print(A+A-1)
    else:
        print(A+B)
elif(B>A):
    if(B-1>A):
        print(B+B-1)
    else:
        print(A+B)
import sys
sys.setrecursionlimit(10**9)
class Combination:
  def __init__(self, n_max, mod=10**9+7):
    self.mod = mod
    self.modinv = self.make_modinv_list(n_max)
    self.fac, self.facinv = self.make_factorial_list(n_max)

  def __call__(self, n, r):
    return self.fac[n] * self.facinv[r] % self.mod * self.facinv[n-r] % self.mod

  def make_factorial_list(self, n):
    # 階乗のリストと階乗のmod逆元のリストを返す O(n)
    # self.make_modinv_list()が先に実行されている必要がある
    fac = [1]
    facinv = [1]
    for i in range(1, n+1):
      fac.append(fac[i-1] * i % self.mod)
      facinv.append(facinv[i-1] * self.modinv[i] % self.mod)
    return fac, facinv

  def make_modinv_list(self, n):
    # 0からnまでのmod逆元のリストを返す O(n)
    modinv = [0] * (n+1)
    modinv[1] = 1
    for i in range(2, n+1):
        modinv[i] = self.mod - self.mod//i * modinv[self.mod%i] % self.mod
    return modinv

N,K = map(int,input().split())
adj = [ [ ]for _ in range(N) ]
comb = Combination(10**5)

def nPr(n,r):
  if n < r: return 0
  return comb(n, r) * comb.fac[r]

for _ in range(N-1):
  a,b = map(int,input().split())
  a -= 1
  b -= 1
  adj[a].append(b)
  adj[b].append(a)

def dfs(v, p=-1):
  global ans
  c = 0
  for nei in adj[v]:
    if nei == p: continue
    c += 1
    dfs(nei, v)

  nk = K-1 if p==-1 else K-2
  ans *= nPr(nk, c)
  ans %= 10**9+7

ans = K
dfs(0)
print(ans)

### FIXED CODE ###

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

x1 = 0
for i,a in enumerate(A):
  if (i&1):
    x1 -= a
  else:
    x1 += a
x1 //= 2

res = [0] * N
res[0] = x1
for i in range(N-1):
  res[i+1] = A[i] - res[i]
for i in range(N):
  res[i] *= 2

print(" ".join(map(str, res)))
N = int(input())
A = list(map(int, input().split()))

hats = A[:]

h1 = hats[0]
 
def search(now1, now2, count, rem):
    now1, now2 = now2, now1^now2
    if now2 in rem:
        if now2 == h1:
            if count == N:
                return True
            else:
                return False
        else:
            return search(now1, now2, count+1, rem.discard(now1))
    else:
        return False
    

ans = False
for h2 in hats[1:]:
    if search(h1, h2, 2, set(hats)):
        ans = True

if ans:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

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

hats = A[:]
import copy
from collections import defaultdict
d = defaultdict(lambda: 0)

for h in hats:
    d[h] += 1

def f():
    if len(d) == 3:
        xor = 0
        for key in d:
            xor ^= key
        if xor == 0:
            lsit_d = list(d.keys())
            if d[lsit_d [0]] == d[lsit_d [1]] and d[lsit_d [0]] == d[lsit_d [2]]:
                return 'Yes'
            else:
                return 'No'
        else:
            return 'No'

    if len(d) == 1:
        lsit_d = list(d.keys())
        if lsit_d [0] == 0:
            return 'Yes'
        
    if len(d) == 2:
        if d[0] * 2 == N - d[0]:
            return 'Yes'
    
    return 'No'
    
print(f())
a, b, c = list(map(int,input().split()))
print(sum(a,b,c) - max(a,b,c))

### FIXED CODE ###

a, b, c = list(map(int,input().split()))
print( (a + b + c) - max(a,b,c))
M,D = map(int,input().split())

if D < 22:
  print("0")
  exit()

count = 0
  
for m in range(1,M+1):
  for d in range(22,N+1):
    if int(str(d)[1]) < 2:
      continue
   	if int(str(d)[0]) * int(str(d)[1]) == m:
      count += 1
print(count)

### FIXED CODE ###

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

if D < 22:
  print("0")
  exit()

count = 0

for m in range(1,M+1):
  for d in range(22,D+1):
    if int(str(d)[1]) < 2:
      continue
    if int(str(d)[0]) * int(str(d)[1]) == m:
      count += 1
print(count)
class Graph():
    def __init__(self):
        self.adjacency_dict = {}

    def add_vertex(self, v):
        self.adjacency_dict[v] = []
    
    def add_edge(self, v1, v2, dist):
        self.adjacency_dict[v1].append([v2, dist])
        self.adjacency_dict[v2].append([v1, dist])
    
    def next_edges(self, v):
        return self.adjacency_dict[v]

    def __str__(self):
        return self.adjacency_dict.__str__()
      
N = int(input())
dists = [list(map(int, input().split())) for _ in range(N-1)]

graph = Graph()
for i in range(1, N+1):
    graph.add_vertex(i)
for v1, v2, dist in dists:
    graph.add_edge(v1, v2, dist)
    
def dfs(start, group):
    if visited[start] is not None:
        return
    visited[start] = group
    for v, dist in graph.next_edges(start):
        if dist % 2 == 0:
            dfs(v, group)
        else:
            dfs(v, 1-group)

visited = [None]*(N+1)
dfs(1, 0)

for i in visited[1:]:
  print(i)

### FIXED CODE ###

import sys
sys.setrecursionlimit(100000)

class Graph():
    def __init__(self):
        self.adjacency_dict = {}

    def add_vertex(self, v):
        self.adjacency_dict[v] = []
    
    def add_edge(self, v1, v2, dist):
        self.adjacency_dict[v1].append([v2, dist])
        self.adjacency_dict[v2].append([v1, dist])
    
    def next_edges(self, v):
        return self.adjacency_dict[v]

N = int(input())
dists = [list(map(int, input().split())) for _ in range(N-1)]

graph = Graph()
for i in range(1, N+1):
    graph.add_vertex(i)
for v1, v2, dist in dists:
    graph.add_edge(v1, v2, dist)

def dfs(start, group):
    if visited[start] is not None:
        return
    visited[start] = group
    for v, dist in graph.next_edges(start):
        if dist % 2 == 0:
            dfs(v, group)
        else:
            dfs(v, 1-group)

visited = [None]*(N+1)
dfs(1, 0)
for i in visited[1:]:
    print(i)
#!/usr/bin/env python3
from math import gcd
n=int(input())
a=list(map(int,input().split()))
m=[0]*n
L,R=[0]*(n+1),[0]*(n+1)
for i in range(1,n+1):
    L[i]=gcd(L[i-1],a[i-1])
    R[n-i]=gcd(R[n-i+1],a[n-i])
for i in range(n):
    m[i]=gcd(L[i],R[i+1])
print(max(m))

### FIXED CODE ###

#!/usr/bin/env python3
from fractions import gcd
n=int(input())
a=list(map(int,input().split()))
m=[0]*n
L,R=[0]*(n+1),[0]*(n+1)
for i in range(1,n+1):
    L[i]=gcd(L[i-1],a[i-1])
    R[n-i]=gcd(R[n-i+1],a[n-i])
for i in range(n):
    m[i]=gcd(L[i],R[i+1])
print(max(m))
s=input()
ans=s.count(1)
print(ans)

### FIXED CODE ###

s=input()
ans=s.count("1")
print(ans)
date = input()
date[3]=8
print(date)

### FIXED CODE ###

S = list(map(str, input().split("/")))
S[0] = "2018"
s = "/".join(S)
print(s)
a, b = list(map(int, float, input().split()))
print(int(a*b))


### FIXED CODE ###

import sys
 
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
 
A, B = read().split()
 
A = int(A)
B = int(float(B) * 100 + .5)
 
A *= B
print(A // 100)
import sys
import collections


def solve():
    input = sys.stdin.readline
    mod = 10 ** 9 + 7
    h, w = list(map(int, input().rstrip('\n').split()))
    s = [list(str(input().rstrip('\n'))) for _ in range(h)]
    ql = [[0, 0, 0]]
    ql = collections.deque(ql)
    fq = collections.defaultdict(list)
    fq[0, 0]
    mt = 10 ** 10
    while True:
        if len(ql) != 0:
            cost, xv, yv = ql.popleft()
            if xv == h - 1 and yv == w - 1:
                mt = min(mt, cost)
            for xv, yv in [[xv + 1, yv], [xv - 1, yv], [xv, yv + 1], [xv, yv - 1]]:
                if 0 <= xv < h and 0 <= yv < w:
                    if (xv, yv) not in fq and s[xv, yv] != "#":
                        ql.append([cost + 1, xv, yv])
                        fq[xv, yv]
        else:
            break
    if mt == 10 ** 10:
        print(-1)
    else:
        cnt = 0
        for i in range(h):
            cnt += s[i].count("#")
        print(h * w - cnt - (mt + 1))


if __name__ == '__main__':
    solve()


### FIXED CODE ###

import sys
import collections


def solve():
    input = sys.stdin.readline
    mod = 10 ** 9 + 7
    h, w = list(map(int, input().rstrip('\n').split()))
    s = []
    b_cnt = 0
    for i in range(h):
        st = list(str(input().rstrip('\n')))
        s.append(st)
        b_cnt += st.count("#")

    ql = [[0, 0, 0]]
    ql = collections.deque(ql)
    fq = collections.defaultdict(int)
    fq[0, 0] = 1
    m_cost = 10 ** 10
    while True:
        if len(ql) != 0:
            cost, x, y = ql.popleft()
            if x == h - 1 and y == w - 1:
                m_cost = min(m_cost, cost)
            for x, y in [[x + 1, y], [x - 1, y], [x, y + 1], [x, y - 1]]:
                if 0 <= x < h and 0 <= y < w:
                    if (x, y) not in fq and s[x][y] == ".":
                        ql.append([cost+1, x, y])
                        fq[x, y] += 1
        else:
            break
    if m_cost == 10 ** 10:
        print(-1)
    else:
        print(h * w - b_cnt - m_cost - 1)


if __name__ == '__main__':
    solve()
# -*- coding:utf-8 -*-
import itertools

if __name__ == "__main__":
    N, X = list(map(int, input().split()))
    xs = list(map(int, input().split()))

    if len(xs) == 1:
        print(abs(xs[0] - X))
        exit()

    xs.sort()
    lowers = list(itertools.takewhile(lambda x: x<=X, xs))
    low = lowers[-1]
    high = xs[len(lowers)]
    Ds = []
    Ds.append(X - low)
    Ds.append(high - X)
    for d in Ds:
        failed = False
        for x in xs:
            if abs(X-x)%d == 0:
                continue
            else:
                failed = True
                break
        if failed:
            continue
        else:
            print(d)
            exit()
    print(1)


### FIXED CODE ###

def main4():
    import fractions
    N, X = list(map(int, input().split()))
    xs = list(map(int, input().split()))

    diffs = []
    for x in xs:
        diffs.append(abs(X-x))

    if len(diffs) == 1:
        print(diffs[0])
        exit()

    ans = 10**9+1
    for i in range(len(diffs)-1):
        ans = min(fractions.gcd(diffs[i], diffs[i+1]), ans)
    print(ans)

if __name__ == "__main__":
    main4()
import re

a = input()
if re.match('(.*)keyence', a):
  print("YES")
  return
if re.match('k(.*)eyence', a)
  print("YES")
  return

if re.match('ke(.*)yence', a)
  print("YES")
  return

if re.match('key(.*)ence', a)
  print("YES")
  return

if re.match('keye(.*)nce', a)
  print("YES")
  return

if re.match('keyen(.*)ce', a)
  print("YES")
  return

if re.match('keyenc(.*)e', a)
  print("YES")
  return

if re.match('keyence(.*)', a)
  print("YES")
  return

print("NO")


### FIXED CODE ###


ll = [1, 9, 7, 4]

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

if ( a in ll ):
  ll.remove(a)
  if ( b in ll ):
    ll.remove(b)
    if ( c in ll ):
      ll.remove(c)
      if ( d in ll ):
        print("YES")
      else:
        print("NO")
    else:
      print("NO")
  else:
    print("NO")
else:
  print("NO")
n,m = map(int,input().split())
lis = [list(input().split()) for _ in range(m)]

dp = [[0 for _ in range(2)] for _ in range(n)] # AC_flg, WA数

for i in range(m):
    if dp[i][0]==1:
        continue
    else:
        if lis[i][1]=='WA':
            dp[int(lis[i][0])][1] += 1
        if lis[i][1]=='AC':
            dp[int(lis[i][0])][0] = 1

ac = 0
wa = 0

for i in range(n):
    if dp[i][0]==1:
        ac += 1
        wa += dp[i][1]

print(ac,wa)

### FIXED CODE ###

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

dp = [[0 for _ in range(2)] for _ in range(n)] # AC_flg, WA数

for i in range(m):
    if dp[int(lis[i][0])-1][0]==1:
        continue
    else:
        if lis[i][1]=='WA':
            dp[int(lis[i][0])-1][1] += 1
        if lis[i][1]=='AC':
            dp[int(lis[i][0])-1][0] = 1

ac = 0
wa = 0

for i in range(n):
    if dp[i][0]==1:
        ac += 1
        wa += dp[i][1]

print(ac,wa)
x=list(map(int, input().split()))
false=0

for i in range(1,len(x)):
	if x[i]%2 ==0:
    	if x[i]%3!=0 or x[i]%5!=0
        	fasle=1
if false==1:
	print('APPROVED')
else:
	print('DENIED')

### FIXED CODE ###

n=input()
a=list(map(int,input().split()))
for x in a:
    if x%2 == 1:
        continue
    if x%3==0 or x%5 == 0:
        continue
    else:
        print('DENIED')
        break
else:
    print('APPROVED')
N = int(input())

if N%2 <> 0:
  print(int(N/2+1))
else:
  print(int(N/2))

### FIXED CODE ###

N = int(input())

if not N%2 == 0:
  print(int(N/2+1))
else:
  print(int(N/2))
lis = list(map(int, input().split()))
if lis[0] => 13:
	print(lis[1])
elif lis[0]>5 and lis[0]<13:
	print(lis[1]/2)
else:
	print(0)

### FIXED CODE ###

lis = list(map(int,input().split()))
if lis[0] >= 13:
	print(lis[1])
elif lis[0] >= 6 and lis[0] <= 13:
	print(int(lis[1]/2))
else:
	print(0)
def abc115_d():
    n, x = map(int, input().split())
    burger = "P"
    for i in range(n):
        burger = ("B" + burger + "P" + burger + "B")[:x]

    print(burger.count("P"))


abc115_d()

### FIXED CODE ###

def abc115_d():
    n, x = map(int, input().split())
    l = [1] * 51
    p = [1] * 51
    for i in range(50):
        l[i + 1] = 2 * l[i] + 3
        p[i + 1] = p[i] * 2 + 1

    ans = 0
    while n:
        if x == l[n]:
            ans += p[n]
            break
        elif x > (l[n] // 2):
            ans += p[n - 1] + 1
            x -= (l[n - 1] + 2)
            n -= 1
        else:
            x -= 1
            n -= 1
    if x == 1:
        ans += 1

    print(ans)


abc115_d()
n,m = map(int,input().split())
x = list(map(int,input().split()))
x.sort()
a = []
ans = 0
for i in range(m-1):
  a.append(x[i+1]-x[i])
a.sort()
if n >= m:
  print(0)
else:
  for i in range(m-n+1):
    ans += a[i]
  print(ans)


### FIXED CODE ###

t,x = map(int,input().split())
print(t/x)
N,K=map(int,input().split())
d=[]
a=[]
for i in range(k):
    d.append(int(input()))
    a.append(list(map(int,input().split())))
    
aa=[0]*N
counts=0

for k in K:
    for j in a[k]:
        aa[j-1]=1
        
for x in range(N+1):
    if aa[x-1]==0:
        counts+=1

print(counts)

### FIXED CODE ###

N,K=map(int,input().split())
d=[]
a=[]
for i in range(K):
    d.append(int(input()))
    a.append(list(map(int,input().split())))
    
aa=[0]*N
counts=0

for k in a:
    for j in k:
        aa[j-1]+=1
        
for x in aa:
    if x==0:
        counts+=1

print(counts)
a,b,c,d = map(int, input().split())
print(min(a,b)+min(c,d))


### FIXED CODE ###

wk = [int(input()) for i in range(4)]
print(min(wk[0], wk[1])+min(wk[2], wk[3]))
# abc121_a
H, W = map(int, input().split())
h, w = map(int, input().split())
print((H-h)*(W-w)9


### FIXED CODE ###

# abc121_a
H, W = map(int, input().split())
h, w = map(int, input().split())
print((H-h)*(W-w))
import math
A, B, H, M = map(int, input().split())
l = (360/60)*M
s = (360/12)*H + (360/12/60)*M
theta = max(l, s) - min(l, s)
theta = min(theta, 360-theta)
print(math.sqrt(A**2 + B**2 - 2*A*B*math.cos(math.radians(theta))))

### FIXED CODE ###

n = str(input())
if int(n[-1]) in [2, 4, 5, 7, 9]:
    print("hon")
elif int(n[-1]) in [0, 1, 6, 8]:
    print("pon")
else:
    print("bon")
def dfs_f(now, prev):
    # 今いる頂点から行ける頂点を順に next に入れてループ
    for next in g[now]:
        # 行ったことがない、白く塗られていない
        if not memo_f[next] and next != n - 1:
            memo_f[next] = True
            dfs_f(next, now)

def dfs_s(now, prev):
    # 今いる頂点から行ける頂点を順に next に入れてループ
    for next in g[now]:
        # 行ったことがない、白く塗られていない
        if not memo_s[next] and next != 0:
            memo_s[next] = True
            dfs_s(next, now)


n = int(input())
g = [[] * n for i in range(n)]
for i in range(n - 1):
    u, v = map(int, input().split())
    u -= 1
    v -= 1
    g[u].append(v)
    g[v].append(u)

# フェネック
# 訪れたことがあるか
memo_f = [False for i in range(n)]
memo_f[0] = True
dfs_f(0, -1)

# すぬけ
# 訪れたことがあるか
memo_s = [False for i in range(n)]
memo_s[n - 1] = True
dfs_s(n - 1, -1)

if sum(memo_f) > sum(memo_s):
    print("Fennec")
else:
    print("Snuke")

### FIXED CODE ###

import sys
sys.setrecursionlimit(1000000)


def dfs_f(now, kyori):
    kyori_f[now] = kyori
    # 今いる頂点から行ける頂点を順に next に入れてループ
    for next in g[now]:
        # 行ったことがない、白く塗られていない
        if not memo_f[next] and next != n - 1:
            memo_f[next] = True
            dfs_f(next, kyori + 1)


def dfs_s(now, kyori):
    kyori_s[now] = kyori
    # 今いる頂点から行ける頂点を順に next に入れてループ
    for next in g[now]:
        # 行ったことがない、黒く塗られていない
        if not memo_s[next] and next != 0:
            memo_s[next] = True
            dfs_s(next, kyori + 1)


n = int(input())
g = [[] * n for i in range(n)]
for i in range(n - 1):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    g[a].append(b)
    g[b].append(a)

# フェネック
memo_f = [False for i in range(n)]  # 訪れたことがあるか
kyori_f = [float("inf") for i in range(n)]  # 始点からの距離
memo_f[0] = True
dfs_f(0, 0)

# すぬけ
memo_s = [False for i in range(n)]  # 訪れたことがあるか
kyori_s = [float("inf") for i in range(n)]  # 始点からの距離
memo_s[n - 1] = True
dfs_s(n - 1, 0)

black = 0
white = 0
for i in range(n):
    if kyori_f[i] <= kyori_s[i]:
        black += 1
    else:
        white += 1

if black > white:
    print("Fennec")
else:
    print("Snuke")
import sys

sys.setrecursionlimit(2000)


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


def gcd(a, b):
    la = max(a, b)
    sm = min(a, b)
    if la % sm == 0:
        return sm
    else:
        return gcd(sm, la - sm)


n = int(input())
A = inpl()

ans = gcd(A[0], A[1])
for a in A:
    ans = gcd(ans, a)
print(ans)


### FIXED CODE ###

import sys

sys.setrecursionlimit(20000)


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


def gcd(a, b):
    la = max(a, b)
    sm = min(a, b)
    if la % sm == 0:
        return sm
    else:
        return gcd(sm, la - sm)


n = int(input())
A = inpl()
A.sort()
ans = gcd(A[0], A[1])
for a in A:
    ans = gcd(ans, a)
print(ans)
#3

n, k = map(lambda x: int(x), input().split())
list_a =  list(map(lambda x: int(x), input().split()))
list_score = []

for i in range(n):
    if i < k - 1:
        continue
#     print(i-k, i+1)
    list_score.append(sum(list_a[i-k+1:i+1]))
# print(list_score)

score_before = list_score[0]
for score in list_score[1:]:
    if score_before < score:
        print('Yes')
        score_before = score
        continue
    print('No')
    score_before = score

### FIXED CODE ###

print(10 - int(input())//200)
if __name__ == '__main__':

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

    #全体の数
    d = Counter(A)
    
    d2 = dict()
    #この時の組み合わせの合計
    for k,v in d.items():
        d2[k] = (v*(v-1)) // 2
    ans_sum = sum(d2.values())

    #結果表示
    for i in A:
        ans = 0
        if i in d2:
            #あるならば
            tmp = d[i] - 1
            before= d2[i]
            after = (tmp*(tmp-1)) //2
            ans = ans_sum - (before-after)
            print(ans)
        else:
            #ないならば
            print(ans_sum)


### FIXED CODE ###

from collections import Counter

if __name__ == '__main__':

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

    #全体の数
    d = Counter(A)
    
    d2 = dict()
    #この時の組み合わせの合計
    for k,v in d.items():
        d2[k] = (v*(v-1)) // 2
    ans_sum = sum(d2.values())

    #結果表示
    for i in A:
        ans = 0
        if i in d2:
            #あるならば
            tmp = d[i] - 1
            before= d2[i]
            after = (tmp*(tmp-1)) //2
            ans = ans_sum - (before-after)
            print(ans)
        else:
            #ないならば
            print(ans_sum)
9
education
7

### FIXED CODE ###

N=int(input())
S=list(input())
K=int(input())
w=S[K-1]
ans=""
for i in range(N):
    if S[i]==w:
        ans+=w
    else:
        ans+="*"
print(ans)
a, b = [ int(v) for v in input().split() ]
ans = -1
for i in range(1, 101):
    if math.floor(i * 0.08) == a and math.floor(i * 0.1) == b:
        ans = i
        break
print(ans)

### FIXED CODE ###

import math
a, b = [ int(v) for v in input().split() ]
ans = -1
for i in range(1, 10001):
    if math.floor(i * 0.08) == a and math.floor(i * 0.1) == b:
        ans = i
        break
print(ans)
N=int(input())
num=list(map(int,input().split()))
cnt=0
while num[i]%2==0 for i in range(N):
  cnt+=1
  num[x]/2 for x in range(N):
print(N)    

### FIXED CODE ###

N=int(input())
num=list(map(int,input().split()))
cnt=0
while all(num[i]%2==0 for i in range(N)):
  cnt+=1
  num=[i/2 for i in num]
print(cnt)