Harryxun/stf_run huggingface dataset:
N = int(input())
# h,n,w
flag = False
for i in range(1,3500):
    for j in range(1,3500):
        if((N*i*j)%(4*i*j - N*i - N*j) == 0 and (N*i*j)/(4*i*j - N*i - N*j) > 0):
            w = int((N*i*j)%(4*i*j - N*i - N*j))
            h = i
            n = j
            flag = True
            break
    if flag:
        break

print(h,n,w)

### FIXED CODE ###

N = int(input())
flag = False
for i in range(1,3500):
    for j in range(1,3500):
        if((4*i*j - N*i - N*j) > 0 and (N*i*j)%(4*i*j - N*i - N*j) == 0):
            w = int((N*i*j)/(4*i*j - N*i - N*j))
            h = i
            n = j
            flag = True
            break
    if flag:
        break

print(h,n,w)
n = int(input())

sayTable = []
for i in range(n):
	a = int(input())
	
	sayArray = []
	for j in range(a):
		x, y = [int(v) for v in input().split()]
		sayArray.append((x-1, y+1))
	sayTable.append(sayArray)

def count(honest):
	count = 0
	for v in honest:
		if v == 2:
			count += 1
	return count

def checkHonest(sayArray, honest):
	for x, y in sayArray:
		if y == 2 and honest[x] != 2:
			return False
	return True

def checkHonestAll(sayTable, honest):
	for i in range(n):
		h = honest[i]
		if h != 2:
			continue
		sayArray = sayTable[i]
		for x, y in sayArray:
			if y != honest[x]:
				return False
	return True

def setHonest(sayArray, honest):
	for x, y in sayArray:
		honest[x] = y

def search(sayTable, honest, i):
	if i >= n;
		if checkHonestAll(sayTable, honest):
			return count(honest)
		else:
			return 0

	count = 0
	h = honest[i]
    sayArray = sayTable[i]
	if (h == 0 or h == 2) and checkHonest(sayArray, honest):
		copyHonest = honest[:]
		setHonest(sayArray, copyHonest)
		copyHonest[i] = 2
		c = search(sayTable, copyHonest, i+1)
		if count < c:
			count = c

	honest[i] = 1
	c = search(sayTable, honest, i+1)
	if count < c:
		count = c
	return count

print(search(sayTable, [0] * n, 0));


### FIXED CODE ###

n = int(input())

sayTable = []
for i in range(n):
	a = int(input())
	
	sayArray = []
	for j in range(a):
		x, y = [int(v) for v in input().split()]
		sayArray.append((x-1, y+1))
	sayTable.append(sayArray)

def countHonest(honest):
	count = 0
	for v in honest:
		if v == 2:
			count += 1
	return count

def checkHonest(sayArray, honest):
	for x, y in sayArray:
		if honest[x] == 0:
				continue
		if y == 2 and honest[x] != 2:
			return False
	return True

def checkHonestAll(sayTable, honest):
	for i in range(n):
		h = honest[i]
		if h != 2:
			continue
		sayArray = sayTable[i]
		for x, y in sayArray:
			if y != honest[x]:
				return False
	return True

def setHonest(sayArray, honest):
	for x, y in sayArray:
		honest[x] = y

def search(sayTable, honest, i):
	if i >= n:
		if checkHonestAll(sayTable, honest):
			return countHonest(honest)
		else:
			return 0

	count = 0
	h = honest[i]
	sayArray = sayTable[i]
	if (h == 0 or h == 2) and checkHonest(sayArray, honest):
		copyHonest = honest[:]
		setHonest(sayArray, copyHonest)
		copyHonest[i] = 2
		c = search(sayTable, copyHonest, i+1)
		if count < c:
			count = c

	honest[i] = 1
	c = search(sayTable, honest, i+1)
	if count < c:
		count = c
	return count

print(search(sayTable, [0] * n, 0))
def main():
  import sys
  input = sys.stdin.readline
  n, k = map(int, input().split())
  arr = list(map(int, input().split()))
  dp = [1000000000] * n
  dp[0] = 0
  for i in range(1, n):
    for j in range(max(0, i - k), i):
    dp[i] = min(dp[i], dp[j] + abs(arr[i] - arr[j]))
  print(dp[-1])
