Harryxun/stf_run huggingface dataset:
#132 12:55
n,k=map(int,input().split())
mod=7+10**9
def C(i,j):
    def a(n):
        b=1
        if n==0:
            return 1
        else:
            for x in range(1,n+1):
                b=b*x
            return b
    return int(a(i)/(a(j)*a(i-j)))

answer=[]
for i in range(1,k+1):
    if n-k-i+1<0:
        continue
    else:
        answer.append( (C(k-1,i-1)%mod)*(C(n-k+1,i)%mod ))
for i in range(len(answer)):
    print(answer[i]%mod)


### FIXED CODE ###

N, K = map(int, input().split())
R = N-K
RR = R-1
mod = 10**9+7

def nCr(n,r):
    K = 1
    for j in range(1,r+1):
        K = K*(n+1-j)//j
    return K

    
for i in range(K):
    ans = (nCr(K-1,i)%mod)*(nCr(N-K+1,i+1)%mod)
    ans = ans%mod
    print(ans)
N, M = (int(i) for i in input().split())
P = [None for i in range(N+1)]
Tree = [list() for i in range(N+1)]
for index in range(M):
	L, R, D = (int(i) for i in input().split())
	Tree[L].append((R, D))
	Tree[R].append((L,-D))

def process(i):
	global P, Tree
	obj = Tree[i]
	if len(obj) != 0:
		if P[i] is None:
			P[i] = 0
		for j, d in obj:
			if P[j] is None:
				P[j] = P[i] + d
				if len(Tree[j]) != 0:
					process(j)
			else:
				if P[j] - P[i] != d:
					print("No")
					exit(0)

for i in range(1,N+1):
	process(i)

print("Yes")

### FIXED CODE ###

import sys

N, M = (int(i) for i in input().split())
P = [None for i in range(N+1)]
Graph = [list() for i in range(N+1)]
for index in range(M):
	L, R, D = (int(i) for i in input().split())
	Graph[L].append((R, D))
	Graph[R].append((L,-D))

def determine(i):
	if P[i] is not None:
		return
	P[i] = 0
	stack = [i]
	while len(stack) != 0:
		I = stack.pop()
		for j, d in Graph[I]:
			if P[j] is None:
				P[j] = P[I] + d
				stack.append(j)

def check(i):
	for j, d in Graph[i]:
		if P[j] - P[i] != d:
			print("No")
			exit(0)

for i in range(1,N+1):
	determine(i)

for i in range(1,N+1):
	check(i)

print("Yes")
#!/usr/bin/env python3
import sys
input = sys.stdin.readline
import heapq
INF = 10**9

MAX_SILVER = 3000 

class Dijkstra:
    def __init__(self, adj):
        self.adj = adj
        self.dist = [INF] * len(adj)
        self.q = []

    def calc(self, start):
        self.dist[start] = 0
        heapq.heappush(self.q, (0, start))
        while len(self.q) != 0:
            prov_cost, src = heapq.heappop(self.q)
            if self.dist[src] < prov_cost:
                continue
            for dest, cost in self.adj[src]:
                if self.dist[dest] > self.dist[src] + cost:
                    self.dist[dest] = self.dist[src] + cost
                    heapq.heappush(self.q, (self.dist[dest], dest))
        return self.dist

n, m, s = map(int, input().split())
edge = [[] for _ in range(n * MAX_SILVER)]
for _ in range(m):
    u, v, a, b = map(int, input().split())
    u -= 1; v -= 1
    for i in range(a, MAX_SILVER):
        edge[u*MAX_SILVER + i].append((v*MAX_SILVER + i-a, b))
        edge[v*MAX_SILVER + i].append((u*MAX_SILVER + i-a, b))

for v in range(n):
    c, d = map(int, input().split())
    for i in range(MAX_SILVER - 100):
        edge[v*MAX_SILVER + i].append((v*MAX_SILVER + i + c, d))

DIJK = Dijkstra(edge)
dist = DIJK.calc(s)

for v in range(1, n): 
    ret = INF
    for val in range(MAX_SILVER):
        if dist[v*MAX_SILVER + val] < ret:
            ret = dist[v*MAX_SILVER + val]
    print(ret)

### FIXED CODE ###

