Harryxun/stf_run huggingface dataset:
n=int(input())

x=[[int(i) for i in input().split()] for i in range(n)]
#print(x)
for i in range(n):
  if x[i][2]> 0:
    y=x

def hight(a,b,x,y,z):
  h=z+abs(x-a)+abs(y-b)
  return h

ans=0

for k in range(101):
  for l in range(101):
    flag=0
    for i in range(1,n):
      if hight(k,l,y[0][0],y[0][1],y[0][2])==hight(k,l,y[i][0],y[i][1],y[i][2]):
        flag+=1 
    if flag==n-1:
      ans1=k
      ans2=l
      ans3=hight(k,l,y[0][0],y[0][1],y[0][2])

print(ans1,ans2,ans3)

### FIXED CODE ###

n=int(input())

x=[[int(i) for i in input().split()] for i in range(n)]
#print(x)
cnt=0
for m in range(n):
  if x[m][2]>0:
    cnt+=1
    ii=m
    
#print(ii,cnt)

def hight(a,b,x,y,z):
  h=z+abs(x-a)+abs(y-b)
  return h

for i in range(101):
  for j in range(101):
    flag=0
    for k in range(n):
      if x[k][2]>0:
        if hight(i,j,x[ii][0],x[ii][1],x[ii][2])==hight(i,j,x[k][0],x[k][1],x[k][2]):
          flag+=1
      else:
        if hight(i,j,x[ii][0],x[ii][1],x[ii][2]) > hight(i,j,x[k][0],x[k][1],x[k][2]):
          flag=0
     
    if flag==cnt:
      ans1=i
      ans2=j
      ans3=hight(i,j,x[ii][0],x[ii][1],x[ii][2])
      
print(ans1,ans2,ans3)
#print(flag)
from math import gcd
from collections import defaultdict

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

MOD = 1000000007

box = defaultdict(int)
zeros = 0
for a, b in AB:
  if a == b == 0:
    zeros += 1
  else:
    if a != 0 and b == 0:
      box[(-1, 1, 0)] += 1
    elif a == 0 and b != 0:
      box[(1, 0, 1)] += 1
    else:
      g = gcd(a, b)
      a //= g
      b //= g
      if a // b < 0:
        s = -1
      else:
        s = 1
    box[(s, abs(a), abs(b))] += 1
   
nakawaru = dict()
others = 0

for (s, i, j), v in box.items():
    if (-s, j, i) in box.keys():
        if (s, i, j) not in nakawaru.keys() and (-s, j, i) not in nakawaru.keys():    
            nakawaru[(s, i, j)] = (box[(s, i, j)], box[(-s, j, i)])
    else:
        others += v

seed = 1
for i, j in nakawaru.values():
    seed *= (pow(2, i, MOD) + pow(2, j, MOD) - 1)
    seed %= MOD

ans = zeros + pow(2, others, MOD) * seed - 1
ans %= MOD

print(ans)


### FIXED CODE ###

from math import gcd
from collections import defaultdict

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

MOD = 1000000007