main()  

### FIXED CODE ###

def main():
  import sys
  input = sys.stdin.readline
  n, k = map(int, input().split())
  arr = list(map(int, input().split()))
  dp = [1000000000] * n
  dp[0] = 0
  for i in range(1, n):
    for j in range(max(0, i - k), i):
      dp[i] = min(dp[i], dp[j] + abs(arr[i] - arr[j]))
  print(dp[-1])
main()
N = list(input())
for i in range(len(N)+1):
  if N[i] in'ACGT':
    N[i] += 1
    N[i+1] = N[i]
  else:
    N[i] = 0
print(max(N))


### FIXED CODE ###

N = list(input())
dp = [0]*(len(N)+1)
for i in range(len(N)):
  if N[i] in'ACGT':
    dp[i] += 1
    dp[i+1] = dp[i]
  else:
    dp[i] = 0
print(max(dp))
N, K = list(map(int, input().split()))


def check(k, hs, mx, mn):
    if k == 0:
        return mx - mn
    r = []
    for i, h in enumerate(hs):
        hs.remove(h)
        r.append(check(k - 1, hs, max(mx, h), min(mn, h)))
        hs.insert(i, h)
    return min(r)


def main():
    hs = [int(input()) for i in range(N)]
    print(check(K, hs, 0, 10 ** 9))


if __name__ == '__main__':
    main()


### FIXED CODE ###

def main():
    N, K = list(map(int, input().split()))
    hs = [int(input()) for i in range(N)]
    hs.sort()
    i = 0
    r = 10 ** 9
    while True:
        if i + K > N:
            break
        r = min(r, hs[i + K - 1] - hs[i])
        i += 1
    print(r)


if __name__ == '__main__':
    main()
n, k = (int(x) for x in input().split())
count = 0
s = [[0 for i in range(n)] for j in range(k)]

for i in range(n):
    for j in range(k):
        if i == 0 or s[i][j] != s[i - 1][j]:
            count += 1

print(count)

### FIXED CODE ###

n, k = (int(x) for x in input().split(' '))
print(k*(k-1)**(n-1))
while True:
    try:
        d = int(raw_input())
    except EOFError:
        break
    rects = map(lambda x:d*x*x,range(d, 600, d))
    print reduce(lambda x,y:x+y,rects)

### FIXED CODE ###

while True:
    try:
        d = int(raw_input())
    except EOFError:
        break
    if d == 600:
        print 0
    else:
        rects = map(lambda x:d*x*x,range(d, 600, d))
        print reduce(lambda x,y:x+y,rects)
from math import factorial

n, a, b = map(int, input().split())
v = list(map(int, input().split()))
v.sort(reverse=True)

n1 = v.count(v[a - 1])
n2 = v[:a].count(v[:a][a - 1])

print(sum(v[:a]) / a)
if len(set(v[:a])) != 1:
	if n1 == n2:
		print(1)
	else:
		print(int(factorial(n1) / (factorial(n2) * factorial(n1 - n2))))
else:
	ans = 0
	if n1 == 1:
		print(1)
	else:
		for i in range(a, b + 1):
			ans += int(factorial(n1) / (factorial(i) * factorial(n1 - i)))
		print(int(ans))

### FIXED CODE ###

from math import factorial

n, a, b = map(int, input().split())
v = list(map(int, input().split()))
v.sort(reverse=True)

n1 = v.count(v[a - 1])
n2 = v[:a].count(v[:a][a - 1])

print(sum(v[:a]) / a)
if len(set(v[:a])) != 1:
	if n1 == n2:
		print(1)
	else:
		print(int(factorial(n1) / (factorial(n2) * factorial(n1 - n2))))
else:
	ans = 0
	if n1 == 1:
		print(1)
	else:
		for i in range(a, min(n1 + 1, b + 1)):
			ans += int(factorial(n1) / (factorial(i) * factorial(n1 - i)))
		print(int(ans))
A, B= map(int, input().split())
ans = max(A+B, A-B, A*B)
print async 

### FIXED CODE ###

A, B= map(int, input().split())
ans = max(A+B, A-B, A*B)
print(ans)
n = int(input())
x = int(input())
t = int(input())

if(n%x==0):
  count = n/x
else:
  count = n/x + 1

