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

from collections import defaultdict
import sys,heapq,bisect,math,itertools,string
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
AtoZ = [chr(i) for i in range(65,65+26)]
atoz = [chr(i) for i in range(97,97+26)]

def inpl_int(): return list(map(int, input().split()))
def inpl_str(): return list(map(int, input().split()))

def Comb(n):
    gyakugen = [1]*(n+1)
    fac = [1]*(n+1)

    for i in range(1,n+1):
        fac[i] = (fac[i-1]*i)%mod

    gyakugen[n] = pow(fac[n],mod-2,mod)

    for i in range(n,0,-1):
        gyakugen[i-1] = gyakugen[i]*i

    com = [1]*(n+1)

    for i in range(1,n+1):
        com[i] = (fac[n]*gyakugen[i]*gyakugen[n-i])%mod

    return com

N = int(input())
aa = inpl_int()

i = 1
while True:
	if aa.count(i)==2:
		X1 = aa.index(i)
		aa[X1] = 0
		X2 = aa.index(i)
		break
	i += 1

L,R = X1,N-X2
ALL = 1


ALL = Comb(N+1)
daburi = Comb(L+R)


for i in range(1,N+2):
	if L+R+1 >= i:
		print(ALL[i]-daburi[i-1])
	else:
		print(ALL[i])

### FIXED CODE ###

from collections import defaultdict
import sys,heapq,bisect,math,itertools,string
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
AtoZ = [chr(i) for i in range(65,65+26)]
atoz = [chr(i) for i in range(97,97+26)]

def inpl_int(): return list(map(int, input().split()))
def inpl_str(): return list(map(int, input().split()))

def Comb(n):
    gyakugen = [1]*(n+1)
    fac = [1]*(n+1)

    for i in range(1,n+1):
        fac[i] = (fac[i-1]*i)%mod

    gyakugen[n] = pow(fac[n],mod-2,mod)

    for i in range(n,0,-1):
        gyakugen[i-1] = (gyakugen[i]*i)%mod

    com = [1]*(n+1)

    for i in range(1,n+1):
        com[i] = (fac[n]*gyakugen[i]*gyakugen[n-i])%mod

    return com

N = int(input())
aa = inpl_int()

i = 1
dd = defaultdict(int)
for i,a in enumerate(aa):
	if dd[a] == 0:
		dd[a] = i+1
	else:
		X1 = dd[a]-1
		X2 = i

L,R = X1,N-X2
ALL = 1

ALL = Comb(N+1)
daburi = Comb(L+R)

for i in range(1,N+2):
	if L+R+1 >= i:
		print((ALL[i]-daburi[i-1])%mod)
	else:
		print(ALL[i]%mod)
### BUGGY CODE ###

import numpy as np
n=int(input())
a=list(map(int,input().split()))
a2=np.array(a.copy())
mod=10**9+7
def f(n,i):
  for j in range(i+1,n):
    c=eucrid(a[i],a[j])
    a[j]//=c
    
def eucrid(a,b):
  if a < b:
    a,b=b,a
  while True:
    if a%b==0:
      return b
    else:
      a,b=b,a%b

for i in range(n):
  f(n,i)
m = 1
for i in a:
  m = m * i
