Harryxun/stf_run huggingface dataset:
H,W = map(int,input().split())
h,w = map(int,input().split())
print(H*W-h*W-wH+h*w)

### FIXED CODE ###

H,W = map(int,input().split())
h,w = map(int,input().split())
print(H*W-h*W-w*H+h*w)
#!/usr/bin/env python3
import sys
from collections import Counter
from scipy.special import comb

def solve(N: int, s: "List[str]"):
    print(sum([comb(v, 2, exact=True) for v in Counter(s).itervalues()]))

def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    s = [ ' '.join(sorted(next(tokens))) for _ in range(N) ]  # type: "List[str]"
    solve(N, sorted(s))

if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys
from collections import Counter
from scipy.misc import comb

def solve(N: int, s: "List[str]"):
    print(sum([comb(v, 2, exact=True) for v in Counter(s).values()]))

def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    s = [ ' '.join(sorted(next(tokens))) for _ in range(N) ]  # type: "List[str]"
    solve(N, sorted(s))

if __name__ == '__main__':
    main()
import math
a,b = int(input())
Z = a*b:
  print(Z)


### FIXED CODE ###

a,b =map(int,input().split())
if 1 <= a <=100 and 1 <= b <= 100:
     print(a*b)
a,b,c=map(int,input().split())
if abs(a-b)<=d or abs(a-c)<=d:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

a,b,c,d=map(int,input().split())
if abs(a-c)<=d:
  print('Yes')
elif abs(a-b)<=d and abs(b-c)<=d:
  print('Yes')
else:
  print('No')
a,b,c,d=map(int,input().split())
if abs(a-c)<= d 
    print("Yes")
elif abs(a-b)<=d and abs(b-c)<=d:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

a,b,c,d=map(int,input().split())
if abs(a-c)<= d: 
    print("Yes")
elif abs(a-b)<=d and abs(b-c)<=d:
    print("Yes")
else:
    print("No")
s=input()
K=int(input())
 
ans=[]
ans.append(s)
 
 
for i in range(len(s)-1):
 for j in range(i+1):
  cut_s=s[j:j+len(s)-i-1]
  if cut_s not in ans:
   ans.append(cut_s)
   ans.sort()
 
answer=ans[K-1]
print(answer)

### FIXED CODE ###

s=input()
K=int(input())
 
ans=[]
ans.append(s)
 
 
for i in range(len(s)):
 for j in range(len(s)-i):
  cut_s=s[i:i+j+1]
  ans.append(cut_s)
  ans=sorted(set(ans))
  if len(ans)>K:
   if cut_s==ans[K]:
     ans.pop()
     break;
   ans.pop()
 
answer=ans[K-1]
print(answer)
s=input()
if s[3]==s[2] and s[5]==s[4]:
print('Yes')
else:
print('No')

### FIXED CODE ###

s=list(input())
if s[3]==s[2] and s[5]==s[4]:
	print('Yes')
else:
	print('No')
def merge(A,left,mid,right):
    global cnt
    n1=mid-left
    n2=right-mid
    L=[]
    R=[]
    for i in range(n1):
        L.append(A[left+i])
    for j in range(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[0]+=1
        else:
            A[k]=R[j]
            j=j+1
            cnt[0]+=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()))

cnt=[0]
mergeSort(S,0,n)
print(*S)
print(cnt[0])



### 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)
(x, a, b) = (int(tok) for tok in input().split())
print((x - a) % b)

### FIXED CODE ###

x = int(input())
a = int(input())
b = int(input())

print((x - a) % b)
def lcm(a,b):
    m = a*b
    while a != 0 and b != 0:
        if a > b:
            a %= b
        else:
            b %= a
    return m // (a+b)

print(lcm(int(input()), int(input())))




### FIXED CODE ###

def lcm(a,b):
    m = a*b
    while a != 0 and b != 0:
        if a > b:
            a %= b
        else:
            b %= a
    return m // (a+b)
a, b = tuple(map(int, input().split()))
print(lcm(a, b))
n, k = map(int, input().split())
a = [i-1 for i in map(int, input().split())]

left, right = 0, 10**9
while left < right:
    middle = (left+right)//2
    count = 0
    for i in a:
        count += i//middle
    
    if count <= k:
        right = middle
    else:
        left = middle + 1

print(left)

### FIXED CODE ###

n, k = map(int, input().split())
a = [i-1 for i in map(int, input().split())]

