Harryxun/stf_run huggingface dataset:
from collections import deque
import numpy as np
 
num = list(map(int,input().split()))
field = [list(input()) for i in range(num[0])]
q_r = deque([])
q_c = deque([])
seen = np.zeros((num[0],num[1]))
step_r = [1,0,-1,0]
step_c = [0,1,0,-1]
 
for i in range(num[0]):
  for j in range(num[1]):
    if field[i][j] == "#":
      q_r.append(i)
      q_c.append(j)
      g_r = i
      g_c = j
 
while q_r:
  r = q_r.popleft()
  c = q_c.popleft()
 
  for i in range(4):
    next_r = r + step_r[i]
    next_c = c + step_c[i]
    
    if (next_r<0) or (num[0]<=next_r) or (next_c<0) or (num[1]<=next_c) or (field[next_r][next_c] == "#"):
      continue
    
    field[next_r][next_c] = "#"
    q_r.append(next_r)
    q_c.append(next_c)
    seen[next_r][next_c] = seen[r][c] + 1
#    print(seen[next_r][next_c],next_r,next_c)
    g_r = next_r
    g_c = next_c
 
print(int(seen[g_r][g_c]))

### FIXED CODE ###

def main():
    h,w = map(int,input().split())
    a = []
    for i in range(h):
        a.append(input())

    used = [True]*(h*w)

    p = []
    for i in range(h):
        for j in range(w):
            if a[i][j] == '#':
                p.append(i*w+j)
                used[i*w+j] = False


    
    res = 0
    while p:
        tank = []
        for e in p:
            if e>w-1 and used[e-w]:
                tank.append(e-w)
                used[e-w] = False
            if e%w > 0 and used[e-1]:
                tank.append(e-1)
                used[e-1] = False
            if e<(h-1)*w and used[e+w]:
                tank.append(e+w)
                used[e+w] = False
            if e%w<w-1 and used[e+1]:
                tank.append(e+1)
                used[e+1] =  False
        p = tank
        res += 1
    print(res-1)

if __name__ == '__main__':
    main()
a,b,c = map(int, input().split())
if a==b==c:


### FIXED CODE ###

a,b,c = map(int, input().split())
if a == b == c:
    print('Yes')
else:
    print('No')
a1 = input()
a2 = input()
a3 = input()
a = a1 + a2 + a3

if a >= 22:
  print('bust')
else:
  print('win')

### FIXED CODE ###

a1, a2, a3 = map(int, input().split())
 
if a1 + a2 + a3 >= 22:
  print('bust')
else:
  print('win')
import numpy as np


def main():
    # H, W = [int(x) for x in input().split()]
    H, W = map(int, [int(x) for x in input().split()])
    board = [[0 for i in range(H)] for j in range(W)]

    """ #は1, .は0 """
    for i in range(H):
        X = input()
        for j in range(len(X)):
            if X[j] == "#":
                board[i][j] = 1

    num_board = np.array(board)
    height, width = num_board.shape[:2]
    count = 0
    while (np.sum(num_board) != height*width):
        num_board_ans = np.zeros((height, width))
        for i in range(height):
            for j in range(width):
                if num_board[i, j] == 1:
                    num_board_ans[i, j] = 1
                    a = max(i-1, 0)
                    num_board_ans[a, j] = 1
                    b = max(j-1, 0)
                    num_board_ans[i, b] = 1
                    c = min(i+1, height-1)
                    num_board_ans[c, j] = 1
                    d = min(j+1, width-1)
                    num_board_ans[i, d] = 1
        num_board = num_board_ans
        count += 1

    print(count)


if __name__ == "__main__":
    main()


### FIXED CODE ###

from collections import deque


def bfs(h, w, board, visited):
    queue = deque([])
    for i in range(h):
        for j in range(w):
            if board[i][j] == "#":
                queue.append([i, j])
                visited[i][j] = 0
    ans = 0
    while queue:
        y, x = queue.popleft()
        for i, j in ([1, 0], [0, 1], [-1, 0], [0, -1]):
            yn, xn = y+i, x+j
            if yn >= h or xn >= w or yn < 0 or xn < 0:
                continue
            if visited[yn][xn] == -1 and board[yn][xn] == ".":
                visited[yn][xn] = visited[y][x] + 1
                queue.append([yn, xn])
                ans = max(ans, visited[yn][xn])

    return ans