b=(m//a2)%mod
ans=np.sum(b)%mod
print(ans)

### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
mod=10**9+7

def eucrid(a,b):
  a,b=max(a,b),min(a,b)
  while True:
    if a%b==0:
      return b
    else:
      a,b=b,a%b
m=a[0]
for i in range(n):
  m=m//eucrid(m,a[i])*a[i]
b=0
m=m%mod
for i in a:
  b+=m*pow(i,mod-2,mod)%mod
print(b%mod)
### BUGGY CODE ###

n = int(input())
p = list(map(int, input().split()))
ans = 0

for i, item in enumerate(p):
    if min(p[:i+1]) == item:
        ans += 1

print(ans)


### FIXED CODE ###

n = int(input())
p = list(map(int, input().split()))
ans = 0
min_p = n

for i in p:
    if i <= min_p:
        min_p = i
        ans += 1

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

import numpy as np

N = int(input())
P = [int(i) for i in input().split()]

res = 1

for i in range(N-1, 0, -1):
    m = min(P[:i])
    if m > P[i]:
        res += 1

print(res)

### FIXED CODE ###

import numpy as np

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

res = 0
min_ = 2*10**5

for i in range(0, N):
    if P[i] <= min_:
        res += 1
    
        min_ = P[i]

print(res)
### BUGGY CODE ###

# ABC174 C

K=int(input())

res=1
r=7
while 1:
    if not r%K:
        break
    r=(10*r+7)%K
    res+=1
print(res)

### FIXED CODE ###

# ABC174 C

K=int(input())

res=1
r=7%K
flg=(K%2==0 or K%5==0)
if flg:
    res=-1
while not flg:
    if not r:
        break
    r=(10*r+7)%K
    res+=1
print(res)
### BUGGY CODE ###

from functools import reduce

def gcd(a,b):
    if a < b:
        a, b = b, a
    while a % b != 0:
        a, b = b, a % b
    return b

def lcm_base(x, y):
    return (x * y) // gcd(x, y)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

N = int(input())
A = list(map(int,input().split()))
B = []
div = 10**9+7

lcm_A = lcm_list(A)

for item in A:
    B.append(lcm_A//item)

print(sum(B)%div)


### FIXED CODE ###

from functools import reduce
import fractions

def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

N = int(input())
A = list(map(int,input().split()))
B = 0
div = 10**9+7

lcm_A = lcm_list(A)

for item in A:
    B+=(lcm_A//item)

print(B%div)
### BUGGY CODE ###

from math import ceil

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

d = ceil(pow(P, 1/N))
for i in range(ceil(pow(P, 1/N)), 0, -1):
  if P % i**N == 0:
    d = i
    break
print(d)

### FIXED CODE ###

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

if N == 1:
  d = P
else:
  d = 1
  i = 2
  while i <= round(pow(P, 1/N)):
    if P % i**N == 0:
      P //= i**N
      d *= i
    else:
      i += 1
print(d)
### BUGGY CODE ###

s = input()[::-1]

cnts = [1] + [0] * (2019 - 1)
tmp = 0
d = 1

for i in s:
    tmp += int(i) * d
    cnts[tmp % 2019] += 1
    d *= 10

ans = 0
for cnt in cnts:
    ans += (cnt - 1) * cnt // 2

print(ans)

### FIXED CODE ###

s = input()[::-1]

cnts = [1] + [0] * (2019 - 1)
tmp = 0
d = 1

for i in s:
    tmp += int(i) * d
    cnts[tmp % 2019] += 1
    d = d * 10 % 2019 # 桁数が大きくなりすぎる → 10と2019が素だから可能

ans = 0
for cnt in cnts:
    ans += (cnt - 1) * cnt // 2

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

# coding: utf-8

state = list(input())
print_state = "".join(state)

times = 0
while "BW" in print_state:
    for i in range(len(state)):
        if state[i] == "B":
            if i < len(state)-1 and state[i+1] == "W":
                state[i] = "W"
                state[i+1] = "B"
                times += 1
                print_state = "".join(state)
                
print(times)
    

### FIXED CODE ###

# coding: utf-8

s = list(input())
time = 0
count = 0
for i in range(len(s)):
  if s[i] == "W":
    time += i - count
    count += 1

print(time)
### BUGGY CODE ###

# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

from fractions import gcd

sys.setrecursionlimit(100000)


def read_int():
    return int(input())


def read_int_n():
    return list(map(int, input().split()))


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap



@mt
def slv(N, A):
  
    ans = 0
    for i in range(N):
        cand = A[0] if i != 0 else A[1]
        for j, a in enumerate(A):
            if i == j:
                continue
            cand = gcd(cand, a)
            if cand <= ans:
                break
        ans = max(ans, cand)
        
    return ans


def main():
    N = read_int()
    A = read_int_n()
    print(slv(N, A))

    # N  = 10**5
    # A = [10**9] * N
    # print(slv(N, A))


if __name__ == '__main__':
    main()


### FIXED CODE ###

# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

from fractions import gcd

sys.setrecursionlimit(100000)


def read_int():
    return int(input())


def read_int_n():
    return list(map(int, input().split()))


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap



@mt
def slv(N, A):
    L = [A[0]]
  
    for a in A[1:]:
        L.append(gcd(L[-1], a))
        
    R = [-1] * N
    R[-1] = A[-1]
    for i in range(N-2, -1, -1):
        R[i] = gcd(R[i+1], A[i])
    
    ans = 0
    for i in range(N):
        if i == 0:
            ans = max(ans, R[i+1])
        elif i == N-1:
            ans = max(ans, L[i-1])
        else:
            ans = max(ans, gcd(L[i-1], R[i+1]))
    return ans
    


def main():
    N = read_int()
    A = read_int_n()
    print(slv(N, A))


if __name__ == '__main__':
    main()
### BUGGY CODE ###

N = int(input())
C, S, F = [], [], []
for _ in range(N - 1):
    c, s, f = map(int, input().split())
    C.append(c)
    S.append(s)
    F.append(f)


def next_time(i, t):
    a = S[i]
    while a < t:
        a += F[i]
    return a


for i in range(N):
    time = 0
    for j in range(i, N - 1):
        time = next_time(j, time)
        time += C[j]

    print(time)


### FIXED CODE ###

N = int(input())
C, S, F = [], [], []
for _ in range(N - 1):
    c, s, f = map(int, input().split())
    C.append(c)
    S.append(s)
    F.append(f)


def next_time(i, t):
    a = S[i]
    if t - a < 0:
        return a
    if t % F[i] == 0:
        return t
    b = (t - a + F[i] - 1) // F[i]
    # print(i, t, a, b, t + b * F[i])
    assert (a + b * F[i]) % F[i] == 0
    return a + b * F[i]


for i in range(N):
    time = 0
    for j in range(i, N - 1):
        time = next_time(j, time)
        time += C[j]

    print(time)
### BUGGY CODE ###

from collections import deque
N = int(input())
D = deque(sorted(list(map(int, input().split()))))
M = int(input())
T = deque(sorted(list(map(int, input().split()))))
ans = 'YES'
for i in range(M):
  prb = T.pop()
  #print(D, T, prb)
  if prb in D:
    D.remove(prb)
  else:
    ans = 'NO'
    break
print(ans)


### FIXED CODE ###

import collections
N = int(input())
D = collections.Counter(list(map(int, input().split())))
M = int(input())
T = collections.deque(sorted(list(map(int, input().split()))))
ans = 'YES'
for i in range(M):
  prb = T.pop()
  #print(prb, D)
  if prb in D:
    if D[prb]:
      D[prb] -= 1
      if not D[prb]:
        del D[prb]
    else:
      ans = 'NO'
      break
  else:
    ans = 'NO'
    break
print(ans)
### BUGGY CODE ###


import fractions as fr
import functools as ft
#import math as fr


prime = 10**9+7

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

an.sort()


lcm_ = 1
for a in an :
    lcm_ = a*lcm_ // fr.gcd(a, lcm_)
#    print(lcm_)
    
#ans = 0
#for a in an:
#    ans += lcm_ // a
#    ans = ans % prime if ans >= prime else ans

ans = ft.reduce(lambda x,y: (x + lcm_//y)%(prime*100), an ,0 )

print(ans%prime)

### FIXED CODE ###


import fractions as fr
import functools as ft
#import math as fr


prime = 10**9+7

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

an.sort()


lcm_ = 1
for a in an :
    lcm_ = a*lcm_ // fr.gcd(a, lcm_)
#    print(lcm_)
    
#ans = 0
#for a in an:
#    ans += lcm_ // a
#    ans = ans % prime if ans >= prime else ans

ans = ft.reduce(lambda x,y: (x + lcm_//y), an ,0 )

print(ans%prime)
### BUGGY CODE ###

def bit_add(bit, i, x):
    i += 1
    n = len(bit)
    while i <= n:
        bit[i - 1] += x
        i += i & -i


def bit_sum(bit, i):
    result = 0
    i += 1
    while i > 0:
        result += bit[i - 1]
        i -= i & -i
    return result


def main():
    from sys import stdin
    from builtins import int, list, map, range
    readline = stdin.readline
    N, D, A = map(int, readline().split())
    XH = [tuple(map(int, readline().split())) for _ in range(N)]

    XH.sort()
    result = 0
    bit = [0] * (N + 1)
    for i in range(N):
        x, h = XH[i]
        h -= bit_sum(bit, i)
        if h <= 0:
            continue
        c = (h + A - 1) // A
        result += c
        bit_add(bit, i, c * A)

        t = x + 2 * D
        ok = i
        ng = N
        while ng - ok != 1:
            m = ok + (ng - ok) // 2
            if XH[m][0] <= t:
                ok = m
            else:
                ng = m
        bit_add(bit, ng, -c * A)
    print(result)


main()


### FIXED CODE ###

N, D, A = map(int, input().split())
XH = [list(map(int, input().split())) for _ in range(N)]

XH.sort()
q = []
t = 0
result = 0
for x, h in XH:
    while True:
        if len(q) == 0:
            break
        if x <= q[0][0]:
            break
        t -= q[0][1]
        q.pop(0)
    h -= t
    if h < 0:
        continue
    c = (h + A - 1) // A
    result += c
    t += c * A
    q.append((x + 2 * D, c * A))
print(result)
### BUGGY CODE ###

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

ans = 1
for a in a_lst:
    ans = ans * a
if ans > 10**18:
    print("-1")
else:
    print(ans)

### FIXED CODE ###

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

ans = 1
if 0 in a_lst:
    print(0)
else:
    for a in a_lst:
        ans *= a
        if ans > 10**18:
            ans = -1
            break
    print(ans)
### BUGGY CODE ###

import sys
sys.setrecursionlimit(1000000)
input = sys.stdin.readline
mod = 10**9+7
def dfs(n,fr):
    color = 0
    if(fr==-1):
        color = K-1
    else:
        color = K-2
    if(K<len(edges[n])):
        return 0
    else:
        case_num = 1
        for e in edges[n]:
            if(e==fr):continue
            case_num*=color
            case_num*=dfs(e,n)
            color-=1
            case_num%=mod

        return case_num

if(__name__=='__main__'):
    N,K = [int(x) for x in input().split()]
    edges = [[] for _ in range(N)]
    for _ in range(N-1):
        s,d = [int(x) for x in input().split()]
        edges[s-1].append(d-1)
        edges[d-1].append(s-1)
    ans = K*dfs(0,-1)
    print(ans%mod)


### FIXED CODE ###

import sys
from collections import deque
sys.setrecursionlimit(1000000)
input = sys.stdin.readline
mod = 10**9+7
def dfs():
    stack = deque([[-1,0]])
    visited = set()
    case_num=1
    while stack:
        fr,n = stack.pop()
        if(n in visited):continue
        visited.add(n)
        color = 0
        if(fr==-1):
            color = K-1
        else:
            color = K-2
        if(K<len(edges[n])):
            return 0
        else:
            for e in edges[n]:
                if(e==fr):continue
                case_num*=color
                color-=1
                stack.append([n,e])
                case_num%=mod
    return case_num%mod

if(__name__=='__main__'):
    N,K = [int(x) for x in input().split()]
    edges = [[] for _ in range(N)]
    for _ in range(N-1):
        s,d = [int(x) for x in input().split()]
        edges[s-1].append(d-1)
        edges[d-1].append(s-1)
    ans = K*dfs()
    print(ans%mod)
### BUGGY CODE ###

d=[0]*8**7
for i in[*open(0)][1].split():d[int(i)]+=1
i=r=0
while i<1e6:
 i+=1;r+=d[i]==1;j=i
 while j<1e6:j+=i;d[j]&=d[i]<1
print(r)

### FIXED CODE ###

d = [0] * (10**6 + 1)
n = int(input())
for a in map(int, input().split()):
    d[a] += 1
ans = 0
for i in range(1, 10**6 + 1):
    if d[i] == 1:
        ans += 1
    if d[i] > 0:
        for j in range(i, 10**6 + 1, i):
            d[j] = 0
print(ans)
### BUGGY CODE ###

K = int(input())
total = 0


def ab_gcd(a: int, b: int):
    small = min(a, b)
    large = max(a, b)
    r = large % small
    if r != 0:
        return ab_gcd(r, small)
    else:
        return small


for i in range(1, K+1):
    for j in range(1, i+1):
        for k in range(1, j+1):
            gcd1 = ab_gcd(i, j)
            gcd2 = ab_gcd(k, gcd1)
            if i == j == k:
                total += gcd2
            elif i == j and j != k:
                total += gcd2 * 3
            elif i != j and j == k:
                total += gcd2 * 3
            else:
                total += gcd2 * 6

print(total)


### FIXED CODE ###

import math
from functools import reduce

K = int(input())
total = 0


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


for i in range(1, K+1):
    for j in range(1, i+1):
        for k in range(1, j+1):
            s = [i, j, k]
            if i == j == k:
                total += gcd_list(*s)
            elif i == j and j != k:
                total += gcd_list(*s) * 3
            elif i != j and j == k:
                total += gcd_list(*s) * 3
            else:
                total += gcd_list(*s) * 6

print(total)
### BUGGY CODE ###


def solve():
  n = int(input())
  l = []
  for i in range(n):
    a = int(input())
    l.append(a)
  
  bit = 0
  for j in l:
    bit ^= (1 << j)

  ans = countSetBits(bit)
  print(ans)

def countSetBits(n):
  count = 0
  while(n):
    count += n & 1
    n >>= 1
  return count

if __name__ == "__main__":
  solve()

### FIXED CODE ###

n = int(input())
di = {}

for x in range(n):
  i = int(input())
  if (i in di.keys()):
    di.pop(i)
  else:
    di[i] = i
print(len(di))
### BUGGY CODE ###

N = int(input())
Ai = [0] * N
Ai = list(map(int,input().split()))
Ans = 1

for i in range(N):
  Ans = Ans * Ai[i]
  
if Ans <= 10**18:
  print(Ans)
else:
  print('-1')

### FIXED CODE ###

N = int(input())
Ai = [0] * N
Ai = list(map(int,input().split()))
Ai.sort()
Ans = 1

for i in range(N):
  if Ai[i] == 0:
    Ans = 0
    break
    
  Ans = Ans * Ai[i]

  if Ans > 10 ** 18:
    Ans = -1
    break
  
if Ans <= 10**18:
  print(Ans)
else:
  print('-1')
### BUGGY CODE ###

import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

K, Q = na()
d = na()

for z in range(Q):
    n, x, m = na()

    n -= 1

    rem = n%K
    pre = m-1
    x %= m
    ans = 0
    for i in range(rem):
        pre = x
        x = (x + d[i]) % m
        if pre < x:
            ans += 1

    lpre = 0
    turn = 0
    # print(d[rem:] +  d[:rem])
    for v in d[rem:] + d[:rem]:
        cur = (lpre + v) % m
        if lpre < cur:
            turn += 1
        lpre = cur
    my = turn*m - lpre
    # print(turn, m, my, n//K, x)
    ans += (my * (n//K) + m-x-1) // m - (m-x-1)//m
    print(ans)


### FIXED CODE ###

import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

K, Q = na()
d = na()

for z in range(Q):
    n, x, m = na()

    n -= 1

    rem = n%K
    pre = m-1
    x %= m
    ans = 0
    for i in range(rem):
        pre = x
        x = (x + d[i]) % m
        if pre < x:
            ans += 1

    lpre = 0
    turn = 0
    # print(d[rem:] +  d[:rem])
    for v in d[rem:] + d[:rem]:
        cur = (lpre + v) % m
        if lpre < cur:
            turn += 1
        lpre = cur
    my = turn*m - lpre
    # print(turn, m, my, n//K, x)
    ans += (my * (n//K) + m-x-1) // m - (m-x-1)//m
    print(ans)
### BUGGY CODE ###

s=list(input())
s.reverse()

MOD=10**9+7
dp = [[0 for _ in range(13)] for _ in range(len(s)+1)]
dp[0][0]=1
for i in range(len(s)):
    nd=s[i]
    for mod in range(13):
        dp[i][mod] %=MOD
        if dp[i][mod]==0:
            continue

        for d in range(10):
            if nd != "?" and str(d)!=nd:
                continue
            nmod=(d*(pow(10,i,13)) + mod) % 13
            dp[i+1][nmod] += dp[i][mod]

print(dp[-1][5]%MOD)

### FIXED CODE ###

s=list(input())
s.reverse()

MOD=10**9+7
dp = [[0 for _ in range(13)] for _ in range(len(s)+1)]
dp[0][0]=1
keta=1
for i in range(len(s)):
    nd=s[i]
    for mod in range(13):
        dp[i][mod] %=MOD
        if dp[i][mod]==0:
            continue

        for d in range(10):
            if nd != "?" and str(d)!=nd:
                continue
            nmod=(d*keta + mod) % 13
            dp[i+1][nmod] += dp[i][mod]
    keta*=10
    keta%=13

print(dp[-1][5]%MOD)
### BUGGY CODE ###

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

s = 0
for i in range(N-1):
    num = i
    t = 0
    while num < N - 1 and H[num] >= H[num + 1]:
        t += 1
        num += 1
    if s <= t:
        s = t
        
print(s)

### FIXED CODE ###

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

s = 0
i = 0
while 0 <= i < N - 1:
    num = i
    t = 0
    while num < N - 1 and H[num] >= H[num + 1]:
        t += 1
        num += 1
    if s <= t:
        s = t
    i = num + 1
        
print(s)
### BUGGY CODE ###

n = int(input())
l = list(map(int,input().split()))
l1 = l.count(1)
l2 = l.count(2)
l3 = l.count(3)

dp = [[[0]*(l3+1) for i in range(l2+l3+1)] for j in range(n+1)]

for i in range(1,n+1):
    for j in range(min(i,l2+l3)+1):
        for k in range(min(j,l3)+1):
            s = i-j
            t = j-k
            count = n
            if s > 0:
                count += dp[s-1][t][k]*s
                
            if t > 0 :
                count += dp[s+1][t-1][k]*t
            if k > 0 :
                count += dp[s][t+1][k-1]*k

            count *= 1/(s+t+k)
            dp[s][t][k] = count

print(dp[l1][l2][l3])



### FIXED CODE ###

N=int(input())
A=[int(i) for i in input().split()]
I,J,K=0,0,0
for a in A:
    if a==1:
        I+=1
    if a==2:
        J+=1
    if a==3:
        K+=1
L=I+J+K
M=J+K
dp=[[[0.0]*(K+1) for i in range(M+1)] for i in range(L+1)]
for n in range(1,L+1):#n=i+j+k
    for m in range(min(n,M)+1):#m=j+k
        for k in range(min(m,K)+1):
            j=m-k
            i=n-m
            #print(i,j,k)
            ret=N/(i+j+k)
            if i>0:
                ret+=dp[i-1][j][k]*(i/(i+j+k))
            if j>0:
                ret+=dp[i+1][j-1][k]*(j/(i+j+k))
            if k>0:
                ret+=dp[i][j+1][k-1]*(k/(i+j+k))
            dp[i][j][k]=ret
print(dp[I][J][K])
### BUGGY CODE ###

dx = [-1,-1,-1,0,0,1,1,1]
dy = [-1,0,1,-1,1,-1,0,1]
H,W,N = map(int,input().split())
s = []
d = {}
for i in range(N):
    a,b = map(int,input().split())
    f = 1
    if b <= 1:
        f = 0
    if b >= W:
        f = 0
    if a <= 1:
        f = 0
    if a >= H:
        f = 0
    if f == 1:
        if (a,b) not in s:
            d[(a,b)] = 0
            s.append((a,b))
        d[(a,b)] += 1
    for j in range(8):
        A = a + dy[j]
        B = b + dx[j]
        if A <= 1:
            continue
        if A >= H:
            continue
        if B <= 1:
            continue
        if B >= W:
            continue
        if (A,B) not in s:
            d[(A,B)] = 0
            s.append((A,B))
        d[(A,B)] += 1
ans = [(H-2)*(W-2)-len(s),0,0,0,0,0,0,0,0,0]
for (x,y) in s:
    ans[d[(x,y)]] += 1
for i in range(10):
    print(ans[i])

### FIXED CODE ###

dx = [-1,-1,-1,0,0,1,1,1,0]
dy = [-1,0,1,-1,1,-1,0,1,0]
H,W,N = map(int,input().split())
from collections import defaultdict, Counter
d = defaultdict(int)
for i in range(N):
    a,b = map(int,input().split())
    for j in range(9):
        A = a + dy[j]
        B = b + dx[j]
        f = 0
        if 2 <= A <= H-1:
            if 2 <= B <= W-1:
                f = 1
        if f == 1:
            d[(A,B)] += 1
s = 0
c = Counter(d.values())
for i in range(1,10):
    s += c[i]
c[0] = (H-2)*(W-2) - s
for i in range(10):
    print(c[i])