Harryxun/stf_run huggingface dataset:
n, m = map(int, input().split())
light = []
for _ in range(m):
  s_map = map(int, input().split())
  next(s_map)
  indices = [s-1 for s in s_map]
  light.append(int('0b' + ''.join(number)))
p = list(map(int, input().split()))
count = 0
for i in range(1 << n):
  list_i = [int(bit) for bit in format(i, '0{}b'.format(n))]
  flag = True
  for j in range(m):
    on = 0
    for idx in indices:
      on ^= list_i[idx]
    if on != p[j]:
      flag = False
      break
  if flag:
    count += 1
print(count)

### FIXED CODE ###

n, m = map(int, input().split())
indices = []
for _ in range(m):
  s_map = map(int, input().split())
  next(s_map)
  indices.append([s-1 for s in s_map])
p = list(map(int, input().split()))
count = 0
for i in range(1 << n):
  list_i = [int(bit) for bit in format(i, '0{}b'.format(n))]
  flag = True
  for j in range(m):
    on = 0
    for idx in indices[j]:
      on ^= list_i[idx]
    if on != p[j]:
      flag = False
      break
  if flag:
    count += 1
print(count)
N = int(input())
def gcd(a,b):
    if b == 0:
        return a
    else:
        return gcd(b,a%b)
def lcm(a,b):
    g = gcd(a,b)
    return (a*b)//g

T = [int(input()) for _ in range(N)]
l = lcm(T[0],T[1])
for i in range(2,N):
    l = lcm(l,T[i])

print(l)


### FIXED CODE ###

"""
すべての秒数の最小公倍数を求める
Gを最大公約数として持つX,Yの最小公倍数はG*X/G*Y/G
"""
def gcd(a,b):
    return a if b==0 else gcd(b,a%b)