print(count*t)

### FIXED CODE ###

n = []
n = input().split()
n_1 = int(n[0])
x = int(n[1])
t = int(n[2])
 
if(n_1%x==0):
  count,mod = divmod(n_1,x)
else:
  count,mod = divmod(n_1,x)
  count = count + 1
 
print(count*t)
N, M = map(int, input().split())

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

for i in range(N-M+1):
  for _ in range(A[i].count(B[0])):
    l = A[i].index(B[0], l)
    result = True
    for k in range(1, M):
      if B[k] != A[i+k][l:l+len(B[k])]:
        result = False
        break
    if result:
      print("Yes")
      exit()
    l += 1
      
print("No")

### FIXED CODE ###

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

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

for i in range(N-M+1):
  for _ in range(A[i].count(B[0])):
    l = A[i].index(B[0])
    result = True
    for k in range(1, M):
      if B[k] != A[i+k][l:l+len(B[k])]:
        result = False
        break
    if result:
      print("Yes")
      exit()
    l += 1
      
print("No")
s = input()
count = 0
for i in range(3):
  if s[i] == 'R':
    count++
if count <= 1 || count == 3:
  print(count)
elif s[1] != 'S':
  print(count-1)
else:
  print(count)
  

### FIXED CODE ###

s = input()
count = 0
for i in range(3):
  if s[i] == 'R':
    count+=1
if count <= 1 or count == 3:
  print(count)
elif s[1] != 'R':
  print(count-1)
else:
  print(count)
a = input()
a = [int(i) for i in a]
if sum(a) >= 22:
    print("bust")
else:
    print("win")

### FIXED CODE ###

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

if sum(a) >= 22:
    print("bust")
else:
    print("win")
x=int(input())

b=0

while 1:
  a5=x+b**5
  a=a5**0.2
  if a-int(a)==0:
    print(int(a),b)
    exit()
  
  a5=x-b**5
  a=a5**0.2
  if a-int(a)==0:
    print(int(a),-b)
    exit()
  
  b+=1

### FIXED CODE ###

x=int(input())

def rt5(a):
  if a==0:
    return 0
  i=1
  while 1:
    s=i**5
    if a==s:
      return i
    elif a==-s:
      return -i
    elif abs(a)<s:
      return False
    i+=1

b=0

while 1:
  a5=x+b**5
  a=rt5(a5)
  if a==False:
    pass
  else:
    print(a,b)
    exit()
  
  a5=x-b**5
  a=rt5(a5)
  if a==False:
    pass
  else:
    print(a,-b)
    exit()
  b+=1
N = int(input())
V = list(map(int, input().split()))
alist = []
tmp = 0

def cook(N, V, alist, tmp):
    if N = 1:
        print(V[0])
    
    else:
        V.sort()
        for i in range(0, N, 2):
            if i + 1 > N - 1:
                alist.append(V[i])
                
            else:
                tmp = (V[i] + V[i +1]) / 2
            alist.append(tmp)
            
        N = len(alist)
        V = alist
        alist = []
        tmp = 0
        cook(N, V, alist, tmp)
        
cook(N, V, alist, tmp)

### FIXED CODE ###

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

v.sort()

r = v[0]

for i in v[1::]:
    r = (r + i) / 2

print(r)
N, S = [int(i) for i in input().split()]
A = [int(i) for i in input().split()]
MOD =   998244353
DP = [[0 for p in range(S+1)]for x in range(N)]
ans = N * (A[0]==S)
DP[0][A[0]] = 1
for n,a in enumerate(A):
    if n==0:continue
    #もらう
    for p in range(a):
        DP[n][p] = DP[n-1][p]
    for p in range(a,S+1):
        DP[n][p] = DP[n-1][p] + DP[n-1][p-a]
    #初期化
    DP[n][a] += n+1
    ans += (DP[n][S]*(N-n))% MOD
    DP[n][S] = 0
    ans %= MOD
print(ans)

### FIXED CODE ###

N, S = [int(i) for i in input().split()]
A = [int(i) for i in input().split()]
MOD =   998244353
DP = [[0 for p in range(S+1)]for x in range(N)]
ans = N * (A[0]==S)
if A[0]<=S:
    DP[0][A[0]] = 1
