Harryxun/stf_run huggingface dataset:
#coding: utf-8
N = int(input())
l = []
for i in range(N):
    a = list(map(int, input().split()))
    l.append(a)

for i in range(len(l)):
    ansn = []
    for cx in range(101):
        for cy in range(101):
            ans_tmp = [cx, cy, l[i][2] + abs(l[i][0] - cx) + abs(l[i][1] - cy)]
            if i == 0 and ans_tmp[-1] >= 1:
                ansn.append(ans_tmp)
            else:
                if ans_tmp in ans:
                    ansn.append(ans_tmp)
    ans = ansn[:]
print(ans[0][0], ans[0][1], ans[0][2])

### FIXED CODE ###

#coding: utf-8
N = int(input())
l = []
for i in range(N):
    a = list(map(int, input().split()))
    if a[2] > 0:
      l.append(a)
if len(l) >= 2:
    for i in range(len(l)-1):
        ans = []
        for cx in range(101):
            for cy in range(101):
                if l[i][2] + abs(l[i][0] - cx) + abs(l[i][1] - cy) == l[i+1][2] + abs(l[i+1][0] - cx) + abs(l[i+1][1] - cy) and l[i][2] != 0 and l[i+1][2] != 0:
                    if i == 0:
                        ans.append([cx, cy])
                    else:
                        if [cx, cy] in ansn:
                            ans.append([cx, cy])
        ansn = ans[:]
        if len(ans) == 1:
            break
    print(ans[0][0], ans[0][1], l[0][2] + abs(l[0][0] - ans[0][0]) + abs(l[0][1] - ans[0][1]))
else:
    print(l[0][0], l[0][1], l[0][2])
N, Q = map(int, input().split())
2 S = input()
3 t = [0] * (N + 1)
4 for i in range(N):
5 t[i + 1] = t[i] + (1 if S[i : i + 2] == 'AC' else 0)
6 for i in range(Q):
7 l, r = map(int, input().split())
8 print(t[r-1] - t[l-1])

### FIXED CODE ###

import numpy as np

s=input()

if s=='A':
    print('T')

if s=='T':
    print('A')

if s=='G':
    print('C')

if s=='C':
    print('G')
# https://atcoder.jp/contests/abc070/tasks/abc070_c

from functools import reduce
import math
import sys
input = sys.stdin.readline
sys.setrecursionlimit(1000000)

# 最小公倍数を求める問題
# 参考：https://note.nkmk.me/python-gcd-lcm/
# 上記リンク先に最大公約数も載ってた

N = int(input())
T = []
for i in range(N):
    T.append(int(input()))


def lcm_base(x, y):
    x_y = x * y
    gcd_xy = math.gcd(x, y)
    ans = int(x_y / gcd_xy)
    return ans

'''
def lcm_list(list):
    ans = reduce(lcm_base, list, 1)
    return ans
lcm = lcm_list(T)
'''


for i in range(1, N):
    T[i] = lcm_base(T[i-1], T[i])

print(T[N - 1])





### FIXED CODE ###

N = int(input())
T = []
for i in range(N):
    T.append(int(input()))

def gcd(x, y):
    if x < y:
        x, y = y, x
    while x % y != 0:
        x, y = y, x % y
    return y


ans = T[0]
for i in range(1, N):
    ans *= T[i] // gcd(ans, T[i])

print(ans)
import math

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

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

# 2で割り切れる回数を求める
def division(value):

    count = 0

    while(value % 2 == 0):

        value = value // 2
        count += 1

    return count

counts = list(map(division, a))

