Harryxun/stf_run huggingface dataset:
import sys
import itertools
# import numpy as np
import time
import math
import heapq
from collections import defaultdict
sys.setrecursionlimit(10 ** 7)
 
INF = 10 ** 18
MOD = 10 ** 9 + 7
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

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

A = [input() for _ in range(N)]
B = [input() for _ in range(M)]

def check(x, y):
    for i in range(M):
        for j in range(M):
            if A[y + i][x + j] != B[i][j]:
                return False
    return True

for i in range(N):
    for j in range(N):
        if check(i, j):
            print("Yes")
            exit()
print("No")



### FIXED CODE ###

import sys
import itertools
# import numpy as np
import time
import math
import heapq
from collections import defaultdict
sys.setrecursionlimit(10 ** 7)
 
INF = 10 ** 18
MOD = 10 ** 9 + 7
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

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

A = [input() for _ in range(N)]
B = [input() for _ in range(M)]

def check(x, y):
    for i in range(M):
        for j in range(M):
            if y + i >= N or x + j >= N:
                return False
            if A[y + i][x + j] != B[i][j]:
                return False
    return True

for i in range(N):
    for j in range(N):
        if check(i, j):
            print("Yes")
            exit()
print("No")
n = int(input())
s = input()
a = s.count("R")
b = s.count("G")
c = s.count("B")
z = a*b*c
if z ==0:
  print(0)
else:
  R=[]
  G=[]
  B=[]
  for i in range(n):
    if s[i]=="R":
      R.append(i)
    elif s[i]=="G":
      G.append(i)
    else:
      B.append(i)
  x = 0
  for i in R:
    for j in G:
      for k in B:
        if 2*j==i+k or 2*i==j+k or 2*k==i+j:
          x+=1
print(z-x)

### FIXED CODE ###

n = int(input())
s = input()
a = s.count("R")
b = s.count("G")
c = s.count("B")
z = a*b*c
R=[]
G=[]
B=[]
for i in range(n):
  if s[i]=="R":
    R.append(i)
  elif s[i]=="G":
    G.append(i)
  else:
    B.append(i)