for n,a in enumerate(A):
    if n!=0:
        #もらう
        for p in range(a,S+1):
            DP[n][p] += DP[n-1][p-a]
        for p in range(S+1):
            DP[n][p] += DP[n-1][p]
            DP[n][p] %= MOD
        #初期化
        if a<=S:DP[n][a] += n+1
    ans += (DP[n][S]*(N-n))% MOD
    DP[n][S] = 0
    ans %= MOD
print(ans)
N,D = map(int,input(),split())
a = (N-1)/(2*D)
if (N-1)%(2*D)==0:
	print(a)
else:
 	print((N-1)//(2*D+1))


### FIXED CODE ###

N,D = map(int,input().split())
a = N//(2*D+1)
if N%(2*D+1) == 0:
	print(a)
else:
 	print(a+1)
a, b = map(int(), input().split())
c = a * b
d = c % 2
if d == 0:
    print("Odd")
else:
    print("Even")

### FIXED CODE ###

a, b = map(int, input().split())
c = a * b
d = c % 2
if d == 0:
    print("Even")
else:
    print("Odd")
import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        String a = s.nextLine();
        String b = s.nextLine();
        String c = b.concat(a);
        System.out.println(c);
    }
}


### FIXED CODE ###

s = input().split()
print(s[1]+s[0])
N, Q = input().split()
S = input()
for i in range(int(Q)):
    l, r = (int(x) for x in input().split())
    sub_S = S[l-1:r]
    count = 0
    print('hoge')

### FIXED CODE ###

b = input()

if b ==	'A':
    print('T')
elif b == 'T':
    print('A')
elif b =='C':
    print('G')
elif b == 'G':
    print('C')
n = int(input())
index = list(map(int, input().split()))
energy = []
for p in range(min(index), max(index)):
    sum = 0
    for xi in index:
        sum += (xi-p)**2
    energy.append(sum)
print(min(energy))

### FIXED CODE ###

n = int(input())
index = list(map(int, input().split()))
energy = []
for p in range(min(index), max(index)+1):
    sum = 0
    for xi in index:
        sum += (xi-p)**2
    energy.append(sum)
print(min(energy))
def how_many_times_divisible(n):
	ans = 0
	while n % 2 == 0:
		n /= 2
		ans += 1
	return ans

n = int(raw_input())
a = map(int, input().split())
ans = min(map(how_many_times_divisible, a))

print ans


### FIXED CODE ###

def how_many_times_divisible(n):
	ans = 0
	while n % 2 == 0:
		n /= 2
		ans += 1
	return ans

n = int(input())
a = map(int, input().split())
ans = min(map(how_many_times_divisible, a))

print(ans)
def main():
  n = int(input())
  print((n - 1) * n) // 2)



if __name__ == "__main__":
  main()

### FIXED CODE ###