#!/usr/bin/env python3
import sys
input = sys.stdin.readline
import heapq
INF = 10**18

MAX_SILVER = 3000 

class Dijkstra:
    def __init__(self, adj):
        self.adj = adj
        self.dist = [INF] * len(adj)
        self.q = []

    def calc(self, start):
        self.dist[start] = 0
        heapq.heappush(self.q, (0, start))
        while len(self.q) != 0:
            prov_cost, src = heapq.heappop(self.q)
            if self.dist[src] < prov_cost:
                continue
            for dest, cost in self.adj[src]:
                if self.dist[dest] > self.dist[src] + cost:
                    self.dist[dest] = self.dist[src] + cost
                    heapq.heappush(self.q, (self.dist[dest], dest))
        return self.dist

n, m, s = map(int, input().split())
edge = [[] for _ in range(n * MAX_SILVER)]
for _ in range(m):
    u, v, a, b = map(int, input().split())
    u -= 1; v -= 1
    for i in range(a, MAX_SILVER):
        edge[u*MAX_SILVER + i].append((v*MAX_SILVER + i-a, b))
        edge[v*MAX_SILVER + i].append((u*MAX_SILVER + i-a, b))

for v in range(n):
    c, d = map(int, input().split())
    for i in range(MAX_SILVER - 100):
        edge[v*MAX_SILVER + i].append((v*MAX_SILVER + i + c, d))

DIJK = Dijkstra(edge)
if s > 2500:
    s = 2500
dist = DIJK.calc(s)

for v in range(1, n): 
    ret = INF
    for val in range(MAX_SILVER):
        if dist[v*MAX_SILVER + val] < ret:
            ret = dist[v*MAX_SILVER + val]
    print(ret)
import sys
sys.setrecursionlimit(100000000)


def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)


mod = 1e9 + 7
n = int(input())
a = [int(i) for i in input().split()]
kek = 1
for i in range(n):
    kek = (kek * a[i]) / gcd(kek, a[i])
s = 0
for i in range(n):
    s += kek / a[i]
print(int(s % mod))

### FIXED CODE ###

import sys
sys.setrecursionlimit(10000000)


def gcd(aa, b):
    if b == 0:
        return aa
    return gcd(b, aa % b)


mod = int(1e9 + 7)
n = int(input())
a = [int(i) for i in input().split()]
kek = 1
for i in range(n):
    kek = (kek * a[i]) // gcd(kek, a[i])
s = 0
for i in range(n):
    s += kek // a[i]
print(int(s % mod))
n, k = map(int, input().split())
l = [False] * n
ans = [0, 0]
for i in range(k):
  p, r = map(input().split())
  if l[int(p) - 1] == False:
    if r == "WA":
      c[0] += 1
    elif r == "AC":
      l[int(p) - 1] = True
      c[1] += 1
print(c[1], c[0])

### FIXED CODE ###

n, m = map(int, input().split())
l = [False] * n
c = [0] * n
ans = [0, 0]
for i in range(m):
  p, r = map(str, input().split())
  if l[int(p) - 1] == False:
    if r == "WA":
      c[int(p) - 1] += 1
    elif r == "AC":
      l[int(p) - 1] = True
      ans[0] += c[int(p) - 1]
      ans[1] += 1
print(ans[1], ans[0])
n,k-map(int,input().split())
ans=k
for i in range(n):
	ans*=k-1

### FIXED CODE ###

n,k=map(int,input().split())
ans=k
for i in range(n-1):
	ans*=k-1
print(ans)
num_prob = int(input())
prob = input()
new = prob.split()
sum = 0
num_drinks = int(input())
for j in new:
  sum += int(j)

for i in range(num_drinks):
  line = input()
  new_line = line.split()
  if new_line[1] != new[new_line[0]]:
    sum -= new[new_line[0]]
    sum += new_line[1]
  print(sum)
    


### FIXED CODE ###

num_prob = int(input())
prob = input()
new = prob.split()
sum = 0

for j in new:
  sum += int(j)

  
num_drinks = int(input())
for i in range(num_drinks):
  line = input()
  new_line = line.split()
  if int(new_line[1]) != int(new[int(new_line[0])-1]):
    temp = sum - int(new[int(new_line[0])-1]) + int(new_line[1])
    print(temp)
  else:
    print(sum)
