Harryxun/stf_run huggingface dataset:
n = int( input( ) )
nums = []
for i in range( n ):
	nums.append( int( input( ) ) )

g = []
val = 1
while val <= n:
	g.append( val )
	val = 3*val+1
g.reverse( )
m = len( g )
print( m )
print( " ".join( map( str, g ) ) )
cnt = 0
for i in range( m ):
	for k in range( g[i], n ):
		v = nums[k]
		j = k - g[i]
		while 0 <= j and v < nums[j]:
			nums[ j+g[i] ] = nums[j]
			j = j - g[i]
			cnt = cnt + 1
		nums[ j+g[i] ] = v
print( cnt )
for val in nums:
	print( val )

### FIXED CODE ###

import sys
 
def insertionSort( nums, n, g ):
    cnt = 0
    i = g
    while i < n:
        v = nums[i]
        j = i - g
        while 0 <= j and v < nums[j]:
            nums[ j+g ] = nums[j]
            j -= g
            cnt += 1
        nums[ j+g ] = v
        i += 1
    return cnt
         
def shellSort( nums, n ):
    g = []
    val = 1
    while val <= n:
        g.append( val )
        val = 3*val+1
     
    g.reverse( )
    m = len( g )
    print( m )
    print( " ".join( map( str, g ) ) )
    cnt = 0
    for i in range( m ):
        cnt += insertionSort( nums, n, g[i] )
    print( cnt )
     
n = int( sys.stdin.readline( ) )
nums = []
for i in range( n ):
    nums.append( int( sys.stdin.readline( ) ) )
 
shellSort( nums, n )
print( "\n".join( map( str, nums ) ) )
N = input()
S = input()

def main(N,S):
    N = int(N)
    if N%2 == 1:
        print('No')
    else:
        l=int(N/2)

        S1 = S[:l]
        S2 = S[l:]

        if S1 == S2:
            print('Yes')
        else:
            print('No')


main(N,S)


### FIXED CODE ###

r = int(input())

print(r**2)
# D
from bisect import bisect_right
A,B,Q = map(int, input().split())
INF = float('inf')
s = [-INF] + [int(input()) for _ in range(A)] + [INF]
t = [-INF] + [int(input()) for _ in range(A)] + [INF]
for q in range(Q):
    x = int(input())
    b,d = bisect_right(s, x), bisect_right(t, x)
    ans = INF
    for s_visit in [s[b-1], s[b]]:
        for t_visit in [t[d-1, t[d]]]:
            dist1 = abs(s_visit - x) + abs(t_visit - s_visit)
            dist2 = abs(t_visit - x) + abs(s_visit - t_visit)
            ans = min(ans, dist1, dist2)
    print(ans)

### FIXED CODE ###

# D
from bisect import bisect_right
A,B,Q = map(int, input().split())
INF = float('inf')
s = [-INF] + [int(input()) for _ in range(A)] + [INF]
t = [-INF] + [int(input()) for _ in range(B)] + [INF]
for q in range(Q):
    x = int(input())
    b,d = bisect_right(s, x), bisect_right(t, x)
    ans = INF
    for s_visit in [s[b-1], s[b]]:
        for t_visit in [t[d-1], t[d]]:
            dist1 = abs(s_visit - x) + abs(t_visit - s_visit)
            dist2 = abs(t_visit - x) + abs(s_visit - t_visit)
            ans = min(ans, dist1, dist2)
    print(ans)
import sys
import numpy as np

def main(N, S, dp):
    ans = 0
    for i in range(N - 1):
        for j in range(i + 1, N):
            dp[i, j] = min(j - i, dp[i - 1, j - 1] + 1) if S[i] == S[j] else 0
        ans = max(ans, np.max(dp[i]))
    return ans


if sys.argv[-1] == 'ONLINE_JUDGE':
    import numba
    from numba.pycc import CC
    cc = CC('my_module')
    cc.export('main', 'i8(i8,i8[:],i8[:,:])')(main)
    # b1: bool, i4: int32, i8: int64, double: f8, [:], [:, :]
    cc.compile()
else:
    try:
        from my_module import main
    except:
        1
    dp = np.zeros((N + 1, N + 1), dtype=int)
    N = int(input())
    S = np.array([ord(_) for _ in input()])
    print(main(N, S, dp))


### FIXED CODE ###