def main():
    n = int(input())
    print( (n * (n- 1) ) // 2)


if __name__ == "__main__":
    main()
import math
a, b, x = map(int, input().split())
print(math.degrees(math.atan(2*b/a-2*x/a/a/a if x >= a*a*b/2 else a*b*b/2/x)


### FIXED CODE ###

import math
a, b, x = map(int, input().split())
if x >= a*a*b/2:
  print(math.degrees(math.atan(2*b/a-2*x/a/a/a)))
else:
  print(math.degrees(math.atan(a * b * b / 2 / x)))
n=int(input())
a=list(map(int,input().split()))
result = False


if a[0]^a[1] == a[2]:
    if a[1]^a[2] == a[3]:
        if a[n-2]^a[n-1] == a[0]:
            if a[n-1]^a[0] == a[1]:
                result = True

if result:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

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

a_unique = list(set(a))

if n == 3:
    if a_unique[0]^a_unique[1] == a_unique[2]:
        result = True
    
elif len(a_unique) == 3:
    if a_unique[0]^a_unique[1] == a_unique[2]: 
        if a.count(a_unique[0]) == a.count(a_unique[1]) and a.count(a_unique[1]) == a.count(a_unique[2]):
            result = True

elif len(a_unique) == 1:
    if a_unique[0]^a_unique[0] == a_unique[0]:
        result = True

elif len(a_unique) == 2:
    if a_unique.count(a_unique[0]) == 1:
        if a_unique[0]^a_unique[1] == a_unique[1]:
            if a_unique[1]^a_unique[1] == a_unique[0]:
                if a.count(a_unique[0])*2 == a.count(a_unique[1]):
                    result = True
    elif  a_unique.count(a_unique[1]) == 1:
        if a_unique[0]^a_unique[1] == a_unique[0]:
            if a_unique[0]^a_unique[0] == a_unique[1]:
                if a.count(a_unique[1])*2 == a.count(a_unique[0]):
                    result = True

if len(a_unique) > 3:
    result = False    
            
if result:
    print("Yes")
else:
    print("No")
from math import gcd
from functools import reduce
n = int(input())
a = list(map(int, input().split()))

tmp = [set() for _ in range(10**2+1)]
for i in range(2, 10**2//2+1):
    for j in range(i, 10**2+1, i):
        tmp[j].add(i)


flag = False
for i in range(n-1):
    if len(tmp[a[i]] & tmp[max(a)]) > 0:
        flag = True
        break

if flag == False:
    print("pairwise coprime")
else:
    if reduce(gcd, a) == 1:
        print("setwise coprime")
    else:
        print("not coprime")

### FIXED CODE ###

from math import gcd
from functools import reduce
n = int(input())
a = list(map(int, input().split()))

# sieve[n]は、その数を最初にふるいに落とした数を格納
def prime_factor_table(n):
    # sieveとはふるいの意味
    sieve = [i for i in range(n+1)]
    # n以下の整数を最初にふるい落とす数(√n以下に必ず存在)を求める.
    for i in range(2, int(n**0.5)+1):
        if sieve[i] == i:
            for j in range(2*i, n+1, i):
                if sieve[j] == j:
                    sieve[j] = i
    return sieve

sieve = prime_factor_table(10**6+1)

def prime_factor(n):
    # 素数は英語でprime number
    prime = set()
    while n > 1:
        prime.add(sieve[n])
        n //= sieve[n]
    return prime

for i, v in enumerate(a):
    if i == 0:
        tmp = prime_factor(v)
    else:
        prime = prime_factor(v)
        for j in prime:
            if j in tmp:
                if reduce(gcd, a) == 1:
                    print("setwise coprime")
                    exit()
                else:
                    print("not coprime")
                    exit()
            tmp.add(j)
print("pairwise coprime")
for i in range(0, 3000):
    array = map(int, input().split(' '))
    if x == 0 and y == 0:
        break
    else:
        print(' '.join(map(str, sorted(array))))


### FIXED CODE ###

for i in range(0, 3000):
    array = [int(x) for x in input().split(' ')]
    if array[0] == 0 and array[1] == 0:
        break
    else:
        print(' '.join([str(x) for x in sorted(array)]))
a =set()
n = int(input())
for _ in range(n):
    tmp = int(input()) 
    if tmp in a:
        a.remove(tmp)
    else:
        a.append(tmp)
print(len(a))

### FIXED CODE ###

from collections import Counter
a =[]
n = int(input())
for _ in range(n):
    a.append(int(input()))
b = Counter(a).values()
print(sum([i % 2 for i in b]))
n,z,w = map(int,raw_input().split())
arr = map(int,raw_input().split())
print max(abs(arr[-1]-w),abs(arr[-1]-arr[-2]))


### FIXED CODE ###

'''input
4
4 3 2 1
'''
n,z,w = map(int,raw_input().split())
arr = map(int,raw_input().split())
if n > 1:
	print max(abs(arr[-1]-w),abs(arr[-1]-arr[-2]))
else:
	print abs(arr[-1]-w)
n = int(input())
v = list(map(int,input().split()))
c = list(map(int,input().split()))
cnt == 0
for i in range(len(n)):
    if v[i] > c[i]:
        cnt += (v[i] - c[i])
    else:
        cnt += 0
print(cnt)        


### FIXED CODE ###

n = int(input())
v = list(map(int,input().split()))
c = list(map(int,input().split()))
cnt = 0
for i in range(n):
    if v[i] > c[i]:
        cnt += (v[i] - c[i])
print(cnt)
n,m = map(int, input().split())
H = list(map(int, input().split()))
s = [[0]]*m
 
for _  in range(m):
    a, b = map(int, input().split())
    s[a-1].append(H[b-1])
    s[b-1].append(H[a-1])
 
c = 0
for j in range(n):
    if H[j] > max(s[j]):
        c+= 1
 
print(c) 


### FIXED CODE ###

n, m = map(int, input().split())
h = list(map(int, input().split()))
sore = [[0] for i in range(n)]
for i in range(m):
    road = list(map(int, input().split()))
    sore[road[0]-1].append(h[road[1]-1])
    sore[road[1]-1].append(h[road[0]-1])
ans = 0
for i in range(n):
    if h[i] > max(sore[i]):
        ans+=1
print(ans)
a=int(input())
print(a+a＊＊2+a＊＊3)

### FIXED CODE ###

a=int(input())
print(a+a**2+a**3)
S = raw_input()

s = S % 60
h = (S - S % 3600) / 3600
m = (S - s - h * 3600) / 60

print h + ':' + m + ':' + s

### FIXED CODE ###

S = input()
h = S / 3600
s = S % 60
m = (S - h * 3600 - s) / 60

print "%d:%d:%d" %(h,m,s)
a = int(input())
b = int(input())
  
print(str(a*b)+""+str(a*2 + b*2))

### FIXED CODE ###

z = input()
m,l = z.split()
s = int(m) * int(l)
n = int(m)*2 + int(l)*2

print("{} {}".format(str(s),str(n)))
N, M = map(int, input().split())
loved_by_everyone = [0] * M
for _ in range(N):
    like_list = list(map(int, input().split()))
    for like in like_list[1:]:
        loved_by_everyone[like] += 1

kinds = 0
for food in loved_by_everyone:
    kinds += 1 if food == N else 0
print(kinds)


### FIXED CODE ###

N, M = map(int, input().split())
loved_by_everyone = [0] * M
for _ in range(N):
    like_list = list(map(int, input().split()))
    for like in like_list[1:]:
        loved_by_everyone[like-1] += 1

kinds = 0
for food in loved_by_everyone:
    kinds += 1 if food == N else 0
print(kinds)
import sys
INFTY=sys.maxsize

def readinput():
    n=int(input())
    nList=[]
    for _ in range(n+1):
        nList.append([])
    for _ in range(1,n):
        u,v,w=map(int,input().split())
        nList[u].append((v,w))
        nList[v].append((u,w))

    return n,nList

WHITE=0
GRAY=1
BLACK=2
status=[]
color=[]

def dfs(s,nList):
    for u,w in nList[s]:
        if status[u]==WHITE:
            if w%2==0:
                color[u]=color[s]
            else:
                color[u]=(color[s]+1)%2
            status[u]=GRAY
            dfs(u,nList)
    status[s]=BLACK

def main(n,nList):
    global status
    global color

    status=[WHITE]*(n+1)
    color=[WHITE]*(n+1)
    dfs(1,nList)

    for i in range(1,n+1):
        print(color[i])
    

if __name__=='__main__':
    n,nList=readinput()
    main(n,nList)
    #print(ans)


### FIXED CODE ###

import sys
INFTY=sys.maxsize
sys.setrecursionlimit(100000)

def readinput():
    n=int(input())
    nList=[]
    for _ in range(n+1):
        nList.append([])
    for _ in range(1,n):
        u,v,w=map(int,input().split())
        nList[u].append((v,w))
        nList[v].append((u,w))

    return n,nList

WHITE=0
GRAY=1
BLACK=2
status=[]
color=[]

def dfs(s,nList):
    for u,w in nList[s]:
        if status[u]==WHITE:
            if w%2==0:
                color[u]=color[s]
            else:
                color[u]=(color[s]+1)%2
            status[u]=GRAY
            dfs(u,nList)
    status[s]=BLACK

def main(n,nList):
    global status
    global color

    status=[WHITE]*(n+1)
    color=[WHITE]*(n+1)
    dfs(1,nList)

    for i in range(1,n+1):
        print(color[i])
    

if __name__=='__main__':
    n,nList=readinput()
    main(n,nList)
    #print(ans)
N, M = map(int,input().split())

broken = [0]*M
ans = [0]*(N+1)

for i in range(M):
    a = int(input())
    broken[i] = a

ans[0] = 1
if(broken[0] == 1):
    ans[1] = 0
else:
    ans[1] = 1

for i in range(2,N+1):
    if (i in broken):
        ans[i] = 0
    else:
        ans[i] = ans[i-1] + ans[i-2]
    

print(ans[N]%1000000007)

### FIXED CODE ###

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

broken = [N+1]*(M+1)
ans = [0]*(N+1)
broken_pointer = 0
for i in range(M):
    a = int(input())
    broken[i] = a

ans[0] = 1
if(broken[0] == 1):
    ans[1] = 0
    broken_pointer += 1
else:
    ans[1] = 1

for i in range(2,N+1):
    if (broken[broken_pointer] == i):
        ans[i] = 0
        broken_pointer += 1
    else:
        ans[i] = ans[i-1] + ans[i-2]
    

print(ans[N]%1000000007)
H,W = map(int,input().split())
S = [input() for _ in range(H)]

seen = [[False for _ in range(W)] for _ in range(H)]
dx = [1,-1,0,0]
dy = [0,0,1,-1]
numb = 0
numw = 0

def dfs(y,x):
  global numb
  global numw
  seen[y][x] = True
  if S[y][x] == '#':
    numb += 1
  if S[y][x] == '.':
    numw += 1
  for i in range(4):
    if not(0<=y+dy[i]<H) or not(0<=x+dx[i]<W):
      continue
    if seen[y+dy[i]][x+dx[i]]:
      continue
    if S[y][x] == S[y+dy[i]][x+dx[i]]:
      continue
    dfs(y+dy[i],x+dx[i])

ans = 0
for i in range(H):
  for j in range(W):
    numb = 0
    numw = 0
    if S[i][j] == '#':
      dfs(i,j)
      ans += numb * numw
print(ans)


### FIXED CODE ###

import sys
sys.setrecursionlimit(10 ** 9)
input = sys.stdin.readline

H,W = map(int,input().split())
S = [input() for _ in range(H)]

seen = [[False for _ in range(W)] for _ in range(H)]
dx = [1,-1,0,0]
dy = [0,0,1,-1]
numb = 0
numw = 0

def dfs(y,x):
  global numb
  global numw
  seen[y][x] = True
  if S[y][x] == '#':
    numb += 1
  if S[y][x] == '.':
    numw += 1
  for i in range(4):
    if not(0<=y+dy[i]<H) or not(0<=x+dx[i]<W):
      continue
    if seen[y+dy[i]][x+dx[i]]:
      continue
    if S[y][x] == S[y+dy[i]][x+dx[i]]:
      continue
    dfs(y+dy[i],x+dx[i])

ans = 0
for i in range(H):
  for j in range(W):
    numb = 0
    numw = 0
    if S[i][j] == '#' and not seen[i][j]:
      dfs(i,j)
      ans += numb * numw
print(ans)
N, M = map(int, input().split())
A = [0] * M
count = 0
ans = 0
for k in range(N):
	A[k] = list(map(int, input().split()))
for i in range(1, M + 1):
	for j in range(N):
		if i in A[j][1:]:
			count += 1
	if count == N:
		ans += 1
	count = 0
print(ans)


### FIXED CODE ###

N, M = map(int, input().split())
A =[list(map(int, input().split())) for _ in range(N)]
ans = 0
for i in range(1, A[0][0] + 1):
	flag = True
	a = A[0][i]
	for j in range(1, N):
		if not a in A[j][1:]:
			flag = False
	if flag:
		ans += 1
print(ans)
s = list(input())
K = int(input())
alphabet = "abcdefghijklmnopqrstuvwxyz"

# need = 0
# for i in range(len(s)):
#     need += ord("z") - ord(s[i]) + 1

for i in range(len(s)):
    if K >= 26 or s[i] >= alphabet[-K]:
        K -= ord("z") - ord(s[i]) + 1
        s[i] = "a"

if K > 0:
    K %= 26
    if (ord(s[-1] + K <= ord("z"))):
        s[-1] = chr(ord(s[-1]) + K)
    else:
        s[-1] = chr(ord("a") + K - (ord("z" - ord(s[-1]))))

print("".join(s))

### FIXED CODE ###

s = list(input())
s.insert(4, " ")
print("".join(s))