Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

from collections import Counter

n = int(input())
s = []
for i in range(n):
    s.append(Counter(input()))

ans = 0
while s != []:
    string = s.pop()
    s_new = []
    temp = 1
    for mojiretu in s:
        if string == mojiretu:
            temp += 1
        else:
            s_new.append(mojiretu)
    ans += temp * (temp-1) // 2
    s = s_new.copy()

print(ans)

### FIXED CODE ###

n = int(input())
lst = []
dic = {}
for i in range(n):
    s = list(input())
    s.sort()
    s = ''.join(s)
    if s not in dic.keys():
        dic[s] = 1
    else:
        dic[s] += 1

ans = 0
for i in dic.values():
    ans += i * (i-1) // 2

print(ans)
### BUGGY CODE ###

n, k = map(int, input().split())
p = list(map(int, input().split()))
ans = ((sum(p[:k])+k))/2
for i in range(1, n-k+1):
    ans_2 = (sum(p[(i):(k+i)])+k)/2
    if ans < ans_2:
        ans = ans_2
print(ans)

### FIXED CODE ###

n, k = map(int, input().split())
p = list(map(int, input().split()))
tmp = sum(p[:k])
ans = [tmp]
if n == k:
    ans_mae = ans[0]
    print((ans_mae+k)/2)
else:
    for i in range(1,n-k+1):
        tmp = tmp - p[i-1] + p[i+k-1]
        ans.append(tmp)
    print((max(ans)+k)/2)
### BUGGY CODE ###

from collections import Counter
from math import factorial
N=int(input())
A=list(map(int,input().split()))
B=Counter(A)
for a in A:
    count=0
    for key,b in B.items():
        if b >= 2 and a!=key:
            count += factorial(b) // (factorial(b - 2) * factorial(2))
        elif b>=3 and a==key:
            b-=1
            count += factorial(b) // (factorial(b - 2) * factorial(2))
    print(count)


### FIXED CODE ###

from collections import Counter
from math import factorial
N=int(input())
A=list(map(int,input().split()))
B=Counter(A)
count=0
def combination(x,y):
    return factorial(x) // (factorial(x - y) * factorial(y))
for key,b in B.items():
    if b>=2:
        count+=combination(b,2)
for a in A:
    ans=count
    ans-=B[a]-1
    print(ans)
### BUGGY CODE ###

# 後ろからカウント、操作後にその周辺で書き換えるものがあるかどうかを探せばOK
s = input()

# 確か文字列は操作時に毎回文字列を作り直すはずだからTLE対策に数字の配列に直しておく
s_int = [1 if c == "A" else 2 if c == "B" else 3 for c in s ]

s_len = len(s_int)

s_pointer = s_len - 3

writecount = 0

# 配列の領域外を探すまで続ける
while s_pointer >= 0:
    if s_int[s_pointer] == 1 and s_int[s_pointer + 1] == 2 and s_int[s_pointer + 2] == 3:
        writecount += 1
        s_int[s_pointer] += 1
        s_int[s_pointer + 1] += 1
        s_int[s_pointer + 2] = 1
        if s_pointer + 2 + 3 <= s_len:   # ポインタを後ろに二つずらしてもはみ出ない
            s_pointer += 3
    s_pointer -= 1

print(writecount)

### FIXED CODE ###

# 前からカウント
s = input()

# 確か文字列は操作時に毎回文字列を作り直すはずだからTLE対策に数字の配列に直しておく
s_int = [1 if c == "A" else 2 if c == "B" else 3 for c in s ]

s_len = len(s_int)

write_count = 0

s_pointer = 0

a_count = 0

while (s_pointer + 1 < s_len):
    # AAAAABC→5回変換可、BCを一番左にもっていった状態と等しい
    if s_int[s_pointer] == 1:
        a_count += 1
    elif s_int[s_pointer] == 2 and s_int[s_pointer + 1] == 3:
        # BCで変換個数を確定し、一個余分にポインタを動かす
        write_count += a_count
        s_pointer += 1
    else:
        # 連鎖が途切れた
        a_count = 0
    s_pointer += 1

print(write_count)
### BUGGY CODE ###