import itertools
N = int(input())
S = input()
dp = [[0] * N for _ in range(N)]
ans = 0
for i, j in itertools.combinations(range(N), 2):
    if S[i] == S[j]:
        dp[i][j] = dp[i - 1][j - 1] + 1
    else:
        dp[i][j] = 0
    ans = max(ans, min(j - i, dp[i][j]))
print(ans)
N = int(input())
G = [[] for i in range(N+1)]
for i in range(N-1):
    a,b = map(int,input().split())
    G[a].append(b)
    G[b].append(a)
c = list(map(int,input().split()))
c.sort()
ans = sum(c) - c[N-1]
F = []
for i in range(N):
    n = len(G[i])
    if n == 1:
        F.append(i)
d = {}
i = 0
while len(F) != 0:
    x = F.pop(0)
    d[x] = c[i]
    i += 1
    if len(G[x]) > 0:
        y = G[x][0]
        G[y].remove(x)
        if y not in F:
            F.append(y)
ANS = []
for i in range(1,N+1):
    ANS.append(d[i])
print(ans)
print(*ANS)

### FIXED CODE ###

N = int(input())
G = [[] for i in range(N+1)]
for i in range(N-1):
    a,b = map(int,input().split())
    G[a].append(b)
    G[b].append(a)
c = list(map(int,input().split()))
c.sort()
ans = sum(c) - max(c)
F = []
for i in range(1,N+1):
    n = len(G[i])
    if n == 1:
        F.append(i)
d = {}
i = 0
while i < N:
    x = F.pop(0)
    d[x] = c[i]
    i += 1
    if len(G[x]) > 0:
        y = G[x][0]
        G[y].remove(x)
        if len(G[y]) == 1:
            F.append(y)
ANS = []
for i in range(1,N+1):
    ANS.append(d[i])
print(ans)
print(*ANS)
S = sorted(list(str(input())))
T = sorted(list(str(input())),reverse=True)

print('YNeos'[S>=::2])

### FIXED CODE ###

S = sorted(list(str(input())))
T = sorted(list(str(input())),reverse=True)

for i in range(min(len(S),len(T))):
    if S[i] < T[i]:
        print('Yes')
        break
    elif S[i] == T[i]:
        if i+1 == len(S) < len(T):
            print('Yes')
            break
        elif i+1 == len(T):
            print('No')
            break
        else:
            continue
    else:
        print('No')
        break
N,M = map(int, input().split())
As = list(map(int, input().split()))
As.sort()
BCs = [0 for i in range(M)]
for i in range(M):
    BCs[i] = list(map(int, input().split()))
BCs.sort(key=lambda x: x[1])
for i in range(M):
    B = BCs[i][0]
    C = BCs[i][1]
    j = 0
    while As[j] < C and B > 0:
        As[j] = C
        j += 1
        B -= 1
    As.sort()

ans = 0
for i in range(N):
    ans += As[i]

print(ans)



### FIXED CODE ###

N,M = map(int, input().split())
As = list(map(int, input().split()))
As.sort()
BCs = [0 for i in range(M)]
for i in range(M):
    BCs[i] = list(map(int, input().split()))
BCs.sort(key=lambda x: x[1])
mark = 0
ans = 0
for i in reversed(range(M)):
    B = BCs[i][0]
    C = BCs[i][1]
    j = mark
    if As[j] >= C:
        break
    while As[j] < C and B > 0:
        As[j] = C
        j += 1
        if j >= N:
            break
        B -= 1
    
    ans += (j - mark)*C
    mark = j
    if j >= N:
        break
    
for i in range(mark,N):
    ans += As[i]

print(ans)
n,x = map(int,input().split())
l = list(map(int,input().split()))
ans = 0
i = 0

while True:
    ans = ans + l[i]
    if ans > x:
        break

    i += 1
    
print(i+1)

### FIXED CODE ###

n,x = map(int,input().split())
l = list(map(int,input().split()))
ans = 0
i = 0

for _ in range(n):
    ans = ans + l[i]
    if ans <= x:
        i += 1
    
print(i+1)
sin = input()
queue = deque(maxlen=len(sin))
for s in sin:
    if len(queue)>0 and queue[-1] != s:
        queue.pop()
    else:
        queue.append(s)
#print("".join(arr))
print(len(sin)-len(queue))

### FIXED CODE ###

