Harryxun/stf_run huggingface dataset:
line = input().split()
nPerson = int(line[0])
nFriend = int(line[1])
nBlock  = int(line[2])

friends = []
for i in range(nFriend):
  line = input().split()
  friends.append(( int(line[0]), int(line[1]) ))

blocks = []
for i in range(nBlock):
  line = input().split()
  blocks.append(( int(line[0]), int(line[1]) ))
  
connected = [[] for i in range(nPerson+1)]
  
for i in friends:
  connected[i[0]].append(i[1])
  connected[i[1]].append(i[0])

blocked = [[] for i in range(nPerson+1)]
for i in blocks:
  blocked[i[0]].append(i[1])
  blocked[i[1]].append(i[0])
  
for i in range(len(connected)):
  connected[i] = set(connected[i])
for i in range(len(blocked)):
  blocked[i] = set(blocked[i])
  
nCand = [0]*(nPerson+1)

def findCand(target,curPer):
  if visited[curPer] == True :
    return
  visited[curPer] = True
  if curPer not in connected[target] and curPer not in blocked[target]:
    nCand[target] += 1
  for i in connected[curPer]:
    findCand(target,i)

for i in range(1,nPerson+1):
  visited = [False]*(nPerson+1)
  visited[i] = True
  for j in connected[i]:
    findCand(i,j)

res = ""
for i in range(1,nPerson+1):
  res += str(nCand[i]) + " "
  
print(res)
  

### FIXED CODE ###

class unionFind():
  def __init__(self,n):
    self.size = 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 grpsize(self, x):
    return -self.parents[self.find(x)]
  def roots(self):
    return [i for i, x in enumerate(self.parents) if x < 0]
  def members(self, x):
    root = self.find(x)
    return [i for i in range(self.size) if self.find(i) == root]
  def __str__(self):
    return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())
      
import sys
sys.setrecursionlimit(4100000)

line = input().split()
nPerson = int(line[0])
nFriend = int(line[1])
nBlock  = int(line[2])

friends = [[] for i in range(nFriend)]
for i in range(nFriend):
  line = input().split()
  friends[i] =[int(line[0])-1, int(line[1])-1]

nconnected = [0]*nPerson
for i in friends:
    nconnected[i[0]] += 1
    nconnected[i[1]] += 1
  
  
blocks = [[] for i in range(nBlock)]
for i in range(nBlock):
  line = input().split()
  blocks[i] = [int(line[0])-1, int(line[1])-1]

uf = unionFind(nPerson)
for i in friends:
  uf.union(i[0],i[1])

nblocked = [0]*nPerson
for i in blocks:
  if uf.find(i[0]) == uf.find(i[1]):
    nblocked[i[0]] += 1
    nblocked[i[1]] += 1
  
res = ""
for i in range(nPerson):
  res += str(uf.grpsize(i)-nconnected[i] -nblocked[i]-1) + " "

print(res)
list1 = list(map(int, input().split()))
list1 = sorted(list1, reverse=True)
print(list1[0]*10 +list[1]+list[2])

### FIXED CODE ###

list1 = list(map(int, input().split()))
list1 = sorted(list1, reverse=True)
print(list1[0]*10 +list1[1]+list1[2])
import streams, sequtils, strutils, algorithm, math, future, sets, tables, hashes
proc `ceilDiv`*[T](x, y: T): T = x div y + ord(x mod y != 0)
proc `//=`*(x: var SomeInteger; y: SomeInteger) = x = x div y
proc `%=`*(x: var SomeInteger; y: SomeInteger) = x = x mod y
var
    X = stdin.readLine.split.map(parseInt)
    ans:int
for i in 0..4:
    if X[i] == 0:
        ans = i.int + 1
echo ans

### FIXED CODE ###

# coding: utf-8
X = list(map(int, input().split()))
for i in range(5):
    if X[i] == 0:
        ans = i + 1
print(ans)
import sys
input = sys.stdin.readline
N,M=map(int, input().split())
B=[tuple(map(int, input().split())) for _ in range(M)]

P=list(range(N+1))
C=[1 for _ in range(N+1)]
C[0] = 0