import sys
sys.setrecursionlimit(100000)
input = sys.stdin.readline
n,m=map(int,input().split())
z=n*(n-1)//2
l=[-1]*n
a=[1]*n
b=[input().split() for _ in range(m)]
c=[0]*m+[z]
def r(s):
  t=l[s]
  return s if t<0 else r(t)
def f(s):
  return r(int(s)-1)
for i in range(m-1,-1,-1):
  x,y=map(f,b[i])
  if x!=y:
    l[x]=y
    z-=a[x]*a[y]
    a[y]+=a[x]
  c[i]=z
for x in c[1:]:
  print(x)

### FIXED CODE ###

import sys
sys.setrecursionlimit(100000)
input = sys.stdin.readline
n,m=map(int,input().split())
z=n*(n-1)//2
l=[-1]*n
a=[1]*n
b=[input().split() for _ in range(m)]
c=[0]*m+[z]
def r(s):
  t=l[s]
  if t<0:
    return s
  else:
    l[s]=r(t)
    return l[s]
def f(s):
  return r(int(s)-1)
for i in range(m-1,-1,-1):
  x,y=map(f,b[i])
  if x!=y:
    l[x]=y
    z-=a[x]*a[y]
    a[y]+=a[x]
  c[i]=z
for x in c[1:]:
  print(x)
### BUGGY CODE ###

h,w,m = map(int,input().split())
hli = [0]*h
wli = [0]*w
li = []
for i in range(m):
    a,b = map(int,input().split())
    li.append([a,b])
    hli[a-1] += 1
    wli[b-1] += 1
a = max(hli)
b = max(wli)
hli2 = []
wli2 = []
for i in range(h):
    if hli[i] == a:
        hli2.append(i+1)
for i in range(w):
    if wli[i] == b:
        wli2.append(i+1)
for i in range(len(hli2)):
    for j in range(len(wli2)):
        if [hli2[i],wli2[j]] not in li:
            print(a + b)
            exit()
print(a + b - 1)

### FIXED CODE ###

h,w,m = map(int,input().split())
hli = [0]*h
wli = [0]*w
li = []
liset = set()
for i in range(m):
    a,b = map(int,input().split())
    li.append([a,b])
    liset.add((a,b))
    hli[a-1] += 1
    wli[b-1] += 1
a = max(hli)
b = max(wli)
hli2 = []
wli2 = []
for i in range(h):
    if hli[i] == a:
        hli2.append(i+1)
for i in range(w):
    if wli[i] == b:
        wli2.append(i+1)
for i in hli2:
    for j in wli2:
        if (i,j) not in liset:
            print(a + b)
            exit()
print(a + b - 1)
### BUGGY CODE ###