sankaku = 0
tyokkaku = 0
eikaku = 0
donkaku = 0
inputed_line = input()
data_str = inputed_line.split(' ')
data = [int(i) for i in data_str]
while True:
    if data[-1] < data[0] + data[1]:
            sankaku += 1
        if data[-1] ** 2 == data[0] ** 2 + data[1] ** 2:
            tyokkaku += 1
        elif data[-1] ** 2 < data[0] ** 2 + data[1] ** 2:
            eikaku += 1
        elif data[-1] ** 2 > data[0] ** 2 + data[1] ** 2:
            donkaku += 1
    else:
        break

answer_list = [sankaku, tyokkaku, eikaku, donkaku]
answer_str = ' '.join(answer_list)
print(answer_str)



### FIXED CODE ###

sankaku = 0
tyokkaku = 0
eikaku = 0
donkaku = 0
while True:
    inputed_line = input()
    data_str = inputed_line.split(' ')
    data = [int(i) for i in data_str]
    data.sort()
    if data[-1] < data[0] + data[1]:
        sankaku += 1
        if data[-1] ** 2 == data[0] ** 2 + data[1] ** 2:
            tyokkaku += 1
        elif data[-1] ** 2 < data[0] ** 2 + data[1] ** 2:
            eikaku += 1
        elif data[-1] ** 2 > data[0] ** 2 + data[1] ** 2:
            donkaku += 1
    else:
        break

answer_list = [sankaku, tyokkaku, eikaku, donkaku]
answer_list_str = [str(i) for i in answer_list]
answer_str = ' '.join(answer_list_str)
print(answer_str)
n,m,k=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
i=j=0
limit=k

while i<n and limit>=a[i]:
   
    limit-=a[i]
    i+=1
    
limit2=k
while j<m and limit2>=b[j]:
  
   
    limit2-=b[j]
    j+=1

if(i>j)or(i==j and limit>=limit2):
    j=0
    while j<m and limit>=b[j]:
        j+=1
        limit-=b[j]
else:
    i=0
    while i<n and limit2>=a[i]:
        i+=1
        limit2-=a[i]
print(i+j)

### FIXED CODE ###

n,m,k=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
a.insert(0,0)
b.insert(0,0)
j=1
while j<=m and b[j]+b[j-1]<=k:
  b[j]+=b[j-1]
  j+=1
  

j-=1
books=j
#print(books,b)

i=1
while i<n+1:
  a[i]+=a[i-1]
  while j>=0 and a[i]+b[j]>k:
    j-=1
  if(j!=-1) and a[i]+b[j]<=k:
    books=max(books,j+i)
    
    
    i+=1
    #print(books,b[:j+1],a[:i])
  else:
    break
print(books)
import bisect
A,B,Q = map(int,input().split())
S = [int(input()) for _ in range(A)]
T = [int(input()) for _ in range(B)]
for _ in range(Q):
    x = int(input())
    indS = bisect.bisect_right(S,x)
    indT = bisect.bisect_right(T,x)
    if indS==0 and indT==0:
        print(max(S[0],T[0])-x)
    elif indS==0 and indT>0:
        if indT<len(T) and T[indT]<S[indS]:
            print(S[0]-x)
        elif indT<len(T) and T[indT]>S[indS]:
            r1 = T[indT]-x
            r2 = 2*(x-T[indT-1])+S[indS]-x
            print(min(r1,r2))
        elif indT==len(T):
            r1 = 2*(x-T[indT-1])+S[indS]-x
            r2 = x-T[indT-1]+2*(S[indS]-x)
            print(min(r1,r2))
    elif indT==0 and indS>0:
        if indS<len(S) and S[indS]<T[indT]:
            print(T[0]-x)
        elif indS<len(S) and S[indS]>T[indT]:
            r1 = S[indS]-x
            r2 = 2*(x-S[indS-1])+T[indT]-x
            print(min(r1,r2))
        elif indS==len(S):
            r1 = 2*(x-S[indS-1])+T[indT]-x
            r2 = x-S[indS-1]+2*(T[indT]-x)
            print(min(r1,r2))
    elif indS==len(S) and indT==len(T):
        print(x-min(S[-1],T[-1]))
    elif indS==len(S) and indT<len(T):
        if indT==0:
            r1 = 2*(x-S[-1])+T[0]-x
            r2 = x-S[-1]+2*(T[0]-x)
            print(min(r1,r2))
        elif indT>0:
            if T[indT-1]>S[-1]:
                print(x-S[-1])
            elif T[indT-1]<S[-1]:
                r1 = 2*(T[indT]-x)+x-S[-1]
                r2 = x-T[indT-1]
                print(min(r1,r2))
    elif indS<len(S) and indT==len(T):
        if indS==0:
            r1 = 2*(x-T[-1])+S[0]-x
            r2 = x-T[-1]+2*(S[0]-x)
            print(min(r1,r2))
        elif indT>0:
            if S[indS-1]>T[-1]:
                print(x-T[-1])
            elif S[indS-1]<T[-1]:
                r1 = 2*(S[indS]-x)+x-T[-1]
                r2 = x-S[indt-1]
                print(min(r1,r2))
    else:
        r1 = max(S[indS],T[indT])-x
        r2 = x-min(S[indS-1],T[indT-1])
        print(min(r1,r2))