left, right = 0, 10**9
while left < right:
    middle = (left+right)//2
    if middle==0:
        left=1
        break
    count = 0
    for i in a:
        count += i//middle
    
    if count <= k:
        right = middle
    else:
        left = middle + 1

print(left)
#!/usr/bin/python3
# -*- coding: utf-8 -*-

import sys

def main():
    c = tuple(tuple(map(int, line.split())) for line in sys.stdin.readlines())
    for i in range(101):
        b = [c[0][0] - i]
        for j in range(101):
            b.append(c[1][1] - j)
            for k in range(101):
                b.append(c[2][2] - k)
                a = (i, j, k)
                flg = False
                for l in range(3):
                    for m in range(3):
                        if a[l] + b[m] != c[l][m]:
                            flg = True
                            break
                    if flg == True:
                        break
                else:
                    print('Yes')
                    sys.exit()
    else:
        print('No')

if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/python3
# -*- coding: utf-8 -*-

import sys

def main():
    n = int(input())
    a = int(input())
    if (n % 500) > a:
        print('No')
    else:
        print('Yes')

if __name__ == '__main__':
    main()
import copy
N, K = map(int, input().split())
L = [list(map(int, input().split())) for i in range(N)]
dic = {}
ans = []
uniq = []
etc = []
def calc_ans(ans):
    x = 0
    tmp = 0
    for i in range(K):
      tmp += ans[i][0]
      x += ans[i][1]
    tmp += x * x
    return tmp

for l in L:
    if dic.get(l[0]):
        dic[l[0]].append(l[1])
    else:
        dic[l[0]] = [l[1]]
for t in dic.keys():
    dic[t].sort(reverse=True)
    uniq.append((dic[t][0], t))
uniq.sort(reverse=True)
for i in range(K):
  ans.append((uniq[i][0], 1))
  for n in dic[uniq[i][1]][1:]:
      if n > uniq[K-1][0]:
          etc.append((n, 0))
etc.sort(reverse=True)
for n in etc:
    ans_res = calc_ans(ans)
    tmp = copy.copy(ans)
    tmp[-1] = n
    tmp_res = calc_ans(tmp)
    if ans_res > tmp_res:
        print(ans_res)
        exit()
    else:
        ans = copy.copy(tmp)
print(tmp_res)

### FIXED CODE ###

N,K = map(int,input().split())
td = [[int(i) for i in input().split()] for _ in range(N)]
td.sort(key=lambda x:x[1],reverse=True)
ans = 0
ls = set()
dl = []
for i in range(K):
    ans += td[i][1]
    if not td[i][0] in ls:
        ls.add(td[i][0])
    else:
        dl.append(td[i][1])
ans = ans + len(ls)**2
res = ans
for i in range(K,N):
    if not dl:
        break
    if td[i][0] in ls:
        continue
    ans += len(ls)*2+1
    ans += td[i][1]
    ans -= dl[-1]
    del dl[-1]
    res = max(res,ans)
    ls.add(td[i][0])
print(res)
ciar = input().split()
W,H,x,y,r = [ciar[0],ciar[1],ciar[2],ciar[3],ciar[4]]
if (x + r) <= W and (y + r) <= H and (y - r) >= 0 and (x -r) >= 0:
    print("Yes")
else :
    print("No")

### FIXED CODE ###

ciar = input().split()
W = int(ciar[0])
H = int(ciar[1])
x = int(ciar[2])
y = int(ciar[3])
r = int(ciar[4])
if (x + r) <= W and (x - r) >= 0 :
    if (y + r) <= H and (y - r) >= 0 :
        print("Yes")
    else :
        print("No")
else :
    print("No")
a,b,c,k = map(int,input().split())
m = min(k,a)
if m == k :
    n = 0
    l = 0
n = min(k-a,b)
if n == k=a :
    l = 0
l = min(k-a-b,c)
print(1*m+0*n+(-1)*l)

### FIXED CODE ###

a,b,c,k = map(int,input().split())
if k <= a :
    print(k)
else :
    m = min(k,a)
    k -= a

    if k <= b :
        print(a)
    else :
        n = min(k,b)
        k -= b
        l = k
        print(1*m+(-1)*l)
abcd = list(input())
pirnt("Yes") if abcd[2]==abcd[3]==abcd[1] or abcd[0]==abcd[1]==abcd[2] else print("No")

### FIXED CODE ###