# 2で割り切れる回数が全てのa_Nで等しい場合
if counts.count(counts[0]) == len(counts):

    a = list(map(lambda x: x // 2, a))
    s = a[0]
    for i in range(1, len(a)):
        s = s * a[i] // math.gcd(s, a[i])

    print(math.ceil(M/s/2))

else:
    print(0)

### FIXED CODE ###

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

a = list(set(map(int, input().split(" "))))
g = a.copy()

while not any(x%2 for x in g): g = [i //2 for i in g]

if not all(x%2 for x in g): print(0); exit(0)

def gcd(a, b):

    while b:

        a, b = b, a % b
    return a

def lcm(a, b):
    return a * b // gcd(a, b)


tot = 1

for x in a: tot = lcm(tot, x//2)
print((M//tot+1)//2)
X = input()

result = False
try:
  X = int(X)
except:
  X = -1
  
  
if X in (3, 5, 7):
  return "YES"
return "NO"

### FIXED CODE ###

X = input()

try:
  X = int(X)
except:
  X = -1
  
if X in (3, 5, 7):
  print("YES")
else:
  print("NO")
# coding: utf-8
import sys
#from operator import itemgetter
sysread = sys.stdin.buffer.readline
read = sys.stdin.buffer.read
from heapq import heappop, heappush
from collections import defaultdict
sys.setrecursionlimit(10**7)
import math
#from itertools import product, accumulate, combinations, product
#import bisect
#import numpy as np
#from copy import deepcopy
from collections import deque
#from decimal import Decimal

INF = 1 << 50

def run():
    K, T, *A = map(int, read().split())
    A = sorted(A)
    A = deque(A)
    high, low = 0, 0
    last = None
    while A:
        #print(A)
        if high == 1:
            A.appendleft(1)
            high = A.pop()

        if not high:
            high = A.pop()
            if high == 1:break
        elif not low:
            low = A.popleft()
        #print(high, low)       
        
        val = min(low, high-1)
        if not val:
            last = None
        else:
            last = 'LOW'
        high -= val
        low -= val
        #print('-->', high, low)
    if high == 1
        if last == None:
            print(max(low-high-1, 0))
            return
        else:
            print(max(low - 1, 0)))
            return
    print(high - 1 + max(low - 1, 0))

if __name__ == "__main__":
    run()

### FIXED CODE ###

# coding: utf-8
import sys
#from operator import itemgetter
sysread = sys.stdin.buffer.readline
read = sys.stdin.buffer.read
from heapq import heappop, heappush
from collections import defaultdict
sys.setrecursionlimit(10**7)
import math
#from itertools import product, accumulate, combinations, product
#import bisect
#import numpy as np
#from copy import deepcopy
from collections import deque
#from decimal import Decimal

INF = 1 << 50

def run():
    K, T, *A = map(int, read().split())
    max_a = max(A)
    print(max(max_a-1-K+max_a, 0))

if __name__ == "__main__":
    run()
n, m = map(int, input().split())
k = []
count_sub = 0
steps = []
j = 0
for i in range(m):
    k.append(int(input())) 
    if len(k)>1 and k[i]-k[i-1]==1:
        count_sub = 1
        
if count_sub ==1:
    steps = [0 for i in range(n)]  
else:
    for i in range(n+1):
        if k[j]==i:
            steps.append(0)
            if j < len(k)-1:
                j = j + 1
        elif i ==0:
            steps.append(1)
        elif i ==1:
            steps.append(1)  
        else:
            steps.append(steps[i-1]+steps[i-2])
 
print(steps[-1]%(1000000007))

### FIXED CODE ###

n, m = map(int, input().split())
k = []
count_sub = 0
steps = []
j = 0
for i in range(m):
    k.append(int(input())) 
    if len(k)>1 and k[i]-k[i-1]==1:
        count_sub = 1
        
if count_sub ==1:
    steps = [0 for i in range(n)]  
else:
    for i in range(n+1):
        if k!=[] and k[j]==i:
            steps.append(0)
            if j < len(k)-1:
                j = j + 1
        elif i ==0:
            steps.append(1)
        elif i ==1:
            steps.append(1)  
        else:
            steps.append(steps[i-1]+steps[i-2])
 
print(steps[-1]%(1000000007))
n,m=map(int,input().split())
a=list(map(int,input().split()))
a.sort()
ans=sum(a)
l=[]
for i in range(m):
    b,c=map(int,input().split())
    l.append((b,c))
l.sort(key=lambda x:x[1],reverse=True)
x=[]
for i in range(m):
    xx=[l[i][1]]*l[i][0]
    x.extend(xx)
c=0
while a[c]<x[c] :
    ans+=x[c]-a[c]
    c+=1
    if c>=len(a):
        break
print(ans)


### FIXED CODE ###

n,m=map(int,input().split())
a=list(map(int,input().split()))
l=[]
for i in range(n):
    l.append([1,a[i]])
for i in range(m):
    l.append(list(map(int,input().split())))
l.sort(key=lambda x:x[1], reverse=True)
c=0
ans=0
for i in range(n+m):
    ans+=l[i][1]*l[i][0]
    c+=l[i][0]
    if c>n:
        ans-=l[i][1]*(c-n)
        break
print(ans)
N,X,M=map(int,input().split())
A = [X,]
setA = {A,}
alast=X
flag=False
for i in range(min(N-1,M)):
    P=alast**2%M
    if P in setA:
        flag=True
        d = A.index(P)
        C=A[d:]
        alast=P
        break
    else:
        A.append(P)
        setA.add(P)
        alast=P
if alast==0:
    print(sum(C))
elif (flag==False) and (alast!=0):
    print(sum(A))
else:
    suma=sum(C)
    res = (N-d)%len(C)
    print(sum(A[:d])+((N-d)//len(C))*suma + sum(C[:res]))

### FIXED CODE ###

N,X,M=map(int,input().split())
A = [X,]
setA = {X,}
alast=X
flag=False
for i in range(min(N-1,M)):
    P=alast**2%M
    if P in setA:
        flag=True
        d = A.index(P)
        C=A[d:]
        alast=P
        break
    else:
        A.append(P)
        setA.add(P)
        alast=P
if flag:
    if alast==0:
        ans = sum(A)
    else:
        res = (N-d)%len(C)
        ans = sum(A[:d])+((N-d)//len(C))*sum(C) + sum(C[:res])
else:
    ans = sum(A) 
print(ans)
A_B = input().split()
print((int(A_B[1])-1)//(int(A_B[0])-1))

### FIXED CODE ###

# Sを入力する
S = list(input())
# Lを入力する
L = list(input())
 
# 3つの要素に定義しなおす
S1 = S[0]
S2 = S[1]
S3 = S[2]
L1 = L[0]
L2 = L[1]
L3 = L[2]
 
# 全部同じ
if S1 == L1 and S2 == L2 and S3 == L3:
  print(3)
# 全部違う
elif S1 != L1 and S2 != L2 and S3 != L3:
  print(0)
# 一つだけ
elif (S1 == L1 and S2 != L2 and S3 != L3) or (S1 != L1 and S2 == L2 and S3 != L3) or (S1 != L1 and S2 != L2 and S3 == L3):
  print(1)
# その他
else:
  print(2)
N = int(input())
A = list(map(int,input().split()))

from collections import Counter

A.sort(reverse=True)
d = Counter(A)
d = d.most_common()
d.sort(reverse=True)
x = []

for i in range(len(d)):
    if d[i][1] >= 4:
        x.append(d[i][0])
        x.append(d[i][0])
    elif d[i][1] >= 2:
        x.append(d[i][0])
        
print(x[0]*x[1])
        

### FIXED CODE ###

N = int(input())
A = list(map(int,input().split()))

from collections import Counter

A.sort(reverse=True)
d = Counter(A)
d = d.most_common()
d.sort(reverse=True)
x = []

for i in range(len(d)):
    if d[i][1] >= 4:
        x.append(d[i][0])
        x.append(d[i][0])
    elif d[i][1] >= 2:
        x.append(d[i][0])
        
if len(x) < 2:
    print(0)
else:   
    print(x[0]*x[1])
x=input()
y=x.split()

if y[0] == y[1] :
    if y[0] == y[2]:
        print("No")
    else:
        print("Yes")
elif y[0] == y[2] :
    print("Yes")
elif y[2] == y[1] :
        print("Yes")
else:
    print("No)

### FIXED CODE ###

x=input()
y=x.split()

if y[0] == y[1] :
    if y[0] == y[2]:
        print("No")
    else:
        print("Yes")
elif y[0] == y[2] :
    print("Yes")
elif y[2] == y[1] :
        print("Yes")
else:
    print("No")
N = int(input())
A = map(int, input().split())
numbers = []
result = True
for i in A:
  numbers.append(int(i))
  result = sorted(numbers)
  if (result == True):
    print("YES")
    return "YES"
  if (result == False):
    for i in range(len(numbers)):
      for x in range(i+1, len(numbers)):
        numbers2 = numbers[:]
        if swap(numbers2, i, x) == True:
          print("TRUE")
          return "TRUE"
        print("FALSE")
        return "FALSE"


def sorted(list):
    result = True
    for i in range(len(list)):
        if i < len(list) - 1:
            if (list[i] > list[i+1]):
                result = False
    return result


def swap(list, pos1, pos2):
    list[pos1], list[pos2] = list[pos2], list[pos1]
    return sorted(list)

### FIXED CODE ###

def test(x, j):
    # X, A = map(int, input().split())
    A = j.split()
    numbers = []
    result = True
    for i in A:
        numbers.append(int(i))
    result = sorted(numbers)
    if (result == True):
        print("YES")
        return "YES"
    if (result == False):
        # numbers2 = numbers[:]
        for i in range(len(numbers)):
            for x in range(i+1, len(numbers)):
                numbers2 = numbers[:]
                if swap(numbers2, i, x) == True:
                    print("YES")
                    return "TRUE"
    print("NO")
    return "FALSE"


def sorted(list):
    result = True
    for i in range(len(list)):
        if i < len(list) - 1:
            if (list[i] > list[i+1]):
                result = False
    return result


def swap(list, pos1, pos2):
    list[pos1], list[pos2] = list[pos2], list[pos1]
    return sorted(list)


N = int(input())
p = input()
test(N, p)
N,K = map(int,input().split())
height_list = list(map(int,input().split()))
print(sum(1 for i in h if i >= K]))

### FIXED CODE ###

N,K = map(int,input().split())
height_list = list(map(int,input().split()))
print(sum([1 for i in height_list if i >= K]))
def getCal(a,b):
    return a//b, a%b, float(a/b)

a, b = map(int, input().split())
d, r, f = getCal(a,b)

print("{} {} {2: 5f}".format(d, r, f))

### FIXED CODE ###

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

print(a//b, a%b, '%.5f' % (a/b))
b = int(input())
print("A" if b == "T" else "T" if b == "A" else
      "C" if b == "G" else "G")


### FIXED CODE ###

b = input()
print("A" if b == "T" else "T" if b == "A" else
      "C" if b == "G" else "G")
import math
import functools

n = int(input())
as_ = [int(i) for i in input().split()]


def gcds(list_):
    return functools.reduce(math.gcd, list_)


def drop(list_, i):
    list_copy = list_.copy()
    del list_copy[i]
    return list_copy


print(max(gcds(drop(as_, i)) for i, _ in enumerate(as_)))


### FIXED CODE ###

import fractions
import itertools

n = int(input())
as_ = [int(i) for i in input().split()]


def gcds(list_):
    return list(itertools.accumulate(list_, fractions.gcd))


def reversed_gcds(list_):
    return list(itertools.accumulate(reversed(list_), fractions.gcd))


as_accum_gcd, as_rev_accum_gcd = gcds(as_), reversed_gcds(as_)

dropped_gcds = []
for i in range(len(as_)):
    if i == 0:
        dropped_gcd = as_rev_accum_gcd[-2]
    elif i == len(as_) - 1:
        dropped_gcd = as_accum_gcd[-2]
    else:
        dropped_gcd = fractions.gcd(as_accum_gcd[i - 1], as_rev_accum_gcd[-2 - i])
    dropped_gcds.append(dropped_gcd)

print(max(dropped_gcds))
import fractions

N=int(input())
T0=int(input())
for i in range(1,N):
    T=int(input())
    ans=(T0*T)//fractions.gcd(T0,T)
    T0=T
print(ans)

### FIXED CODE ###

import fractions

N=int(input())
T0=int(input())

if N==1:
  print(T0)
  exit()

for i in range(1,N):
    T=int(input())
    g=fractions.gcd(T0,T)
    ans=T0*T//g
    T0=ans
print(ans)
# -*- coding: utf-8 -*-
A,B,C,D=map(str,input().split())
+ = "1"
- = "-1"
L = [+,-]
S = map(int,L.split())
print("{}".format(A+B+C+D))

### FIXED CODE ###

# -*- coding: utf-8 -*-
S = str(input())
P = S.count("+")
Q = S.count("-")
print("{}".format(P-Q))
a, b, x = map(int, input().split())

print('YES'　if a<= x <= a+b else 'NO')

### FIXED CODE ###

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

print('YES' if a <= x <= a+b else 'NO')
import math

a,b,c,d = map(int,input().split())
c_ok = b//c - (a-1)//c
d_ok = b//d - (a-1)//d

cd = int(c*d/math.gcd(c,d))
cd_ok = b//cd - (a-1)//cd

print(int(b-a+1-c_ok-d_ok+cd_ok))

### FIXED CODE ###



def gcd(x,y):
    x, y = max(x,y), min(x,y)
    while x!=0 :
        x, y = max(x,y), min(x,y)
        x %= y
    return y
#print(gcd(4,8))

a,b,c,d = map(int,input().split())
c_ok = b//c - (a-1)//c
d_ok = b//d - (a-1)//d

cd = int(c*d/gcd(c,d))
cd_ok = b//cd - (a-1)//cd

print(int(b-a+1-c_ok-d_ok+cd_ok))
def popcount(x): #xは10進数の整数
    return bin(x).count('1')
def count(n):
    ans = 0
    while n:
        ans += n % 2
        n //= 2
    return ans
ma = 2*10**5
dp = [0] * ma
for i in range (1, ma):
    dp[i] = dp[i % count(i)] + 1
def solve(N, x):
    p = popcount(int(x, 2))
    nowp_p = int(x, 2) % (p+1)
    if p-1 != 0: 
        nowp_m = int(x, 2) % (p-1)
    x = list(x)#list
    for i in range(N):
        if x[i] == '0':
            print(dp[(nowp_p + 2**(N-i-1)) % (p + 1)] + 1)
        elif x[i] == '1':
            if p == 1:
                print(0)
            else:
                print(dp[(nowp_m - 2**(N-i-1) + p - 1) % (p - 1)] + 1)
N = int(input())
x = input() #str
solve(N, x)

### FIXED CODE ###

def solve(L,R,d):
    count = 0
    for i in range(L,R+1):
        if i % d == 0:
            count += 1
    return count
L, R, d = map(int, input().split())
print(solve(L,R,d))
import sys
sys.setrecursionlimit(1000000)

def process():
    data = []
    for line in get_data():
        line = line.split()
        if len(line) == 2:
            if line[0] == line[1] == '0':
                data = []
                continue
            H = int(line[0])
            W = int(line[1])
        elif len(line) == 0:
            pass
        else:
            data.append(line[0])
            if len(data) == H:
                field = create_field(H, W)
                print search(H, W, data, field)


def search(H, W, data, field):
    count = 0
    for i in xrange(H):
        for j in xrange(W):
            if field[i][j] == 0:
                continue
            _search(i, j, H, W, data[i][j], data, field)
            count += 1
    return count


def _search(i, j, H, W, cell, data, field):
    field[i][j] = 0
    for a in xrange(i-1, i+2):
        if -1 < a < H:
            pass
        else:
            continue
        for b in xrange(j-1, j+2):
            if -1 < b < W:
                pass
            else:
                continue

            if a != i and b != j:
                continue

            if field[a][b] == 0:
                continue
            if cell == data[a][b]:
                _search(a, b, H, W, cell, data, field)
    return


def create_field(H, W):
    field = []
    for i in xrange(H):
        raw = []
        for j in xrange(W):
            raw.append(1)
        field.append(raw)
    return field


def get_data():
    return [line.strip() for line in raw_input()]

process()

### FIXED CODE ###

import sys
sys.setrecursionlimit(100000000)


def main():
    solve()


def solve():
    for data in get_dataset():
        print search(data)


def search(data):
    count = 0
    H = len(data)
    W = len(data[0])
    for i in xrange(H):
        for j in xrange(W):
            if data[i][j] == '.':
                continue
            _search(i, j, H, W, data[i][j], data)
            count += 1
    return count


def _search(i, j, H, W, cell, data):
    data[i][j] = '.'
    for a in xrange(i-1, i+2):
        if not -1 < a < H:
            continue
        for b in xrange(j-1, j+2):
            if not -1 < b < W:
                continue

            if a != i and b != j:
                continue

            if data[a][b] == '.':
                continue

            if cell == data[a][b]:
                _search(a, b, H, W, cell, data)
    return


def get_dataset():
    dataset = []
    while True:
        line = raw_input().rstrip().split()
        H = int(line[0])
        if H == 0:
            break

        data = []
        for i in xrange(H):
            data.append(list(raw_input().rstrip()))
        dataset.append(data)
    return dataset


if __name__ == '__main__':
    main()
# -*- coding: utf-8 -*-

def move(S, before_a, before_b, a_index, b_index, g_a, g_b):
    if (len(S)>a_index and len(S) > b_index)==False:
        return -1
    if S[a_index]=='#' or S[a_index]=='B':
        return 0
    elif S[b_index]=='#' or S[b_index]=='A':
        return 0
    if a_index==g_a and b_index==g_b:
        return 100
    S[before_a] = '.'
    S[before_b] = '.'

    S[a_index] = 'A'
    S[b_index] = 'B'
    rr1 = 0
    rr2 = 0
    rr3 = 0
    rr4 = 0
    if len(S)>a_index:
        rr1 = move(S, a_index, b_index, a_index+1, b_index, g_a, g_b)
    if len(S)-1>a_index:
        rr2 =  move(S, a_index, b_index, a_index+2, b_index, g_a, g_b)
    if len(S)>b_index:
        rr3 = move(S, a_index, b_index, a_index, b_index+1, g_a, g_b)
    if len(S)-1>b_index:
        rr4 = move(S, a_index, b_index, a_index, b_index+2, g_a, g_b)
    return max([rr1,rr2,rr3,rr4])
#    return 1

N, A, B, C, D = map(int, input().split())

S = list(input())

S[A-1] = 'A'
S[B-1] = 'B'

a_index = A-1
b_index = B-1

r1 = move(S, a_index, b_index, a_index+1, b_index, C-1, D-1)
r2 = move(S, a_index, b_index, a_index+2, b_index, C-1, D-1)
r3 = move(S, a_index, b_index, a_index, b_index+1, C-1, D-1)
r4 = move(S, a_index, b_index, a_index, b_index+2, C-1, D-1)


if r1==100 or r2==100 or r3==100 or r4==100:
    print('Yes')
else:
    print('No')


### FIXED CODE ###

#!/usr/bin/env python3

N, A, B, C, D = map(int, input().split())
S = input()

#hunuke

h = S[A-1:D+1].count('##')
m3 = S[B-2:D+1].count('...')

if C < D:
    if h == 0: print('Yes')
    else: print('No')
else:
    if m3 != 0 and h == 0:
        print('Yes')
    else: print('No')
from datetime import datetime
s = input()
t = datetime.strptime(s, '%y/%m/%d')
thres = datetime(2019, 4, 30)
print('heisei' if t <= thres else 'TBD')


### FIXED CODE ###

from datetime import datetime
s = input()
t = datetime.strptime(s, '%Y/%m/%d')
thres = datetime(2019, 4, 30)
print('Heisei' if t <= thres else 'TBD')
import math
from functools import reduce

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

def gcd(*numbers):
  return reduce(math.gcd, numbers)
def gcd_list(numbers):
  return reduce(math.gcd, numbers)

print(gcd(*new_lst))

### FIXED CODE ###

import fractions
from functools import reduce

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

def gcd(*numbers):
  return reduce(fractions.gcd, numbers)
def gcd_list(numbers):
  return reduce(math.gcd, numbers)

print(gcd(*new_lst))
n = int(input())
h = list(map(int, input().split()))[::-1]
if n ==1:
    print('Yes')
else:
    for i in range(1,n):
        if h[i] > (h[i - 1] + 1):
            print('No')
            break
        elif h[i] == (h[i - 1] + 1):
            h[i] = h[i - 1]
        print(h)
    else:
        print('Yes')

### FIXED CODE ###

n = int(input())
h = list(map(int, input().split()))[::-1]
if n ==1:
    print('Yes')
else:
    for i in range(1,n):
        if h[i] > (h[i - 1] + 1):
            print('No')
            break
        elif h[i] == (h[i - 1] + 1):
            h[i] = h[i - 1]
    else:
        print('Yes')
n, = map(int, input().split())
a = list(map(int, input().split()))
ans = []

h = a[0]
i = a[1]
s = h + abs(h-i)
if i < h:
    ans[0] = -1 * abs(h-i)
else:
    ans[0] = 0
for x in range(2, n+1):
    j = a[x]
    s += abs(i-j)
    if j < i:
        ans[x] = -1 * abs(i-j)
    else:
        ans[x] = 0
    h = i
    i = j

for x in ans:
    print(s+x)

### FIXED CODE ###

n, = map(int, input().split())
a = list(map(int, input().split()))
a.append(0)
m = []

i = 0
j = a[0]
s = abs(a[0])
for x in range(1, n+1):
    k = a[x]
    s += abs(j-k)
    if i<=j<=k or k<=j<=i:
        m.append(0)
    else:
        ij = abs(i-j)
        jk = abs(j-k)
        if ij<jk:
            m.append(-2*ij)
        else:
            m.append(-2*jk)
    i = j
    j = k
for x in m:
    print(s+x)
n, k = map(int, input().split())
h = list(map(int, input().split())
         
         count = 0
         
         for i in h:
         if i >= k:
         count += 1
         
         print(count)

### FIXED CODE ###

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

count = 0

for i in h:
   if i >= k:
       count += 1

print(count)
a,b=map(int,input()).split()
print("Draw" if a==b else "Alice" if a==1 else "Bob"if b==1 else "Alice" if a>b else "Bob")

### FIXED CODE ###

a,b=map(int,input().split())
print("Draw"if a==b else"Alice"if a==1 else"Bob"if b==1 else"Alice"if a>b else"Bob")
def fib_memo(n):
    memo=["EMPTY"]*(n+1)
    def _fib(n):
        if n == 1:
            return 0
        elif n == 2:
            return 1
        elif memo[n] != "EMPTY":
            return memo[n]
        else:
            memo[n] = _fib(n-1)+_fib(n-2)
            return memo[n]
    return _fib(n)
n,m=map(int,input().split())
a=[int(input()) for i in range(m)]
cnt=fib_memo(a[0]-1)*fib_memo(n-a[m-1]-1)
for i in range(1,m-1):
  cnt*=fib_memo(a[i]-a[i-1]-1)
print(cnt)
  
  

### FIXED CODE ###

n,m=map(int,input().split())
a=[int(input()) for i in range(m)]
dp=[1]*(n+1)
dp[0]=1
dp[1]=1
for i in range(m):
  if a[i]==1:
    dp[1]=0
  else:
    dp[a[i]]=0
for i in range(2,n+1):
  if dp[i]:
    dp[i]=dp[i-1]+dp[i-2]
print(dp[n]%(10**9+7))