def root(x):
    if P[x]==x: return x
    P[x] = root(P[x])
    return P[x]

def unite(a,b):
    ra = root(a)
    rb = root(b)
    C[ra] += C[rb]
    C[rb] = 0
    P[rb] = ra

def same(a,b):
    return root(a) == root(b)

def count(x):
    return C[root(x)]

ans=[0]*(M+1)
ans[M] = N * (N-1)

for i in range(M-1,-1,-1):
    a,b = B[i]
    if same(a,b):
        ans[i] = ans[i+1]
        continue
    ans[i] = ans[i+1] - count(a) * count(b)
    unite(a,b)

for i in range(1,M+1):
    print(ans[i] - ans[0])

### FIXED CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

N,M=map(int, input().split())
B=[tuple(map(int, input().split())) for _ in range(M)]

P=list(range(N+1))
C=[1 for _ in range(N+1)]
C[0] = 0

def root(x):
    if P[x]==x: return x
    P[x] = root(P[x])
    return P[x]

def unite(a,b):
    ra = root(a)
    rb = root(b)
    C[ra] += C[rb]
    C[rb] = 0
    P[rb] = ra

def same(a,b):
    return root(a) == root(b)

def count(x):
    return C[root(x)]

ans=[0]*(M+1)
ans[M] = N * (N-1)

for i in range(M-1,-1,-1):
    a,b = B[i]
    if same(a,b):
        ans[i] = ans[i+1]
        continue
    ans[i] = ans[i+1] - count(a) * count(b)
    unite(a,b)

for i in range(1,M+1):
    print(ans[i] - ans[0])
S = input()

a = n
n = len(S)
for i in range(n-1):
    if S[i] != S[i+1]:
        a = min(a, max(i+1, n-i+1))

print(a)


### FIXED CODE ###

S = input()

n = len(S)
a = n
for i in range(n-1):
    if S[i] != S[i+1]:
        a = min(a, max(i+1, n-i-1))

print(a)
n = int(input())
w = list(map(int,input().split()))
ans = []
for i in range(1,n):
    ans.append(abs(sum(l[:i])-sum(l[i:])))
print(min(ans))

### FIXED CODE ###

n = int(input())
w = list(map(int,input().split()))
ans = []
for i in range(1,n):
    ans.append(abs(sum(w[:i])-sum(w[i:])))
print(min(ans))
import math
N = int(input())
v = int(math.sqrt(N))
return v*v

### FIXED CODE ###

import math
n = int(input())
v = int(math.sqrt(n))
print(v*v)
a, b, x = map(int, input().split())
print('YES' if a<=c and x-a<=b else 'NO')

### FIXED CODE ###

a, b, x = map(int, input().split())
print('YES' if a<=x and x-a<=b else 'NO')
N = int(input())
V = list(map(int, input().split())
C = list(map(int, input().split())

s = A
for i in range(N):
	if V[i] >= C[i]:
		s += V[i]-C[i]
	else:
		s += 0
print(s)


### FIXED CODE ###

N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))

s = 0
for i in range(N):
	if V[i] >= C[i]:
		s += V[i]-C[i]
	else:
		s += 0
print(s)
import sequtils
from strutils import split, parseInt
from math import ceil

let
  HW = map(readLine(stdin).split(), parseInt)

if HW[0] == 1 or HW[1] == 1:
  echo 1
else:
  echo int(ceil(HW[0] * HW[1] / 2))

### FIXED CODE ###

# coding: utf-8
from math import ceil
H, W = map(int, input().split())
if H == 1 or W == 1:
    print(1)