abcd = list(input())
print("Yes") if abcd[2]==abcd[3]==abcd[1] or abcd[0]==abcd[1]==abcd[2] else print("No")
s = [input()]
q = int(input())

for _ in range(q):
    a = list(input().split())
    if len(a) == 1:
        s.reverse()
    else:
        if a[1] == "1":
            s.reverse()
            s += a[-1]
            s.reverse()
        else:
            s += a[-1]
print("".join(s))

### FIXED CODE ###

s = list(input())
if s[0] == s[1] and s[1] == s[2]:
    print("No")
else:
    print("Yes")
S = input()
for _ in range(int(input())):
    l = input().split()
    if len(l) == 1:
        S = S[::-1]
    else:
        if l[1] == "1":
            S = l[2] + S
        else:
            S = S + l[2]
print(S)

### FIXED CODE ###

if len(set(input())) == 1:
    print("No")
else:
    print("Yes")
N=int(input().strip())
primes=sorted(eratosthenes(int(1e5)))
p_set=set(primes)
primes2=[]
for p in primes:#MlogM
    if (p+1)//2 in p_set:
        primes2.append(p)
for i in range(N):#N
    l,r=map(int,input().split())
    li=binsearch_lb(primes2,l)#l以上のインデックス logM
    ri=binsearch_ub(primes2,r)#r以下のインデックス
    print(ri-li+1)

### FIXED CODE ###

def eratosthenesAray(N):
    prime=[True]*(N+1)
    prime[0]=False
    prime[1]=False
    for i in range(2,N+1):
        if prime[i]:
            for j in range(i+i,N+1,i):
                prime[j]=False
    return prime