from collections import deque
sin = input()
queue = deque(maxlen=len(sin))
for s in sin:
    if len(queue)>0 and queue[-1] != s:
        queue.pop()
    else:
        queue.append(s)
#print("".join(arr))
print(len(sin)-len(queue))
import sys
from collections import *
import heapq
import math
from math import gcd
import bisect
import copy
from itertools import permutations,accumulate,combinations,product
def input():
    return sys.stdin.readline()[:-1]
def ruiseki(lst):
    return [0]+list(accumulate(lst))
mod=pow(10,9)+7
al=[chr(ord('a') + i) for i in range(26)]
direction=[[1,0],[0,1],[-1,0],[0,-1]]

n=int(input())

ans=0
# cnt=0
for i in range(int(n**0.5)):
    x=(n-(i+1))//(i+1)
    if n//x==n%x:
        ans+=x
    # print(n//cnt,cnt)
print(ans)

### FIXED CODE ###

import sys
from collections import *
import heapq
import math

import bisect
import copy
from itertools import permutations,accumulate,combinations,product
def input():
    return sys.stdin.readline()[:-1]
def ruiseki(lst):
    return [0]+list(accumulate(lst))
mod=pow(10,9)+7
al=[chr(ord('a') + i) for i in range(26)]
direction=[[1,0],[0,1],[-1,0],[0,-1]]

n=int(input())

ans=0
# cnt=0
if n==1:
    print(0)
    quit()
for i in range(int(n**0.5)):
    x=(n-(i+1))//(i+1)
    if n//x==n%x:
        ans+=x
    # print(n//cnt,cnt)
print(ans)
from collections import defaultdict
N = int(input())
d = defaultdict(int)
tmp = N
for i in range(2, int(math.sqrt(N))+1):
    while tmp % i == 0:
        d[i] += 1
        tmp /= i

if tmp > 1:
    d[tmp] += 1
ans = 0
for key, value in d.items():
    i = value
    j = 1
    while value >= j:
       ans += 1
       value -= j
       j += 1
print(ans)

### FIXED CODE ###

import math
from collections import defaultdict
N = int(input())
d = defaultdict(int)
tmp = N
for i in range(2, int(math.sqrt(N))+1):
    while tmp % i == 0:
        d[i] += 1
        tmp /= i

if tmp > 1:
    d[tmp] += 1
ans = 0
for key, value in d.items():
    i = value
    j = 1
    while value >= j:
       ans += 1
       value -= j
       j += 1
print(ans)
N =int(input())
l =[int(i)for i in input().split()]
l =sorted(l)
min =l[0]
for i,st in enumerate(l):
    st = st % min
    if st==0:
        l.pop(i)
    elif st < min:
        min = min(st,min%st)
print(min)

### FIXED CODE ###

def kumitate(a,b):
    a,b =max(a,b),min(a,b)
    while b != 0:
        a,b = b,a%b
    return a

N =int(input())
l =[int(i)for i in input().split()]
l =sorted(l)
mini =l[0]
for i in l:
    mini = kumitate(mini,i)
print(mini)
c=str(input("please enter a string"))
list=list(c)
index=0
for x in list:
      list[index]='x'
      index+=1
s=''.join(list)
print(s)

### FIXED CODE ###

s = input ()
# what stupid problem this is
print ('x' * len (s))
d = int(input())

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

s = []

for _ in range(d):
    temp = list(map(int,input().split()))

    s.append(temp)

last = [0] * 26

for i in range(d):
    temp = [x - c[i] * day for i, (x, day) in  enumerate(zip(s[i], last))]

    print(temp.index(max(temp)) + 1)

    last = [x + 1 for x in last]

    last[i] = 0

### FIXED CODE ###

d = int(input())

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

s = []

for _ in range(d):
    temp = list(map(int,input().split()))

    s.append(temp)

for i in range(d):
    print(s[i].index(max(s[i])) + 1)
n = int(input())
a_L = list(range(1,n+1))
a_L.pop()

print(sum(a_L))


### FIXED CODE ###

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

### FIXED CODE ###

A, B = map(int,input().split())
add = A + B
sub = A - B
mul = A * B
print(max(add,sub,mul))
a,b=map(str,input().split())

if(a=="A"):
  c=1
if(a=="B"):
  c=2
if(a=="C"):
  c=3
if(a=="D"):
  c=4