N = int(input())
T = [int(input()) for _ in range(N)]
tmp = T[0]
for i in range(1,N):
    t = T[i]
    g = gcd(tmp,t)
    tmp = g*(tmp//g)*(t//g)
print(tmp)
a, b = map(int, input().split())
c = a + b
d = c / 2
print(math.ceil(d))

### FIXED CODE ###

import math
a,b = map(int, input().split())
print(math.ceil((a+b)/2))
import sys
sys.setrecursionlimit(100000)

N = int(input())

graph = [[] for _ in range(N)]
for _ in range(N-1):
    a, b = map(int, input().split())
    graph[a-1].append(b-1)
    graph[b-1].append(a-1)

def dfs(p, checked, now):
    #print(p, checked, now)
    if p == N-1:
        return now, True
    ok = False
    for q in graph[p]:
        if not checked[q]:
            now.append(q)
            checked[q] = True
            bw, ok = dfs(q, checked, now)
    if not ok:
        now.pop()
        return now, False
    return bw, True

checked = [False for _ in range(N)]
checked[0] = True
bw, ok = dfs(0, checked, [0])
#print(bw)
cb = len(bw) - 2

between = [False for _ in range(N)]
for b in bw:
    between[b] = True

def dfs2(p, checked, c):
    c += 1
    for q in graph[p]:
        if not checked[q]:
            checked[q] = True
            c = dfs2(q, checked, c)
    return c

c0 = dfs2(0, between, 0)-1
cN = dfs2(N-1, between, 0)-1
#print(c0, cN)

if cb % 2 == 0:
    c0 += cb//2
    cN += cb//2
else:
    c0 += cb//2+1
    cN += cb//2

if cN < c0:
    print('Fennec')
else:
    print('Snuke')

### FIXED CODE ###

import sys
sys.setrecursionlimit(600000)

N = int(input())

graph = [[] for _ in range(N)]
for _ in range(N-1):
    a, b = map(int, input().split())
    graph[a-1].append(b-1)
    graph[b-1].append(a-1)

def dfs(p, checked, now):
    #print(p, checked, now)
    if p == N-1:
        return now, True
    ok = False
    for q in graph[p]:
        if not checked[q]:
            now.append(q)
            checked[q] = True
            nbw, ok1 = dfs(q, checked, now)
            if ok1:
                bw = nbw
                ok = True
    if not ok:
        now.pop()
        return now, False
    return bw, True

checked = [False for _ in range(N)]
checked[0] = True
bw, ok = dfs(0, checked, [0])
#print(bw)

between = [0 for _ in range(N)]
k = len(bw)
if k % 2 == 0:
    s0 = bw[k//2-1]
    sN = bw[k//2]
else:
    s0 = bw[k//2]
    sN = bw[k//2+1]
between[s0] = True
between[sN] = True

def dfs2(p, checked, c):
    c += 1
    for q in graph[p]:
        if not checked[q]:
            checked[q] = True
            c = dfs2(q, checked, c)
    return c

c0 = dfs2(s0, between, 0)
cN = dfs2(sN, between, 0)
#print(c0, cN)



if cN < c0:
    print('Fennec')
else:
    print('Snuke')
a,b=map(int,input().split())
c=[i for i in range(1,a+1) if a%i==0]
d=[i for i in range(1,b+1) if b%i==0]
e=[i for i in c if i in d]
for i in range(1,len(e)-1):
    for j in range(i+1,len(e)):
        if e[j]%e[i]==0:
            e[j]=0
            break
e=list(set(e))
print(len(e)-1)

### FIXED CODE ###

import fractions
a,b=map(int,input().split())
g=fractions.gcd(a,b)
ans=1
i=2
while i*i<=g:
    if g%i==0:
        ans+=1
        while g%i==0:
            g//=i
    i+=1
if g>1:
    ans+=1
print(ans)
n = int(input())
x=[]
y=[]
h=[]
for i in range(0,n):
    a,b,c = map(int,input().split())
    x.append(a)
    y.append(b)
    h.append(c)



for i in range(0,101):
    for j in range(0,101):
        tmph=abs(x[0]-i)+abs(y[0]-j)+h[0]
        flag = True
        for k in range(0,n):
            calch = abs(x[k]-i)+abs(y[k]-j)+h[k]
            if tmph != calch:
                flag = False
                break
        if flag == False:
            continue
        else:
            ansx=i
            ansy=j
            ansh=tmph

print(ansx,ansy,ansh)


        


### FIXED CODE ###

n = int(input())
x=[]
y=[]
h=[]
for i in range(0,n):
    a,b,c = map(int,input().split())
    x.append(a)
    y.append(b)
    h.append(c)
 
 
 
for i in range(0,101):
    for j in range(0,101):
        tmph=0
        flag = True
        for k in range(0,n):
            if tmph == 0 and h[k] != 0:
                tmph=abs(x[k]-i)+abs(y[k]-j)+h[k]
                break
        for k in range(0,n):
            calch = tmph - abs(x[k]-i)-abs(y[k]-j)
            if h[k] != max(calch,0):
                flag = False
                break
        if flag == False:
            continue
        elif tmph == 0:
            flag2 = True
            for c in range(0,101):
                if i == x[c] and j == y[c]:
                    flag2 = False
                    break
            if flag2:
                ansx = i
                ansy = j
                ansh = 1
        else:
            ansx=i
            ansy=j
            ansh=tmph
 
print(ansx,ansy,ansh)
def f(x):return 1if x<2else x*f(x-1)
print(f(int(input())))

### FIXED CODE ###

def f(x): return 1 if x<2 else x*f(x-1)
print(f(int(input())))
n,p=map(int,input().split())
a=1
for i in range(2,int(p**0.5)+2):
  if p%i==0:
    c=0
    while p%i!=0:
      p//=i
      c+=1
	a*=(c//n)*i
  if p==1:
    break
print(a)

### FIXED CODE ###

n,p=map(int, input().split())
ans=1
m=int(pow(p,1/n))+1
if n==1:
    print(p)
else:
    m=int(pow(p,1/n))+1
    i=2
    c=0
    while(i<=p and i<=m):
        #print('i,p=',i,p)
        if p % i == 0:
            p=p/i
            c=c+1
            if p % i != 0:
                #print('i**(c//n)=',i**(c//n))
                ans = ans * ( i**(c//n) )
                i=i+1
                c=0
        else:
            i=i+1
    print(ans)
Num = int(input())
Indata = [0] * num
Indata = [int(i) for i in input().split()]
MinVal = min(Indata)
MaxVal = max(Indata)
SumVal = sum(Indata)

print(MinVal, MaxVal, SumVal)


### FIXED CODE ###

num = int(input())
inData = [0] * num
inData = [int(i) for i in input().split()]
minVal = min(inData)
maxVal = max(inData)
sumVal = sum(inData)

print(minVal, maxVal, sumVal)
n, m = map(int, input().split())

friend = [set() for i in range(n)]

for i in range(m):
  a = list(map(int, input().split()))
  a.sort()
  x, y = a[0]-1,a[1]-1
  friend[x].add(y)
  friend[y].add(x)

def dfs(s):
  if vis[s] == False:
    vis[s] = True
    ary.append(s)
    for j in friend[s]:
      dfs(j)
vis = [False for i in range(n)]
ans = 0
for i in range(n):
  ary = []
  dfs(i)
  ans = max(ans,len(ary))
print (ans)


### FIXED CODE ###

import sys
sys.setrecursionlimit(10 ** 9)
n, m = map(int, input().split())

friend = [set() for i in range(n)]

for i in range(m):
  a = list(map(int, input().split()))
  a.sort()
  x, y = a[0]-1,a[1]-1
  friend[x].add(y)
  friend[y].add(x)

def dfs(s):
  if vis[s] == False:
    vis[s] = True
    ary.append(s)
    for j in friend[s]:
      dfs(j)
vis = [False for i in range(n)]
ans = 0
for i in range(n):
  ary = []
  dfs(i)
  ans = max(ans,len(ary))
print (ans)
n= int(input())
T = int(input())
c = list(input().split())
t = list(input().split())
min = 1000
for i in range(n):
    if int(T) > int(t[i]) and min > int(c[i]):
        min = int(c[i])
if min ==1000:
    print('TLE')
else:
    print(min)

### FIXED CODE ###

n,T= map(int,input().split())
min = 1001
for i in range(n):
    c,t = map(int,input().split())
    if T >= t and min > c:
        min = c
if min > 1000:
    print('TLE')
else:
    print(min)
import numpy as np

N = int(input())
v = np.array(list(map(int, input().split())))

answer = v.prod()

answer = answer if answer <= 10 ** 18 else -1
print(answer)

### FIXED CODE ###

N = int(input())
v = list(map(int, input().split()))
limit = 10 ** 18

answer = 1
if 0 in v:
  answer = 0
else:
  for i in v:
    answer = answer * i
    if answer <= limit:
      continue
    else:
      answer = -1
      break
print(answer)
N,M=map(int,input().split())
A=[-1]+[int(input()) for i in range(M)]+[N+1]
res=1
for i in range(1,len(a)):
  steps=a[i]-a[i-1]-2
  if steps<0:
    patern_nmu=0
  else:
    p,q=1,0
    for j in range(steps):
      p,q=p+q,p
    patern_nmu=p
    res*=patern_nmu
    res%=1000000007
print(res)

### FIXED CODE ###

N,M=map(int,input().split())
A=[-1]+[int(input()) for i in range(M)]+[N+1]
res=1
for i in range(1,len(A)):
  steps=A[i]-A[i-1]-2
  if steps<0:
    patern_nmu=0
  else:
    p,q=1,0
    for j in range(steps):
      p,q=p+q,p
    patern_nmu=p
  res*=patern_nmu
  res%=1000000007
print(res)
import itertools
import math
from collections import deque
from collections import defaultdict
from itertools import permutations
import heapq
import bisect
from scipy.sparse.csgraph import floyd_warshall as wf
from collections import Counter
from itertools import*
from bisect import bisect_left,bisect_right
inf = 10**10

n = int(input())
ans = inf
def f(x):
    cur = 0
    while x >0:
        cur += x % 10
        x = x //10
    return cur
for a in range(1,n):
    b = n-a
    ans = min(ans,f(a)+f(b))
print(ans)

### FIXED CODE ###

inf = 10**10

n = int(input())
ans = inf
def f(x):
    cur = 0
    while x >0:
        cur += x % 10
        x = x //10
    return cur
for a in range(1,n):
    b = n-a
    ans = min(ans,f(a)+f(b))
print(ans)
N = int(input())
ans=1
for i in range(1:32):
    for j in range(1:10):
        if i**j <= N:
            ans = max(ans,i**j)
        else:
            break
print(ans)

### FIXED CODE ###

N = int(input())
ans=1
for i in range(1,32):
    for j in range(2,10):
        if i**j <= N:
            ans = max(ans,i**j)
        else:
            break
print(ans)
N, M = [int(a) for a in input().split()]
S = [[int(i) for i in input().split()] for _ in range(M)]
flag = 0
NUM = 0
LIST = [-1 for _ in range(N)]
for s,c in S:
  s -= 1
  if(LIST[s]==-1):
    NUM += c*(10**(N-s-1))
    LIST[s] = c
    else:
      if(LIST[s]!=c):
        flag = 1
        print(-1)
        break
        else:
          continue
          if(LIST[0] == -1):
            if(N>1):
              NUM += 10**(N-1)
              else:
                NUM = 0
                elif(LIST[0] == 0):
                  if(N>1):
                    print(-1)
                    flag = 1
                    else:
                      NUM = 0
                      if(flag==0):
                        print(NUM)

### FIXED CODE ###

N, M = [int(a) for a in input().split()]
S = [[int(i) for i in input().split()] for _ in range(M)]
flag = 0
NUM = 0
LIST = [-1 for _ in range(N)]
for s,c in S:
    s -= 1
    if(LIST[s]==-1):
        NUM += c*(10**(N-s-1))
        LIST[s] = c
    else:
        if(LIST[s]!=c):
            flag = 1
            print(-1)
            break
        else:
            continue
if(LIST[0] == -1):
    if(N>1):
        NUM += 10**(N-1)
    else:
        NUM = 0
elif(LIST[0] == 0):
    if(N>1):
        print(-1)
        flag = 1
    else:
        NUM = 0
if(flag==0):
    print(NUM)
global cnt
cnt=0

def merge(A,left,mid,right):
    global cnt
    n1=mid-left
    n2=right-mid
    #L=[0 for i in range(n1+1)]
    #R=[0 for i in range(n2+1)]
    L=[]
    R=[]
    for i in range(max(n1,n2)):
        if i<n1:
            L.append(A[left+i])
        if i<n2:
            R.append(A[mid+j])
    L.append(float("inf"))
    R.append(float("inf"))
    i=0
    j=0
    for k in range(left,right):
        if L[i]<=R[j]:
            A[k]=L[i]
            i=i+1
            cnt+=1
        else:
            A[k]=R[j]
            j=j+1
            cnt+=1

def mergeSort(A,left,right):
    if left+1<right:
        mid=(int)((left+right)/2)
        mergeSort(A,left,mid)
        mergeSort(A,mid,right)
        merge(A,left,mid,right)

n=int(input())
S=list(map(int,input().split()))


mergeSort(S,0,n)
print(*S)
print(cnt)



### FIXED CODE ###

global cnt
cnt=0

def merge(A,left,mid,right):
    L=A[left:mid]
    R=A[mid:right]
    L.append(float("inf"))
    R.append(float("inf"))
    
    i=0
    j=0
    for k in range(left,right):
        global cnt
        cnt+=1
        if L[i]<=R[j]:
            A[k]=L[i]
            i=i+1
        else:
            A[k]=R[j]
            j=j+1

def mergeSort(A,left,right):
    if left+1<right:
        mid=(int)((left+right)/2)
        mergeSort(A,left,mid)
        mergeSort(A,mid,right)
        merge(A,left,mid,right)

n=int(input())
S=list(map(int,input().split()))

mergeSort(S,0,n)
print(*S)
print(cnt)
n, k, c = map(int, input().split())
s = list(input())
# cnt = s.count('o')
os = [i for i,x in enumerate(s) if x=='o']

from collections import deque

q = deque(os.copy())
_q1 = q.popleft()
m = k-1
l = [_q1]
if m > 0:
    while q:
        _q2 = q.popleft()
        if _q2 - _q1 > c:
            l.append(_q2)
            _q1 = _q2
            m -= 1
            if m == 0:
                q = deque([])
        else:
            pass

q = deque(os.copy())
_q2 = q.pop()
m = k-1
r = [_q2]
if m > 0:
    while q:
        _q1 = q.pop()
        if _q2 - _q1 > c:
            r.append(_q1)
            _q2 = _q1
            m -= 1
            if m == 0:
                q = deque([])
        else:
            pass

r = list(reversed(r))

ans = 0
for _l, _r in zip(l, r):
    if _l == _r:
        print(str(_l+1))
        ans = 1

if ans == 0:
    print()


### FIXED CODE ###

n, k, c = map(int, input().split())
s = list(input())
# cnt = s.count('o')
os = [i for i,x in enumerate(s) if x=='o']

from collections import deque

q = deque(os.copy())
_q1 = q.popleft()
m = k-1
l = [_q1]
if m > 0:
    while q:
        _q2 = q.popleft()
        if _q2 - _q1 > c:
            l.append(_q2)
            _q1 = _q2
            m -= 1
            if m == 0:
                q = deque([])
        else:
            pass

q = deque(os.copy())
_q2 = q.pop()
m = k-1
r = [_q2]
if m > 0:
    while q:
        _q1 = q.pop()
        if _q2 - _q1 > c:
            r.append(_q1)
            _q2 = _q1
            m -= 1
            if m == 0:
                q = deque([])
        else:
            pass

r = list(reversed(r))

ans = 0
for _l, _r in zip(l, r):
    if _l == _r:
        print(str(_l+1))
        ans = 1

if ans == 0:
    print()
import sys
sys.setrecursionlimit(10 ** 9)

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

p = [-1 for _ in range(2*(10**6)+1)]
cnt = x.count('1')

def calc(a):
  #print('a=',a)
  if p[a] != -1:
    return p[a]
  else:
    if a == 0:
      ret = 0
    else:
      b = bin(a).count('1')
      ret = 1+calc(a%b)
    p[a] = ret
    return ret

x0 = int(x,2)%(cnt-1)
x1 = int(x,2)%(cnt+1)
xx0 = [1]
for i in range(n+1):
  xx0.append((xx0[-1]*2)%(cnt-1))
xx1 = [1]
for i in range(n+1):
  xx1.append((xx1[-1]*2)%(cnt+1))

y = list(x)  
for i in range(n):
  if y[i] == '0':
    xx = xx1[n-i-1]
    print(calc((x1+xx)%(cnt+1))+1)
  else:
    xx = xx0[n-i-1]
    print(calc((x0-xx)%(cnt-1))+1)
  

### FIXED CODE ###

import sys
sys.setrecursionlimit(10 ** 9)

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

p = [-1 for _ in range(2*(10**7)+1)]
cnt = x.count('1')

def calc(a):
  #print('a=',a)
  if 0 <= a <= 2*(10**7) and  p[a] != -1:
    return p[a]
  else:
    if a == 0:
      ret = 0
    else:
      b = bin(a).count('1')
      ret = 1+calc(a%b)
    if 0 <= a <= 2*(10**7):
      p[a] = ret
    return ret

if cnt > 1:
  x0 = int(x,2)%(cnt-1)
  xx0 = [1]
  for i in range(n+1):
    xx0.append((xx0[-1]*2)%(cnt-1))
x1 = int(x,2)%(cnt+1)
xx1 = [1]
for i in range(n+1):
  xx1.append((xx1[-1]*2)%(cnt+1))

y = list(x)  
for i in range(n):
  if y[i] == '0':
    xx = xx1[n-i-1]
    print(calc((x1+xx)%(cnt+1))+1)
  else:
    if cnt == 1:
      print(0)
    else:
      xx = xx0[n-i-1]
      print(calc((x0-xx)%(cnt-1))+1)
n, k = map(int, input().split())
hs = list(map(int, input().split()))

dp = [float("inf") in range(n)]

for i in range(1, n):
    for j in range(min(i, k)):
        dp[i] = min(dp[i], dp[j] + abs(hs[j] - hs[i]))

print(dp[i])

### FIXED CODE ###

n, k = map(int, input().split())
hs = list(map(int, input().split()))

dp = [0] + [float("inf") for _ in range(n - 1)]

for i in range(1, n):
    for j in range(1, min(i, k) + 1):
        dp[i] = min(dp[i], dp[i - j] + abs(hs[i - j] - hs[i]))
print(dp[i])
N, X = map(int, input().split())


def search(level, eat_num):
    if eat_num == 0:
        return 1

    elif eat_num == 1:
        return 0

    elif 1 < eat_num <= pow(2, level + 1) - 2:
        return search(level - 1, eat_num - 1)

    elif eat_num == pow(2, level + 1) - 1:
        return pow(2, level)

    elif pow(2, level + 1) - 1 < eat_num <= pow(2, level + 2):
        return pow(2, level) + search(level - 1, eat_num - (pow(2, level + 1) - 1))

    elif X == pow(2, level + 2) + 1:
        return pow(2, level + 1) - 1

    else:
        print('out', X)


print(search(level=N, eat_num=X))

### FIXED CODE ###

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


def search(level, eat_num):
    if level == 0:
        if eat_num <= 0:
            return 0
        else:
            return 1

    elif eat_num == 1:
        return 0

    elif 1 < eat_num <= pow(2, level + 1) - 2:
        return search(level - 1, eat_num - 1)

    elif eat_num == pow(2, level + 1) - 1:
        return pow(2, level)

    elif pow(2, level + 1) - 1 < eat_num <= pow(2, level + 2):
        return pow(2, level) + search(level - 1, eat_num - (pow(2, level + 1) - 1))

    elif X == pow(2, level + 2) + 1:
        return pow(2, level + 1) - 1

    else:
        return pow(2, level + 1) - 1


print(search(level=N, eat_num=X))
N=int(input())
A=list(map(int,input().split()))
ans=A[0]
for i in range(len(A)):
    ans*=A[i]

if ans>3:
    =10**18:
    print(-1)
else:
    print(ans)

### FIXED CODE ###

import sys
N=int(input())
A=list(map(int,input().split()))
if 0 in A:
    print(0)
    sys.exit()


ans=1
for elem in A:
    ans*=elem
    if ans>10**18:
        print(-1)
        sys.exit()
print(ans)
N,K=map(int,input().split())

num=[0]*(K-1)
for i in range(N):
    num[i%K]+=1

for a in range(K):
    b=(K-a)%K#a=0なら0 a!=0ならk-aになる賢い手
    c=(K-a)%K
    if (b+c)%K!=0:
        continue
    else:
        ans=num[a]*num[b]*num[c]
print(ans)

### FIXED CODE ###

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

num=[0]*(max(N+1,K))
for i in range(1,N+1):
    num[i%K]+=1
#print(num)
ans=0
for a in range(K):
    b=(K-a)%K#a=0なら0 a!=0ならk-aになる賢い手
    c=(K-a)%K
    if (b+c)%K!=0:
        continue
    else:
      	#print(a)
        ans+=num[a]*num[b]*num[c]
        #print(a,b,c)
print(ans)
from sys import stdin

n = int(stdin.readline().rstrip())
l = [1,2,3,4,5,6,7,8,9,2,4,6,8,10,12,14,16,18,3,6,9,12,15,18,21,24,27,4,8,12,16,20,24,28,32,36,5,10,15,20,25,30,35,40,45,6,12,18,24,30,36,42,48,54,7,14,21,28,35,42,49,56,63,64,72,81]
ans = n in l
if ans == True:
    ans = "Yes"
else:
    ans = "No"
print(ans)


### FIXED CODE ###


from sys import stdin

A, B = [int(x) for x in stdin.readline().rstrip().split()]
if A<1 or A>9 or B<1 or B>9:
    ans = -1
else:
    ans = A*B

print(ans)
n = int(input())
s = 'abcdefghijklmnopqrstuvwxyz'


def calc(x, i):
  target = x - 26 ** i
  if (target < 0):
    return (x, i)
  else:
    return calc(target, i + 1)


def base10to(n, b):
  if(int(n/b)):
    return base10to(int(n/b), b) + str(n % b)
  return str(n % b)


target, index = calc(n, 1)
base26 = str(int(base10to(target, 26)) - 1)
ans = ''
head = index - len(base26)
for a in range(head):
  ans += 'a'
for c in base26:
    ans += s[int(c)]
print(ans)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10 ** 6)
n = int(input())
s = 'abcdefghijklmnopqrstuvwxyz'


def calc(x, i):
  target = x - 26 ** i
  if (target <= 0):
    return (x, i)
  else:
    return calc(target, i + 1)


target, index = calc(n, 1)
target -= 1
base26 = [0] * index
for i in range(index):
  tmp, target = divmod(target, 26 ** (index - i - 1))
  base26[i] = tmp
ans = ''
for i in base26:
  ans += s[i]
print(ans)
r,g,b=map(int.input().split())
if (g*10+b)%4==0:
  print('YES')
else:
  print('NO')

### FIXED CODE ###

r,g,b=map(int,input().split())
if ((g*10+b)%4)==0:
  print('YES')
else:
  print('NO')
import sys

n=int(input())
l=[int(n) for n in input().split()]
sum=0
for i in l:
    if i%2!=0:
        oc=0
    sum+=i
if(oc==0):
    print(0)
else:
    c=0
    while(sum%2==0 and sum>=2):
        c+=1
        sum=sum//2
    print(c)

### FIXED CODE ###

n=int(input())
a = list(map(int, input().rstrip().split()))

flag=1
c=0
while flag==1:
  for i in range(0,n):
    if a[i]%2!=0:
      flag=0
      break
  if flag==1:
    c+=1
    for j in range(0,n):
      a[j]//=2
print(c)
@njit(cache=True)
def light(n,a_list):
    outcome= np.zeros(n+1, dtype=np.int64)
    for i in range(n):
        outcome[max(0,i-a_list[i])] += 1
        outcome[min(n,i+a_list[i]+1)] -= 1
    outcome = np.cumsum(outcome)[:-1]
    return outcome
 
for _ in range(k):
    if min(a) == n:
        break
    a = light(n,a)
 
[print(aa,end=' ') for aa in a]

### FIXED CODE ###

N, K = map(int, input().split())
import numpy as np
A = np.array(input().split(), dtype=int)
I = np.arange(0, N)
for i in range(K):
  X = np.zeros(N + 1, int)
  np.add.at(X, np.maximum(0, I - A), 1)
  np.add.at(X, np.minimum(N, I + A + 1), -1)
  A = X.cumsum()[:-1]
  if np.all(A == N):
    break
print(*A)
i = input()
print(re.sub'[abcdefghijklmnopqrstuvwyz]', 'x',i)

### FIXED CODE ###

import re
i = input()
print(re.sub('[abcdefghijklmnopqrstuvwyz]', 'x',i))
from scipy.sparse.csgraph import dijkstra
import sys
input = sys.stdin.readline
def solve():
  inf = float("Inf")
  n,m,l = (int(i) for i in input().split())
  path = [[-1*inf]*n for _ in range(n)]
  for i in range(m):
    a,b,c = (int(i) for i in input().split())
    path[a-1][b-1] = c
    path[b-1][a-1] = c
  d = dijkstra(path)
  q = int(input())
  minipath = [[-1*inf]*n for _ in range(n)]
  for i in range(n):
    for j in range(n):
      if d[i][j] <= l:
        minipath[i][j] = 1
  d2 = dijkstra(minipath)

  for i in range(q):
    s,t = (int(i) for i in input().split())
    s,t = s-1,t-1
    cost = d2[s][t]
    if cost == inf:
      print(-1)
    else:
      print(int(cost)-1)

solve()

### FIXED CODE ###

from scipy.sparse.csgraph import floyd_warshall
import sys
input = sys.stdin.readline
def solve():
  inf = float("Inf")
  n,m,l = (int(i) for i in input().split())
  path = [[-1*inf]*n for _ in range(n)]
  for i in range(m):
    a,b,c = (int(i) for i in input().split())
    path[a-1][b-1] = c
    path[b-1][a-1] = c
  d = floyd_warshall(path)
  q = int(input())
  minipath = [[-1*inf]*n for _ in range(n)]
  for i in range(n):
    for j in range(n):
      if d[i][j] <= l:
        minipath[i][j] = 1
  d2 = floyd_warshall(minipath)

  for i in range(q):
    s,t = (int(i) for i in input().split())
    s,t = s-1,t-1
    cost = d2[s][t]
    if cost == inf:
      print(-1)
    else:
      print(int(cost)-1)

solve()