x = 0
for i in R:
  for j in G:
    if 0 <= 2*j-i <= n-1 and s[2*j-i]=="B":
      x+=1
    if 0 <= 2*i-j <= n-1 and s[2*i-j]=="B":
      x+=1
    if (i+j)%2==0 and s[(i+j)//2]=="B":
      x+=1
print(z-x)
n = int(input())
s = input()
k = int(input())
for i in range(length(s))
	if s[i] != s[k]
  		s[i] = *


### FIXED CODE ###

input()
S=input()
k=int(input())
for s in S:print(s if s==S[k-1] else "*",end="")
a,b,t = input().split()
int(a)
int(b)
int(c)
print(b*(t//a))

### FIXED CODE ###

a,b,t=map(int,input().split())
i=1
ans=0
while i*a<=t+0.5:
    ans+=b
    i+=1
print(ans)
import heapq
x,y,z,k = map(int, input().split())
al = list(map(int, input().split()))
bl = list(map(int, input().split()))
cl = list(map(int, input().split()))
 
al.sort(reverse=True)
bl.sort(reverse=True)
cl.sort(reverse=True)
regist = set()
regist.add((0,0,0))
q = [(-1*(al[0]+bl[0]+cl[0]),0,0,0)]
heapq.heapify(q)
for _ in range(k):
    s,ai,bi,ci = heapq.heappop(q)
    print(-s,flush=True)
 
    if ai+1<x and (ai+1,bi,ci) not in regist:
        heapq.heappush(q, (-1*(al[ai+1]+bl[bi]+cl[ci]), ai+1,bi,ci))
        regist.add((ai+1,bi,ci))
 
    if bi+1<y and (ai,bi+1,ci) not in regist:
        heapq.heappush(q, (-1*(al[ai]+bl[bi+1]+cl[ci]), ai,bi+1,ci))
        regist.add((ai,bi+1,ci))
 
    if ci+1<z and (ai,bi,ci+1) not in regist:
        heapq.heappush(q, (-1*(al[ai]+bl[bi]+cl[ci+1]), ai,bi,ci+1))
        regist.add((ai,bi,ci+1))

### FIXED CODE ###

import itertools

X, Y, Z, K = map(int, input().split())
A = sorted(list(map(int, input().split())))
B = sorted(list(map(int, input().split())))
C = sorted(list(map(int, input().split())))

comb_ab = []
for a, b in itertools.product(A, B):
    comb_ab.append(sum([a, b]))

comb_ab_top = sorted(comb_ab, reverse=True)[:K]

comb_abc = []
for ab, c in itertools.product(comb_ab_top, C):
    comb_abc.append(sum([ab, c]))

ans = sorted(comb_abc, reverse=True)[:K]
print(*ans, sep='\n')
import math

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

if n == 1:
    print(abs(X-x[0]))
    exit()

x.append(X)

x.sort()

xx=[]

for i in range(1,n+1):
    xx.append(x[i]-x[i-1])

xxx = math.gcd(xx[0],xx[1])

if n == 2:
    print(xxx)
    exit()

for i in range(2,n):
    xxx=math.gcd(xxx,xx[i])
print(xxx)

### FIXED CODE ###

import fractions

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

xx = []

for i in range(n):
    xx.append(abs(x[i]-X))

if n == 1:
    print(xx[0])
else:
    xg = xx[0]
    for i in range(1,n):
        xg = fractions.gcd(xg,xx[i])
    print(xg)
N,P = map(int,input().split())
def prime_decomposition(n):
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:
      n /= i
      table.append(i)
    i += 1
  if n > 1:
    table.append(n)
  return table

M = prime_decomposition(P)
            
c = Counter(M)
temp = [i[0] for i in c.items() if i[1] >= N]
if temp == []:
  temp.append(1)
print(reduce(lambda x,y:x*y,temp))

### FIXED CODE ###

N,P = map(int,input().split())
i = round(P**(1/N))
res = []
if N == 1:
  print(P)
elif P == 1:
  print(1)
else:
  for i in range(i,0,-1):
    if P%i**N==0:
      print(i)
      break
from operator import itemgetter
n=int(input())
xl=[list(map(int,input().split()))for i in range(N)]
R=[list(xl[i][0]-xl[i][1],xl[i][0]+xl[i][1]) for i in range(n)]
r=sorted([(R[i][0],R[i][1]) for i in range(n)],key=itemgetter(1))
s=r[0][1]
ans=1
for i in range(1,n):
    if r[i][0]>s:
        s=r[i][1]
        ans+=1
print(ans)

### FIXED CODE ###

from operator import itemgetter
n=int(input())
xl=[list(map(int,input().split()))for i in range(n)]
R=[(xl[i][0]-xl[i][1],xl[i][0]+xl[i][1]) for i in range(n)]
r=sorted([(R[i][0],R[i][1]) for i in range(n)],key=itemgetter(1))
s=r[0][1]
ans=1
for i in range(n-1):
    if r[i+1][0]>=s:
        s=r[i+1][1]
        ans+=1
print(ans)
def solve(n, m, s):
    f = s[0]
    MOD = 10 ** 9 + 7

    p = None
    seq = 0
    max_seq = 0
    for c in s + '*':
        if c == p:
            seq += 1
        else:
            if p == f:
                max_seq = max(max_seq, seq)
            seq = 1
            p = c

    if max_seq == m:
        a, b = 1, 0
        for _ in range(n - 2):
            a, b = (a + b) % MOD, a % MOD
        return (3 * a + b) % MOD

    if n % 2 == 1:
        return 0

    ms = max_seq // 2 + 1

    dp = [0] * (n // 2 + 1)
    ap = [0] * (n // 2 + 1)
    dp[0] = 0
    ap[0] = 1
    for i in range(1, n // 2 + 1):
        j = max(-1, i - ms - 1)
        dp[i] = (ap[i - 1] - ap[j]) % MOD
        ap[i] = (ap[i - 1] + dp[i]) % MOD

    ans = 0
    for d in range(2, ms * 2 + 1, 2):
        ans = (ans + dp[(n - d) // 2] * d) % MOD

    return ans


n, m = map(int, input().split())
s = input()

print(solve(n, m, s))


### FIXED CODE ###

def solve(n, m, s):
    f = s[0]
    MOD = 10 ** 9 + 7
    INF = 10 ** 6

    p = None
    seq = 0
    min_seq = INF
    for c in s:
        if c == p:
            seq += 1
        else:
            if p == f and (min_seq == INF or seq % 2 == 1):
                min_seq = min(min_seq, seq)
            seq = 1
            p = c

    if min_seq == INF:
        a, b = 1, 0
        for _ in range(n - 2):
            a, b = (a + b) % MOD, a
        return (3 * a + b) % MOD

    if n % 2 == 1:
        return 0

    n2 = n // 2
    ms = min(n2, min_seq // 2 + 1)

    dp = [0] * (n2 + 1)
    dp[0] = 1
    acc, reject = 1, 0
    for i in range(1, n2 + 1):
        dp[i] = (acc - reject) % MOD
        acc = (acc + dp[i]) % MOD
        if i >= ms:
            reject = (reject + dp[i - ms]) % MOD

    ans = 0
    for d in range(1, ms + 1):
        ans = (ans + dp[n2 - d] * d * 2) % MOD

    return ans


n, m = map(int, input().split())
s = input()

print(solve(n, m, s))
import math

n = int(input())

ans = 0

for i in range(1,n+1):
  r = math.floor(math.sqrt(i))
  for x in range(1,r+1):
    for y in range(x,r+1):
      for z in range(y,r+1):
        if x**2 + y**2 + z**2 + x*y + y*z + z*x == i:
          if i == 12:
          if x == y and y == z:
            ans += 1
          elif x == y or y == z or z == x:
            ans += 3
          else:
            ans += 6
  print(ans)
  ans = 0

### FIXED CODE ###

import math

n = int(input())

ans = [0] * n

r = math.floor(math.sqrt(n))
for x in range(1,r+1):
  for y in range(x,r+1):
    for z in range(y,r+1):
      sum = x**2 + y**2 + z**2 + x*y + y*z + z*x
      if sum <= n:
        if x == y and y == z:
          ans[sum-1] += 1
        elif x == y or y == z or z == x:
          ans[sum-1] += 3
        else:
          ans[sum-1] += 6

for p in ans:
  print(p)
from collections import Counter
from math import factorial
N,M = map(int,input().split())

# 因数分解
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

# 重複組み合わせ
# フェルマーの小定理nHk≡(n+k−1)!⋅(k!)M−2⋅((n−1)!)M−2(modM)
def comb(n,k,p):
    """power_funcを用いて(nCk) mod p を求める"""
    if n<=0 or k<0 or n<k: return 0
    if k==0　or n==1: return 1
    a=factorial(n+k-1) %p
    b=factorial(k) %p
    c=factorial(n-1) %p
    return (a*power_func(b,p-2,p)*power_func(c,p-2,p))%p

def power_func(a,b,p):
    """a^b mod p を求める"""
    if b==0: return 1
    if b%2==0:
        d=power_func(a,b//2,p)
        return d*d %p
    if b%2==1:
        return (a*power_func(a,b-1,p ))%p

a = prime_factorize(M)
c = Counter(a)
l = []
ans = 1
for i in c.values():
    # それぞれの余りがわかっている時、その積の余りを求める時は以下
    ans *= comb(N,i,10**9+7)
    ans %= 10**9+7

print(ans)

### FIXED CODE ###

from collections import Counter
import math
mod = 10**9+7
N,M = map(int,input().split())
factors = []
f = 2
while M%f==0:
    M//=2
    factors.append(f)
f = 3
while f*f<=M:
    if M%f==0:
        M//=f
        factors.append(f)
    else:
        f+=2
if M!=1:
    factors.append(M)
count = Counter(factors)

def choose(n,k):
    return math.factorial(n)//(math.factorial(n-k)*math.factorial(k))
ans = 1
for v in count.values():
    ans *= choose(N+v-1,N-1)
    ans %= mod
print(ans)
#include <stdio.h>
#include <string.h>
#include <math.h>

int main(void){
        int N = 0;
        scanf("%d", &N);
        int l[N];
        for (int i = 0; i < N; i++) {
                        scanf("%d", &l[i]);
        }
        int tmp = -1;
        int sum = 0;
        for (int i = 0; i < N; i++) {
                        if (tmp < l[i]) tmp = l[i];sum += l[i];
        }
        printf("%d\n",sum - tmp / 2);
//      for (int i = 0; i < N; i++) {
//                      printf("%d\n",l[i]);
//      }
        return 0;
}

### FIXED CODE ###

N=int(input())
L=[int(input()) for _ in range(N)]

ans=sum(L)-max(L)/2
print(int(ans))
from collections import deque
import bisect

N, M = map(int, input().split(" "))
As = [0]+list(map(int, input().split(" ")))
As = sorted(As)
cnt = 0
cnt2 = 1
for _ in range(M):
  i = As[-1-cnt]  
  i = i//(2**cnt2)
  if i < As[-1-cnt-1]:
    cnt += 1
    cnt2 = 1
    bisect.insort_left(As,i)
  else:
    cnt2 += 1

print(sum(As[:-cnt]))


### FIXED CODE ###

n = input()
weather = {0:"Sunny", 1:"Cloudy", 2:"Rainy"}

           
for k, v in weather.items():
  if v == n:
    nk = k
    break

nk = (nk+1) % 3

print(weather[nk])
from bisect import bisect_left, bisect_right
a, b, q = map(int, input().split())
s = [int(input()) for _ in range(a)]
t = [int(input()) for _ in range(b)]
q = [int(input()) for _ in range(q)]
for qi in q:
    qans = 10**18
    ai = bisect_left(s, qi)
    bi = bisect_left(t, qi)
    ac = []
    bc = []
    for i in range(2):
        if (0 <= ai + i < a):
            ac.append(ai + i);
        if (0 <= ai - i < a):
            ac.append(ai - i);
    for i in range(2):
        if (0 <= bi + i < b):
            bc.append(bi + i);
        if (0 <= bi - i < b):
            bc.append(bi - i);
    for i in ac:
        for j in bc:
            aa = s[i];
            bb = t[j];
            if (max(aa, bb) <= qi):
                qans = min(qans, qi - min(aa, bb))
            elif (qi <= min(aa, bb)):
                qans = min(qans, max(aa, bb) - qi)
            else:
                qans = min(qans, min(abs(aa - qi), abs(bb - qi)) * 2 + max(abs(aa - qi), abs(bb - qi)))
    print(qans)


### FIXED CODE ###

s = input()
b = s.split("/")
a = []
for i in b:
    a.append(int(i))
if (a[0] * 10000 + a[1] * 100 + a[2] <= 20190430):
    print("Heisei")
else:
    print("TBD")
import math

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

def main(i):
  blue = int(math.factorial(k-1) / (math.factorial(i-1) * math.factorial(k-i)))
  red = int(math.factorial(n-k+1) / (math.factorial(n-k+1-i) * math.factorial(i)))
  print((blue*red) % (10**9 + 7))

for i in range(1, k+1):
  if i > n-k+1:
    print('0')
  else:
   main(i)

### FIXED CODE ###

import math
 
n,k = map(int, input().split())
 
def main(i):
  blue = math.factorial(k-1) // (math.factorial(i-1) * math.factorial(k-i))
  red = math.factorial(n-k+1) // (math.factorial(n-k+1-i) * math.factorial(i))
  print((blue*red) % (10**9 + 7))
 
for i in range(1, k+1):
  if i > n-k+1:
    print('0')
  else:
   main(i)
from sys import stdin, exit
from math import factorial
input = stdin.readline
lmi = lambda: list(map(int, input().split()))
mi = lambda: map(int, input().split())
si = lambda: input().strip('\n')
ssi = lambda: input().strip('\n').split()

def choose(x):
  return factorial(x)/(2*factorial(x-2))

words = {}

for i in range(int(input())):
    s = "".join(sorted(si()))
    if s not in words:
        words[s] = 1
    else:
        words[s] += 1
ans = 0
print(words)
for i in words:
    ans += choose(words[i])
print(int(ans))

### FIXED CODE ###

from sys import stdin, exit
from math import factorial
input = stdin.readline
lmi = lambda: list(map(int, input().split()))
mi = lambda: map(int, input().split())
si = lambda: input().strip('\n')
ssi = lambda: input().strip('\n').split()

def choose(x):
  return factorial(x)/(2*factorial(x-2))

words = {}

for i in range(int(input())):
    s = "".join(sorted(si()))
    if s not in words:
        words[s] = 1
    else:
        words[s] += 1
ans = 0
for i in words:
    if words[i] == 1: continue
    ans += choose(words[i])
print(int(ans))
from collections import deque

def bfs():
    global ans
    que = deque([])
    for i in range(h):
        for j in range(w):
           if A[i][j] == "#":
               que.append((i, j))
               d[i][j] = 0
            
    while que:
        p = que.popleft()
        dx = [1, 0, -1, 0]
        dy = [0, 1, 0, -1]
        for k in range(len(que)):
            i = 0
            while i < 4: 
                nx = p[0] + dx[i]
                ny = p[1] + dy[i]
                if 0 <= nx < w and 0 <= ny < h and A[nx][ny] != "#" and d[nx][ny] == float("inf"):
                    d[nx][ny] = d[p[0]][p[1]] + 1
                    A[nx][ny] = "#"
                    que.append((nx, ny))
                i += 1
    ans = 0
    for i in range(h):
        for j in range(w):
            ans = max(ans, d[i][j])


h, w = map(int, input().split())
A = [list(input()) for _ in range(h)]
d = [[float("inf")] * w for _ in range(h)]
ans = 0
bfs()

print(ans)

### FIXED CODE ###

from subprocess import call
call (('pypy3', '-c', """
from collections import deque

def main():
    h, w = map(int, input().split())
    A = [list(input()) for _ in range(h)]
    d = [[10**9] * w for _ in range(h)]
    que = deque([])
    
    for i in range(h):
        for j in range(w):
           if A[i][j] == "#":
               que.append([i, j])
               d[i][j] = 0
           else:
               d[i][j] = 10 ** 9
            
    while que:
        x, y = que.popleft()
        dx = [1, 0, -1, 0]
        dy = [0, 1, 0, -1]
        for i in range(4): 
            nx = x + dx[i]
            ny = y + dy[i]
            if 0 <= nx < h and 0 <= ny < w and d[nx][ny] == 10**9:
                d[nx][ny] = d[x][y] + 1
                que.append([nx, ny])
    ans = 0
    for i in range(h):
        for j in range(w):
            ans = max(ans, d[i][j])
    print(ans)
    
    return
    
main()

"""))
N = int(input())
A = []
for i in range(N):
   A.append(input())
S = 0
for i in range(N-1):
    if A[i][-1] == A[i+1][0]:
        S += 1
B = 0
for i in range(N):
    for j in range(N):
        if A[i] == A[j]:
            B += 1
            else:
                B += 0

if S == N-1 and B == N:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

N = int(input())
A = []
for i in range(N):
   A.append(input())
S = 0
for i in range(N-1):
    if A[i][-1] == A[i+1][0]:
        S += 1
B = 0
for i in range(N):
    for j in range(N):
        if A[i] == A[j]:
            B += 1
        else:
            B += 0

if S == N-1 and B == N:
    print('Yes')
else:
    print('No')
n = int(input())
lst_a = list(map(int, input().split()))

def gcd(a, b):
    if b==0:
        return a
    else:
        gcd(b, a%b)

ans = lst_a[0]
for a in lst_a:
    # 配列の最初からひとつずつ最大公約数を取っていけばよい。
    ans = gcd(ans, a)

print(ans)

### FIXED CODE ###

# import math
import fractions
from functools import reduce

def gcd_list(lst):
    # return reduce(math.gcd, lst)
    return reduce(fractions.gcd, lst)

N = int(input())
lst_monsters = map(int, input().split())
print(gcd_list(lst_monsters))
while True:
    n, x = [int(i) for i in input().split()]

    if n == x == 0:
        break

    count = 0
    for s in range(1, n - 1):
        for m in range(s + 1, n):
            for e in range(m + 1, n + 1):
                if x == sum(s, m, e):
                    count += 1

    print(count)

### FIXED CODE ###

while True:
    n, x = [int(i) for i in input().split()]

    if n == x == 0:
        break

    count = 0
    for s in range(1, n - 1):
        for m in range(s + 1, n):
            for e in range(m + 1, n + 1):
                if x == s+m+e:
                    count += 1

    print(count)
# -*- coding: utf-8 -*-
"""
Created on Sun Mar 22 10:29:00 2020

@author: azikausy
"""

from collections import deque
S = list(input())
Q = int(input())
#Query = {}
#TFC = []
perm = 0
d =deque(S)
for i in range(0, Q):
    l = input().split()
    if len(l) == 1:
        #Query[i] = [l[0], 0, 0]
        #S.reverse()
        perm += 1
    else:
        #Query[i] = l
        if (int(l[1])+perm) % 2 == 0:
            d.append(l[2])
        else:
            d.insert(0, l[2])

S0 = list(d)
if perm % 2 != 0:
    S0.reverse()
ans = ""
for i in range(0, len(S0)):
    ans = ans + S0[i]
print(ans)


### FIXED CODE ###

from collections import deque
S = list(input())
Q = int(input())
perm = 0
d = deque(S)

for i in range(0, Q):
    l = input().split()
    if len(l) == 1:
        perm += 1
    else:
        if (int(l[1])+perm) % 2 == 0:
            d.append(l[2])
        else:
            d.appendleft(l[2])
 
S0 = list(d)
if perm % 2 != 0:
    S0.reverse()
ans = ""
for i in range(0, len(S0)):
    ans = ans + S0[i]
print(ans)
import string
n = input()
s = string.ascii_lowercase - set(n)

if len(s) == 0:
    print('None')
else:
    print(min(s))

### FIXED CODE ###

import string
n = input()
s = set(string.ascii_lowercase) - set(n)

if len(s) == 0:
    print('None')
else:
    print(min(s))
from fractions import gcd

n, x = map(int, input().split())
x_lis = [abs(int(i)-x) for i in input().split()]

ans = x_lis[0]
for i in range(n):
	ans = gcd(ans, x[i])
	if ans == 1:
		break
print(ans)

### FIXED CODE ###

from fractions import gcd

n, x = map(int, input().split())
x_lis = [abs(int(i)-x) for i in input().split()]

ans = x_lis[0]
for i in range(n):
	ans = gcd(ans, x_lis[i])
	if ans == 1:
		break
print(ans)
# coding: utf-8
S = input()
cnt = {}
flg = True
for s in S:
  if s in cnt:
    cnt[s] = 1
  else:
    cnt[s] += 1
for i in cnt.values():
  if j % 2 != 0:
    flg = False
print('Yes' if flg else 'No')

### FIXED CODE ###

# coding: utf-8
S = input()
cnt = {}
flg = True
for s in S:
  if s not in cnt:
    cnt[s] = 1
  else:
    cnt[s] += 1
for i in cnt.values():
  if i % 2 != 0:
    flg = False
print('Yes' if flg else 'No')
N = int(input())
a = list(map(int,input().split()))
one = 0
four = 0
two = 0

for j in range(N):

  if a[j]%2 == 1:
    one += 1
  elif a[j]%4 == 0:
    four += 1
  else :
    two +=1

  
if one =< four:
  print('Yes')
else :
  if two == 0:
    if four == one-1:
      print('Yes')
  else:
    print('No')

### FIXED CODE ###

N = int(input())
a = list(map(int,input().split()))
one = 0
four = 0
two = 0

for j in range(N):

  if a[j]%2 == 1:
    one += 1
  elif a[j]%4 == 0:
    four += 1
  else :
    two +=1

print("Yes" if four >= one or (four == one - 1 and two == 0) else "No")
k=int(input())
mal=1      
n=list(map(int,input().split()))
      
          
for i in range(0,len(n)):
    mal=mal*n[i]
    if(mal>10**18and n[i]!=0):
            mal=-1
            break
        if(n[i]==0):
        mal=0
        break
print(mal)

        
           


### FIXED CODE ###

k=int(input())
mal=1      
n=list(map(int,input().split()))
      
          
for i in range(0,len(n)):
    mal=mal*n[i]
    if(mal>10**18):
            mal=-1
            break
for j in range(0,len(n)):
    if(n[j]==0):
        mal=0
print(mal)
D = input()
if D ==25:
    print('Christmas')
elif D == 24:
    print('Christmas Eve')
elif D == 23:
    print('Christmas Eve Eve')
else D == 22:
    print('Christmas Eve Eve Eve')

### 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')
S,W = map(int, input().split())
print "unsafe" if W >= S else "safe"


### FIXED CODE ###

S, W = map(int, input().split())
print("unsafe" if W >= S else "safe")
N,X=map(int, input().split())
m=[input() for i in range(N)]
t=int(min(m))

for i in range(N):
    X-=int(m[i])
if X>=t:
    x=X//t
print(N+x)
    


### FIXED CODE ###

N,X=map(int, input().split())
m=[int(input()) for i in range(N)]
t=min(m)
#print(t)
for i in range(N):
    X-=m[i]
if X>=t:
    x=X//t
else:
    x=0
print(N+x)
def search(i, total):
  for dist, to in edges[i]:
    if dists[to] == None:
      dists[to] = total + dist
      if not search(to, total + dist):
        return False
    else:
      if dists[to] == total + dist:
        continue
      else:
        return False
  return True

n, m = map(int, input().split())
edges = [[] for _ in range(n)]
for _ in range(m):
  l, r, d = map(int, input().split())
  l -= 1
  r -= 1
  edges[l].append((d, r))
  edges[r].append((-d, l))

dists = [None] * n

for i in range(n):
  if dists[i] == None:
    dists[i] = 0
    if not search(i, 0):
      print("No")
      break
else:
  print("Yes")

### FIXED CODE ###

import sys
sys.setrecursionlimit(1000000)
def search(i, total):
  for dist, to in edges[i]:
    if dists[to] == None:
      dists[to] = total + dist
      if not search(to, total + dist):
        return False
    else:
      if dists[to] == total + dist:
        continue
      else:
        return False
  return True

n, m = map(int, input().split())
edges = [[] for _ in range(n)]
for _ in range(m):
  l, r, d = map(int, input().split())
  l -= 1
  r -= 1
  edges[l].append((d, r))
  edges[r].append((-d, l))

dists = [None] * n

for i in range(n):
  if dists[i] == None:
    dists[i] = 0
    if not search(i, 0):
      print("No")
      break
else:
  print("Yes")
from collections import Counter

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

new = [key for key, val in Counter(a).most_common() if val == 1]
dp = [0] * 100010

for i in new:
    temp = i
    while i <= 100000:
        dp[i] += 1
        i += temp

ans = 0
for i in new:
    if dp[i] == 1:
        ans += 1
print(ans)


### FIXED CODE ###

from collections import Counter

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

# new = [key for key, val in Counter(a).most_common() if val == 1]
prime = [1] * 1000010

for i in set(a):
    # if prime[i]:
    for j in range(i + i, 1000001, i):
        prime[j] = 0

c = Counter(a)
ans = 0
for i in a:
    if prime[i] and c[i] == 1:
        ans += 1
print(ans)