def main():
    h, w = map(int, input().split())
    board = [input() for _ in range(h)]
    visited = [[-1 for _ in range(w)] for _ in range(h)]
    print(bfs(h, w, board, visited))


if __name__ == "__main__":
    main()
import sys
lines = sys.stdin.readlines()    
# 1行ずつ取り出し
KN = lines[0].strip(" ")
A = lines[1].strip(" ")

K=KN[0]

X = K - A[-1]
temp = 0
for Ai in A:
  Y = Ai - temp
  if Y > X:
    X = Y
  temp = Ai

print(K-X)
  

### FIXED CODE ###

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

ans = K - A[-1] + A[0]
for n in range(N-1):
  dis = A[n+1] - A[n]
  ans = max(ans, dis)
  
print(K-ans)
a,b,x=[int(i) for i in input().split())]
print((b-a)//x)

### FIXED CODE ###

a,b,x=[int(i) for i in input().split()]
print(b//x-(a-1)//x)
n, x = map(int, input().split())
l = list(map(int, input().split()))
cnt = 1
d = 0
for i in range(n):
    d += l[i]
    if d = x:
        cnt += 1
        break
    elif d > x:
        break

print(cnt)

### FIXED CODE ###

n, x = map(int, input().split())
l = list(map(int, input().split()))
cnt = 1
d = 0
for i in range(n):
    d += l[i]
    if d > x:
        break
    cnt += 1

print(cnt)
N, K = map(int, input().split())
routes = list(map(int, input().split()))

otozureta = set([1])
otozureta_list = [1]


def search(list, next):
    if not otozureta.isdisjoint(set([next])):
        return next
    else:
        otozureta.add(next)
        otozureta_list.append(next)
        return search(list, routes[next - 1])


target = search(routes, routes[0])
target_index = otozureta_list.index(target)

otozureta_list_len = len(otozureta_list)
loop_length = otozureta_list_len - target_index
loop_made_length = target_index
print(otozureta)

if K < otozureta_list_len:
    print(otozureta_list[K])
else:

    print(otozureta_list[loop_made_length + (K % loop_length) - 1])


### FIXED CODE ###

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

otozureta = set([1])
otozureta_list = [1]

import sys
sys.setrecursionlimit(1000000)

def search(list, next):
    if not otozureta.isdisjoint(set([next])):
        return next
    else:
        otozureta.add(next)
        otozureta_list.append(next)
        return search(list, routes[next - 1])


target = search(routes, routes[0])
target_index = otozureta_list.index(target)

otozureta_list_len = len(otozureta_list)
loop_length = otozureta_list_len - target_index
loop_made_length = target_index
#print(otozureta)

if K < otozureta_list_len:
    print(otozureta_list[K])
else:

    print(otozureta_list[loop_made_length + ((K - loop_made_length) % loop_length)])
x = input()
print(int(x**3))

### FIXED CODE ###

x = input()
y = int(x)**3
print(y)
import re
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def s(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
cnt = 0
ans = 0
inf = float("inf")

n,k=I()
a = l()
x = a.index(1)
if x % (k-1)==0 and (n-x-1)%(k-1)==0:
    print(x//(k-1) + (n-x-1)//(k-1))
elif (x%(k-1)==0 and (n-x-1)%(k-1)!=0) or (x%(k-1)!=0 and (n-x-1)%(n-k)==0):
    print(x//(k-1)+(n-x-1)//(k-1)+1)
else:
    print(x//(k-1)+(n-x-1)//(k-1)+2)


### FIXED CODE ###

import re
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def s(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
cnt = 0
ans = 0
inf = float("inf")

n,k=I()
a = l()
x = a.index(1)
if n == k:
    print(1)
    sys.exit()

print(1+math.ceil((n-k)/(k-1)))
[N,K] = list(map(int,input().split()))
R = N-K

print(int((N-K+1)%(10**9+7)))
for i in range(2,K+1):
    if i>R+1:
        print(0)
    C1 = 1
    bo = i-1
    shi = K-1
    while bo>0:
        C1 *= shi/bo
        shi += -1
        bo += -1
    R2 = R - (i-1)
    C2 = 1
    bo = i
    shi = R2+i
    while bo>0:
        C2 *= shi/bo
        shi += -1
        bo += -1
    print(int((C1*C2)%(10**9+7)))

### FIXED CODE ###

N,K = list(map(int,input().split()))
B = K
R = N-K

MAXN = 2000+5
p = 10**9+7
MOD = p
f = [1]
for i in range(MAXN):
    f.append(f[-1] * (i+1) % MOD)
def nCr(n, r, mod=MOD):
    return f[n] * pow(f[r], mod-2, mod) * pow(f[n-r], mod-2, mod) % mod

for i in range(1,K+1):
    if (i>R+1) or (i-1>B-1):
        print(0)
    else:
        X = nCr(R+1, i, mod=p)
        Y = nCr(B-1, i-1, mod=p)
        print(X*Y%p)
n,c = map(int,input().split())
l = [[0]*10**5 for _ in range(c)]
for _ in range(n):
    s,t,c = map(int,input().split())
    for i in range(s,t+1):
        l[c-1][i] = 1
ans = [0]*10**5
for i in range(len(l)):
    for j in range(len(l[i])):
        ans[j] += l[i][j]
print(max(ans))

### FIXED CODE ###

n,c = map(int,input().split())
l = [[0]*(10**5+1) for _ in range(c+1)]
for _ in range(n):
    s,t,c = map(int,input().split())
    for i in range(s,t+1):
        l[c-1][i] = 1
ans = [0]*(10**5+1)
for i in range(len(l)):
    for j in range(len(l[i])):
        ans[j] += l[i][j]
print(max(ans))
n=int(input())
s=input()
a=0
for i in range(0,n):
    if s[i]=='A' and s[i+1]=='B' and s[i+2]=='C':
        a=a+1
print(a)

### FIXED CODE ###

n=int(input())
s=input()
a=0
if n>2:
    for i in range(0,n):
        if i<n-2 and s[i]=='A' and s[i+1]=='B' and s[i+2]=='C':
         a=a+1
print(a)
n = int(input())
s = input()
y = list(s)
ans = 0
for a in range(n):
    a = int(a)
    if y[a] == "A" and y[a+1] == "B" and y[a+2] == "C":
        ans += 1

print(ans)


### FIXED CODE ###

n = int(input())
s = input()
y = list(s+"JK")
ans = 0
for a in range(n):
    a = int(a)
    if y[a] == "A" and y[a+1] == "B" and y[a+2] == "C":
        ans += 1

print(ans)
N, M = map(int,input().split())
num = ["9"]*N
l = [list(map(int,input().split())) for i in range(M)]
l = sorted(l)
if N == 1 and l[0][0]==1 and l[0][1] == 0:
  print(0)
  exit()
for i in range(M):
  if l[i][0] == 1 and l[i][1] == 0:
    print(-1)
    exit()
  if i < M-1 and l[i][0] == l[i+1][0] and l[i][1] != l[i+1][1]:
    print(-1)
    exit()
  num[l[i][0]-1] = l[i][1]
for i in range(N):
  if num[i] == "9" and i != 0:
    num[i] = 0
  elif num[i] == "9" and i == 0:
    num[i] = 1
print("".join(map(str,num)))

### FIXED CODE ###

N, M = map(int,input().split())
num = ["9"]*N
if M == 0:
  if N == 1:
    print(0)
    exit()
  for i in range(N):
    if i == 0:
      num[i] = 1
    else:
      num[i] = 0
  print("".join(map(str,num)))
  exit()
l = [list(map(int,input().split())) for i in range(M)]
l = sorted(l)
if N == 1 and l[0][0]==1 and l[0][1] == 0:
  print(0)
  exit()
for i in range(M):
  if l[i][0] == 1 and l[i][1] == 0:
    print(-1)
    exit()
  if i < M-1 and l[i][0] == l[i+1][0] and l[i][1] != l[i+1][1]:
    print(-1)
    exit()
  num[l[i][0]-1] = l[i][1]
for i in range(N):
  if num[i] == "9" and i != 0:
    num[i] = 0
  elif num[i] == "9" and i == 0:
    num[i] = 1
print("".join(map(str,num)))
N=int(input())
A=list(map(int,input().split())
kazu = len([x for x in A if x%2 == 1])
if kazu%2==1:
  print('NO')
else:
  print('YES')

### FIXED CODE ###

N=int(input())
A=list(map(int,input().split()))
kazu = len([x for x in A if x%2 == 1])
if kazu%2==1:
  print('NO')
else:
  print('YES')
while true:
  H, W = map(int, raw_input().split())
   if H == 0 and W == 0:
      break
  print (("#" * W "\n") * H)

### FIXED CODE ###

while True:
  H, W = map(int, raw_input().split())
  if H == 0 and W == 0:
      break
  print (("#" * W + "\n") * H)
from functools import sqrt
N, D = map(int, input().split(' '))

coordinate_list = list()

# 一行ずつ分解してリストに入れる
for i in range(N):
    coordinate = list(input().split())
    coordinate = list(map(int, coordinate))
    coordinate_list.append(coordinate)

def make_dis_list(D, coordinate_list):
    distance_list = list()
    for i, coordinate in enumerate(coordinate_list):
        for j in range(i+1, N):
            distance_list.append(measure_distance(coordinate, coordinate_list[j], D))
    return distance_list

def measure_distance(a, b, D):
    square_dist = 0
    for i in range(D):
        square_dist += (a[i] - b[i])**2
    return sqrt(square_dist)

def int_counter(nums):
    counter = 0
    for num in nums:
        if int(num) == num: counter += 1
    return counter

distance_list = make_dis_list(D, coordinate_list)
print(int_counter(distance_list))

### FIXED CODE ###

from math import sqrt
N, D = map(int, input().split(' '))
 
coordinate_list = list()
 
# 一行ずつ分解してリストに入れる
for i in range(N):
    coordinate = list(input().split())
    coordinate = list(map(int, coordinate))
    coordinate_list.append(coordinate)
 
def make_dis_list(D, coordinate_list):
    distance_list = list()
    for i, coordinate in enumerate(coordinate_list):
        for j in range(i+1, N):
            distance_list.append(measure_distance(coordinate, coordinate_list[j], D))
    return distance_list
 
def measure_distance(a, b, D):
    square_dist = 0
    for i in range(D):
        square_dist += (a[i] - b[i])**2
    return sqrt(square_dist)
 
def int_counter(nums):
    counter = 0
    for num in nums:
        if int(num) == num: counter += 1
    return counter
 
distance_list = make_dis_list(D, coordinate_list)
print(int_counter(distance_list))
import numpy as np
from itertools import groupby

h,w=map(int,input().split())
M=np.array([list(input()) for i in range(h)])
L=np.array([[0]*w for i in range(h)])

for i in range(w):
	c=0
	for k,g in groupby(M[:,i]):
		l=len(list(g))
		if k=='.':
			L[c:c+l,i]+=l
		c+=l

for i in range(h):
	c=0
	for k,g in groupby(M[i,:]):
		l=len(list(g))
		if k=='.':
			L[i,c:c+l]+=l
		c+=l

print(np.amax(L)-1)


### FIXED CODE ###

h,w=map(int,input().split())
M=[list(input()) for i in range(h)]
D=[[0]*w for i in range(h)]
U=[[0]*w for i in range(h)]
R=[[0]*w for i in range(h)]
L=[[0]*w for i in range(h)]

for i in range(h):
    c=0
    for j in range(w):
        if M[i][j]=='.':
            c+=1
            R[i][j]=c
        else:
            c=0
for i in range(h):
    c=0
    for j in range(w):
        if M[i][w-1-j]=='.':
            c+=1
            L[i][w-1-j]=c
        else:
            c=0
for j in range(w):
    c=0
    for i in range(h):
        if M[i][j]=='.':
            c+=1
            D[i][j]=c
        else:
            c=0
for j in range(w):
    c=0
    for i in range(h):
        if M[h-1-i][j]=='.':
            c+=1
            U[h-1-i][j]=c
        else:
            c=0
r=0
for i in range(h):
    for j in range(w):
        r=max(r,R[i][j]+L[i][j]+D[i][j]+U[i][j]-3)
print(r)
N,Q=map(int,input().split())
S=input()
li=[]
t=0
for i in range(1,N):
  if S[i-1:i+1]=="AC":
      t+=1
  li.append(t)
for _ in range(Q):
  l,r=map(int,input().split())
  print(li[r-1]-li[l-1])


### FIXED CODE ###

dna={"A":"T", "T":"A", "C":"G", "G":"C"}
print(dna[input()])
N = int(input())
X = input()
val = int(X,2)
C = X.count("1")

# xをpopcountで割ったあまりに置き換える
def f(x):
  if x==0: return 0
  return 1 + f(x % bin(x).count("1"))

# 初回のpopcountでの割り方は、(C+1) or (C-1)
Y = val%(C+1)
if C-1 != 0:
  Z = val%(C-1)
else:
  Z = 0

for i in range(N):
  if X[i] == "1":
    if Z - 1 == 0:
      print(0)
      continue
    k = (Z - pow(2,N-i-1,C-1)) % (C-1)
  else:
    k = (Y + pow(2,N-i-1,C+1)) % (C+1)
  print(f(k)+1)

### FIXED CODE ###

N = int(input())
X = input()
val = int(X,2)
C = X.count("1")

if C==1:
  for i in range(N):
    if X[i]=='1':
      print(0)
    elif i==N-1:
      print(2)
    else:
      print(1)
  exit()

# xをpopcountで割ったあまりに置き換える
def f(x):
  if x==0: return 0
  return 1 + f(x % bin(x).count("1"))

# 初回のpopcountでの割り方は、(C+1) or (C-1)
Y = val%(C+1)
if C-1 != 0:
  Z = val%(C-1)
else:
  Z = 0

for i in range(N):
  if X[i] == "1":
    if Z - 1 == 0:
      print(0)
      continue
    k = (Z - pow(2,N-i-1,C-1)) % (C-1)
  else:
    k = (Y + pow(2,N-i-1,C+1)) % (C+1)
  print(f(k)+1)
s = input()
if s == 'AAA' or s = 'BBB':
    print('No')
else:
    print('Yes')

### FIXED CODE ###

s = input()
if s == 'AAA' or s == 'BBB':
    print('No')
else:
    print('Yes')
# 未完成
import math
a = list(map(int, input().split()))

x = [a[0] / 0.08, (a[0] + 1) / 0.08]
y = [a[1] / 0.1, (a[1] + 1) / 0.1]
ans = [max([a[0] / 0.08, a[1] / 0.1]),
       min([(a[0] + 1) / 0.08, (a[1] + 1) / 0.1])]
if ((a[1] + 1) / 0.1 > (a[1] + 1) / 0.1) or (a[1] / 0.1 > (a[0] + 1) / 0.08):
    print(-1)
else:
    if math.ceil(ans[0]) > ans[1]:
        print(-1)
    else:
        print(math.ceil(ans[0]))


### FIXED CODE ###

a = input()
if a == "AAA" or a == "BBB":
    print("No")
else:
    print("Yes")
n, m = map(int, input().split())
friend = [[0]*n for i in range(n)]
s = [0] * n
for i in range(m):
    a, b = map(int, input().split())
    if friend[a-1][b-1] != 1 and friend[b-1][a-1] != 1:
        friend[a-1][b-1] = 1
        friend[b-1][a-1] = 1
        s[a-1] += 1
        s[b-1] += 1
print(max(s) + 1)

### FIXED CODE ###

class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

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

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

n,m = map(int, input().split())
uf = UnionFind(n)
for i in range(m):
    a, b = map(int, input().split())
    uf.union(a-1,b-1)
maxn = 0
for i in range(n):
    maxn = max(maxn, uf.size(i))
print(maxn)
ef remaining_ball():
    S,T=map(str,input().split())
    A,B=map(int,input().split())
    U=input()
    if U==S:
        A-=1
    else:
        B-=1
    print(A,B)
remaining_ball()

### FIXED CODE ###

def remaining_ball():
    S,T=map(str,input().split())
    A,B=map(int,input().split())
    U=input()
    if U==S:
        A-=1
    else:
        B-=1
    print(A,B)
remaining_ball()
n=int(input())
alist=[int(input()) for i in range(n)]
b=alist.sort(reverse=True)
for a in alist:
    if a < b[0]:
        print(b[1])
    elif b[0] <= a:
        print(b[0])

### FIXED CODE ###

n=int(input())
alist=[int(input()) for i in range(n)]
b=sorted(alist, reverse=True)
for a in alist:
    if a < b[0]:
        print(b[0])
    elif b[0] <= a:
        print(b[1])
N,M=list(map(int,input().split()))
H=list(map(int,input().split()))
A=[list(map(int,input().split())) for i in range(M)]
B=[0]*N
from functools import lru_cache
@lru_cache(maxsize=1000)
for i in A:
    ans=max(H[i[0]-1],H[i[1]-1])
    B[H.index(ans)]=B[H.index(ans)]+1
print(B.count(0))

### FIXED CODE ###

N,M=list(map(int,input().split()))
H=list(map(int,input().split()))
A=[list(map(int,input().split())) for i in range(M)]

B=[0]*N
# from functools import lru_cache
# @lru_cache(maxsize=1000)
# def yapoos()
for i in A:
    if H[i[0]-1]>H[i[1]-1]:
        B[i[1]-1]=1
    elif H[i[0]-1]<H[i[1]-1]:
        B[i[0]-1]=1
    else:
        B[i[0]-1]=1
        B[i[1]-1]=1
print(B.count(0))
import sys
dataset = sys.stdin.readlines()

seq = 0
l = len(dataset)

while dataset[seq] != '-':
 s = dataset[seq]
 n = int(dataset[seq+1])
 for i in range(seq + 2, seq + 2 + n):
  h = int(dataset[seq])
  s = s[h:] + s[0:h]
 print(s)
 seq += 2 + n
 

### FIXED CODE ###

import sys
dataset = sys.stdin.readlines()

seq = 0

while dataset[seq] != '-\n':
 s = dataset[seq]
 l = len(s) - 1
 s = s[:l]
 seq += 1
 n = dataset[seq]
 l = len(n) - 1
 n = int(n[:l])
 seq += 1
 for i in range(seq, seq + n):
  h = dataset[i]
  l = len(h) - 1
  h = int(h[:l])
  s = s[h:] + s[0:h]
 print(s)
 seq += n
N = int(input())
A = list(map(int, input().split()))

result = A
while True:
    result = list(set(result))
    result.sort()
    if min(result) == 0:
        result.remove(0)
    tmp_min = min(result)
    result =[r % tmp_min for r in result[1:]]
    #print(result)
    if max(result) == 0:
        result.append(tmp_min)
        break
    result.append(tmp_min)
    #print(result)

print(max(result))


### FIXED CODE ###

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

result = A
while True:
    result = list(set(result))
    result.sort()
    if min(result) == 0:
        result.remove(0)
    tmp_min = min(result)
    #print(result)
    if len(result) == 1:
        break
    result =[r % tmp_min for r in result[1:]]
    #print(result)
    if max(result) == 0:
        result.append(tmp_min)
        break
    result.append(tmp_min)
    #print(result)

print(max(result))
N = int(input())


for h in range(1, 3501):
    for n in range(1, 14000):
        if 4/N - 1/h -1/n == 0:
            continue
        else:
            w = N * h * n /(4*h*n-N*n-N*h)
            if 4/N != 1/h + 1/n + 1/w:
                continue
            elif w > 0 and w.is_integer():
                print(h, n, int(w))
                exit()

### FIXED CODE ###

N = int(input())


for h in range(1, 3501):
    for n in range(1, 3501):
        if 4*h*n-N*n-N*h == 0:
            continue
        else:
            w = N * h * n /(4*h*n-N*n-N*h)
            if w > 0 and w.is_integer():
                print(h, n, int(w))
                exit()
N, M =map(int, input().split())
Ps =[]
Ys =[]
dic = {}
for i in range(M):
    p, y = map(int, input().split())
    Ps.append(p)
    Ys.append(y)
    ls = dic.get(p, [])
    ls.append(y)
    dic[p] = ls.sort()
for i in range(M):
    p = Ps[i]
    y = Ys[i]
    number = dic[p].index(y) + 1
    strp = str(p)
    strn = str(number)
    print(strp.zfill(6) + strn.zfill(6))


### FIXED CODE ###

N, M =map(int, input().split())
ls = []
pcount =[]
for i in range(N):
    pcount.append(0)
for i in range(M):
    p, y = map(int, input().split())
    ls.append([i, p, y])
ls.sort(key = lambda x:x[2])

for l in ls:
    pcount[l[1]-1] += 1
    l.append(pcount[l[1]-1])
ls.sort(key = lambda x:x[0])
for l in ls:
    print(str(l[1]).zfill(6) + str(l[3]).zfill(6))
a, b, c = gets.chomp.split(" ")
a, b, c = a.to_i, b.to_i, c.to_i
if a < b && b < c
    puts "YES"
else
    puts "NO"
end

### FIXED CODE ###

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

if (a < b and b < c):
    print 'Yes'
else:
    print 'No'