Harryxun/stf_run huggingface dataset:
# coding: utf-8
N,M=map(int,input().split())
picN=[]
picM=[]

for i in range(N):
    L=list(input())
    picN.append(L)

for i in range(M):
    L=list(input())
    picM.append(L)

K=N-M

for i in range(K):
    for j in range(K):
        flg=True
        for a in range(M):
            for b in range(M):
                if picN[a+i][b+j]!=picM[a][b]:
                    flg=False
        if flg:
            break
if flg:
    print("YES")
else:
    print("NO")

### FIXED CODE ###

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

A=[]
B=[]

for i in range(N):
    A.append(list(input()))
    
for i in range(M):
    B.append(list(input()))

k=N-M+1
ans=False

for i in range(k):
    for j in range(k):
        flg=True
        
        for p in range(M):
            for q in range(M):
                if A[i+p][j+q] != B[p][q]:
                    flg=False
                    
        ans=flg
        if ans:
            break
    if ans:
        break

if ans:
    print("Yes")
else:
    print("No")
N , A = map(int,input().split())
print('YES') if N % 500 <= A else print('NO')

### FIXED CODE ###

n=int(input())
a=int(input())
print('Yes' if n%500<=a else 'No');
A = list(map(int, input().split()))
B = list(map(int, input().split()))

N = A[0]
K = A[1]

a = N-1
b = 0
d = 0
for i in B:
  c = B[b]
  if K <= c:
    d = d+1
  b = b+1
print(d)

### FIXED CODE ###

N = input()

s = int(N)%2

if s == 0:
  print(0.5)
else:
  a = (int(N)+1)/(2*int(N))
  print(a)
S=input().replace("abc","").replace("acb","").replace("bac","").replace("bca","").replace("cab","").replace("cba","")
if s:
	print("NO")
else:
    print("YES")

### FIXED CODE ###

S = input()

S1='abc'
S2='acb'
S3='bac'
S4='bca'
S5='cab'
S6='cba'
if S==S1:
    print ('Yes')
elif S==S2:
    print ('Yes')
elif S==S3:
    print ('Yes')
elif S==S4:
    print ('Yes')
elif S==S5:
    print ('Yes')
elif S==S6:
    print ('Yes')
else:
    print ('No')
n=int(input())
l=map(int,input().split())
ans=0
maxt=0
for i in l:
  if i<maxt:
    ans+=maxt-i
  maxt=max(i,maxt)
print(ans)


### FIXED CODE ###

N,X,T=map(int,input().split())
if N%X==0:
  s=N//X
  print(s*T)
else:
  s=N//X+1
  print(s*T)
k,s = map(int,input().split())
counter = 0
for i in range(k+1):
  for m in range(k+1):
	if 0 <= (s -i- m) <= k:
      counter+= 1
print(counter)


### FIXED CODE ###

k,s = map(int,input().split())
counter = 0
for i in range(k+1):
  for m in range(k+1):
    if 0 <= s-i-m <= k:
      counter += 1
print(counter)
import sys
input = sys.stdin.readline
N, Q =map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(N-1)]
 
g = [[] for _ in range(N+1)]
for a, b in ab:
    g[b].append(a)
    g[a].append(b)
cnt = [0]*(N+1)
 
for _ in range(Q):
    p, x = map(int, input().split())
    cnt[p] += x
 
temp = [1]
visited = [0]*(N+1)
visited[1] = 1
 
while temp:
    q = temp.pop()   
    for i in g[q]:
        if visited[i] == 0:
            temp.append(i)
            visited[i] = 1
            cnt[i] += cnt[q]
print(*cnt[1:])
N, Q =map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(N-1)]

g = [[] for _ in range(N+1)]
for a, b in ab:
    g[b].append(a)
    g[a].append(b)
cnt = [0]*(N+1)

for _ in range(Q):
    p, x = map(int, input().split())
    cnt[p] += x

temp = [1]
visited = [0]*(N+1)
visited[1] = 1

