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

mod=1000000007

x=0
cnt=1
while x<3:
    if x==0:
        if s1[x]==s2[x]:
            cnt*=3%mod
            x+=1
        else:
            cnt*=6%mod
            x+=2
    else:
        if s1[x-1]==s2[x-1]:
            #x-1:AA 
            #x  :BB CC
            if s1[x]==s2[x]:
                cnt*=2%mod
                x+=1
            #x-1:AA 
            #x  :BC  CB
            #    BC  CB
            else:
                cnt*=2%mod
                x+=2
        else:
            #x-1:AB
            #   :CC
            if s1[x]==s2[x]:
                cnt*=1%mod
                x+=1
            #x-1:AB
            #x  :BA CA BC 
            else:
                cnt*=3%mod
                x+=2

print(cnt%mod)






### FIXED CODE ###

n=int(input())
s1=input()
s2=input()

mod=1000000007

x=0
cnt=1
while x<n:
    if x==0:
        if s1[x]==s2[x]:
            cnt*=3%mod
            x+=1
        else:
            cnt*=6%mod
            x+=2
    else:
        if s1[x-1]==s2[x-1]:
            #x-1:AA 
            #x  :BB CC
            if s1[x]==s2[x]:
                cnt*=2%mod
                x+=1
            #x-1:AA 
            #x  :BC  CB
            #    BC  CB
            else:
                cnt*=2%mod
                x+=2
        else:
            #x-1:AB
            #   :CC
            if s1[x]==s2[x]:
                cnt*=1%mod
                x+=1
            #x-1:AB
            #x  :BA CA BC 
            else:
                cnt*=3%mod
                x+=2

print(cnt%mod)
from math import *

def main()
    m, n = [int(_) for _ in input().split()]
    print(pow(m, n, 1000000007))

main()



### FIXED CODE ###

def main():
    m, n = [int(_) for _ in input().split()]
    print(pow(m, n, 1000000007))

main()
A = int(input())
B = int(input())
if A<=9 & B<=9:
  print(A*B)
else:
  print(-1)

### FIXED CODE ###

A,B = map(int, input().split())
if (A<=9) & (B<=9):
  print(A*B)
else:
  print(-1)
a,b = input().split()