else:
    ans = 0
    ans += ceil(W / 2) * ceil(H / 2)
    ans += (W // 2) * (H // 2)
    print(ans)
n,m=map(int,input())
s=open(0).read().split()
for i in range(n):print(s.count(str(i)))

### FIXED CODE ###

N,M=list(map(int,input().split()))
a=list()
for i in [1]*M:
    for j in input().split():
        a.append(j)
for i in range(1,N+1):
    print(str(a.count(str(i))))
N,M,K=list(map(int,input().split()))

mod=998244353

comb=1
pw=(M*pow(M-1,N-1,mod))%mod
ans=pw*comb

invmodk=[0]*(K+1)
invmodk[1]=1
invmodm=pow(M-1,mod-2,mod)
for k in range(2,K+1):
    invmodk[k]=invmodk[mod%k]*(mod-mod//k)%mod

for k in range(1,K+1):
    pw=(pw*invmodm)%mod
    comb*=(N-k)*invmodk[k]
    ans=(ans+pw*comb)%mod

print(ans)

### FIXED CODE ###

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

mod=998244353

com=1
ans=0

for i in range(K+1):
    ans+=M*com*pow(M-1,N-1-i,mod)
    ans%=mod
    com*=(N-1-i)*pow(i+1,mod-2,mod)
    com%=mod

print(ans)
A,B = map(int, input().split())
if A-2*B <= 0:
    print(o)
else:
    print(A-2*B)

### FIXED CODE ###

A,B = map(int, input().split())
if A-2*B <= 0:
    print(0)
else:
    print(A-2*B)
n = int(input())
x = input()

outf = {}
res = []

dec_d = {}
def get_dec(bin):
  if bin in dec_d.items():
    return dec_d[bin]
  s = 0
  seed = 2 ** (len(bin)-1)
  for el in bin:
    if el == '1':
      s += seed
    seed = seed // 2
  dec_d[bin] = s
  return s

bin_d = {}
def get_bin(dec):
  if dec in bin_d.items():
    return bin_d[dec]
  s = ''
  while dec > 0:
    if dec % 2 == 1:
      s = s + '1'
    else:
      s = s + '0'
    dec = dec // 2
  bin_d[dec] = s
  return s

pop_d = {}
def popcount(n):
  if n in pop_d.items():
    return pop_d[n]
  out = 0
  while n > 0:
    if n % 2 == 1:
      out += 1
    n = n // 2
  pop_d[n] = out
  return out


for i in range(n):
  if x[i] == '0':
    lx = x[:i] + '1' + x[i+1:]
  else:
    lx = x[:i] + '0' + x[i+1:]
  x_dec = get_dec(lx)
  res.append(x_dec)

  # calc f
  kp = []
  f = 0
  while x_dec > 0:
    st = get_bin(x_dec)
    if st in outf.items():
      f += outf[st]
      break
    kp.append(x_dec)
    f += 1
    pc = popcount(x_dec)
    x_dec = x_dec % pc

  # keep
  lf = f
  for k in kp:
    st = get_bin(k)
    outf[st] = lf
    lf -= 1


for i in res:
  st = get_bin(i)
  print(outf[st])


### FIXED CODE ###

n = int(input())
x = input()

init_pop_cnt = x.count('1')
init_pop_cnt_less = init_pop_cnt - 1
init_pop_cnt_more = init_pop_cnt + 1

valid_l = init_pop_cnt_less != 0

# x's state after f
init_res_less = 0
init_res_more = 0
seed_more = 1
seed_less = 1
for i in range(1, n+1):
  xp = x[-1 * i]
  if xp == '1':
    if valid_l:
      init_res_less += seed_less % init_pop_cnt_less
    init_res_more += seed_more % init_pop_cnt_more
  if valid_l:
    seed_less = (seed_less * 2) % init_pop_cnt_less
  seed_more = (seed_more * 2) % init_pop_cnt_more


dif_less = [0] * (2 * 10**5 + 100)
dif_more = [0] * (2 * 10**5 + 100)
if valid_l:
  dif_less[0] = 1 % init_pop_cnt_less
dif_more[0] = 1 % init_pop_cnt_more
for i in range(1, n+1):
  if valid_l:
    dif_less[i] = (dif_less[i-1] * 2) % init_pop_cnt_less
  dif_more[i] = (dif_more[i-1] * 2) % init_pop_cnt_more


def get_pc(dec):
  out = 0
  while dec > 0:
    if dec % 2 == 1:
      out+=1
    dec = dec // 2
  return out

def f(dec):
  pc = get_pc(dec)
  return dec % pc

cnt = [0] * (2 * 10**5 + 200)

for i in range(1, 2 * 10**5 + 100):
  c = 0
  cur = i
  while cur > 0:
    c += 1
    cur = f(cur)
  cnt[i] = c

for i in range(n):
  xi = x[i]

  if xi == '1':
    if valid_l:
      lx = init_res_less
      lx -= dif_less[n-i-1]
      lx %= init_pop_cnt_less
      print((cnt[lx] % init_pop_cnt_less) + 1)
    else:
      print(0)
  else:
    lx = init_res_more
    lx += dif_more[n-i-1]
    lx %= init_pop_cnt_more
    print((cnt[lx] % init_pop_cnt_more) + 1)
A, B, C, D, E, F = map(int, input().split(' '))
maxconc = 0.0
maxwater = 100*A
maxsugar = 0

for i in range(F//(100*A)+1):
  for j in range((F-100*A*i)//(100*B)+1):
    if i == 0 and j == 0:
      continue
    S =min(E*(A*i+B*j),F-100*(A*i+B*j))
    
    sugar=0
    for c in range(S//C+1):
      d = (S-c*C)//D
      sugar = max(sugar,c*C+d*D)
    conc = sugar / (sugar +100*(A*i+B*j))
    if conc > maxconc:
      maxconc = conc 
      maxwater = 100*(A*i+B*j)
      maxsugar = sugar
print('{0} {1}'.format(maxwater+maxsugar,maxsugar))    

### FIXED CODE ###

a=int(input())
b=int(input())
print(a*a-b)
n=int(input())
string=""

if n==0:
    string="0"
while n!=0:
    if n%2==1:
        string="1"+string
        n=n-1
    else:
        string="0"+string
    n=n//(-2)
    
print(string)

### FIXED CODE ###

n,k=(int(i) for i in input().split())
if n%k==0:
    print(0)
else:
    print(1)
while True
    a,op,b = input().split()
    a = float(a)
    b = float(b)
    if op == "?":
        break
    else:
        if op == "+":
            ans = a + b
        elif op == "-":
            ans = a-b
        elif op == "*":
            ans = a * b
        else:
            rem = a%b
            if rem == 0:
                ans = a/b
            else:
                ans = int(a/b)
    print(ans)  


### FIXED CODE ###

while True:
    a,op,b = input().split()
    a = int(a)
    b = int(b)
    if op == "?":
        break
    else:
        if op == "+":
            ans = a + b
        elif op == "-":
            ans = a-b
        elif op == "*":
            ans = a * b
        elif op == "/":
            rem = a%b
            if rem == 0:
                ans = int(a/b)
            else:
                ans = int(a/b)
    print(ans)
n=int(input())
l=list(map(int,input().split()))
ans=[[]for i in range(n+1)]
for i in range(n):
    ans[l[i]].append(i+1)

    
c=1
tem=[]
ch=0
while 1:
    if len(ans[c])==0:
        break
    else:
        flag=0
        for i in ans[c]:
            if i>ch:
                tem.append(i)
                ch=i
                flag=1
                break
        if not flag:
            break
        else:
            c+=1
                
                
if len(tem)==0:
    print(-1)
else:
    print(n-len(tem))
                
            

### FIXED CODE ###

n=int(input())
l=list(map(int,input().split()))
ans=[[]for i in range(n+1)]
for i in range(n):
    ans[l[i]].append(i+1)

    
c=1
tem=[]
ch=0
while 1:
    if c>n:
        break
    else:
        
        if len(ans[c])==0:
            break
        else:
            flag=0
            for i in ans[c]:
                if i>ch:
                    tem.append(i)
                    ch=i
                    flag=1
                    break
            if not flag:
                break
            else:
                c+=1
                    
                
if len(tem)==0:
    print(-1)
else:
    print(n-len(tem))
import collections

n = int(input())
V = [int(x) for x in input().split()]
V_even = collections.Counter([V[i] for i in range(len(V)) if i % 2 == 1])
V_odd = collections.Counter([V[i] for i in range(len(V)) if i % 2 == 0])
even_most = V_even.most_common()
odd_most = V_odd.most_common()
if len(even_most) == 1 and len(odd_most) == 1 and even_most[0][0] == odd_most[0][0]:
    ans = n/2
    print(int(ans))
elif len(even_most) == 1:
    ans = n/2 - V_even[even_most[0][0]] + n/2 - V_odd[odd_most[1][0]]
    print(int(ans))
elif len(odd_most) == 1:
    ans = n/2 - V_even[even_most[1][0]] + n/2 - V_odd[odd_most[0][0]]
    print(int(ans))
elif even_most[0][0] is not odd_most[0][0]:
    ans = n/2 - V_even[even_most[0][0]] + n/2 - V_odd[odd_most[0][0]]
    print(int(ans))
else:
    ans1 = n/2 - V_even[even_most[0][0]] + n/2 - V_odd[odd_most[1][0]]
    ans2 = n/2 - V_even[even_most[1][0]] + n/2 - V_odd[odd_most[0][0]]
    print(int(min(ans1, ans2)))


### FIXED CODE ###

import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

n = INT()
v = LIST()

v_odd = [v[i] for i in range(n) if i % 2 == 1]
v_even = [v[i] for i in range(n) if i % 2 == 0]

count_odd = Counter(v_odd)
count_even = Counter(v_even)

if count_odd.most_common()[0][0] != count_even.most_common()[0][0]:
	print(int(n/2-count_odd.most_common()[0][1] + n/2 - count_even.most_common()[0][1]))
else:
	if len(count_odd) == 1 and len(count_even) == 1:
		print(int(n/2))
	else:
		if len(count_odd) == 1:
			print(int(n/2 - count_even.most_common()[1][1]))
		elif len(count_even) == 1:
			print(int(n/2 - count_odd.most_common()[1][1]))
		else:
			tmp1 = int(n/2-count_odd.most_common()[1][1] + n/2 - count_even.most_common()[0][1])
			tmp2 = int(n/2-count_odd.most_common()[0][1] + n/2 - count_even.most_common()[1][1])
			print(min(tmp1, tmp2))
import numpy as np

N = int(input())
H = [ int(s) for s in str(input()).split()]
dp = np.full(10**5 + 10, np.inf)

def rec(i):
    if dp[i] < np.inf:
        return dp[i]
    
    if i==0:
        return 0
    
    res = np.inf
    res = min(res, rec(i-1) + abs(H[i] -H[i-1]))
    if i > 1:
        res = min(res, rec(i-2) + abs(H[i] - H[i-2]))
    
    dp[i] = res
    return res

if __name__ == '__main__':
	print(int(rec(N-1)))


### FIXED CODE ###

import numpy as np

N = int(input())
H = [ int(s) for s in str(input()).split()]
dp = np.full(10**5 + 10, np.inf)

def rec(i):
    if dp[i] < np.inf:
        return dp[i]
    
    if i==0:
        return 0
    
    res = np.inf
    res = min(res, rec(i-1) + abs(H[i] -H[i-1]))
    if i > 1:
        res = min(res, rec(i-2) + abs(H[i] - H[i-2]))
    
    dp[i] = res
    return res

def main3():
    print(int(rec(N-1)))

def main2():
    dp = np.full(10**5 + 10, np.inf)
    dp[0] = 0
    
    for i in range(0, N):
        if i+1 < N:
            dp[i+1] = min(dp[i+1], dp[i] + abs(H[i] - H[i+1]))
        if i+2 < N:
            dp[i+2] = min(dp[i+2], dp[i] + abs(H[i] - H[i+2]))
    
    print(int(dp[N-1]))
    
if __name__ == '__main__':
    main2()
N , K = (int(i) for i in input().split())
A = list(int(i) for i in range(input().split(),N))

count = 1
s  = K

while s < N:
    s = s + (K - 1)
    count = count + 1
    print(s)
print(count)


### FIXED CODE ###

N , K = (int(i) for i in input().split())
A = list(int(i) for i in input().split())
 
count = 1
s  = K
 
while s < N:
    s = s + (K - 1)
    count = count + 1
    #print(s)
print(count)
n, h = input().split()
n = int(n)
h = int(h)

a = []
b = []
for i in range(n):
    a_, b_ = input().split()
    a.append(int(a_))
    b.append(int(b_))

import numpy as np
a = np.array(a)
b = np.array(b)

to_throw = b[b>max(a)]
sum_throw = sum(to_throw)

d = h - sum_throw

if d <= 0:
    cum = np.cumsum(np.sort(b)[::-1])
    print(len(to_throw) - len(cum[cum>=h])) + 1
else:
    import math
    print(len(to_throw) + math.ceil(d/max(a)))


### FIXED CODE ###

n, h = input().split()
n = int(n)
h = int(h)

a = []
b = []
for i in range(n):
    a_, b_ = input().split()
    a.append(int(a_))
    b.append(int(b_))

import numpy as np
a = np.array(a)
b = np.array(b)

to_throw = b[b>max(a)]
sum_throw = sum(to_throw)

d = h - sum_throw

if d <= 0:
    cum = np.cumsum(np.sort(to_throw)[::-1])
    print(len(to_throw) - len(cum[cum>=h]) + 1)
else:
    import math
    print(len(to_throw) + math.ceil(d/max(a)))
h,w=map(int,input().split())
a=[list(map(lambda x:int(x)%2,input().split())) for _ in range(h)]
maxnum=sum(sum(a))//2
ans=[]
bx,by,cnt=0,0,0
if a[0][0]==0:
    flg=0#0はスタートを探しモード
else:
    flg=1
for i in range(1,h*w):
    if (i//w)%2==0:
        x,y=i%w,(i//w)%2
    else:
        x,y=w-1-i%w,(i//w)%2
    if flg==1:
        a[y][x]=(a[y][x]+1)%2
        ans.append([by,bx,y,x])
        cnt+=1
    if maxnum==cnt:
        break
    flg=a[y][x]
    bx,by=x,y
print(len(ans))
for a,b,c,d in ans:
    print(a+1,b+1,c+1,d+1)

### FIXED CODE ###

h,w=map(int,input().split())
a=[list(map(int,input().split())) for _ in range(h)]
ans=[]
for i in range(h):
    for j in range(w-1):
        if a[i][j]%2==1:
            a[i][j+1]+=1
            ans.append([i+1,j+1,i+1,j+2])
for i in range(h-1):
    if a[i][w-1]%2==1:
        a[i+1][w-1]+=1
        ans.append([i+1,w,i+2,w])
print(len(ans))
for i in ans:
    print(*i)
print(*list[input().split(",")])

### FIXED CODE ###

a,b,c = input().split(",")
print(a,b,c)
a = int(input())

if a[0]==a[1]==a[2] or a[1]==a[2]==a[3] a[0]==a[1]==a[2]==a[3]:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

a = str(input())
 
if a[0]==a[1]==a[2] or a[1]==a[2]==a[3] or a[0]==a[1]==a[2]==a[3]:
  print('Yes')
else:
  print('No')
a = int(input())
if a % 2 = 0:
  print(str(a//2))
else:
  print(str((a//2)+1))

### FIXED CODE ###

a = int(input())
if a % 2 == 0:
  print(str(int(a//2)))
else:
  print(str(int(a//2)+1))
N, Y = map(int, input().split(" "))
for x in range(N + 1):
    for y in range(N - x + 1):
        for z in range(N - x - y + 1):
            if Y = 10000 * x + 5000 * y + 1000 * z:
                print("{} {} {}".format(x,y,z))
                break
print("-1 -1 -1")

### FIXED CODE ###

N, Y = map(int, input().split(" "))
found = False
for x in range(N + 1):
    if 10000 * x + 5000 * (N - x) + 1000 * (N - x) < Y:
        continue
    for y in range(N - x + 1):
        if 10000 * x + 5000 * y + 1000 * (N - x - y) == Y:
            print("{} {} {}".format(x,y,N - x - y))
            found = True
            break
        if found:
            break
    if found:
        break
else:
    print("-1 -1 -1")
n=int(input())
A=[]
for i in range(n):
  a,b,c=map(int,input().split())
  if a<b+c or (b+c)%2!=a%2:
    print("No")
    exit()
  A.append(list(a,b,c))
if n==1:
  print("Yes")
  exit()
for i in range(n-1):
  if not A[i+1][0]-A[i][0]>=A[i+1][2]+A[i+1][1]-A[i][1]-A[i][2]:
    print("No")
    exit()
print("Yes")


### FIXED CODE ###

n=int(input())
A=[]
for i in range(n):
  a,b,c=map(int,input().split())
  if a<b+c or (b+c)%2!=a%2:
    print("No")
    exit()
  A.append([a,b,c])
if n==1:
  print("Yes")
  exit()
for i in range(n-1):
  if not A[i+1][0]-A[i][0]>=A[i+1][2]+A[i+1][1]-A[i][1]-A[i][2]:
    print("No")
    exit()
print("Yes")
while True:
    s=input()
    if s.isdigit():
        strings=strings[len(strings)-int(s)-1:]+strings[:int(s)]
    else :
        strings=s
    print(strings)

### FIXED CODE ###

while True:
    s=input()
    if s=="-":
        break
    m=int(input())
    for i in range(m):
        n=input()
        s=s[int(n):]+s[:int(n)]
    print(s)
n = int(input())

yn=1
a=2
while True:
    if n==yn:
        print('Yes')
        break
    elif yn>n:
        print('No')
        exit()
    else:
        yn+=a
        a+=1

a-=1
k=n*2//a
print(k)
print(a)
s=[[a] for i in range(k)]

l = [0]*n

for i in range(a):
    s[0].append(i+1)
    l[i]+=1

for i in range(1,k):
    for k in range(i):
        for j in range(a):
            if l[s[i-k-1][j+1]-1]==1:
                s[i].append(s[i-k-1][j+1])
                l[s[i-k-1][j+1]-1]+=1
                break
    if len(s[i]) - 1 != s[i][0]:
        if i==k-1:
            s[i].append(n)
        else:
            while len(s[i]) - 1 != s[i][0]:
                s[i].append()
    while len(s[i]) - 1 != s[i][0]:
        for m in range(s[i-1][-1]-1,n):
            if l[m] == 0:
                s[i].append(m + 1)
                l[m] += 1
                if len(s[i]) - 1 == s[i][0]:
                        break
        if len(s[i]) - 1 != s[i][0]:
            for m in range(s[i-1][-1]-1,n):
                if l[m] == 1:
                    s[i].append(m + 1)
                    l[m] += 1
                    if len(s[i]) - 1 == s[i][0]:
                        break
        break

print(k)

for i in range(len(s)):
    for j in range(len(s[i])):
        if j==len(s[i])-1:
            print(s[i][j])
        else:
            print(s[i][j], end=' ')

### FIXED CODE ###

n = int(input())

yn=1
a=2
while True:
    if n==yn:
        print('Yes')
        break
    elif yn>n:
        print('No')
        exit()
    else:
        yn+=a
        a+=1

a-=1
k=n*2//a
s=[[a] for i in range(k)]

l = [0]*n

for i in range(a):
    s[0].append(i+1)
    l[i]+=1

for i in range(1,k):
    for j in range(i):
        s[i].append(s[j][i])
    while len(s[i]) - 1 != s[i][0]:
        for m in range(s[i-1][-1]-1,n):
            if l[m] == 0:
                s[i].append(m + 1)
                l[m] += 1
                if len(s[i]) - 1 == s[i][0]:
                        break
        if len(s[i]) - 1 != s[i][0]:
            for m in range(s[i-1][-1]-1,n):
                if l[m] == 1:
                    s[i].append(m + 1)
                    l[m] += 1
                    if len(s[i]) - 1 == s[i][0]:
                        break
        break

print(k)

for i in range(len(s)):
    for j in range(len(s[i])):
        if j==len(s[i])-1:
            print(s[i][j])
        else:
            print(s[i][j], end=' ')
N = int(input())

if N == 1:
    print(0)
elif N == 2:
    print(1)
else:
    ans = int((N*(N-1))/2)
    print(ans)

### FIXED CODE ###

S = list(input())
T = list(input())

ans = 0

for i in range(3):
    if S[i] == T[i]:
        ans += 1

print(ans)