while temp:
    q = temp.pop()   
    for i in g[q]:
        if visited[i] == 0:
            temp.append(i)
            visited[i] = 1
            cnt[i] += cnt[q]
print(*cnt[1:])
提出情報
提出日時

### FIXED CODE ###

import sys
input = sys.stdin.readline

N, Q = map(int, input().split())

bond_lst = list([list(map(int,input().split())) for _ in range(N-1)])
      
point_lst = [0]*(N+1)

for _ in range(Q):
    a, b = map(int, input().split())
    point_lst[a] += b

graph = {}

for a, b in bond_lst:
    if a in graph:graph[a].append(b)
    else:graph[a] = [b]
    if b in graph:graph[b].append(a)
    else:graph[b] = [a]
      
passed = [0]*(N+1)
nxt_lst = [1]
while nxt_lst:
    nxt = nxt_lst.pop()
    for i in graph[nxt]:
        if passed[i] == 1:continue
        point_lst[i] += point_lst[nxt]
        nxt_lst.append(i)
    passed[nxt] = 1
print(*point_lst[1:])
n=int(input())
s=[input() for i in range(n)]
m=int(input())
t=[input() for i in range(m)]

S=set(s[i] for i in range(n))
L=len(S)
a=[0]*(L+1)
for i in range(L):
    a[i]=s.count(S[i])-t.count(S[i])
print(max(a))

### FIXED CODE ###

n=int(input())
s=[input() for i in range(n)]
m=int(input())
t=[input() for i in range(m)]

S=set(s[i] for i in range(n))
L=len(S)
x = list(S)
a=[0]*(L+1)
for i in range(L):
    a[i]=s.count(x[i])-t.count(x[i])
print(max(a))
nums = map(int,input.split())
if nums[0] = 5 and nums[1] = 5 and nums[2] = 7:
	print('YES')
elif nums[0] = 5 and nums[1] = 7 and nums[2] = 5:
	print('YES')
elif nums[0] = 7 and nums[1] = 5 and nums[2] = 5:
	print('YES')
else:
	print('NO')

### FIXED CODE ###

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

if a == 5 and b == 5 and c == 7:
  print('YES')
elif a == 5 and b == 7 and c == 5:
  print('YES')
elif a == 7 and b == 5 and c == 5:
  print('YES')
else:
  print('NO')
import re
s = input()
pattern = r"\d{2}"
if(!re.match(pattern, s)):
  print("Yes")
else:
  print("No")

### FIXED CODE ###

import re
s = input()
pattern = r"(00|11|22|33|44|55|66|77|88|99)"
if(re.search(pattern, s)):
	print("Bad")
else:
	print("Good")
int N= input()
int M = input()
if (N==M):
 		 print("Yes")
 	else:
      print("No")

### FIXED CODE ###

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

if (N==M):
  print("Yes")
else:
  print("No")
a,b,c,d=[int(input()) for i in range(4)]
ls = list[a+c,a+d,b+c,b+d]
print(min(ls))

### FIXED CODE ###

a,b,c,d=[int(input()) for i in range(4)]
print(min(a+c,a+d,b+c,b+d))
import math

n, k = list(map(int, input().split()))
h = [int(input()) for _ in range(n)]
h.sort()
ans = math.inf
for i in range(n - k + 1):
    ans = min(ans, h[i + k - 1] - h[i])

print(ans)


### FIXED CODE ###

D = int(input())
c = "Christmas"
e = " Eve"
print(c, end="")
if D != 25:
    for i in range(25 - D):
        print(e, end="")
print()
# -*- coding: utf-8 -*-
from bisect import bisect_right

import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

def primes(n):
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    return [i for i in range(n + 1) if is_prime[i]]

P = primes(10**6)

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

check = [0]*(10**6)
flag = 0
for a in A:
    temp = 0
    for i in range(bisect_right(P, int(a**0.5+10))):
        if a%P[i] == 0:
            if check[P[i]] == 1:
                flag = 1
            else:
                check[P[i]] = 1
            temp = 1
    if check[a] == 1:
        flag = 1
    if not temp:
        check[a] = 1
    if flag:
        break