### FIXED CODE ###

from bisect import bisect_right
A,B,Q = map(int,input().split())
S = [int(input()) for _ in range(A)]
S.append(10**11)
S.insert(0,-10**11)
T = [int(input()) for _ in range(B)]
T.append(10**11)
T.insert(0,-10**11)
Ds = {i:0 for i in range(1,A+1)}
Ds[A+1] = 10**11
Ds[0] = 10**11
for i in range(1,A+1):
    ind = bisect_right(T,S[i])
    Ds[i] = min(T[ind]-S[i],S[i]-T[ind-1])
Dt = {j:0 for j in range(1,B+1)}
Dt[B+1] = 10**11
Dt[0] = 10**11
for j in range(1,B+1):
    ind = bisect_right(S,T[j])
    Dt[j] = min(S[ind]-T[j],T[j]-S[ind-1])
for _ in range(Q):
    x = int(input())
    inds = bisect_right(S,x)
    cnts = min(S[inds]-x+Ds[inds],x-S[inds-1]+Ds[inds-1])
    indt = bisect_right(T,x)
    cntt = min(T[indt]-x+Dt[indt],x-T[indt-1]+Dt[indt-1])
    print(min(cnts,cntt))
N = int(input())
A = list(map(int,input().split()))

x = 1


for i in A:
  x = x*i  
y = 10**18
if (x>y) :
    print(-1)
else:
    print(x)

### FIXED CODE ###

A,B= map(int,input().split())