box = defaultdict(int)
zeros = 0
for a, b in AB:
  if a == b == 0:
    zeros += 1
  else:
    if a != 0 and b == 0:
      box[(-1, 1, 0)] += 1
    elif a == 0 and b != 0:
      box[(1, 0, 1)] += 1
    else:
      g = gcd(a, b)
      ga = a // g
      gb = b // g
      if (a // b) < 0:
        s = -1
      else:
        s = 1
      box[(s, abs(ga), abs(gb))] += 1
   
nakawaru = dict()
others = 0

for (s, i, j), v in box.items():
    if (-s, j, i) in box.keys():
        if (s, i, j) not in nakawaru.keys() and (-s, j, i) not in nakawaru.keys():    
            nakawaru[(s, i, j)] = (box[(s, i, j)], box[(-s, j, i)])
    else:
        others += v

seed = 1
for i, j in nakawaru.values():
    seed *= (pow(2, i, MOD) + pow(2, j, MOD) - 1)
    seed %= MOD

ans = zeros + pow(2, others, MOD) * seed - 1
ans %= MOD

print(ans)
import sys
input = sys.stdin.readline
n,m = map(int, input().split())

print(a)
dp = [0] * (n+1)

#`dp[i] = i段目にいる通り数`
dp[0] = 1
dp[1] = 1
for i in range(2,n+1):
    if i in a:
        dp[i] = 0
    else: 
        dp[i] += (dp[i-1] + dp[i-2]) % (10 ** 9 + 7)

print(dp[-1])


### FIXED CODE ###

import sys
input = sys.stdin.readline
n,m = map(int, input().split())
a = set(map(int, [input() for _ in range(m)]))
dp = [0] * (n+1)

#`dp[i] = i段目にいる通り数`
if not 0 in a:
    dp[0] = 1
if not 1 in a:
    dp[1] = 1
    
for i in range(2,n+1):
    if i in a:
        dp[i] = 0
    else: 
        dp[i] += (dp[i-1] + dp[i-2]) % (10 ** 9 + 7)

print(dp[-1])
a=int.(input())
print(a+a**2+a**3)

### FIXED CODE ###

a=int(input())
print(a+a**2+a**3)
l=[]
N,W=list(map(int,input().split()))
for i in range(N):
	item=list(map(int,input().split))
	l.append([item[1],item[0]])

# n=4
# l=[[2,3],[1,2],[3,4],[2,2]] #w,v
# W=5

print(l)
def solve(i,w):
	if i==n or w<0:
		return(0)
	elif w-l[i][0]<0:
		return(0)
	else:
		return(max(solve(i+1,w),l[i][1]+solve(i+1,w-l[i][0])))

print(solve(0,W))

### FIXED CODE ###

value=[0]
weight=[0]
n,W=input().split()
n=int(n)
W=int(W)
for i in range(n):
	item=list(map(int,input().split()))
	value.append(item[0])
	weight.append(item[1])

dp=[[0 for j in range(W+1)] for i in range(n+1)]
for i in range(n+1):
	for j in range(W+1):
		if i==0:
			res=0
		elif j-weight[i]<0:
			res=dp[i-1][j]
		else:
			res=max(dp[i-1][j-weight[i]]+value[i],dp[i-1][j])
		dp[i][j]=res
print(dp[n][W])
x,y = map(int,input().split())
print int(x + y/2)

### FIXED CODE ###

x,y = map(int,input().split())
print (int(x + y/2))
abc=map(int,input().split())
if abc.count(5)==5 and abc.count(7)==1:
	print("YES")
else:
  	print("NO")

### FIXED CODE ###

a,b,c=map(int,input().split())
if((a*b*c)%7==0)and((a*b*c)/7==25):
	print("YES")
else:
  	print("NO")
A=['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O',
   'P','Q','R','S','T','U','V','W','X','Y','Z']
N=int(input())
X=input()
for i in range(0,len(X)-1):
  n=(A.index(i)+N)%26
  X[i]=A[n]
print(X)

### FIXED CODE ###

A=['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O',
   'P','Q','R','S','T','U','V','W','X','Y','Z']
N=int(input())
x=input()
X=[j for j in x]
for i in range(0,len(X)):
  n=(A.index(X[i])+N)%26
  X[i]=A[n]
Y=''
for i in X:
  Y+=i
print(Y)
n = int(input())
s = str(input())

if s%2 != 0:
  print('No')
elif s == s[:n/2]*2:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

N = int(input())
S = str(input())

if S[:int(N/2)] == S[int(N/2):]:
    print("Yes")
else:
    print("No")
h, w = map(int, input().split(" "))
dp = [[0 for i in range(w)] for j in range(h)]
for i in range(h):
    s = input()
    for j in range(w):
        if i==0 and j==0:
            dp[0][0]= 1 if (s[j]=='.') else 0
        elif i==0:
            dp[0][j]= dp[0][j-1] if (s[j]=='.') else 0
        elif j==0:
            dp[i][0]= dp[i-1][0] if (s[0]=='.') else 0
        else:
            dp[i][j]= dp[i-1][j]+dp[i][j-1] if s[j]=='.' else 0
mod=1e9+7
print(int(dp[h-1][w-1]%mod))


### FIXED CODE ###

h, w = map(int, input().split(" "))
dp = [[0 for i in range(w)] for j in range(h)]
mod=1e9+7
for i in range(h):
    s = input()
    for j in range(w):
        if i==0 and j==0:
            dp[0][0]= 1 if (s[j]=='.') else 0
        elif i==0:
            dp[0][j]= dp[0][j-1] if (s[j]=='.') else 0
        elif j==0:
            dp[i][0]= dp[i-1][0] if (s[0]=='.') else 0
        else:
            dp[i][j]= (dp[i-1][j]%mod+dp[i][j-1]%mod)%mod if s[j]=='.' else 0
print(int(dp[h-1][w-1]%mod))
k = int(input())
a, b = map(int, input().split())
judge = 0
for i in range(b-a+1):
    if a+i % k = 0:
        judge = 1
if judge == 1:
    print("OK")
else:
    print("NG")       

### FIXED CODE ###

k = int(input())
a, b = map(int, input().split())
judge = 0
for i in range(b-a+1):
    if (a+i) % k == 0:
        judge = 1
if judge == 1:
    print("OK")
else:
    print("NG")
A=list(map(int,input().split()))
A.sorted()
if A==[5,5,7]:
  print("YES")
else:
  print("NO")
    


### FIXED CODE ###

A=list(map(int,input().split()))
A.sort()
if A==[5,5,7]:
  print("YES")
else:
  print("NO")
n,k=map(int,input().split())
h=list(map(int,input().split()))
if n<=k:
  print(0)
else:
  h.sort()
  print(sum(h[:n-k])

### FIXED CODE ###

n,k=map(int,input().split())
h=list(map(int,input().split()))
if n<=k:
  print(0)
else:
  h.sort()
  print(sum(h[:n-k]))
# coding: utf-8

line = raw_input()
for s in line:
    if s.isalpha():
        if s.isupper():
            print s.lower(),
        else:
            print s.upper(),
    else:
       print s,
else print

### FIXED CODE ###

# coding: utf-8

line = raw_input()
print ''.join([((s.lower() if s.isupper() else s.upper()) if s.isalpha() else s) for s in line])
def unchi(x,m,n):
  r=x//m+x//n-x//(m＊n)
  return r
a,b,c,d=(int(i) for i in input().split())
print(unchi(b,c,d)-unchi(a,c,d))

### FIXED CODE ###

def gcd(a, b):
	while b:
		a, b = b, a % b
	return a
def unchi(x,m,n):
  r=x//m+x//n-x//(m*n//(gcd(m,n)))
  return r
a,b,c,d=(int(i) for i in input().split())
print(b-a+1-(unchi(b,c,d)-unchi(a-1,c,d)))
W, H, x, y, r = [int(i) for i in input().split]


if x-r < 0:
    print("No")
if x-r >= 0 and x + r < W:
    print("Yes")

### FIXED CODE ###

W, H, x, y, r = [int(i) for i in input().split()]


if x + r <= W and y - r >= 0 and x - r >= 0 and y + r <= H:
    print("Yes")
else:
    print("No")
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
##################################
# University of Wisconsin-Madison
# Author: Yaqi Zhang
##################################

# standard library
import sys
from functools import lru_cache

def main():
    N = int(input())
    INF = 10**18
    nums = list(map(int, input().split()))
    @lru_cache(None)
    def dp(idx, n):
        if idx >= N:
            return -INF
        if N - idx + 2 < 2 * n:
            return -INF
        if n == 0:
            return 0
        elif n == 1:
            return max(nums[idx:])
        return max(nums[idx] + dp(idx + 2, n - 1), dp(idx + 1, n))
    print(dp(0, N // 2))



if __name__ == "__main__":
    main()


### FIXED CODE ###

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
##################################
# University of Wisconsin-Madison
# Author: Yaqi Zhang
##################################

# standard library
import sys
sys.setrecursionlimit(10**9)

from functools import lru_cache

def main():
    N = int(input())
    INF = 10**18
    nums = list(map(int, input().split()))
    @lru_cache(None)
    def dp(idx, n):
        if idx >= N:
            return -INF
        if N - idx + 2 < 2 * n:
            return -INF
        if n == 0:
            return 0
        elif n == 1:
            return max(nums[idx:])
        return max(nums[idx] + dp(idx + 2, n - 1), dp(idx + 1, n))
    print(dp(0, N // 2))


if __name__ == "__main__":
    main()
import numpy as np

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

pos = 0
saidai = 0
for i in range(N-K+1):
  temp = sum(p[i:i+K])
  if saidai < temp:
    saidai = temp
    pos = i
    
kitaichi = 0
for i in range(K):
  temp = (p[pos+i]+1)*p[pos+i]/2
  kitaichi = kitaichi + float(temp/p[pos+i])
  
print('{:.12f}'.format(kitaichi))

### FIXED CODE ###

N, K = map(int, input().split())
p = list(map(int, input().split()))
 
now = sum(p[:K])
saidai = now
for i in range(K, N):
  now -= p[i-K]
  now += p[i]
  if now > saidai:
    saidai = now
 
print('{:.12f}'.format((saidai + K)/2))
import numpy
h,w,m = map(int,input().split())
hight = [0]*h
width = [0]*w
matrix =[0]*w
for i in range(w):
    matrix[i] = [0]*h
for i in range(m):
    hi,wi = map(int,input().split())
    hight[hi-1]+=1
    width[wi-1]+=1
    matrix[wi-1][hi-1] += 1
# print(matrix)
max_vh = numpy.argmax(hight)
max_vw = numpy.argmax(width)
print(hight[max_vh]+width[max_vh]-matrix[max_vw][max_vh])


### FIXED CODE ###

import sys
h,w,m = map(int,input().split())
hight = [0]*h
width = [0]*w
S = set()

for i in range(m):
    hi,wi = map(int,input().split())
    S.add((hi-1,wi-1))
    hight[hi-1] += 1
    width[wi-1] += 1

max_vh = max(hight)
max_vw = max(width)

max_h = [i for i in range(h) if hight[i] == max_vh]
max_w = [i for i in range(w) if width[i] == max_vw]
for i in max_h:
    for j in max_w:
        if not(i,j) in S:
            print(max_vh+max_vw)
            sys.exit()

print(max_vh+max_vw-1)
n = int(raw_input())
 
d = [0 for i in range(n)]
f = [0 for i in range(n)]
G = [0 for i in range(n)]
M = [[0 for i in range(n)] for j in range(n)]
col = [0 for i in range(n)]
t = [0]
 
def DFS_visit(u):
    col[u] = 1
    t[0] += 1
    d[u] = t[0]
    for v in range(n):
        if M[u][v] == 1 and col[v] == 0:
            DFS_visit(v)
    col[u] = 2
    t[0] += 1
    f[u] = t[0]
 
def DFS():
    for u in range(n):
        if col[u] == 0:
            DFS_visit(u)
    for u in range(n):
        print'{0} {1} {2}'.format(s+1, d[s], f[s])
     
for i in range(n):
    X = map(int, raw_input().split())
    for j in range(X[1]):
        M[X[0]-1][X[2+j]-1] = 1
 
DFS()

### FIXED CODE ###

n = int(raw_input())
 
d = [0 for i in range(n)]
f = [0 for i in range(n)]
G = [0 for i in range(n)]
M = [[0 for i in range(n)] for j in range(n)]
col = [0 for i in range(n)]
t = [0]
 
def DFS_visit(u):
    col[u] = 1
    t[0] += 1
    d[u] = t[0]
    for v in range(n):
        if M[u][v] == 1 and col[v] == 0:
            DFS_visit(v)
    col[u] = 2
    t[0] += 1
    f[u] = t[0]
 
def DFS():
    for u in range(n):
        if col[u] == 0:
            DFS_visit(u)
    for u in range(n):
        print'{0} {1} {2}'.format(u+1, d[u], f[u])
     
for i in range(n):
    X = map(int, raw_input().split())
    for j in range(X[1]):
        M[X[0]-1][X[2+j]-1] = 1
 
DFS()
import sys
def f(c,h=0):
 if 2 in c and sum(c)==2:return 1
 if 5 in c:return 0  # sum(c)==2
 if 4 in c:
     k=c.index(4);c[k]-=3
     if f(c,h+1):return 1
     c[k]+=3
 if 3 in c:
     k=c.index(3);c[k]-=3
     if f(c,h+1):return 1
     c[k]+=3
 for i in range(7):
  if c[i]and c[i+1]and c[i+2]:
      c[i]-=1;c[i+1]-=1;c[i+2]-=1
      if f(c,h+1):return 1
      c[i]+=1;c[i+1]+=1;c[i+2]+=1
n='123456789'
for e in sys.stdin:
 e=list(e)
 a=[i for i in n if f([(e+[i]).count(j)for j in n])]
 print(*a if a else 0)


### FIXED CODE ###

import sys
def f(c):
 if sum(c)in c:return 1
 if 5 in c:return 0
 if 4 in c:
  k=c.index(4);c[k]-=3
  if f(c):return 1
  c[k]+=3
 if 3 in c:
  k=c.index(3);c[k]-=3
  if f(c):return 1
  c[k]+=3
 for i in range(7):
  if c[i]and c[i+1]and c[i+2]:
   c[i]-=1;c[i+1]-=1;c[i+2]-=1
   if f(c):return 1
   c[i]+=1;c[i+1]+=1;c[i+2]+=1
n='123456789'
for e in sys.stdin:
 c=[list(e).count(j)for j in n]
 a=[]
 for i in range(9):
  t=c[:];t[i]+=1
  if f(t):a+=[i+1]
 if a:print(*a)
 else:print(0)
def fun(x):
    x = int(input())
    if x=0:
        return 1
    else:
        return 0

print(fun(x))

### FIXED CODE ###

x = int(input())
if x==0:
    print(1)
else:
    print(0)
import itertools

n,m=(int(i) for i in input().split())
#print(n,m)
alist=[]
for i in range(m):
  a,b=(int(i) for i in input().split())
  alist.append(10*a+b)
  alist.append(10*b+a)

#print(alist)
ans=0
mylist=list(itertools.permutations(range(2,m+1)))
#print(mylist)
for j in range(len(mylist)):
  mylist1=[10+mylist[j][0]]
  for i in range(m-2):
    mylist1.append(10*mylist[j][i]+mylist[j][i+1])
#  print(mylist1)
  test=0
  for i in range(len(mylist1)):
    if alist.count(mylist1[i]) > 0:
      test+=1
  if len(mylist1)==test:
    ans+=1
    
print(ans)

### FIXED CODE ###

n,m=(int(i) for i in input().split())
mtrx=[[int(i) for i in input().split()] for j in range(m)]
#print(mtrx)
mtrx+=[[mtrx[i][1],mtrx[i][0]] for i in range(m)]
#print(mtrx)
mylist=[10*mtrx[i][0]+mtrx[i][1] for i in range(len(mtrx))]
#print(mylist)
# 順列を格納するリスト
perm = []
cnt=[]
# 順列の生成
def make_perm(n, m = 0):
    if n == m and perm[0]==1:
        flag=1
        for i in range(len(perm)-1):
            myval=10*perm[i]+perm[i+1]
            myval1=mylist.count(myval)
            flag=flag*myval1
        cnt.append(flag)
        
    else:
        for x in range(1, n + 1):
            if x in perm: continue
            perm.append(x)
            make_perm(n, m + 1)
            perm.pop()
            
make_perm(n)
print(sum(cnt))
import math as mt
N = int(input())
A = [int(input()) for i in range(N)]
A.sort()
#print(A)
S = 0
P2 = mt.floor(N/2 - 1)
if N % 2 == 0:
    for i in range(0,P2,1):
        S += 2 * (A[N-i-1] - A[i])
    S += A[P2+1] - A[P2]
    print(S)
elif N % 2 == 1:
    for i in range(0,P2,1):
        S += 2 * (A[N-i-1] - A[i])
    S1 = A[N-P2-1] + A[N-P2] - 2 * A[P2]
    S2 = 2 * A[N-1-P2] - A[P2] - A[P2+1]
    if S1 >= S2:
        print(S1)
    else:
        print(S2)


### FIXED CODE ###

import math as mt
N = int(input())
A = [int(input()) for i in range(N)]
A.sort()
#print(A)
S = 0
P2 = mt.floor(N/2 - 1)
if N % 2 == 0:
    for i in range(0,P2,1):
        S += 2 * (A[N-i-1] - A[i])
    S += A[P2+1] - A[P2]
    print(S)
elif N % 2 == 1:
    for i in range(0,P2,1):
        S += 2 * (A[N-i-1] - A[i])
    S1 = A[N-P2-2] + A[N-P2-1] - 2 * A[P2]
    S2 = 2 * A[N-1-P2] - A[P2] - A[P2+1]
    if S1 >= S2:
        print(S1+S)
    else:
        print(S2+S)
INF = 10000000000000
class Vertice:
  def __init__(self, num):
    self.num = num
    self.connected = []
    self.edge = []
    self.pos = INF
    
def DFS(vertice):
  judge = True
  connected_num = len(vertice.connected)
  for i in range(connected_num):
    con = vertice.connected[i]
    if con.pos == INF:
      con.pos = vertice.pos + vertice.edge[i]
      judge = DFS(con)
    elif con.pos != vertice.pos + vertice.edge[i]:
      judge = False
    if judge == False:
      break
  return judge
 
N, M = map(int, input().split())
vertices = [Vertice(i) for i in range(N)]
L, R, D = ([None for i in range(M)] for j in range(3))
for i in range(M):
  L[i], R[i], D[i] = map(int, input().split())
for i in range(M):
  if not vertices[R[i] - 1] in vertices[L[i] - 1].connected:
    vertices[L[i] - 1].connected.append(vertices[R[i] - 1])
    vertices[R[i] - 1].connected.append(vertices[L[i] - 1])
    vertices[L[i] - 1].edge.append(D[i])
    vertices[R[i] - 1].edge.append(-D[i])
judge = True
for i in range(N):
  if vertices[i].pos == INF:
    vertices[i].pos = 0
    judge = DFS(vertices[i])
    if judge == False:
      break
if judge:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

import sys
sys.setrecursionlimit(2000002)

def DFS(i, pos, connected, distances):
  if pos[i] == None:
    pos[i] = 0
  size = len(connected[i])
  for j in range(size):
    if pos[connected[i][j]] == None:
      pos[connected[i][j]] = pos[i] + distances[i][j]
      if DFS(connected[i][j], pos, connected, distances) == False:
        return False
    elif pos[connected[i][j]] != pos[i] + distances[i][j]:
      return False
  return True

N, M = map(int, input().split())
pos = [None for i in range(N + 1)]
connected = [[] for i in range(N + 1)]
distances = [[] for i in range(N + 1)]
for i in range(M):
  l, r, d = map(int, input().split())
  connected[l].append(r)
  distances[l].append(d)
  connected[r].append(l)
  distances[r].append(-d)
judge = True
for i in range(1, N + 1):
  if pos[i] == None:
    judge = DFS(i, pos, connected, distances)
    if judge == False:
      break
if judge:
  print('Yes')
else:
  print('No')
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
n=int(0)
manzoku=int(0)
hantei = int(1)
if A[0] == hantei:
        manzoku += sum(C)
        while n<N:
            manzoku += B[n]
            n += 1
    else:
        manzoku += sum(C) - C[A[0]-2]
        while n<N:
            manzoku += B[n]
            n += 1

print(manzoku)


### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
i = 1
manzoku = sum(B)
while N>i:
    if A[i]-A[i-1] == 1:
      j = A[i-1]
      manzoku += C[j-1]
    i += 1
print(manzoku)
n,m=map(int,input().split())
a=list(map(int,input().split()))
fib=[0,1]
for i in range(n):
  fib.append(fib[i]+fib[i+1])
b=[]
for j in range(m):
  b.append(fib[a[m]-1])
ans=0
for t in range(m-1):
  ans+=(b[t]*b[t+1])%(10**9+1)
print(ans%(10**9+1))

### FIXED CODE ###

n,m=map(int,input().split())
a=[int(input()) for i in range(m)]
b=set(a)
dp=[0]*(n+2)
dp[0]=0
dp[1]=1
for j in range(n):
  if j+1 not in b:
    dp[j+2]=(dp[j]+dp[j+1])%(10**9+7)
  else:
    dp[j+2]=0
print(dp[j+2]%(10**9+7))
ABInput = str(input())
 
AB = ABInput.split(" ")
 
A = AB[0]
B = AB[1]

TotalCartain = B * 2

if TotalCartain > A or TotalCartain = A:
  print (0)
else:
  print (A-TotalCartain)

### FIXED CODE ###

ABInput = str(input())
 
AB = ABInput.split(" ")
 
A = int(AB[0])
B = int(AB[1])
 
TotalCartain = B * 2
 
if TotalCartain > A or TotalCartain == A:
  print (0)
else:
  print (A-TotalCartain)
A, B, C = map(int, input())

coin_sound_cnt = B//A
if coin_sound_cnt > C:
  return C
else:
  return coin_sound_cnt

### FIXED CODE ###

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

coin_sound_cnt = B//A
if coin_sound_cnt > C:
  print(C)
else:
  print(coin_sound_cnt)
from collections import defaultdict

class Tree:
  def __init__(self):
    self.edges = defaultdict(set)
  
  def add(self, x, y, w):
    self.edges[x].add((y, w))
    self.edges[y].add((x, w))
  
  def traverse(self, start):
    return self._traverse(start, 0, set([start]), [])
  
  def _traverse(self, start, dist, already_visited, result):
    out_nodes = self.edges[start]
    for out_node, w in out_nodes:
      if out_node in already_visited:
        continue
      new_dist = dist + w
      result.append((out_node, new_dist))
      self._traverse(out_node, new_dist, already_visited | set([out_node]), result)
    return result
      
n = int(input())
tree = Tree()
for _ in range(n-1):
  xyw = list(map(int, input().split()))
  tree.add(*xyw)

print(0)
"""
node_dists = list(tree.traverse(1))
node_dists.append((1, 0))
node_dists = sorted(node_dists, key=lambda x: x[0])

for node, dist in node_dists:
  print(1 if dist % 2 == 0 else 0)
""")

### FIXED CODE ###

#!/usr/bin/env python
import bisect
from collections import defaultdict
import math

def main():
    #N = map(int, input().split())
    N = int(input())

    edges = defaultdict(list)
    for _ in range(N-1):
        u, v, w = map(int, input().split())
        edges[u-1].append((v-1, w))
        edges[v-1].append((u-1, w))

    colors = [None]*N
    colors[0] = 0
    colored = [(0, 0)]
    while colored:
        new_colored = []
        for n, d in colored:
            nodes = edges[n]
            for m, w in nodes:
                if colors[m] is None:
                    dist = d + w
                    if dist % 2 == 0:
                        colors[m] = 0
                    else:
                        colors[m] = 1
                    new_colored.append((m, dist))
        colored = new_colored

    for n in range(N):
        print(colors[n])

if __name__ == '__main__':
    main()
S = input().strip()

if S == 'AAA' or 'BBB':
  return 'No'
else:
  return 'Yes'

### FIXED CODE ###

S = input()
 
if (S == 'AAA') or (S=='BBB'):
  print('No')
else:
  print('Yes')