if gcd_list(A) > 1:
    print("not coprime")
elif flag:
    print("setwise coprime")
else:
    print("pairwise coprime")
    
    
    
    
    


### FIXED CODE ###

# -*- coding: utf-8 -*-
import math
from functools import reduce

def gcd_list(numbers):
    return reduce(math.gcd, numbers)


n = 10**6
minfac = list(range(n+1))
for i in range(2, int(n**0.5) + 1):
    if minfac[i] < i:
        continue
    for j in range(i, n + 1, i):
        if minfac[j] > i:
            minfac[j] = i

"""nの素因数の種類を求める"""
def osa_k(n):
    temp = set()
    while n > 1:
        temp.add(minfac[n])
        n = n//minfac[n]
    return temp


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

check = [0]*(10**6)
flag = 0
for a in A:
    for i in osa_k(a):
        if check[i]:
            flag = 1
        else:
            check[i] = 1
    if flag:
        break
        
if gcd_list(A) > 1:
    print("not coprime")
elif flag:
    print("setwise coprime")
else:
    print("pairwise coprime")
a,b,c = input().split()

if a[len(a)-1] == b[0] and b[len(b)-1] == c[0]]:
    print('YES')
else:
    print(ans)


### FIXED CODE ###

a,b,c = input().split()

if a[len(a)-1] == b[0] and b[len(b)-1] == c[0]:
    print('YES')
else:
    print('NO')
import itertools
from bisect import bisect_left,bisect
import sys

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

A_max=max(A)
lst=[[] for i in range(A_max+1)]
flag=[0]*(A_max+1)
for i in range(n):
    lst[A[i]].append(i)

flag=[0]*n
data=[]
i=0
while flag[i]==0:
    flag[i]=1
    a=A[i]
    b=bisect(lst[a],i)
    if b==len(lst[a]):
        data.append(i)
        i=lst[a][0]+1
    else:
        i=lst[a][b]+1
    if i==n:
        data.append(n)
        i=0

#大丈夫
if not data:
    print()
    sys.exit()
s=len(data)
zzz=data[(K-1)%s]
i=zzz
d=[]
while i<n:
    a=A[i]
    b=bisect(lst[a],i)
    if b<len(lst[a]):
        d.append([i,lst[a][b]])
        i=lst[a][b]+1
        continue
    else:
        i+=1


if d:
    ans=A[zzz:d[0][0]]
    for j in range(len(d)-1):
        ans=list(itertools.chain(ans,A[d[i][1]+1:d[i+1][0]]))
    ans=list(itertools.chain(ans,A[d[-1][1]+1:]))
    print(*ans)

### FIXED CODE ###

import itertools
from bisect import bisect_left,bisect
import sys

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

A_max=max(A)
lst=[[] for i in range(A_max+1)]
flag=[0]*(A_max+1)
for i in range(n):
    lst[A[i]].append(i)

flag=[0]*n
data=[]
i=0
while flag[i]==0:
    flag[i]=1
    a=A[i]
    b=bisect(lst[a],i)
    if b==len(lst[a]):
        data.append(i)
        i=lst[a][0]+1
    else:
        i=lst[a][b]+1
    if i==n:
        data.append(n)
        i=0

#大丈夫
if not data:
    print()
    sys.exit()
s=len(data)
zzz=data[(K-1)%s]
i=zzz
d=[]
while i<n:
    a=A[i]
    b=bisect(lst[a],i)
    if b<len(lst[a]):
        d.append([i,lst[a][b]])
        i=lst[a][b]+1
        continue
    else:
        i+=1


if d:
    ans=A[zzz:d[0][0]]
    for j in range(len(d)-1):
        ans=list(itertools.chain(ans,A[d[j][1]+1:d[j+1][0]]))
    ans=list(itertools.chain(ans,A[d[-1][1]+1:]))
    print(*ans)