print(A*B)
from sys import stdin
import math
a, b = map(int,stdin.readline().split())
gcd = math.gcd(a,b)
print((a*b)//math.gcd(a,b))

### FIXED CODE ###

a, b = map(int,input().split())
for i in range(1,b+1):
  if (a*i) % b == 0:
    print(a*i)
    break
N = int(input())
list1 = list(map(int, input().split())).sort()
pre_num = None
s = 'YES'
for num in list1:
  if num == pre_num:
    s = 'NO'
    break
  pre_num = num
print(s)

### FIXED CODE ###

N = int(input())
list1 = sorted(list(map(int, input().split())))
pre_num = None
s = 'YES'
for num in list1:
  if num == pre_num:
    s = 'NO'
    break
  pre_num = num
print(s)
n = input()
inf = 1000000000
M = [[inf for i in range(n)] for j in range(n)]
for i in range(n):
  str = raw_input().split()
  u = int(str[0])
  k = int(str[1])
  for j in range(k-1):
    v = int(str[2+j])
    c = int(str[3+j])
    M[u][v] = c
d = [inf for i in range(n)]
color = [0 for i in range(n)]

d[0] = 0
color[0] = 1

while 1:
  minv = inf
  u = -1
  for i in range(n):
    if minv>d[i] and color[i]!=2:
      u = i
      minv = d[i]
    print minv
  if u == -1:
    break
  color[u] = 2
  for v in range(n):
    if color[v]!=2 and M[u][v]!=inf:
      if d[v]>d[u]+M[u][v]:
        d[v] = d[u] + M[u][v]
        color[v] = 1
for i in range(n):
  if d[i]==inf:
    print '%d -1' % i
  else:
    print '%d %d' % (i, d[i])

### FIXED CODE ###

n = input()
inf = 1000000000
M = [[inf for i in range(n)] for i in range(n)]
for i in range(n):
  str = map(int, raw_input().split())
  u = str[0]
  k = str[1]
  for j in range(k):
    v = str[2+2*j]
    c = str[3+2*j]
    M[u][v] = c
d = [inf for i in range(n)]
color = [0 for i in range(n)]
 
d[0] = 0
color[0] = 1
 
while 1:
  minv = inf
  u = -1
  for i in range(n):
    if minv>d[i] and color[i]!=2:
      u = i
      minv = d[i]
  if u == -1:
    break
  color[u] = 2
  for v in range(n):
    if color[v]!=2 and M[u][v]!=inf:
      if d[v]>d[u]+M[u][v]:
        d[v] = d[u] + M[u][v]
        color[v] = 1
for i in range(n):
  if d[i]==inf:
    print '%d -1' % i
  else:
    print '%d %d' % (i, d[i])
X=int(input())
Y=[]
for i in range(1,X):
    for j in range(2,X):
        if pow(i,j)>X:
            break;
        Y.append(pow(i,j))

print(max(Y))


### FIXED CODE ###

x = int(input())
 
m = 1
 
for i in range(1, 32):
    for j in range(2, 10):
        p = pow(i, j)
        if p > x:
            break
        if p > m:
            m = p
 
print(m)
s = input(); a = []; b = [0]*27; t = ""
for i in range(len(s)): a.append(ord(s[i])); b[a[i]-97] = 1
if s == "zyxwvutsrqponmlkjihgfedcba": print(-1)
else:
    for i in range(27):
        if b[i] == 0: c = i; break
    if c != 26:
        a.append(c+97)
        for i in range(len(a)): t += chr(a[i])
        print(t)
    else:
        d = []
        for _ in range(25):
            if a[-2] > a[-1]: d.append(a.pop())
            else:
                d.append(a.pop()); a.pop(); d.sort()
                for i in range(len(d)):
                    if a[-1] < d[i]: a.append(d[i]); break
                break
        for i in range(len(a)): t += chr(a[i])
        print(t)

### FIXED CODE ###

s = input(); a = []; b = [0]*27; t = ""
for i in range(len(s)): a.append(ord(s[i])); b[a[i]-97] = 1
if s == "zyxwvutsrqponmlkjihgfedcba": print(-1)
else:
    for i in range(27):
        if b[i] == 0: c = i; break
    if c != 26:
        a.append(c+97)
        for i in range(len(a)): t += chr(a[i])
        print(t)
    else:
        d = []
        for _ in range(24):
            if a[-2] > a[-1]: d.append(a.pop())
            else:
                d.append(a.pop()); d.sort()
                break
        else: d.append(a.pop()); d.sort()
        for i in range(len(d)):
            if a[-1] < d[i]: a.pop(); a.append(d[i]); break
        for i in range(len(a)): t += chr(a[i])
        print(t)
N=int(input())
d=[int(i) for i in input().split()]

d.sort()
ans=d[N/2+1]-d[N/2]
print(ans)


### FIXED CODE ###

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

d.sort()
ans=d[N//2]-d[N//2-1]
print(ans)
A,B = map(int, input().split())
print(6-A-B)

### FIXED CODE ###

A = int(input())
B = int(input())
print(6-A-B)
import sys
import numpy as np
sys.setrecursionlimit(10 ** 6)
input = sys.stdin.readline
X, Y, A, B, C = [int(x) for x in input().strip().split()]
p = np.array(sorted([int(x) for x in input().strip().split()], reverse=True))[:X]
q = np.array(sorted([int(x) for x in input().strip().split()], reverse=True))[:Y]
r = np.array(sorted([int(x) for x in input().strip().split()], reverse=True))[:min(C, X+Y)]

pq = np.hstack((p, q))
ri = 0
for i, t in enumerate(pq):
    if t < r[ri]:
        pq[i] = r[ri]
        ri += 1
print(sum(pq))

### FIXED CODE ###

import sys
import numpy as np
sys.setrecursionlimit(10 ** 6)
input = sys.stdin.readline
X, Y, A, B, C = [int(x) for x in input().strip().split()]
p = np.array(sorted([int(x) for x in input().strip().split()], reverse=True))[:X]
q = np.array(sorted([int(x) for x in input().strip().split()], reverse=True))[:Y]
r = np.array(sorted([int(x) for x in input().strip().split()], reverse=True))[:min(C, X+Y)]

pq = np.hstack((p, q))
pq.sort()
ri = 0
for i, t in enumerate(pq):
    if t < r[ri]:
        pq[i] = r[ri]
        ri += 1
    if ri == len(r):
        break
print(sum(pq))
import math
import sys
n = int(input())
s = int(input())

def f(b, n):
    if n == 0:
        return 0
    return f(b, n//b) + n % b

if s == 1:
    print(n)
    sys.exit(0)

sn = math.ceil(math.sqrt(n))
for i in range(2, sn):
    if f(i, n) == s:
        print(i)
        sys.exit(0)

for i in range(1, sn):
    if (n - s) % i == 0:
        b = (n-s)//i + 1
        if 1 + n % b == s:
            print(b)
            sys.exit(0)
print(-1)


### FIXED CODE ###

import math
import sys

n = int(input())
s = int(input())

def f(b, n):
    if n == 0:
        return 0
    return f(b, n//b) + n % b

if s > n:
    print(-1)
    sys.exit(0)

sn = math.ceil(math.sqrt(n))
for i in range(2, sn+1):
    if f(i, n) == s:
        print(i)
        sys.exit(0)

ans = n + 1
for i in range(1, sn+1):
    if (n - s) % i == 0:
        b = (n-s)//i + 1
        if b >= 2 and f(b, b * i + n%b) == s:
            ans = min((ans, b))
if s == n:
    print(n+1)
elif ans < n + 1:
    print(ans)
else:
    print(-1)
S = str(input())

S.replace("hi", "")
if S = "":
  print("Yes")
else:
  print("No")

### FIXED CODE ###

S = str(input())
 
S1 = S.replace("hi", "")
if S1 == "":
  print("Yes")
else:
  print("No")
def solve(i,sum):
    if i==n-1:
        ans[sum] = 1
        if sum+A[i] <= 2000:
            ans[sum+A[i]] = 1
    solve(i+1,sum)
    if sum+A[i] <= 2000:
        solve(i+1,sum+A[i])

n=int(input())
A=[]*n
A=list(input().split())
for i in range(n):
    A[i]=int(A[i])
ans=[0]*2001    
solve(0,0)   

m=int(input())
B=list(input().split())
for i in range(m):
    B[i]=int(B[i])
for i in range(m):
    if ans[B[i]]==1:
        print("yes")
    else:
        print("no")



### FIXED CODE ###

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

T = [[0]*2001 for i in range(n)]

T[0][0] = 1
T[0][A[0]] = 1
for i in range(1,n):
    for j in range(2001):
        T[i][j] = T[i-1][j]
        if (j - A[i] >=0) and (T[i-1][j-A[i]] == 1):
            T[i][j] = 1
    
for i in range(m):
    if T[n-1][B[i]] == 1: print("yes")
    else: print("no")
n = int(input())

ab = []
ans = []
for i in range(1, int(n**(0.5))):
	ab.clear()
	if n%i == 0:
		ab.append(i)
		ab.append(int(n/i))
		ans.append(len(str(max(ab))))
			

print(min(ans))


### FIXED CODE ###

n = int(input())

ab = []
ans = []
for i in range(1, int(n**(0.5))+1):
	ab.clear()
	if n%i == 0:
		ab.append(i)
		ab.append(int(n/i))
		ans.append(len(str(max(ab))))
			
if len(ans) == 0:
	ans.append(1)

print(min(ans))
a = input()
a = a.replace(c[0], "")
a = a.replace(c[0], "")
if len(a) == 0:
    print("Yes")
else:
    print("No")
    

### FIXED CODE ###

a = input()
a = a.replace(a[0], "")
if len(a) == 0:
    print("No")
    exit()
a = a.replace(a[0], "")
if len(a) == 0:
    print("Yes")
else:
    print("No")
N=int(input())
res=0
for in range(1:10):
  if N.count(i)>=3:
    res+=1
    print("Yes")
if res==0:
  print("No")
  

### FIXED CODE ###

N = input()

if N[0] == N[1] == N[2] or N[1] == N[2] == N[3]:
    print("Yes")
else:
    print("No")
import math

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

def gcd(a, b):
    if a % b == 0 or b % a == 0:
        return min(a, b)
    else:
        if a // b >= b // a:
            c = abs(a - b * (a // b))
        else:
            c = abs(b - a * (b // a))
        d = min(a, b)
        return gcd(c, d)

gcd_ = gcd(a, b)
d = []
for i in range(2, max(4, int(math.sqrt(gcd_))+1)):
    if not gcd_ % i:
        d.extend([i, gcd_ // i])

d.sort()
if d[0] == 1:
    del d[0]
ans = [1]

for i in d:
    for j in ans:
        if gcd(i, j) == 1 and j == ans[-1]:
            ans.append(i)
        elif gcd(i, j) != 1:
            break

print(len(ans))

### FIXED CODE ###

import math

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

def gcd(a, b):
    if a % b == 0 or b % a == 0:
        return min(a, b)
    else:
        if a // b >= b // a:
            c = abs(a - b * (a // b))
        else:
            c = abs(b - a * (b // a))
        d = min(a, b)
        return gcd(c, d)

gcd_ = gcd(a, b)
d = []
for i in range(1, max(4, int(math.sqrt(gcd_))+1)):
    if not gcd_ % i:
        d.extend([i, gcd_ // i])

d.sort()
while d != [] and d[0] == 1:
    del d[0]
ans = [1]

for i in d:
    for j in ans:
        if gcd(i, j) == 1 and j == ans[-1]:
            ans.append(i)
        elif gcd(i, j) != 1:
            break

print(len(ans))
params = input().split(' ')
n = eval(params[1])

penaltyCount = [0] * eval(params[0])

penalties = 0
points = 0

for i in range(n):
    submission = input().split(' ')
    p = eval(submission[0])
    status = submission[1]
    
    if penaltyCount[p] == -1:
        continue

    if status == 'AC':
        penaltyCount += penaltyCount[p]
        penaltyCount[p] = -1
        points += 1
    else:
        penaltyCount[p] += 1


print(points, penalties)


### FIXED CODE ###

params = input().split(' ')
m = eval(params[0])
n = eval(params[1])

penaltyCount = []

for i in range(m):
    penaltyCount.append(0)

penalties = 0
points = 0

for i in range(n):
    submission = input().split(' ')
    p = eval(submission[0])-1
    status = submission[1]
    
    if penaltyCount[p] == -1:
        continue

    if status == 'AC':
        penalties += penaltyCount[p]
        penaltyCount[p] = -1
        points += 1
    else:
        penaltyCount[p] += 1


print(points, penalties)
input()
print(2 * sum(min(x, int(input())-x) for x in list(map(int, input().split()))))

### FIXED CODE ###

_,k=input(),int(input())
print(2*sum(min(x,k-x) for x in map(int,input().split())))
ABC, ARC = map(input().split())

if (s=ABC):
    print('ARC')
else:
    print('ABC')

### FIXED CODE ###

S = input()
if(S=='ABC'):
    print('ARC')
else:
    print('ABC')
from operator import itemgetter
N, M = map(int, input().split())
iPY = [0]*M
res = [0]*M
for i in range(M):
    iPY[i] = (i, *map(int, input().split()))
iPY.sort(key=itemgetter(2))
iPY.sort(key=itemgetter(1))
j = 1
p = iPY[0][1]
for i, P, Y in iPY:
    if P != p:
        j = 1
        p = P
    res[i] = "{:06}{:06}".format(P, j)
    j += 1
for s in res:
    print(s)

### FIXED CODE ###

from operator import itemgetter
N, M = map(int, input().split())
iPY = [0]*M
res = [0]*M
for i in range(M):
    P, Y = map(int, input().split())
    iPY[i] = (i, P, Y)
iPY.sort(key=itemgetter(2))
iPY.sort(key=itemgetter(1))
j = 1
p = iPY[0][1]
for i, P, Y in iPY:
    if P != p:
        j = 1
        p = P
    res[i] = "{:06}{:06}".format(P, j)
    j += 1
for s in res:
    print(s)