N=int(input().strip())
primes=eratosthenesAray(100000)
ruiseki=[0]*100001
for i in range(1,100001):
    ruiseki[i]=ruiseki[i-1]
    if primes[i] and primes[(i+1)//2]:
        ruiseki[i]+=1
for i in range(N):#N
    l,r=map(int,input().split())
    print(ruiseki[r]-ruiseki[l-1])
# -*- coding: utf-8 -*-

def list_n():
    return [int(e) for e in input().split()]


def list_s():
    return [s for e in input().split()]


def main(s):
    ret = []
    for c in s:
        if c in ['0', '1']:
            ret.append(c)
        else:
            if c:
                ret.pop()
    return ''.join(ret)


if __name__ == '__main__':
    s = input()
    print(main(s))


### FIXED CODE ###

# -*- coding: utf-8 -*-

def list_n():
    return [int(e) for e in input().split()]


def list_s():
    return [s for e in input().split()]


def main(s):
    ret = []
    for c in s:
        if c in ['0', '1']:
            ret.append(c)
        else:
            if ret:
                ret.pop()
    return ''.join(ret)


if __name__ == '__main__':
    s = input()
    print(main(s))
k,n = map(int,input(),split())
a = list(map(int,input().split()))
a.append(a[0])
m = 11414114514
 
for i in range(n):
  m = min(m,a[i+1]-a[i])
  
print(k-m)

### FIXED CODE ###

k,n = map(int,input().split())
a = list(map(int,input().split()))
tm = a[0]
a.append(tm)
m = -9878789894545656
 
for i in range(n-1):
  m = max(m,a[i+1]-a[i])
  
m = max(m,a[0]+k-a[n-1])
  
print(k-m)
N = int(input())
Red = [list(map(int, input().split())) for _ in range(N)]
Blue = [list(map(int, input().split())) for _ in range(N)]

Red.sort(key=lambda x: x[1], reverse=True)
Blue.sort(key=lambda x: x[0])

ans = 1
for blue in Blue:
    for red in Red:
        if red[0] < b[0] and red[1] < b[1]:
            ans += 1
            Red.remove(red)
            break

print(ans)


### FIXED CODE ###

N = int(input())
Red = [list(map(int, input().split())) for _ in range(N)]
Blue = [list(map(int, input().split())) for _ in range(N)]

Red.sort(key=lambda x: x[1], reverse=True)
Blue.sort(key=lambda x: x[0])

ans = 0
for blue in Blue:
    for red in Red:
        if red[0] < blue[0] and red[1] < blue[1]:
            ans += 1
            Red.remove(red)
            break

print(ans)
import sys
input = sys.stdin.readline
import numpy as np
from scipy.sparse.csgraph import connected_components
from scipy.sparse import csr_matrix

N, M, K  = (int(i) for i in input().split())
graph = np.zeros((N+1, N+1))
graph2 = [[0] * (N+1) for i in range(N+1)]

#ABC = [[int(i) for i in input().split()] for i in range(N)]
for i in range(M):
    A, B =  (int(i) for i in input().split())
    graph[A][B] = 1
    graph[B][A] = 1
    graph2[A][B] = 1
    graph2[B][A] = 1

for j in range(K):
    A, B =  (int(i) for i in input().split())
    graph2[A][B] = -1
    graph2[B][A] = -1

#graph = np.array(graph)
#print(graph)
#print(graph2)
n, labels = connected_components(graph)

#print(n)
# 2
#print(labels)

for i in range(1, N+1):
    count = 0
    for j in range(1,N+1):
        if i == j:
            continue
        if graph2[i][j] == 0 and labels[i] == labels[j]:
            #print(i, j)
            count += 1
    print(count)


### FIXED CODE ###

import sys
input = sys.stdin.readline

class UnionFind:
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * (n+1)

    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 size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

N, M, K  = (int(i) for i in input().split())

#graph = np.zeros((N+1, N+1))
#graph2 = [[0] * (N+1) for i in range(N+1)]
uf = UnionFind(N)
fblist = [0] * (N+1)

for i in range(M):
    A, B =  (int(i) for i in input().split())
    uf.union(A, B)
    fblist[A] += 1
    fblist[B] += 1
 
for j in range(K):
    A, B =  (int(i) for i in input().split())
    if uf.same(A, B):
        fblist[A] += 1
        fblist[B] += 1

for i in range(1, N+1):
    print(uf.size(i) - fblist[i] - 1, end=" ")

print()
x,y,z=map(int,input().split())
def sort(a,b):
    tmp=a
    a=b
    b=tmp
sort(x,y)
sort(x,z)
print(f"{z} {x} {y}")

### FIXED CODE ###

x,y,z=map(int,input().split())
print(z,x,y)
age,money=map(int, input()).split()
assert 1<=age<=100 and 2<=b<=1000 and b%2==0
if age<=5:
    print('0')
elif 6<=age<=12:
    print(money/2)
else:
    print(money)


### FIXED CODE ###

try:
    age,money=map(int, input().split())
    assert 0<=age<=100 and 2<=money<=1000 and money%2==0
    if age<=5:
        print('0')
    elif 6<=age<=12:
        print(money//2)
    else:
        print(money)
except AssertionError:
    print('')
import math
print(2*math.pi*R)

### FIXED CODE ###

print(int(input())*6.3)
N, K = map(int,input().split())	
S = input()
S = S.replace(S[K],S[K].lower(),1)
print(S)

### FIXED CODE ###

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

#print(S[K-1])
S = (S[:K-1] + S[K-1].lower() + S[K:])
print(S)
import math
n  = int(input())
 
ans = math.factional(n)
 
s = 10**9 + 7
 
print(ans % s)

### FIXED CODE ###

import math
n  = int(input())
 
ans = math.factorial(n)
 
s = 10**9 + 7
 
print(ans % s)
import math
A, B = map(int,input().split())
for i in range(1000):
    if math.floor(i * 0.08) == A:
        result = i
        break
if math.floor(result * 0.1) == B:
    print(result)
else:
    print('-1')


### FIXED CODE ###

import math
A, B = map(int,input().split())
for i in range(10000):
    if math.floor(i * 0.08) == A and math.floor(i * 0.1) == B:
        print(i)
        break
    elif i == 9999:
        print(-1)
import collections

s=list(input())
t=list(input())

ss=collections.Counter(s)
tt=collections.Counter(t)

s_v = ss.values().sorted()
t_v = tt.values().sorted()

if s_v == t_v:
    print("Yes")
else:
    print("No")


### FIXED CODE ###

import collections

s=list(input())
t=list(input())

ss=collections.Counter(s)
tt=collections.Counter(t)

s_v = sorted(ss.values())
t_v = sorted(tt.values())

if s_v == t_v:
    print("Yes")
else:
    print("No")
N, x = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
ans=0
for i in range(N)
  x = x-a[i]
  if x>=0:
    ans+=1
  else:
    break
print(ans)

### FIXED CODE ###

N, x = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
ans=0
for i in range(N):
  x = x-a[i]
  if x>=0:
    ans+=1
  else:
    break
if x>0:
  print(ans-1)
else:
  print(ans)
from functools import reduce
from operator import add
n = int(input())

p = []

for i in range(n):
    p.append(int(input()))

sp = sorted(p, reverse=True)

sp[0] = int(sp[0] / 2)

print(reduce(add, sp))

### FIXED CODE ###

d = int(input())

if d == 25:
    print('Christmas')
elif d == 24:
    print('Christmas Eve')
elif d == 23:
    print('Christmas Eve Eve')
elif d == 22:
    print('Christmas Eve Eve Eve')
n,m = map(int,input().split())
ab = sorted([list(map(int,input().split())) for _ in range(m)])
relaypoint = []
i = 0
while(ab[i][0] == 1):
  relaypoint.append(ab[i][1])
  i += 1
ab.sort(key = lambda ab:ab[1],reverse = True)
relaypoint = list(set(relaypoint))
x = len(relaypoint)
j = 0
flag = 0
while(ab[j][1] == n):
  if ab[j][0] in relaypoint:
    flag = 1
  j += 1
if flag == 1:
  print("POSSIBLE")
else:
  print("IMPOSSIBLE")

### FIXED CODE ###

n,m = map(int,input().split())
ab = sorted([list(map(int,input().split())) for _ in range(m)])
relaypoint = []
for i in range(m):
  if ab[i][0] == 1:
    relaypoint.append(ab[i][1])
  else:
    break
ab.sort(key = lambda ab:ab[1],reverse = True)
relaypoint = set(relaypoint)
x = len(relaypoint)
j = 0
flag = 0
while(ab[j][1] == n):
  if ab[j][0] in relaypoint:
    flag = 1
  j += 1
if flag == 1:
  print("POSSIBLE")
else:
  print("IMPOSSIBLE")
n = int(input())

def find(x, par):
  if par[x] < 0:
    return x
  
  par[x] = find(par[x], par)
  return par[x]

def union(x, y, par):
  if find(x, par) == find(y, par):
    return
  
  if par[par[x]] > par[par[y]]:
    x, y = y, x
  par[x] += par[par[y]]
  par[y] = x


def main():
  ball = [tuple(map(int, input().split())) for i in range(n)]

  ans = n
  for i in range(n):
    for j in range(n):
      p, q = ball[i][0] - ball[j][0], ball[i][1] - ball[j][1]
      par = [-1]*n
      for s in range(n):
        for t in range(n):
          x, y = ball[s][0] - ball[t][0], ball[s][1] - ball[t][1]
          if x == p and y == q:
            union(s, t, par)
      judge = set()
      for k in range(n):
        judge.add(find(k, par))
      if ans > len(judge):
        ans = len(judge)
  print(ans)

  
main()

### FIXED CODE ###

import sys
from collections import deque
input = sys.stdin.readline

def main():
  n = int(input())
  ball = [tuple(map(int, input().split())) for i in range(n)]

  ans = n
  for i in range(n):
    for j in range(n):
      p, q = ball[i][0] - ball[j][0], ball[i][1] - ball[j][1]
      par = [-1]*n
      node = [[] for i in range(n)]
      for s in range(n):
        for t in range(n):
          x, y = ball[s][0] - ball[t][0], ball[s][1] - ball[t][1]
          if x == p and y == q:
            node[s].append(t)
            node[t].append(s)
      already = [False]*n
      count = 0
      for k in range(n):
        if already[k]:
          continue
        count += 1
        already[k] = True
        not_yet = deque([k])
        while not_yet:
          key = not_yet.pop()
          for v in node[key]:
            if already[v]:
              continue
            already[v] = True
            not_yet.append(v)
      if ans > count:
        ans = count
  print(ans)

  
main()
X=list(map(int,input().split()))
#X軸に並行
if X[2]-X[0]==0:
    if X[3]-X[1]>0:
        q=X[3]-X[1]
        U="U"
        D="D"
    else:
        q=X[1]-X[3]
        U="U"
        D="D"
    print(U*(q+1)+R*2+D*(q+2)+L*2+U+L+U*q+R*2+D*q+L)
#Y軸に並行
if X[3]-X[1]==0:
    if X[2]-X[0]>0:
        p=X[2]-X[0]
        R="R"
        L="L"
    else:
        p=X[0]-X[2]
        R="L"
        L="R"
    print(R*(p+1)+U*2+L*(p+2)+D*2+R+D+R*p+U*2+L*p+D)

if X[2]-X[0]!=0 and X[3]-X[1]!=0
    if X[2]-X[0]>0:
        p=X[2]-X[0]
        R="R"
        L="L"
    else:
        p=X[0]-X[2]
        R="L"
        L="R"
    if X[3]-X[1]>0:
        q=X[3]-X[1]
        U="U"
        D="D"
    else:
        q=X[1]-X[3]
        U="D"
        D="U"
    print(U*p+R*(q+1)+D*(p+1)+L*(q+1)+U+L+U*(p+1)+R*(q+1)+D*(p+1)+L*q)  

### FIXED CODE ###

sx, sy, tx, ty = map(int, input().split())

higth = ty - sy
width = tx - sx

ans = ''
ans += 'U' * higth
ans += 'R' * width
ans += 'D' * higth
ans += 'L' * width
ans += 'L' + 'U' * (higth + 1)
ans += 'R' * (width + 1) + 'D'
ans += 'R' + 'D' * (higth + 1)
ans += 'L' * (width + 1) + 'U'
print(ans)
import numpy as np

sheet=[input().split() for l in range(3)]
n=int(input())
b=[input() for i in range(n)]
a=np.array(sheet)
i,j,k,c,z=0,0,0,0,0

for i in range(3):
    for j in range(3):
        for k in range(n):
            if a[i][j]==b[k]:
                a[i][j]="x"


if a[0][0]==a[1][1]==a[2][2]=="x":
    c+=1

if a[0][2]==a[1][1]==a[2][0]=="x":
    c+=1

for z in range(3):
    if a[0][z]==a[1][z]==a[2][z]=="x":
        c+=1
    if a[z]][0]==a[z][1]==a[z][1s]=="x":
        c+=1
if c!=0:
    print("Yes")
else:
    print("No")


### FIXED CODE ###

import numpy as np

sheet=[input().split() for l in range(3)]
n=int(input())
b=[input() for i in range(n)]
a=np.array(sheet)
i,j,k,c,z=0,0,0,0,0

for i in range(3):
    for j in range(3):
        for k in range(n):
            if a[i][j]==b[k]:
                a[i][j]="x"


if a[0][0]==a[1][1]==a[2][2]=="x":
    c+=1

if a[0][2]==a[1][1]==a[2][0]=="x":
    c+=1

for z in range(3):
    if a[0][z]==a[1][z]==a[2][z]=="x":
        c+=1
    if a[z][0]==a[z][1]==a[z][2]=="x":
        c+=1
if c!=0:
    print("Yes")
else:
    print("No")
if S == 'SUN':
    print(7)
elif S == 'MON':
    print(6)
elif S == 'TUE':
    print(5)
elif S == 'WED':
    print(4)
elif S == 'THU':
    print(3)
elif S == 'FRI':
    print(2)
elif S == 'SAT':
    print(1)
else:
    print('間違ってます')

### FIXED CODE ###

S = str(input())

if S == 'SUN':
    print(7)
elif S == 'MON':
    print(6)
elif S == 'TUE':
    print(5)
elif S == 'WED':
    print(4)
elif S == 'THU':
    print(3)
elif S == 'FRI':
    print(2)
elif S == 'SAT':
    print(1)
import sys
sy=sys.stdin.readline

n=int(sy())
dp=[[] for _ in range(n+1)]
lis=[[] for _ in range(n+1)]
dp[0],dp[1],dp[2]=0,1,1
c1=int(sy())
c2=int(sy())
lis[c1]+=[1]
lis[c2]+=[2]
for i in range(3,n+1):
    c1=c2
    c2=int(sy())
    if c1==c2 or lis[c2]==[]:
        dp[i]=dp[i-1]
    else:
        dp[i]=dp[i-1]+dp[lis[c2][-1]]
    lis[c2]+=[i]
print(dp[n])

### FIXED CODE ###

import sys
sy=sys.stdin.readline

n=int(sy())
if n==1:
    print(1)
    quit()
dp=[0]*(n+1)
lis=[0]*(2*10**5+1)
dp[0],dp[1],dp[2]=0,1,1
c1=int(sy())
c2=int(sy())
lis[c1]=1
lis[c2]=2
for i in range(3,n+1):
    c1=c2
    c2=int(sy())
    if c1==c2 or lis[c2]==0:
        dp[i]=dp[i-1]
    else:
        dp[i]=dp[i-1]+dp[lis[c2]]
    lis[c2]=i
    dp[i]%=1000000007
print(dp[n])