else:
    print(*A[zzz:])
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
totl=min(0,a[0]-b[0])
for i in range(n):
  totl+=min(0,a[i+1]-b[i]-b[i+1])
    
print(sum(b)+totl)
  


### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
cnt=0
for i in range(n):
  if b[i]-a[i]>0:
    cnt+=a[i]
    cnt+=min(b[i]-a[i],a[i+1])
    a[i+1]=max(a[i+1]-b[i]+a[i],0)
  else:
    cnt+=b[i]
print(cnt)
N=int(input())
v=int(input()).split()
V=v.sort()
cnt=0
while cnt<N-1:
    v[0]=(int(v[0])+int(v[cnt+1]))/2
    cnt+=1
print(v[0])


### FIXED CODE ###

N=int(input())
v=[int(x) for x in input().split()]
cnt=0
while cnt<N-1:
    v.sort()
    v[0]=(v[0]+v.pop(1))/2
    cnt+=1
print(v[0])
import numpy
a,b,x=map(int,input().split())
if x>=2/a**2*b:
  print(math.degrees(numpy.arccos(a/((2*(a**2*b-x)/a**2)**2+a**2)**0.5)))
else:
  print(math.degrees(numpy.arccos((2*x/a/b)/((2*x/a/b)**2+b**2)**0.5)))


### FIXED CODE ###

import math
a,b,x=map(int,input().split())
if x>=(a**2*b)/2:
  print(math.degrees(math.acos(a/((2*(a**2*b-x)/a**2)**2+a**2)**0.5)))
else:
  print(math.degrees(math.acos((2*x/a/b)/(((2*x/a/b)**2+b**2)**0.5))))
class Dice(object):
    def __init__(self, top, south, east, west, north, bottom):
        self.top = top
        self.south = south
        self.east = east
        self.west = west
        self.north = north
        self.bottom = bottom
    def rollN(self):
        prevN = self.north
        prevB = self.bottom
        prevS = self.south
        self.north = self.top
        self.bottom = prevN
        self.south = prevB
        self.top = prevS
    def rollS(self):
        prevS = self.south
        prevB = self.bottom
        prevN = self.north
        self.south = top
        self.bottom = prevS
        self.north = prevB
        self.top = prevN
    def rollE(self):
        prevE = self.east
        prevB = self.bottom
        prevW = self.west
        self.east = self.top
        self.bottom = prevE
        self.west = prevB
        self.top = prevW
    def rollW(self):
        prevW = self.west
        prevB = self.bottom
        prevE = self.east
        self.west = top
        self.bottom = prevW
        self.east = prevB
        self.top = prevE

diceInit = [int(n) for n in raw_input().split()][:6:]
instruction = raw_input()

diceI = Dice(diceInit[0], diceInit[1], diceInit[2], diceInit[3], diceInit[4], diceInit[5])

for item in instruction:
    if item == 'N':
        diceI.rollN()
    elif item == 'E':
        diceI.rollE()
    elif item == 'W':
        diceI.rollW()
    elif item == 'S':
        diceI.rollS()

print diceI.top

### FIXED CODE ###

class Dice(object):
    def __init__(self, top, south, east, west, north, bottom):
        self.top = top
        self.south = south
        self.east = east
        self.west = west
        self.north = north
        self.bottom = bottom
    def rollN(self):
        prevN = self.north
        prevB = self.bottom
        prevS = self.south
        self.north = self.top
        self.bottom = prevN
        self.south = prevB
        self.top = prevS
    def rollS(self):
        prevS = self.south
        prevB = self.bottom
        prevN = self.north
        self.south = self.top
        self.bottom = prevS
        self.north = prevB
        self.top = prevN
    def rollE(self):
        prevE = self.east
        prevB = self.bottom
        prevW = self.west
        self.east = self.top
        self.bottom = prevE
        self.west = prevB
        self.top = prevW
    def rollW(self):
        prevW = self.west
        prevB = self.bottom
        prevE = self.east
        self.west = self.top
        self.bottom = prevW
        self.east = prevB
        self.top = prevE