if(a=="E"):
  c=5
if(a=="F"):
  c=6
if(b=="A"):
  d=1
if(b=="B"):
  d=2
if(b=="C"):
  d=3
if(b=="D"):
  d=4
if(b=="E"):
  d=5
if(b=="F"):
  d=6
  
if(c>d):
  print(">")
if(c<d):
  print("<")
if(c=d):
  print("=")

### FIXED CODE ###

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

if(a=="A"):
  c=1
if(a=="B"):
  c=2
if(a=="C"):
  c=3
if(a=="D"):
  c=4
if(a=="E"):
  c=5
if(a=="F"):
  c=6
if(b=="A"):
  d=1
if(b=="B"):
  d=2
if(b=="C"):
  d=3
if(b=="D"):
  d=4
if(b=="E"):
  d=5
if(b=="F"):
  d=6
  
if(c>d):
  print(">")
if(c<d):
  print("<")
if(c==d):
  print("=")
import sys

sys.setrecursionlimit(1000000)

class UnionFind:
    def __init__(self, n):
        self.par = list(range(n)) #親
        self.rank = [0] * n #根の深さ

    # xの属する根を求める
    def find(self, x):
        if self.par[x] == x:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]

    # 併合
    def unite(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            # if they have the same parent, no need to union
            return
        if self.rank[x] < self.rank[y]:
            self.par[x] = y
        else:
            self.par[y] = x
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1

    # xとyが同じ集合に属するかを判定（同じ根に属するか）
    def same(self, x, y):
        return self.find(x) == self.find(y)

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

N, M = map(int, input().split())
uf = UnionFind(N)

for _ in range(M):
    a, b = map(int, input().split())
    uf.unite(a-1, b-1)

cnt = [0] *n
for i in range(N):
    cnt[uf.par[i]] += 1
print(max(cnt))

### FIXED CODE ###

d,t,s = map(int,input().split())

print('Yes' if d/s <= t else 'No')
s = map(int, input().split('/'))
print("Heisei" if s <= 20190430 else "TBD")


### FIXED CODE ###

s = int(input().replace('/', ''))
print("Heisei" if s <= 20190430 else "TBD")
from fractions import gcd
n = int(input())
aaa = list(map(int, input().split()))
p = aaa[0]
f = [p]
for a in aaa[1:-1]:
    p = gcd(p, a)
    f.append(p)
aaa.reverse()
p = aaa[0]
b = [p]
for a in a[1:-1]:
    p = gcd(p, a)
    b.append(p)
f = [b[0]] + f
b = b + [f[-1]]
print(max(gcd(p, q)) for p, q in zip(f, b))

### FIXED CODE ###

from fractions import gcd
n = int(input())
aaa = list(map(int, input().split()))
p = aaa[0]
f = [p]
for a in aaa[1:-1]:
    p = gcd(p, a)
    f.append(p)
aaa.reverse()
p = aaa[0]
b = [p]
for a in aaa[1:-1]:
    p = gcd(p, a)
    b.append(p)
b.reverse()

f = [b[0]] + f
b = b + [f[-1]]

print(max(gcd(p, q) for p, q in zip(f, b)))
if x<1200:
    print("ABC")
elif 1200<=x and x<2800:
    print("ARC")
else:
    print("AGC")

### FIXED CODE ###

x=int(input())
if x<1200:
    print("ABC")
elif 1200<=x and x<2800:
    print("ARC")
else:
    print("AGC")
n, k, q = map(int, input().split())
ar = [k for i in range(n)]
for i in range(q):
  index = int(input())
  ar[index-1] += 1
for i in range(n):
  if ar[i] - q > 0:
    print("Yes")
  else:
    print("No")

### FIXED CODE ###

def tap_dance(st):
  size = len(st)
  for i in range(size):
    if (i+1) % 2 == 0:
      if st[i] not in "LUD":
        return "No"
    else:
      if st[i] not in "RUD":
        return "No"
  return "Yes"
st = input()
print(tap_dance(st))
N = input()
A = map(int, input().split())

print("{.16g}".format(sum(1/x for x in A)))

### FIXED CODE ###

N = int(input())
A = map(int, input().split())
print('{:.16g}'.format(1 / sum(1 / x for x in A)))
from math import gcd, floor

def lcm(x: int, y: int) -> int:
    return (x * y) // gcd(x, y)

def calc(n: int, x: int, y: int) -> int:
    return n - floor(n / x) - floor(n / y) + floor(n / lcm(x, y))


a, b, c, d = [int(i) for i in input().split()]
print(calc(b, c, d) - calc(a - 1, c, d))


### FIXED CODE ###

from math import floor
from fractions import gcd

def lcm(x: int, y: int) -> int:
    return (x * y) // gcd(x, y)

def calc(n: int, x: int, y: int) -> int:
    return n - n//x - n//y + n//lcm(x, y)


a, b, c, d = [int(i) for i in input().split()]
print(calc(b, c, d) - calc(a - 1, c, d))
n = int(input())

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

l.sort()

if n < 3:
  print(0)

else:
  for i in range(n-2):
    for j in range(i+1,n-1):
      for k in range(j+1,n):
        if l[i] + l[j] > l[k] and l[i] is not l[j] and l[j] is not l[k] and l[k] is not l[i]:
          ans += 1
  print(ans)

### FIXED CODE ###

n = int(input())

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

l.sort()
ans = 0

if n < 2:
  print(0)
else:
  for i in range(n-2):
    for j in range(i+1,n-1):
      for k in range(j+1,n):
        if l[i] + l[j] > l[k] and l[i] < l[j] < l[k]:
          ans += 1
  print(ans)
import sys

def f1(s): return "".join([d0[c] for c in s])

d0={"M":"10010","N":"10011"}
a="ABCD";
for i in range(4): d0[a[i]]=format(i,"02b")
a="EFGHIJKL"
for i in range(8): d0[a[i]]=format(i,"03b")
L0="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
L1=" ',-.?"
L2=" .,-'?"

d={}
a="J,EE,EH,MF,GF,EF,IJ,NG,BB,AB,K,BF,NH,GE,BD,NE,BC,"\
  "AI,NF,NK,AJ,L,NL,CA,AK,AL,NI,NJ,EG,MG,MH,ME".split(",")
for i,e in enumerate(a): d[f1(e)]=(L1+L0)[i]
for s0 in sys.stdin:
  s1="".join([format((L0+L2).index(c),"05b") for c in s0.strip()])
  s=""
  x=""
  for c in s1:
    try: x+=d[s]; s=""
    except: pass
    s+=c
  if s1="": print
  else: print x

### FIXED CODE ###

import sys

def f1(s): return "".join([d0[c] for c in s])

d0={"M":"10010","N":"10011"}
a="ABCD";
for i in range(4): d0[a[i]]=format(i,"02b")
a="EFGHIJKL"
for i in range(8): d0[a[i]]=format(i,"03b")
L0="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
L1=" ',-.?"+L0
L2=L0+" .,-'?"

dc={}
a="J,EE,EH,MF,GF,EF,IJ,NG,BB,AB,K,BF,NH,GE,BD,NE,BC,"\
  "AI,NF,NK,AJ,L,NL,CA,AK,AL,NI,NJ,EG,MG,MH,ME".split(",")
for i,e in enumerate(a): dc[f1(e)]=L1[i]
ec={}
for i in range(32): ec[L2[i]]=format(i,"05b")
for s0 in sys.stdin:
  s1="".join([ec[c] for c in s0.strip("\n")])
  s=""
  x=""
  for c in s1:
    s+=c
    if s in dc: x+=dc[s]; s=""
  print x
t = list(input())

if t[0] == '?':
    if t[1] == 'D' or t[1] == '?':
                t[0] = 'P'
    else:
        t[0] = 'D'

for i in range(1, len(t)-1):
    if t[i] == '?':
        if t[i-1] == 'P':
            t[i] = 'D'
        else:
            if t[i+1] == 'D' or t[i+1] == '?':
                t[i] = 'P'
            else:
                t[i] = 'D'

if t[-1] == '?':
    t[-1] = 'D' 

print("".join(t))

### FIXED CODE ###

t = input()
if t == 'P':
    print('P')
elif t == 'D' or t == '?':
    print('D')
else:
    t = list(t)
    if t[0] == '?':
        if t[1] == 'D' or t[1] == '?':
                    t[0] = 'P'
        else:
            t[0] = 'D'

    for i in range(1, len(t)-1):
        if t[i] == '?':
            if t[i-1] == 'P':
                t[i] = 'D'
            else:
                if t[i+1] == 'D' or t[i+1] == '?':
                    t[i] = 'P'
                else:
                    t[i] = 'D'
    if t[-1] == '?':
        t[-1] = 'D' 
    print("".join(t))
from collections import deque

n, r = map(int, input().split())
d = deque()

while n > 0:
    d.append(n % k)
    n = n // k
    
print(len(d))

### FIXED CODE ###

n, k = map(int, input().split())
ans = 0
while n > 0:
    n = n // k
    ans += 1
print(ans)
x = int(input())
l_len = x // 100
l_sum = x % 100

if x < 100:
    print(0)
    exit(0)


def issum(lis, l_sum, l_len, curr_sum, curr_len):
    if l_sum - curr_sum > (l_len - curr_len) * 5:
        return
    if curr_sum > l_sum or curr_len > l_len:
        return
    if curr_sum == l_sum and curr_len == l_len:
        return True
    for i in range(6):
#         print(i, l_len)
        if issum(lis, l_sum, l_len, curr_sum + lis[i], curr_len + 1):
            return True
a = [0, 1, 2, 3, 4, 5]
if issum(a, l_sum, l_len, 0, 0):
    print(1)
else:
    print(0)

### FIXED CODE ###

x = int(input())
if x < 100:
    print(0)
    exit()

l_num = x // 100
l_sum = x % 100

if l_sum <= l_num * 5:
    print(1)
else:
    print(0)
S = input()
K = int(input())

if len(S) <= K:
  print(S)
else:
  print(S[0:K],"...")

### FIXED CODE ###

K = int(input())
S = input()

if len(S) <= K:
  print(S)
else:
  print(S[0:K]+"...")
while True:
    H,W = map(int,input().split())
    
    if H == W == 0:
        break
    for i in range(H):
        print(('#.'*w)[i%2:][:w])
    print()



### FIXED CODE ###

while True:
    H,W = map(int,input().split())
    if H == W == 0:
        break
    for i in range(H):
        print(('#.'*W)[i%2:][:W])
    print()
# -*- coding: utf-8 -*-

#############
# Libraries #
#############

import sys
input = sys.stdin.readline

import math

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

if "1"*M in S:
  print(-1)
  exit()  

S = list(map(int,list(S)))

max_n = [0]
mask = (1<<M) -1
b = 0
for i in range(N+1):
  b = ((b<<1) + (1- S[i])) & mask
  max_n.append(math.floor(math.log(b)/math.log(2))+1)

now = N
deme = []
while now != 0:
  x = max_n[now]
  now = now-x
  deme.append(x)
print(*deme[::-1])

### FIXED CODE ###

import sys
input = sys.stdin.readline

import math
import bisect

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

if "1"*M in S:
  print(-1)
  exit()  

S = [int(S[i]) for i in range(N+1)]

L = [(1<<i) -1 for i in range(1,M+1)]

max_n = [0]
mask = (1<<M) -1
b = 0
for i in range(N):
  b = ((b<<1) + (1- S[i])) & mask
  max_n.append(bisect.bisect_left(L,b)+1)

now = N
deme = []
while now != 0:
  x = max_n[now]
  now -= x
  deme.append(x)
print(*deme[::-1])
import sys
input = sys.stdin.readline

a, b, c = map(nt, input().split())
for i in range(1, b):
    if (a*i)%b == c:
        print('YES')
        sys.exit()
print('NO')

### FIXED CODE ###

import sys
input = sys.stdin.readline

a, b, c = map(int, input().split())
for i in range(1, b):
    if (a*i)%b == c:
        print('YES')
        sys.exit()
print('NO')
import math
import itertools

N = int(input())
x = [0] * N
y = [0] * N

for n in range(N):
    x[n], y[n] = map(int, input().split())


def root(xi, yi, xj, yj):
    return math.sqrt((xi - xj) ** 2 + (yi - yj) **2)

# print(root(1, 0, 0, 0))
# print(root(0, 0, 0, 1))


# a = root(4, 3, 6, 2)
# print(a)



# x1 = (-406, 10)
# x2 = ( 512, 859)
# x3 = ( 494, 362)
# x4 = (-955, -475)
# x5 = ( 128, 553)
# x6 = (-986, -885)
# x7 = ( 763, 77)
# x8 = ( 449, 310)
#

# l = [x1, x2, x3, x4, x5, x6, x7, x8]
m = 0
for i in itertools.permutations(l, len(l)):
    k = 0
    for j in range(len(i) -1):
        k += root(*(i[j] + i[j+1]))
    m += k
print(m/math.factorial(len(l)))


### FIXED CODE ###

import math
import itertools

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


# print(x)
# print(y)

def root(xi, yi, xj, yj):
    return math.sqrt((xi - xj) ** 2 + (yi - yj) **2)

# print(root(1, 0, 0, 0))
# print(root(0, 0, 0, 1))


# a = root(4, 3, 6, 2)
# print(a)



# x1 = (-406, 10)
# x2 = ( 512, 859)
# x3 = ( 494, 362)
# x4 = (-955, -475)
# x5 = ( 128, 553)
# x6 = (-986, -885)
# x7 = ( 763, 77)
# x8 = ( 449, 310)
#

l = x
# print(l)
# l = [x1, x2, x3, x4, x5, x6, x7, x8]

m = 0
for i in itertools.permutations(l, len(l)):
    k = 0
    for j in range(len(i) -1):
        k += root(*(i[j] + i[j+1]))
    m += k
print(m/math.factorial(len(l)))
l1
for _ in range(6):
  l1.append(int(input()))

if (l1[4] - l1[0]) < l1[5]:
  r = ':('
else:
  r = 'Yay!'
  
  
print(r)

### FIXED CODE ###

l1 = []
for _ in range(6):
  l1.append(int(input()))
 
if (l1[4] - l1[0]) > l1[5]:
  r = ':('
else:
  r = 'Yay!'
  
  
print(r)
*- coding: UTF-8 -*-

n = int(input())
l = list(map(int, input().split()))
l.reverse()
f = 0

for i in range(len(l)-1):
    if l[i] >= l[i+1]:
        continue
    else:
        if l[i] >= l[i+1] - 1:
            l[i+1] -= 1
        else:
            f = 1

    if f == 1:
        break


if f == 1:
    print("No")
else:
    print("Yes")


### FIXED CODE ###

# -*- coding: UTF-8 -*-

n = int(input())
l = list(map(int, input().split()))
l.reverse()
f = 0

for i in range(len(l)-1):
    if l[i] >= l[i+1]:
        continue
    else:
        if l[i] >= l[i+1] - 1:
            l[i+1] -= 1
        else:
            f = 1

    if f == 1:
        break

if f == 1:
    print('No')
else:
    print('Yes')
from math import gcd

n = int(input())
ans = 1

for _ in range(n):
	i = int(input())
	ans = int(ans * i / gcd(ans, i))

print(ans)

### FIXED CODE ###

from fractions import gcd

n = int(input())
ans = 1

for _ in range(n):
	i = int(input())
	ans = ans // gcd(ans, i) * i

print(ans)
# -*- coding: utf-8 -*-
N = int(input())
L = list(map(int, input().split()))
if max(L) > (sum(L)-max(L)):
    print("Yes")
else:
    print("No")

### FIXED CODE ###

T, X = map(int, input().split())
print(T/X)
x = int(input())
for i in range(x, 0, -1):
  ans = i
  div = []
  for j in range(2,(x**0.5)+1):
    count = 0
    if i%j ==0:
      while i%j==0:
        i //= j
        count += 1
      div.append(count)
  if len(div) == 1 and div[0] > 1:
    print(ans)

### FIXED CODE ###

x = int(input())
if x==1:
  print(1)
  exit()
ans = 1
for i in range(x, 0, -1):
  m = i
  div = []
  for j in range(2,int(m**0.5)+2):
    if m%j==0:
      count = 0
      while m%j ==0:
        m //= j
        count += 1
      div.append(count)
  if m!= 1:
    div.append(1)
  count = div[0]
  for c in div:
    if c!= count or count ==1:
      break
  else:
    print(i)
    exit()
print(ans)
import sys
s=input()
t=input()
s=sorted(list(s))
t=sorted(list(t))[::-1]
sum=0
for i in range(len(s)):
    if ord(s[i])<ord(t[i]):
        print("Yes")
        sys.exit()
print("No")


### FIXED CODE ###

s=input()
t=input()
s="".join(sorted(list(s)))
t="".join(sorted(list(t))[::-1])
if s<t:
    print("Yes")
else:
    print("No")