a = int(a)
b = int(b *100)
c = int(a*b)
print(c//100)


### FIXED CODE ###

from decimal import *

a,b = map(Decimal,input().split())

print(int(a*b))
n=int(input())
a=[(i,int(input())-1) for i in range(n)]
c,x=0,0
for i in range(n):
  x=a[x]
  if x==2:
    print(i+1)
    break
else:
  print(-1)

### FIXED CODE ###

n=int(input())
a=[int(input())-1 for i in range(n)]
c,x=1,0
for i in range(n):
  x=a[x]
  if x==1:
    print(i+1)
    break
else:
  print(-1)
import sys
import numpy as np

n = int(input())

a = []
b = []

for i in range(n):
    x, y = map(int, input().split())
    a.append(x)
    b.append(y)

a = np.array(a)
b = np.array(b)

diff = b - a

li = []
for x, y, z in zip(diff, a, b):
    li.append((x, y, z))

li = sorted(reverse=True)

stack = 0
for _, a, b in li:
    stack += a
    if stack > b:
        print("No")
        sys.exit()

print("Yes")

### FIXED CODE ###

import sys

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

ab.sort(key=lambda x: x[1])

now = 0

for a, b in ab:
    now += a
    if now > b:
        print("No")
        sys.exit()

print("Yes")
while True:
    a, op, b = map(int, inptut().split(" "))
    if a == 0 and b == 0:
        break
    
    if op == "+":
        c = a + b
    elif op == "-":
        c = a - b
    elif op == "*":
        c = a * b
    else
        c = a / b
    print(c)


### FIXED CODE ###

while True:
    a, op, b = map(str, input().split(" "))
    if op == "?":
        break
    a, b = int(a), int(b)
    if op == "+":
        c = a + b
    elif op == "-":
        c = a - b
    elif op == "*":
        c = a * b
    else:
        c = a // b
    print(c)
import sys
# sys.setrecursionlimit(100000)


def input():
    return sys.stdin.readline().strip()


def input_int():
    return int(input())


def input_int_list():
    return [int(i) for i in input().split()]


class SegTree:
    X_unit = 0
    X_f = max

    def __init__(self, N):
        self.N = N
        self.X = [self.X_unit] * (N + N)

    def build(self, seq):
        for i, x in enumerate(seq, self.N):
            self.X[i] = x
        for i in range(self.N - 1, 0, -1):
            self.X[i] = self.X_f(self.X[i << 1], self.X[i << 1 | 1])

    def set_val(self, i, x):
        i += self.N
        self.X[i] = x
        while i > 1:
            i >>= 1
            self.X[i] = self.X_f(self.X[i << 1], self.X[i << 1 | 1])

    def fold(self, L, R):
        L += self.N
        R += self.N
        vL = self.X_unit
        vR = self.X_unit
        while L < R:
            if L & 1:
                vL = self.X_f(vL, self.X[L])
                L += 1
            if R & 1:
                R -= 1
                vR = self.X_f(self.X[R], vR)
            L >>= 1
            R >>= 1
        return self.X_f(vL, vR)


def main():
    n, k = input_int_list()
    segtree = SegTree(300000)
    for _ in range(n):
        a = input_int()

        val = segtree.fold(max(0, a - k), min(300000, a + k + 1))
        segtree.set_val(a, val + 1)

    print(segtree.X[1])

    return


if __name__ == "__main__":
    main()


### FIXED CODE ###


import sys
# sys.setrecursionlimit(100000)


def input():
    return sys.stdin.readline().strip()


def input_int():
    return int(input())


def input_int_list():
    return [int(i) for i in input().split()]


class SegTree:
    X_unit = 0
    X_f = max

    def __init__(self, N):
        self.N = N
        self.X = [self.X_unit] * (N + N)

    def build(self, seq):
        for i, x in enumerate(seq, self.N):
            self.X[i] = x
        for i in range(self.N - 1, 0, -1):
            self.X[i] = self.X_f(self.X[i << 1], self.X[i << 1 | 1])

    def set_val(self, i, x):
        i += self.N
        self.X[i] = x
        while i > 1:
            i >>= 1
            self.X[i] = self.X_f(self.X[i << 1], self.X[i << 1 | 1])

    def fold(self, L, R):
        L += self.N
        R += self.N
        vL = self.X_unit
        vR = self.X_unit
        while L < R:
            if L & 1:
                vL = self.X_f(vL, self.X[L])
                L += 1
            if R & 1:
                R -= 1
                vR = self.X_f(self.X[R], vR)
            L >>= 1
            R >>= 1
        return self.X_f(vL, vR)


def main():
    n, k = input_int_list()
    segtree = SegTree(500000)
    for _ in range(n):
        a = input_int()

        val = segtree.fold(max(0, a - k), min(500000, a + k + 1))
        segtree.set_val(a, val + 1)

    print(segtree.X[1])

    return


if __name__ == "__main__":
    main()
import sys
input=sys.stdin.readline
def main():
    n=int(input())
    #H=[list(map(int,input().split())) for _ in range(n)]
    dp=[[-10**9]*3 for _ in range(n)]
    
    for i in range(n):
        a,b,c=map(int,input().split())
        t=[a,b,c]
        if i==0:
            dp[0][0],dp[0][1],dp[0][2]=a,b,c 
        else:
            for j in range(3):
                dp[i][j]=max(dp[i-1][j-1]+t[j-1],dp[i-2]+t[j-2])

        print(max(dp[-1]))
main()

### FIXED CODE ###

import sys
input=sys.stdin.readline
def main():
    n=int(input())
    #H=[list(map(int,input().split())) for _ in range(n)]
    dp=[[-10**9]*3 for _ in range(n)]
    
    for i in range(n):
        a,b,c=map(int,input().split())
        t=[a,b,c]
        if i==0:
            dp[0][0],dp[0][1],dp[0][2]=a,b,c 
        else:
            for j in range(3):
                dp[i][j]=max(dp[i-1][j-1]+t[j],dp[i-1][j-2]+t[j])
    #print(dp)

    print(max(dp[-1]))
main()
# # # coding=utf-8
# # # Author: lee215

get = lambda: int(raw_input().strip())
getl = lambda: raw_input().strip()
gets = lambda: map(int, raw_input().strip().split())
getss = lambda n: [gets() for _ in xrange(n)]

# 2019-03-30 20:14

A, B, C = gets()


def solve(A, B, C):
    if A == B == C
        print 'YES'
    else:
        print 'NO'

solve(A, B, C)


### FIXED CODE ###

# # # coding=utf-8
# # # Author: lee215

get = lambda: int(raw_input().strip())
getl = lambda: raw_input().strip()
gets = lambda: map(int, raw_input().strip().split())
getss = lambda n: [gets() for _ in xrange(n)]

# 2019-03-30 20:14

A, B, C = gets()


# def solve(A, B, C):
#     if len(set([A, B, C])) < 3:
#         print 'Yes'
#     else:
#         print 'No'



def solve(A, B, C):
    if len(set([A, B, C])) == 1:
        print 'Yes'
    else:
        print 'No'

solve(A, B, C)
import sys
from heapq import *
input = sys.stdin.readline

def main():
  n, m, s, t = map(int, input().split())
  
  tree = [[] for _ in range(n)]
  cost_yen = [[0]*n for _ in range(n)]
  cost_snuke = [[0]*n for _ in range(n)]
  for i in range(m):
    u, v, a, b = map(int, input().split())
    tree[u-1].append(v-1)
    tree[v-1].append(u-1)
    cost_yen[u-1][v-1] = a
    cost_yen[v-1][u-1] = a
    cost_snuke[u-1][v-1] = b
    cost_snuke[v-1][u-1] = b
  
  ans_yen = [0]*n
  ans_snuke = [0]*n
  
  for cost, start, ans in zip([cost_yen, cost_snuke], [s-1, t-1], [ans_yen, ans_snuke]):
    already = [False]*n
    not_yet = [(0, start)]
    
    while len(not_yet) > 0:
      c, p = heappop(not_yet)
      if already[p]:
        continue
      ans[p] = c
      already[p] = True
      
      for value in tree[p]:
        if already[value]:
          continue
        heappush(not_yet, (ans[p]+cost[p][value], value))
  
  ans = [0]*n
  sub = 10**15
  for i in range(n-1, -1, -1):
    sub = min(sub, ans_yen[i]+ans_snuke[i])
    ans[i] = sub
  
  sub = 10**15
  for a in ans:
    print(sub-a)
      
  
  
  
if __name__ == "__main__":
  main()

### FIXED CODE ###

import sys
from heapq import *
input = sys.stdin.readline

def main():
  n, m, s, t = map(int, input().split())
  
  inf = pow(10, 15)
  
  tree = [[] for _ in range(n)]
  for i in range(m):
    u, v, a, b = map(int, input().split())
    tree[u-1].append((v-1, a, b))
    tree[v-1].append((u-1, a, b))
  
  ans_yen = [0]*n
  ans_snuke = [0]*n
  
  for start, ans in zip([s-1, t-1], [ans_yen, ans_snuke]):
    already = [False]*n
    not_yet = [(0, start)]
    
    while len(not_yet) > 0:
      c, p = heappop(not_yet)
      if already[p]:
        continue
      ans[p] = c
      already[p] = True
      
      for (value, a, b) in tree[p]:
        if already[value]:
          continue
        if start == s-1:
          cost = a
        else:
          cost = b
        heappush(not_yet, (c+cost, value))
  
  ans = [0]*n
  sub = inf
  for i in range(n-1, -1, -1):
    sub = min(sub, ans_yen[i]+ans_snuke[i])
    ans[i] = sub
  
  sub = inf
  for a in ans:
    print(sub-a)
      
  
  
  
if __name__ == "__main__":
  main()
# -*- coding: utf-8 -*-
"""
Created on Tue Mar 31 09:15:46 2020

@author: black
"""
def check(x):
    div = [1]
    for j in range(1, x):
        if (x)%(j+1) == 0:
            div.extend([j+1])
            if (i+1)%(j+1) == 0:
                div.extend([j+1])
    return len(div)




N = int(input())
ans = []

for x in range(1, N+1):
    if x%2 == 1:
        if check(x) == 8:
            ans.extend([x])


print(len(ans))

### FIXED CODE ###

# -*- coding: utf-8 -*-
"""
Created on Tue Mar 31 09:15:46 2020

@author: black
"""
def check(x):
    div = [1]
    for j in range(1, x):
        if (x)%(j+1) == 0:
            div.extend([j+1])
    return len(div)




N = int(input())
ans = []

for x in range(1, N+1):
    if x%2 == 1:
        if check(x) == 8:
            ans.extend([x])


print(len(ans))
S = input()
N,A,B = S.split(' ')
N = int(N)
A = int(A)
B = int(B)
till = int(N/(A+B))*(A+B)
left = N - till
leftover = ('b'*A + 'r'*B)[:left]
leftcount = leftover.count('b')
print(int(N/(A+B))*A + leftcount)

### FIXED CODE ###

S = input()
N,A,B = S.split(' ')
N = int(N)
A = int(A)
B = int(B)
ans = N //(A+B) * A
left = N % (A+B)
if left > A:
    ans += A
else:
    ans += left
print(ans)
a=list(input().split())
b=list(input().split())
c=list(input().split())
print(a[0]+b[1]+c[2])

### FIXED CODE ###

a=input()
b=input()
c=input()
print(a[0]+b[1]+c[2])
N,x = map(int,input().split())

lst = list( map(int,input().split() ) )

ans = sum(lst)

dp = lst[:]

#print(N,x)
#print(lst)


for i in range(1,N):
    tmp = 0
    for k in range(0,N):
        index_ = 0
        if(0 <= k-i):
            index_ = k-i
        else:
            index_ = N-i+k
        dp[k] = min(dp[k],lst[index_])
        tmp = tmp+dp[k]
    tmp = tmp + x*i
    ans = min(ans,tmp)

print(ans)

### FIXED CODE ###


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

lst = [a,b,c]

cnt = len(list( filter(lambda x:x%2==0,lst)))

if(0<cnt):
    print(0)
else:
    lst.sort()

    res = 0
    if(lst[2]%2 == 1):  
        res = lst[0]*lst[1]
    else:
        res = 0

    print(res)
def main():
    N = int(input())
    A = [int(i) for i in input().split()]
    cur = 1
    nums = []
    for i in range(N):
        if A[i] == 0:
            cur *= 1
            nums.append(0)
            continue
        #A[i] != 0
        cnt = 0
        for j, n in enumerate(nums):
            if n == A[i] - 1:
                if cnt == 0:
                    nums[j] += 1
                cnt += 1
        cur *= cnt
        cur %= 10**9+7
        # print(nums)
    m = [3, 6, 6]
    print((cur * m[len(nums)-1]) % 10**9+7)
main()

### FIXED CODE ###

# def i():
#     yield "100000"
#     a = 0
#     b = 0
#     c = 0
#     l = []
#     for i in range(100000):
#         import random
#         r = random.randint(0, 2)
#         if r == 0:
#             l.append(str(a))
#             a += 1
#         elif r == 1:
#             l.append(str(b))
#             b += 1
#         else:
#             l.append(str(c))
#             c += 1
#     yield " ".join(l)
# input = i().__next__
def main():
    N = int(input())
    A = [int(i) for i in input().split()]
    cur = 1
    nums = []
    for i in range(N):
        if A[i] == 0:
            cur *= 1
            nums.append(0)
            continue
        #A[i] != 0
        cnt = 0
        for j, n in enumerate(nums):
            if n == A[i] - 1:
                if cnt == 0:
                    if len(nums) <= j:
                        print(0)
                        return
                    nums[j] += 1
                cnt += 1
        cur *= cnt
        cur %= 10**9+7
        # print(nums)
    m = [0, 3, 6, 6]
    if len(nums) >= 4:
        print(0)
        return
    
    print((cur * m[len(nums)]) % (10**9+7))
main()
N = int(input())
li = list(map(int, input().split))
li.sort()
P = 0
for i in range(N):
  P += li[i*2]
print(P)

### FIXED CODE ###

N = int(input())
li = list(map(int, input().split()))
li.sort()
P = 0
for i in range(N):
  P += li[i*2]
print(P)
import queue
H , W = list(map(int, input().split()))
S = [input() for _ in range(H)]
Sum = 0
for i in range(H):
  for j in range(W):
    Sum += (S[i][j] == '#')
start = [1, 1, 1]
visited = [[0] * W for _ in range(H)]
visited[0][0] = 1
Q = queue.Queue()
Q.put(start)
now = start
while(now[:2] != [H, W] and not Q.empty()):
  now = Q.get()
  for i in range(2):
    for j in range(2):
      h = now[0] + ((-1) ** i + (-1) ** j) // 2
      w = now[1] + ((-1) ** i - (-1) ** j) // 2
      if(1 <= h and h <= H and 1 <= w and w <= W and visited[h - 1][w - 1] == 0 and S[h - 1][w - 1] == '.'):
        visited[h - 1][w - 1] = 1
        Q.put([h, w, now[2] + 1])
if(now[:2] == [H, W]):
  print(H * W - Sum - now[2])
else:
  print(-1)
      h = now[0] + (-1) ** i
      w = now[1] + (-1) ** j
      if(1 <= h and h <= H and 1 <= w and w <= W and visited[h - 1][w - 1] == 0):
        visited[h - 1][w - 1] = 1
        Q.put([h, w, now[2] + 1])
if(now[:2] == [H, W]):
  print(H * W - Sum - now[2])
else:
  print(-1)

### FIXED CODE ###

import queue
H , W = list(map(int, input().split()))
S = [input() for _ in range(H)]
Sum = 0
for i in range(H):
  for j in range(W):
    Sum += (S[i][j] == '#')
start = [1, 1, 1]
visited = [[0] * W for _ in range(H)]
visited[0][0] = 1
Q = queue.Queue()
Q.put(start)
now = start
while(now[:2] != [H, W] and not Q.empty()):
  now = Q.get()
  for i in range(2):
    for j in range(2):
      h = now[0] + ((-1) ** i + (-1) ** j) // 2
      w = now[1] + ((-1) ** i - (-1) ** j) // 2
      if(1 <= h and h <= H and 1 <= w and w <= W and visited[h - 1][w - 1] == 0 and S[h - 1][w - 1] == '.'):
        visited[h - 1][w - 1] = 1
        Q.put([h, w, now[2] + 1])
if(now[:2] == [H, W]):
  print(H * W - Sum - now[2])
else:
  print(-1)
S = input()
T = input()

cnt = 0

for i in range(len(s)-len(t)+1):
    same = 0
    for j in range(len(t)):
        if S[i + j] == T[j]:
            same += 1
        cnt = max(same, cnt)
print(len(t)-cnt)


### FIXED CODE ###

S = input()
T = input()

cnt = 0

for i in range(len(S)-len(T)+1):
    same = 0
    for j in range(len(T)):
        if S[i + j] == T[j]:
            same += 1
        cnt = max(same, cnt)
print(len(T)-cnt)
from sys import stdin
inf = 10**10
h,w = [int(x) for x in stdin.readline().rstrip().split()]
li = ["" for j in range(h)]
ma = 0
for i in range(h):
    s = stdin.readline().rstrip()
    li[i] = s
for i in range(h):
    for j in range(w):
        now_u = 0;now_b = 0;now_r = 0;now_l = 0
        while i+now_b < h:
            if li[i+now_b][j] == ".":
                now_b += 1
            else:
                now_b -= 1
                break
        while i-now_u >= 0:
            if li[i-now_u][j] == ".":
                now_u += 1
            else:
                now_u -= 1
                break
        while j+now_r < w:
            if li[i][j+now_r] == ".":
                now_r += 1
            else:
                now_r -= 1
                break
        while i-now_l >= 0:
            if li[i][j-now_l] == ".":
                now_l += 1
            else:
                now_l -= 1
                break
        point = now_u+now_b+now_r+now_l-2
        ma = max(ma,point)
print(ma)

### FIXED CODE ###

from sys import stdin
h,w = map(int,stdin.readline().rstrip().split())
li = [stdin.readline().rstrip() for _ in range(h)]
#各四方向のDPをつくる
L = [[0 for i in range(w)]for j in range(h)]
R = [[0 for i in range(w)]for j in range(h)]
D = [[0 for i in range(w)]for j in range(h)]
U = [[0 for i in range(w)]for j in range(h)]
ma = 0
for i in range(h):
    for j in range(w):
        if li[i][j] == "#":L[i][j] = 0
        elif j == 0:L[i][j] = 1
        else:L[i][j] = L[i][j-1]+1
for i in range(h):
    for j in range(w):
        if li[i][w-j-1] == "#":R[i][w-j-1] = 0
        elif w-j-1 == w-1:R[i][w-j-1] = 1
        else:R[i][w-j-1] = R[i][w-j]+1
for i in range(h):
    for j in range(w):
        if li[i][j] == "#":U[i][j] = 0
        elif i == 0:U[i][j] = 1
        else:U[i][j] = U[i-1][j]+1
for i in range(h):
    for j in range(w):
        if li[h-i-1][j] == "#":D[h-i-1][j] = 0
        elif h-i-1 == h-1:D[h-i-1][j] = 1
        else:D[h-i-1][j] = D[h-i][j]+1
for i in range(h):
    for j in range(w):
        point = L[i][j]+R[i][j]+D[i][j]+U[i][j]-3
        ma = max(ma,point)
print(ma)
from itertools import accumulate

n, m = map(int, input().split())
cards = [0] * (n+1)
for i in range(m):
  s, e = map(int, input().split())
  cards[s] += 1
  cards[e] -= 1
valids = accumulate(cards)
print(valids.count(n))

### FIXED CODE ###

from itertools import accumulate

n, m = map(int, input().split())
cards = [0] * (n+2)
for i in range(m):
  s, e = map(int, input().split())
  cards[s] += 1
  cards[e+1] -= 1
valids = list(accumulate(cards))
print(valids.count(m))
A,B=map(int,input().split())
sum =0
for i in range(2)
  if A >= B:
     sum+=A
      A-=1
   else:
      sum+=B
      B-=1
print(sum)

### FIXED CODE ###

A,B=map(int,input().split())
sum =0
for i in range(2):
  if A >= B:
     sum+=A
     A-=1
  else:
     sum+=B
     B-=1
print(sum)
# -*- coding: utf-8 -*-
n, m = map(int, input().split())
BIGNUM = 10 ** 9 + 7

last_ana = int(input())
blocks = [last_ana]

for _ in range(1, m):
    ana = int(input())
    blocks.append(ana - last_ana - 1)
    last_ana = ana

blocks.append(n - last_ana)

if 0 in blocks:
    ans = 0
else:
    b_max = max(blocks)

    c = [1, 1]
    for i in range(2, b_max):
        ctmp = c[i - 1] + c[i - 2]
        c.append(ctmp)

    ans = 1
    for num in blocks:
        ans = ans * c[num - 1]

print(ans % BIGNUM)

### FIXED CODE ###

# -*- coding: utf-8 -*-
n, m = map(int, input().split())
BIGNUM = 10 ** 9 + 7

if m > 0:
    last_ana = int(input())
    blocks = [last_ana]

    for _ in range(1, m):
        ana = int(input())
        blocks.append(ana - last_ana - 1)
        last_ana = ana
    blocks.append(n - last_ana)
else:
    blocks = [n + 1]

if 0 in blocks:
    ans = 0
else:
    b_max = max(blocks)
    c = [1, 1]
    for i in range(2, b_max):
        ctmp = c[i - 1] + c[i - 2]
        c.append(ctmp % BIGNUM)

    ans = 1
    for num in blocks:
        if num == 1:
            continue
        ans = (ans * c[num - 1]) % BIGNUM
        if ans == 0:
            break

print(ans)
n = list(map(int,input().split()))

p1 = (int(n[0]) + int(n[1]) * 1j)
p2 = (int(n[2]) + int(n[3]) * 1j)

p3 = (p2 - p1) * 1j + p2
p4 = p3 + (p1 - p2)

print(int(p3.real9), int(p3.imag), int(p4.real), int(p4.imag))

### FIXED CODE ###

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

p1 = (int(n[0]) + int(n[1]) * 1j)
p2 = (int(n[2]) + int(n[3]) * 1j)

p3 = (p2 - p1) * 1j + p2
p4 = p3 + (p1 - p2)

print(int(p3.real), int(p3.imag), int(p4.real), int(p4.imag))
s=input()
n=s.count("N")
w=s.count("W")
s=s.count("S")
e=s.count("E")
ns=n+s
we=w+e
if n>0 and w>0 and s>0 and e>0:
  print("Yes")
elif n>0 and w>0 and we==0:
  print("Yes")
elif ns==0 and s>0 and e>0:
  print("Yes")
else print("No")

### FIXED CODE ###

i=set(input())
if i=={"E","N","S","W"} or i=={"N","S"} or i=={"E","W"}:
    print("Yes")
else:
    print("No")
a,b,k = map(int,input().split())
m = []
for i in range(1,min(a,b)):
    if a%i == 0 and b%i == 0:
        m.append(i)

print(m[k-1])

### FIXED CODE ###

A, B, K = map(int, input().split())
 
cand = []
for i in range(100,0,-1):
  if A%i == 0 and B%i == 0:
    cand += [i]
    
    
print(cand[K-1])
N = int(input())
edge = sorted([tuple(map(int, input().split())) for _ in range(N)])
color = [0]*N

for u, v, w in edge:
    if w % 2 == 1 and color[u-1] == color[v-1]:
        color[v-1] ^= 1
    elif w % 2 == 0 and color[u-1] != color[v-1]:
        color[v-1] ^= 1

print(*color, sep='\n')

### FIXED CODE ###

from collections import deque

N = int(input())
edges = {i: [] for i in range(N)}
for _ in range(N-1):
    x, y, z = map(int, input().split())
    edges[x-1].append((y-1, z%2))
    edges[y-1].append((x-1, z%2))
color = [None]*N

q = deque([(0, 0)])
while q:
    v, c = q.popleft()
    color[v] = c
    for u, w in edges[v]:
        if color[u] is None:
            if w == 0:
                q.append((u, c))
            else:
                q.append((u, c^1))
print(*color, sep='\n')
input()
data = input(),split()
data.reverse()
print(' '.join(data))

### FIXED CODE ###

input()
data = input().split()
data.reverse()
print(' '.join(data))
import numpy as np
n = int(input())
A = np.zeros((4, 3, 10))
for _ in range(n):
    b, f, r, v = map(int, input().split())
    A[b-1, f-1, r-1] = v
for i in A:
    for v in i:
        v = [str(int(h)) for h in v]
        print(' '.join(v))
    print('####################')


### FIXED CODE ###

n = int(input())
A = [[0]*10 for i in range(12)] 

for _ in range(n):
    b, f, r, v = map(int, input().split())
    A[(b-1)*3 + (f-1)][r-1] += v
for i, v in enumerate(A, 1):
    print(' ' + ' '.join([str(p) for p in v]))
    if i == 3 or i == 6 or i == 9:
        print('####################')