diceInit = [int(n) for n in raw_input().split()][:6:]
instruction = raw_input()

diceI = Dice(diceInit[0], diceInit[1], diceInit[2], diceInit[3], diceInit[4], diceInit[5])

for item in instruction:
    if item == 'N':
        diceI.rollN()
    elif item == 'E':
        diceI.rollE()
    elif item == 'W':
        diceI.rollW()
    elif item == 'S':
        diceI.rollS()

print diceI.top
import numpy as np
from numba import njit
 
n, k = map(int, input().split())
a = np.array(list(map(int, input().split())), dtype=np.int64)
 
@njit
def imos(a):
  b = np.zeros(n+1, dtype=np.int64)
  for i in range(n):
    l = max(0, i-a[i])
    r = min(i+a[i]+1, n)
    b[l] += 1
    if r <= n-1: b[r] -= 1
  
  b = np.cumsum(b)[:-1]
  return b
 
for q in range(k):
  a = imos(a)
  if np.min(a)==N:
    break
    
print(*a)

### FIXED CODE ###

import numpy as np
from numba import njit
 
n, k = map(int, input().split())
a = np.array(list(map(int, input().split())), dtype=np.int64)
 
@njit
def loop1(a):
  b = np.zeros(n+1, dtype=np.int64)
  for i in range(n):
    l = max(0, i-a[i])
    r = min(i+a[i]+1, n)
    b[l] += 1
    if r <= n-1: b[r] -= 1
  
  b = np.cumsum(b)[:-1]
  return b
 
for q in range(min(42, k)):
  a = loop1(a)
    
print(*a)
import sys
from collections import Counter
from bisect import bisect, bisect_left
from fractions import Fraction

def comb(n, k):
    if n < 0 or k < 0:
        pdt = 0
    else:
        pdt = 1
        for s in range(1, k + 1):
            pdt *= Fraction(n - s + 1, s)
    return pdt.numerator

input = sys.stdin.readline
N = int(input())
L = sorted([int(x) for x in input().split()])
c = 0
Lcnt = Counter(L)
Lset = sorted(list(set(L)))
Nset = len(Lset)
for i in range(Nset):
    if Lcnt[Lset[i]] >= 3:
        c += comb(Lcnt[Lset[i]], 3)
        if i == Nset - 1:
            break

    if Lcnt[Lset[i]] >= 2:
        fl = bisect(L, Lset[i])
        fr = bisect_left(L, Lset[i] * 2)
        c += comb(Lcnt[Lset[i]], 2) * (fr - fl)
    for j in range(i + 1, Nset):
        fl = bisect(L, Lset[j])
        fr = min(bisect_left(L, Lset[i] + Lset[j]), len(L) - 1)
        c += Lcnt[Lset[i]] * Lcnt[Lset[j]] * (fr - fl)

if Lcnt[Lset[-1]] >= 2:
    c += Lcnt[Lset[-2]] * comb(Lcnt[Lset[-1]], 2)
print(c)

### FIXED CODE ###

import sys
from bisect import bisect, bisect_left

input = sys.stdin.readline
N = int(input())
L = sorted([int(x) for x in input().split()])
c = 0
for i in range(N - 2):
    for j in range(i + 1, N - 1):
        f = bisect_left(L, L[i] + L[j])
        c += f - j - 1
print(c)
import sys
input=lambda: sys.stdin.readline().rstrip()
mod=10**9+7
a,b,n=map(int,input().split())
def primes(x):
  is_prime=[True]*(x+1)
  is_prime[0]=False
  is_prime[1]=False
  for i in range(2,int(x**0.5)+1):
    if not is_prime[i]:
      continue
    for j in range(i*2,x+1,i):
      is_prime[j]=False
  return [i for i in range(x+1) if is_prime[i]]
P=primes(b)
ans=1
for p in P:
  ord=1
  ord_p=0
  while True:
    ct=b//(p**ord)-(a-1)//(p**ord)
    if ct:
      ord_p+=pow(ct,n,mod-1)
      ord+=1
    else:
      break
  ord_p%=mod-1
  ans=(ans*(pow(p,ord_p,mod)))%mod