N = int(input())
ans = N*N
for i in range(1, N//2+1):
        if N%i==0:
            j = N//i
            if ans >= i+j-2:
                ans=i+j-2
print(ans)  

### FIXED CODE ###

import math
N = int(input())
ans = N*N
for i in range(1,int(math.sqrt(N))+1):
        if N%i==0:
            j = N//i
            if ans >= i+j-2:
                ans=i+j-2
print(ans)
### BUGGY CODE ###

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

s=0
for x in range(1,N+1):
  p = (A*x)//B - A*(x//B)
  if p<s:
    break
  if p>s:
    s=p
print(s)

### FIXED CODE ###

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

s=0
if B<=N:
  x=B-1
  s=(A*x)//B - A*(x//B)
else:
  x=N
  s=(A*x)//B - A*(x//B)
print(s)
### BUGGY CODE ###

from itertools import groupby

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

b = [A[i+1]-A[i] for i in range(N-1)]

for i in range(b.count(0)):
    b.remove(0)

b = [0<b_i for b_i in b]

b = [len(list(v)) for k, v in groupby(b)]

# print(b)
if len(b) <= 1:
    print(1)
    exit()

c = 2
can_remove = True
for b_i in b[1:-1]:
    if b_i == 1 and can_remove:
        can_remove = False
    else:
        c += 1
        can_remove = True

print(c)

### FIXED CODE ###

# 傾きの正負の変化を調べるのに、
# AとB(傾き)をかけてその符号を見るという方法があると気づいた
N = int(input())
A = list(map(int, input().split(" ")))

c = 1
e = 0
for i in range(N-1):
    d = A[i+1]-A[i]
    # print(d, e, e*d < 0)
    # 一方が負の数、もう一方が正の数なら
    if e*d < 0:
        c += 1
        e = 0
    elif d != 0: # この条件忘れた
        e = d

print(c)
### BUGGY CODE ###

N, K, *A = map(int, open(0).read().split())

dp = [False] * (K + 1)
for i in range(1, K + 1):
    if dp[i]:
        continue

    for a in A:
        if i - a >= 0:
            dp[i] |= not dp[i - a]

if dp[K]:
    print("First")
else:
    print("Second")

### FIXED CODE ###

N, K, *A = map(int, open(0).read().split())

dp = [False] * (K + 1)
for i in range(1, K + 1):
    for a in A:
        if i - a >= 0:
            dp[i] |= not dp[i - a]

if dp[K]:
    print("First")
else:
    print("Second")
### BUGGY CODE ###

import sys, copy
from collections import deque

input = sys.stdin.readline

n = int(input())
a = [deque(map(lambda x:int(x) - 1, input().split())) for _ in range(n)]
q = deque()
pre_q = deque()
day = 0

def check(p, q):
    if not len(a[p]) == 0:
        o = a[p][0]
        if a[o][0] == p:
            if p > o : p , o = o, p
            if not (p, o) in q:
                q.append((p, o))

for p in range(n):
    check(p, q)

while len(q) > 0:
    day += 1
    pre_q = copy.deepcopy(q)
    q.clear()
    for (p, o) in pre_q:
        a[o].popleft()
        a[p].popleft()
        check(p, q)
        check(o, q)


if all(map(len, a)):
    print(-1)
else:
    print(day)


### FIXED CODE ###

from collections import deque
import copy, sys

input = sys.stdin.readline
n = int(input())
a = [deque(map(lambda x: int(x) - 1, input().split())) for _ in range(n)]
q = deque()
pre_q = deque()
day = 0

def check(p, q):
    if not len(a[p]):
        return
    o = a[p][0]
    if p == a[o][0]:
        if p > o: p, o = o, p
        if not (p, o) in q:
            q.append((p, o))

fin = []
for p in range(n):
    if not p in fin:
        o = a[p][0]
        if p == a[o][0]:
            q.append((p, o))
            fin += [p, o]

while q:
    day += 1
    pre_q = copy.copy(q)
    q.clear()
    for (p, o) in pre_q:
        a[p].popleft()
        a[o].popleft()
        check(p, q)
        check(o, q)

if all(map(len, a)):
    print(-1)
else:
    print(day)
### BUGGY CODE ###

n = int(input())
l = [int(_) for _ in input().split()]

ans = 0
for i in range(n-2):
    for j in range(i+1, n-1):
        for k in range(j+1, n):
            a, b, c = l[i], l[j], l[k]
            if a < b+c:
                if b < c+a:
                    if c < a+b:
                        ans += 1
print(ans)

### FIXED CODE ###

import bisect

n = int(input())
l = [int(_) for _ in input().split()]

l.sort()

ans = 0
for i in range(n-2):
    for j in range(i+1, n-1):
        a, b = l[i], l[j]
        k = bisect.bisect_right(l, a+b-1)
        ans += k - j - 1
print(ans)
### BUGGY CODE ###

s = str(input())
q = int(input())
for i in range(q):
    tmp = tuple(map(str, input().split()))
    if len(tmp) == 3:  # pattern 2
        if int(tmp[1]) == 1:
            s = tmp[2]+s
        else:
            s += tmp[2]
    else:
        s = s[::-1]

print(s)


### FIXED CODE ###

from collections import deque
s = str(input())
q = int(input())
stat = 0
l = []
a = deque()
b = deque()
for i in range(q):
    l = list(map(str, input().split()))
    t = int(l[0])
    if t == 1:
        stat += 1
    else:
        f = int(l[1])
        c = l[2]
        if stat % 2 == 0:
            if f == 1:
                a.appendleft(c)
            else:
                b.append(c)
        else:
            if f == 1:
                b.append(c)
            else:
                a.appendleft(c)

#print(a, b, stat % 2)
ans = ''.join(a)+s+''.join(b)
if stat % 2 == 1:
    ans = ans[::-1]
print(ans)
### BUGGY CODE ###

import bisect
n = int(input())
prevMaxs = []
for i in range(n):
    num = int(input())
    if len(prevMaxs) == 0 :
        prevMaxs.append(num)
    else:
        key = bisect.bisect_left(prevMaxs, num)
        if key == 0:
            prevMaxs.insert(0, num)
        else:
            prevMaxs[key - 1] = num
print(len(prevMaxs))

### FIXED CODE ###

import sys
import bisect

n = int(input())
a = [int(sys.stdin.readline().rstrip()) for _ in range(n)][::-1]

bottoms = [a[0]]

for i in range(1, n):
    pos = bisect.bisect_right(bottoms, a[i])
    if pos == len(bottoms):
        bottoms.append(a[i])
    else:
        bottoms[pos] = a[i]

print(len(bottoms))
### BUGGY CODE ###

#import numpy as np
import sys, math
from itertools import permutations, combinations
from collections import defaultdict, Counter, deque
from math import factorial#, gcd
from bisect import bisect_left, bisect_right #bisect_left(list, value)
sys.setrecursionlimit(10**7)
enu = enumerate
MOD = 2019
def input(): return sys.stdin.readline()[:-1]
pl = lambda x: print(*x, sep='\n')

S = input()
N = len(S)
lS = list(map(int, list(S)))
# print(lS)

nums = [0]*(N+1)
for i in range(N):
    m = 10**(N-i-1)
    val = lS[i] * m
    val %= MOD
    nums[i+1] = val
# nums.append(0)
# nums.reverse()
# print(nums)

d = defaultdict(int)
d[0] += 1
cnt = 0
for i in range(N):
    nums[i+1] += nums[i]
    nums[i+1] %= MOD
    # print(nums[i+1])
    cnt += d[nums[i+1]]
    # print(d[nums[i+1]])
    d[nums[i+1]] += 1
# print(nums)
print(cnt)

### FIXED CODE ###

#import numpy as np
import sys, math
from itertools import permutations, combinations
from collections import defaultdict, Counter, deque
from math import factorial#, gcd
from bisect import bisect_left, bisect_right #bisect_left(list, value)
sys.setrecursionlimit(10**7)
enu = enumerate
MOD = 2019
def input(): return sys.stdin.readline()[:-1]
pl = lambda x: print(*x, sep='\n')

S = input()
N = len(S)

d = defaultdict(int)
d[0] += 1
# nums = [0]*(N+1)
m = 0
last = 0
dd = 1
for i in range(N):
    m += int(S[N-i-1])*dd
    m %= MOD
    # val = (int(S[i])*m + nums[i])%MOD
    # cnt += d[val]
    dd = (dd*10)%MOD
    d[m] += 1

cnt = 0
for i, v in d.items():
    cnt += v*(v-1)//2
print(cnt)
### BUGGY CODE ###

def solve():
    from sys import stdin
    f_i = stdin
    
    H, W = map(int, f_i.readline().split())
    
    grid = ['W'] * (W + 2)
    for i in range(H):
        grid += ['W'] + list(f_i.readline().rstrip()) + ['W']
    grid += ['W'] * (W + 2)
    
    adj = (1, -1, W + 2, -W - 2)
    cnt = 0
    next_grid = grid[:]
    while True:
        if '.' not in grid:
            print(cnt)
            break
        
        cnt += 1
        
        idx = 0
        while True:
            try:
                idx = grid.index('#', idx)
                for a in adj:
                    adj_pos = idx + a
                    if grid[adj_pos] == '.':
                        next_grid[adj_pos] = '#'
                idx += 1
            except ValueError:
                break
        
        grid = next_grid[:]

solve()

### FIXED CODE ###

def solve():
    from collections import deque
    from sys import stdin
    f_i = stdin
    
    H, W = map(int, f_i.readline().split())
    
    grid = ['W'] * (W + 2)
    for i in range(H):
        grid += ['W'] + list(f_i.readline().rstrip()) + ['W']
    grid += ['W'] * (W + 2)
    
    q = deque()
    for i, cell in enumerate(grid):
        if cell == '#':
            q.append((i, 0)) # (pos, operation count)
    move = (1, -1, W + 2, -W - 2)
    
    while q:
        pos, count = q.popleft()
        for mv in move:
            next_pos = pos + mv
            if grid[next_pos] == '.':
                grid[next_pos] = '#'
                q.append((next_pos, count + 1))
    
    print(count)
    
solve()
### BUGGY CODE ###

def prod(x):
    c = 1
    for i in x:
        c *= i
    return c
        
n,k = map(int,input().split())
a = list(map(int,input().split()))
for i in range(0,n-k):
    if prod(a[i:k+i]) < prod(a[i+1:k+i+1]):
        print('Yes')
    else:
        print('No')

### FIXED CODE ###

n,k = map(int,input().split())
a = list(map(int,input().split()))
for i in range(0,n-k):
    if a[i]<a[k+i]:
        print('Yes')
    else:
        print('No')
### BUGGY CODE ###

import collections
#入力
N = int(input())
Alist = list(map(int,input().split()))
Q = int(input())
Blist = []
Clist = []
for i in range(Q):
  B, C = map(int,input().split())
  Blist.append(B)
  Clist.append(C)

Adic = collections.Counter(Alist)

def dicsum(dic):
  sum = 0
  for i in range(len(dic)):
    sum += list(dic.keys())[i]*list(dic.values())[i]
  return sum


for j in range(Q):
  if (Blist[j] in Adic) == True:
    Adic[Clist[j]] += Adic[Blist[j]] 
    Adic.pop(Blist[j])
    print(dicsum(Adic))
  else:
    print(dicsum(Adic))

### FIXED CODE ###

import collections
#入力
N = int(input())
n = 100001
Alist = list(map(int,input().split()))
Q = int(input())
Blist = []
Clist = []
for i in range(Q):
  B, C = map(int,input().split())
  Blist.append(B)
  Clist.append(C)

Adic = dict(collections.Counter(Alist))
numlist = [0]*n

for j in range(n):
  if j in Adic:
    numlist[j] = Adic[j]
sum = sum(Alist)
for k in range(Q):
  sum += (Clist[k]-Blist[k])*numlist[Blist[k]]
  numlist[Clist[k]] += numlist[Blist[k]] 
  numlist[Blist[k]] = 0

  print(sum)
### BUGGY CODE ###

n,m = map(int,input().split())
a = [int(input()) for _ in range(m)]
mod = 10**9+7
dp1=0;dp2=1
for i in range(n):
	dp1,dp2=dp2,(dp1+dp2)*(not i+1 in a)
	if dp1==dp2==0:
		print(0);exit()
print(dp2%mod)

### FIXED CODE ###

n,m = map(int,input().split())
ali = [int(input()) for _ in range(m)]
dif = []
cap = 0
for num in ali:
  dif.append(num-cap)
  cap = num
dif.append(n-cap+1)
dif[0] += 1
ref = [0,0,1,1]
a,b = 1,1
for i in range(100000):
  a,b = b,a+b 
  ref.append(b)
ans = 1
for num in dif:
  ans *= (ref[num] % 1000000007)
print(ans % 1000000007)
### BUGGY CODE ###

import numpy as np
import sys
# import copy


def xnxn(n=0, flag="v"):
    """
    args:
        int n: a number of lows to read
    example:
        input   1
        retrun  1

        input   1 2 3
        return  [1,2,3]
        input   1 2 3
                4 
        return  [[1,2,3],
                [4]]
    """
    if n == 0:
        temp = list(map(int, input().split()))
        if len(temp) == 1:
            if flag == "l":
                return temp
            else:
                return temp[0]
        elif len(temp) > 1:
            return temp
    else:
        temp = [list(map(int, input().split())) for _ in range(n)]
        return temp


n, k = xnxn()
a = np.array(xnxn(flag="l"))
for _ in range(k):
    add = np.zeros(n, dtype="int")
    for i in range(0, n):
        idx_min = max(0, i - a[i])
        idx_max = min(n-1, i + a[i])
        # for t in range(idx_min, idx_max + 1):
        #     add[t] = add[t]+1
        add[idx_min:idx_max+1] = add[idx_min:idx_max+1]+1
    a = add

for i in a:
    print(i, end=" ")


### FIXED CODE ###

# import numpy as np
import sys
# import copy


def xnxn(n=0, flag="v"):
    """
    args:
        int n: a number of lows to read
    example:
        input   1
        retrun  1

        input   1 2 3
        return  [1,2,3]
        input   1 2 3
                4 
        return  [[1,2,3],
                [4]]
    """
    if n == 0:
        temp = list(map(int, input().split()))
        if len(temp) == 1:
            if flag == "l":
                return temp
            else:
                return temp[0]
        elif len(temp) > 1:
            return temp
    else:
        temp = [list(map(int, input().split())) for _ in range(n)]
        return temp


n, k = xnxn()
a = xnxn(flag="l")
for _ in range(k):
    tmp = [0]*(n+1)
    for i in range(0, n):
        l = max(0, i - a[i])
        r = min(n, i + a[i]+1)
        tmp[l] += 1
        tmp[r] -= 1
    for i in range(1, n):
        tmp[i] += tmp[i - 1]
    if a == tmp:
        break
    a = tmp

for i in a[:n]:
    print(i, end=" ")
### BUGGY CODE ###

range = xrange
input = raw_input
MOD = 10**9+7
 
n = int(input())

dp = [0] * (1 << n)
for i in [i for i, x in enumerate(input().split()) if x == '1']:
    dp[1 << i] = 1

npow = 1 << n

A = [1<<j for j in range(n)]
masks = [[mask + jpow for mask in range(npow) if not mask & jpow] for jpow in A]

for i in range(n - 1):
    _dp = [0] * npow
    for j in [i for i, x in enumerate(input().split()) if x == '1']:
        jpow = 1 << j
        for mask in masks[j]:
            _dp[mask] += dp[mask ^ jpow]
    for mask in range(npow):
        _dp[mask] %= MOD
    dp = _dp
 
print(sum(dp) % MOD)

### FIXED CODE ###

range = xrange
input = raw_input
MOD = 10**9+7
 
n = int(input())

dp = [0] * (1 << n)
for i in [i for i, x in enumerate(input().split()) if x == '1']:
    dp[1 << i] = 1

npow = 1 << n

for i in range(n - 1):
    _dp = [0] * npow
    for j in [i for i, x in enumerate(input().split()) if x == '1']:
        jpow = 1 << j
        mask = 0
        while mask < npow:
            _dp[mask + jpow] += dp[mask]
            mask += 1 + ((mask+1) & jpow)
    for mask in range(npow):
        _dp[mask] %= MOD
    dp = _dp
 
print(sum(dp) % MOD)
### BUGGY CODE ###

N = int(input())
S = input()

ans = 0
for num in range(1000):
    target = str(num).zfill(3)
    cur = 0
    for s in S:
        if s == target[cur]:
            cur += 1
        if cur == 3:
            ans += 1
            break
print(ans)


### FIXED CODE ###

N = int(input())
S = input()

ans = 0
for num in range(1000):
    target = str(num).zfill(3)
    cur = 0
    for s in S:
        if s == target[cur]:
            cur += 1
        if cur == 3:
            ans += 1
            break
print(ans)
### BUGGY CODE ###

import numpy as np
import sys
n,k,q = map(int,input().split())
p = np.array([k]*n)
for i in range(q):
    p[int(input())-1] += 1
    p -= 1
for i in range(n):
    print('Yes' if p[i]>=1 else 'No')


### FIXED CODE ###

import numpy as np
import sys
n,k,q = map(int,input().split())
p = np.array([k]*n)
if k > q:
    for i in range(q):
        a = int(input())
    for i in range(n):
        print('Yes')
    sys.exit()
for i in range(q):
    p[int(input())-1] += 1
for i in range(n):
    print('Yes' if p[i]>=q+1 else 'No')
### BUGGY CODE ###

# C - Typical Stairs

MOD = (10 ** 9) + 7
INF = float('inf')
N, M = map(int, input().split())
A = [int(input()) for _ in range(M)]
dp = [0] * (N + 1)
dp[0] = 1
if 1 not in A:
    dp[1] = 1

for i in range(2, N + 1):
    if i in A:
        dp[i] = 0
    else:
        dp[i] = (dp[i - 1] + dp[i - 2]) % MOD

print(dp[N])


### FIXED CODE ###

# C - Typical Stairs

MOD = (10 ** 9) + 7
N, M = map(int, input().split())
A = [False] * (N + 1)
for _ in range(M):
    A[int(input())] = True
dp = [0] * (N + 1)
dp[0] = 1
if A[1] == False:
    dp[1] = 1

for i in range(2, N + 1):
    if A[i] == True:
        dp[i] = 0
    else:
        dp[i] = (dp[i - 1] + dp[i - 2]) % MOD

print(dp[N])
### BUGGY CODE ###

import scipy.misc

N = int(input())
lst = sorted(list(map(int, input().split())), reverse=True)

max_comb = -1
for i in range(N):
    if max_comb > scipy.misc.comb(lst[i], lst[i]//2, exact=1):
        break
    k = lst[i]
    mid = k/2
    high = i
    low = N-1
    dif = abs(mid - lst[low])
    #print(mid)
    while abs(high - low) > 1:
        if dif > abs(mid - lst[(high+low)//2]):
            dif = abs(mid - lst[(high+low)//2])
            low = (high+low)//2
        else:
            high = (high+low)//2
        #print(high, low)
    p = lst[high] if abs(mid - lst[high]) < abs(mid - lst[low]) else lst[low]
    comb = scipy.misc.comb(k, p, exact=1)
    if max_comb < comb:
        ans = (k, p)
        #print(ans, comb)
        max_comb = comb

print(ans[0], ans[1])

### FIXED CODE ###

N = int(input())
lst = sorted(list(map(int, input().split())), reverse=True)

max_comb = -1
k = lst[0]
mid = k/2
high = 1
low = N-1
while abs(high - low) > 1:
    if mid - lst[(high+low)//2] ==0:
        high = (high+low) // 2
        low = high
        break
    elif mid - lst[(high+low)//2] > 0:
        low = (high+low)//2
    else:
        high = (high+low)//2
p = lst[high] if abs(mid - lst[high]) < abs(mid - lst[low]) else lst[low]
print(k, p)
### BUGGY CODE ###

def binary_search(list, item):
    low = 0
    lengyh = len(list)
    if lengyh != 0 and list[lengyh - 1] < item:
        return lengyh - 1
    high = lengyh - 1

    while low <= high:
        mid = (low + high) // 2
        guess = list[mid]

        if guess == item - 1 or (mid < lengyh - 1 and (guess < item and list[mid + 1] > item)):
            return mid
        if guess > item:
            high = mid - 1
        else:
            low = mid + 1

    return None


N = int(input())
str_l = input()
num = 0
L = []
for v in str_l.split(' '):
    L.append(int(v))

L.sort()
for i in range(N):
    a = L[i]
    for j in range(i, N - 1):
        b = L[j + 1]
        index = binary_search(L[j + 2:], a + b)
        if index is None:
            continue
        else:
            for k in range(0, index + 1):
                c = (L[j + 2:])[k]
                if b + c > a and a + c > b:
                    num += 1

print(num)

### FIXED CODE ###

import bisect


N = int(input())
str_l = input()
num = 0
L = []
for v in str_l.split(' '):
    L.append(int(v))

L.sort()
for i in range(N - 1):
    a = L[i]
    for j in range(i, N - 2):
        b = L[j + 1]
        index = bisect.bisect_left(L[j + 2:], a + b)
        num += index
        # for k in range(0, index):
        #     c = (L[j + 2:])[k]
        #     if b + c > a and a + c > b:
        #         num += 1

print(num)
### BUGGY CODE ###

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

ans = []
for i in range(n):
    ans.append(A.index(i + 1) + 1)

print(' '.join(map(str, ans)))

### FIXED CODE ###

import numpy as np
n = int(input())
A = list(map(int, input().strip().split()))
arr = np.array(A)


print(' '.join(map(str, np.argsort(arr) + 1)))