print(ans)


### FIXED CODE ###

mod=10**9+7
s=input()
n=len(s)
R=[[[0]*13 for _ in range(10)] for __ in range(13)]
for i in range(13):
  for j in range(10):
    for k in range(13):
      R[i][j][k]=(k-i*j)%13

P=[0]*(n+1)
P[0]=1
for i in range(n):
  P[i+1]=(P[i]*10)%13

DP=[[0]*13 for _ in range(n+1)]
DP[0][0]=1
for i in range(n):
  r=P[n-1-i]
  if s[i]=="?":
    for k in range(13):
      DP[i+1][k]=sum(DP[i][R[r][j][k]] for j in range(10))
      DP[i+1][k]%=mod
  else:
    for k in range(13):
      DP[i+1][k]=DP[i][R[r][int(s[i])][k]]
      DP[i+1][k]%=mod
print(DP[n][5]%mod)
import math

def lcm(x, y):
    return x * y / math.gcd(x, y)

a, b, c, d = map(int, input().split())

x = int(lcm(c, d))

A = a-1 - (a - 1) // c - (a - 1) // d + (a - 1) // x
B = b - b // c - b // d + b // x

print(int(B - A))


### FIXED CODE ###

def gcd(x, y):
    if x < y:
        tmp = y
        y = x
        x = tmp
    while y != 0:
        x = x % y
        temp = y
        y = x
        x = temp
    return int(x)

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

a, b, c, d = map(int, input().split())

x = lcm(c, d)

A = a-1 - (a - 1) // c - (a - 1) // d + (a - 1) // x
B = b - b // c - b // d + b // x

print(int(B - A))
L, R = map(int, input().split())
if R - L >= 2019 :
    print(0)

else :
    t = []
    for i in range(L, R+1):
        for j in range(i+1, R+1) :
            list.append((i*j) % 2019)
    print(min(t))


### FIXED CODE ###

L, R = map(int, input().split())
if R - L >= 2019 :
    print(0)

else :
    t = []
    for i in range(L, R):
        for j in range(i + 1, R + 1) :
            t.append((i * j) % 2019)
    print(min(t))
def slove():
    import sys
    input = sys.stdin.readline
    n, m = list(map(int, input().rstrip('\n').split()))
    py = []
    ls = [1] * (n + 1)
    for i in range(m):
        p, y = list(map(int, input().rstrip('\n').split()))
        py.append([p, y, 0, i])
    py.sort()
    for i in range(m):
        py[i][2] = ls[py[i][0]]
        ls[py[i][0]] += 1
    py.sort(key=lambda x: x[3])
    for i in range(len(py)):
        a = ["0"] * 6
        a.append(list(str(py[i][0])))
        a = a[-6:]
        b = ["0"] * 6
        b.append(list(str(py[i][2])))
        b = b[-6:]
        print("".join(a + b))


if __name__ == '__main__':
    slove()


### FIXED CODE ###

n, m = map(int, input().split())
a = []
b = [1] * n
py = []
for i in range(m):
    p, y = map(int, input().split())
    py.append([p, y, i, 0])
py = sorted(py, key=lambda x: (x[0], x[1]))
for i in range(len(py)):
    py[i][3] = b[py[i][0]-1]
    b[py[i][0] - 1] += 1
py = sorted(py, key=lambda x: x[2])
for i in py:
    print(("000000" + str(i[0]))[-6:] + ("000000" + str(i[3]))[-6:])
N = int(input())

if N % 2 =! 0: s = (N+1) / (2*N) 
else: s = 1/2
print(s)

### FIXED CODE ###

N = int(input())
 
if N % 2 != 0: s = (N+1)/(2*N) 
else: s = 1/2
  
print(s)
N = int(input())
NUM = 1000000007
A = [list(map(int, input().split())) for _ in range(N)]
MASS = 0
for i in range (N):
    I = A[i] % NUM
    I = (I * (N - 1)) % NUM
    MASS += I
print(MASS % NUM)

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
total = 0
sub = 0
for i in a:
    total += i
    sub += i * i
print((((total * total) - sub) // 2) % (10 ** 9 + 7))
N = int(input())
a = list(map(int, input().split()))

b=[-1]*N
b[N-1]=a[N-1]
for i in range(N-1)[::-1]: #N=4なら 2,1,0
    sum_count = N // (i+1)
    if sum_count==1:
        b[i]=a[i]
    else:
        sum1=0
        for j in range(sum_count-1):
            sum1 = sum1 + b[(i+1)*(j+1)]
        sum1 = sum1 % 2
        b[i]=(a[i]+ sum1)%2

print(sum(b))
for i in range(N):
    if b[i]==1:
        print(i+1,end=" ")

### FIXED CODE ###

N = int(input())
print(3*N*N)
import sys

z = 0
for line in sys.stdin:
  xs = map(int, line.split())
  if len(xs) < 2:
    continue
  if xs[1] == 'BTC':
    z += 380000 * xs[0]
  else: 
    z += xs[0]
print(z)


### FIXED CODE ###

import sys

z = 0
for line in sys.stdin:
  xs = line.split()
  if len(xs) < 2:
    continue
  if xs[1] == 'BTC':
    z += 380000 * float(xs[0])
  else: 
    z += float(xs[0])
print(z)
while True:
    num = int(input()).split()
    li = list(map(int,num))
    if li[0] and li[1] == 0: break
    li.sort()
    print('{} {}'.format(li[0],li[1]))

### FIXED CODE ###

import sys
 
for i in sys.stdin:
    i = i.split(" ")
    x, y = int(i[0]), int(i[1])
    if x == y == 0:
       break
    elif x <= y:
       print("{0} {1}".format(x, y))
    else:
       print("{0} {1}".format(y, x))
l = input()
li = list(map(int, input().split()))
m = 0
for i in l:
  n = li[i]
  while not n % 2:
    m += 1
    n /= 2
else:
  print(m)

### FIXED CODE ###

l = int(input())
li = list(map(int, input().split()))
m = 0
for i in range(l):
  n = li[i]
  while not n % 2:
    m += 1
    n /= 2
else:
  print(m)
L, R = map(int, input().split())

listX = []
sw = 0
i = 1
while i * 2019 > 2000000000:
  i3 = i *2019
  listX.append(i3)
  i += 1

for n in range(len(listX)):
  if L < listX[n] and R > listX[n]:
    sw += 1

if sw > 0:
  print(0)

elif sw == 0:      
  L_1 = L % 2019
  R_1 = R % 2019
  
  idx1 = 0
  listA = []
  for idx1 in range(L_1, R_1):
    for idx2 in range(idx1 + 1, R_1 + 1):
      listA.append(idx1 * idx2)
 
  print(min(listA))

### FIXED CODE ###

L, R = map(int, input().split())

listX = []
for i in range(1, 990590):
  listX.append(i*2019)

sw = 0
for n in range(len(listX)):
  if L < listX[n] and R > listX[n]:
    sw += 1

if sw > 0:
  print(0)

elif sw == 0:
  idx1 = 0
  listA = []
  for idx1 in range(L, R):
    for idx2 in range(idx1 + 1, R + 1):
      listA.append(idx1 * idx2)
 
  idx3 = 0
  listB = []
  for idx3 in range(len(listA)):
    listB.append(listA[idx3] % 2019)
 
  print(min(listB))
a,b,c = map(int, input().split())
s = set(a, b, c)
if len(s) == 2:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

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

if a==b and b == c and c==a:
  print("No")
elif a==b or b==c or c == a:
  print("Yes")
else:
  print("No")
N=int(input())

def sumn(N):
    if N > 0:
        return sumn(N//10) + [N%10]
    else:
        return []

if sum(sumn(N)) %9 ==0:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

N=int(input())


result = sum(list(map(int, str(N))))
if result  %9 ==0:
    print('Yes')
else:
    print('No')