Harryxun/stf_run huggingface dataset:
import numpy as np
# import math
# import copy
# from collections import deque
import sys
input = sys.stdin.readline
# sys.setrecursionlimit(10000)


def main():
    N = int(input())
    xy = [list(map(int,input().split())) for i in range(N)]

    xy = np.array(xy)
    # print(xy)

    diffs = xy - xy.T
    print(-1)
    md = np.sum(np.abs(diffs),axis=-1)
    res = md.max()

    # print(diffs)
    # print(md)

    print(res)



main()


### FIXED CODE ###

import numpy as np
# import math
# import copy
# from collections import deque
import sys
input = sys.stdin.readline
# sys.setrecursionlimit(10000)


def main():
    N = int(input())
    xy = [list(map(int,input().split())) for i in range(N)]

    z_max = 0
    z_min = 2 * 10 **9

    w_max = - 10 ** 9
    w_min = 10 ** 9

    for i in range(N):
        z = xy[i][0] + xy[i][1]
        w = xy[i][0] - xy[i][1]
        z_max = max(z_max,z)
        z_min = min(z_min,z)
        w_max = max(w_max,w)
        w_min = min(w_min,w)

    res = max(z_max-z_min,w_max-w_min)

    print(res)



main()
#-*-coding:utf-8-*-

import numpy as np

def main():
    n = int(input())
    ashiba=np.array((input().split()),int)
    dp=np.zeros(n,dtype=int)
    k=2
    for i in range(1,n):
        start=max(0,i-k)
        dp[i]=min(dp[start:i]+abs(ashiba[i]-ashiba[start:i]))
    print(dp[N-1])

if __name__ == "__main__":
    main()

### FIXED CODE ###

#-*-coding:utf-8-*-

import sys

def distance(ashiba,i,j):
    return abs(ashiba[i]-ashiba[j])    

def main():
    N = int(input())
    ashiba = list([int(i) for i in input().split()])
    cost_list=[]
    cost1=0
    cost2=0

    for i in range(N):
        if i==0:
            cost_list.append(0)
        elif i==1:
            cost1 = distance(ashiba,i,i-1)
            cost_list.append(cost1)
        else:
            cost1=distance(ashiba,i,i-1)
            cost2=distance(ashiba,i,i-2)
            cost=min(cost1+cost_list[i-1],cost2+cost_list[i-2])
            cost_list.append(cost)
    print(cost_list[-1])

if __name__ == "__main__":
    main()
x = imput()
print x **= 3


### FIXED CODE ###

x = input()
print (x ** 3)
10
1 8 10 5 8 12 34 100 11 3

### FIXED CODE ###

N = int(input())
*L, = map(int, input().split())

L_sum = sum(L)

res = True
for l in L:
    if ((L_sum - l) <= l):
        res = False

if (res):
    print('Yes')
else:
    print('No')
r,x = map(int,raw_input().split())
matrix = []
for i in range(r):
    matrix.append(map(int,raw_input().split()))

a = [0 for j in range(c)]

matrix.append(a)

for i in range(r):
    sum = 0
    for j in range(c):
        sum += matrix[i][j]
    matrix[i].append(sum)

for j in range(c):
    sum = 0
    for i in range(r):
        sum += matrix[i][j]
    matrix[r][j] = sum

sum = 0
for j in range(c):  
    sum += matrix[r][j]
matrix[r].append(sum)

for i in range(r+1):
    for j in range(c+1):
        print matrix[i][j],
    print ""

### FIXED CODE ###

r,c = map(int,raw_input().split())
matrix = []
for i in range(r):
    matrix.append(map(int,raw_input().split()))

a = [0 for j in range(c)]

matrix.append(a)

for i in range(r):
    sum = 0
    for j in range(c):
        sum += matrix[i][j]
    matrix[i].append(sum)

for j in range(c):
    sum = 0
    for i in range(r):
        sum += matrix[i][j]
    matrix[r][j] = sum

sum = 0
for j in range(c):  
    sum += matrix[r][j]
matrix[r].append(sum)

for i in range(r):
    for j in range(c):
        print matrix[i][j],
    print matrix[i][c]

for j in range(c + 1):
    print matrix[r][j],
import bisect

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

cnt = 1
while cnt <= M:
    x = bisect.bisect_right(A, A[-1]/2)
    for i in range(x + 1):
        A[-i -1] /= 2
        cnt += 1
        if cnt > M:
            break
    A.sort()

print(sum(map(int, A)))

### FIXED CODE ###

import bisect

N, M = list(map(int, input().split()))
A = list(map(lambda x: int(x) * -1, input().split()))
A.sort()

cnt = 1
while cnt <= M:
    x = bisect.bisect(A, A[0]/2)
    for i in range(x):
        A[i] /= 2
        cnt += 1
        if cnt > M:
            break
    if x != 0 or x != len(A):
        A.sort()
print(sum(map(lambda x: int(-x), A)))
a = input()
count = 0
mx = 0
for i in range(len(a)):
	if a[i] == "A" or a[i] == "C" or a[i] == "G" or a[i] == "T":
      count += 1
    else:
      count = 0
    if ma < count:
      mx = count
print(mx)

### FIXED CODE ###

a = input()
count = 0
mx = 0
for i in range(len(a)):
    if a[i] == "A" or a[i] == "C" or a[i] == "G" or a[i] == "T":
        count += 1
    else:
        count = 0
    if mx < count:
        mx = count
print(mx)
coding: utf-8

value = int(input())

gokei = 0

for i in range(value):
    gokei += i + 1
    
print(gokei)

### FIXED CODE ###

#coding:utf-8
 
value = int(input())
 
gokei = 0
 
for i in range(value):
    gokei += i + 1
    
print(gokei)
List=[7,5,3]
X=int(input())
if X in List:
  print("YES")
Else:
  print("NO")

### FIXED CODE ###

x=int(input())
if x in [7,5,3]:
  print("YES")
else:
  print("NO")
N, M = map(int, input().split())
A = []
B = []
pt = [[] for i in range(M)]
#print(pt)
for i in range(M):
	a, b =  map(int, input().split())
	a -=1
	b -=1
	#A.append(a)
	#B.append(b)
	pt[a].append(b)
	pt[b].append(a)
#	print(pt)
#print(A)
#print(B)
print(pt)
n=M
#n=7
#pt=[[1, 2, 3], [0], [5, 0], [6, 0], [6], [2], [3, 4]]
res_list = [-1] * n
def bfs(v):
    d=[-1]*n
    d[v]=0
    q=[v]
    c=1
    while q:
        q1=[]
        for i in q:
            for j in pt[i]:
                if d[j]==-1:
                    d[j]=c
                    q1.append(j)
                    res_list[j]=i
        q=q1
        c+=1
#        print(d,q)
    return d
res = bfs(0)

no = 'No'
yes ='Yes'
if -1 in res:
	print(no)
else:
	print(yes)
	
for i,x in enumerate(res_list):
	if i==0 or x==0:
		continue
	print(x+1)

### FIXED CODE ###

N, M = map(int, input().split())
A = []
B = []
pt = [[] for i in range(N)]
for i in range(M):
	a, b =  map(int, input().split())
	a -=1
	b -=1
	pt[a].append(b)
	pt[b].append(a)
n=N
res_list = [-1] * N
def bfs(v):
    d=[-1]*n
    d[v]=0
    q=[v]
    c=1
    while q:
        q1=[]
        for i in q:
            for j in pt[i]:
                if d[j]==-1:
                    d[j]=c
                    q1.append(j)
                    res_list[j]=i
        q=q1
        c+=1
    return d
res = bfs(0)

no = 'No'
yes ='Yes'
if -1 in res:
	print(no)
else:
	print(yes)
	
for i,x in enumerate(res_list):
	if i==0:
		continue
	print(x+1)
from collections import deque

N, Q = map(int, input().split(' '))
tree = [[] for i in range(N + 1)]
for i in range(N - 1):
    a, b = map(int, input().split(' '))
    tree[a].append([a, b])
    tree[b].append([b, a])
val = [0] * (N + 1)
for i in range(Q):
    p, x = map(int, input().split(' '))
    val[p] += x
ans = [-1] * (N + 1)
ans[1] = val[1]
bfs = deque(tree[1])
while bfs:
    p, n = bfs.popleft()
    if ans[n] == -1:
        ans[n] = val[n] + ans[p]
        for i in tree[n]:
            bfs.append(i)
for i in ans[1:-1]:
    print(i,'',end="")
print(ans[-1])

### FIXED CODE ###

def main():
    a=int(input())
    s=input()
    if a >= 3200:
        print(s)
    else:
        print('red')

if __name__ == '__main__':
    main()
α = (input())
if α = A or B or C or D or E or F or G or H or I or J or K or L or M or N or O or P or Q or R or S or T or U or V or W or X or Y or Z:
    print(A)
else:
    print(a)


### FIXED CODE ###

α = input()
if α in['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']:
    print('A')
else:
    print('a')
n,m,k = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))

acum1 = [0]
for i in range(n):
    acum1.append(acum1[-1] + a[i])

acum2 = [0]
for i in range(m):
    acum2.append(acum2[-1]+b[i])
i = 0
ans = 0
j = m
while acum1[i]<=k:
    while acum2[j]>k-acum1[i] and j>0:
        j -= 1
    ans = max(ans,i+j)
    i+=1
print(ans)
        

### FIXED CODE ###

#　変数 n, m, k, arr1, arr2, acum1, acum2, ans

n, m, k = map(int, input().split())
arr1 = list(map(int, input().split()))
arr2 = list(map(int, input().split()))

acum1 = [0]
for i in range(n):
    acum1.append(acum1[-1] + arr1[i])
acum2 = [0]
for i in range(m):
    acum2.append(acum2[-1] + arr2[i])

ans = 0
j = m
for i in range(n+1):
    if acum1[i] > k:
        break
    while acum2[j] > k - acum1[i] and j > 0:
        j -= 1
    ans = max(ans, i+j)
print(ans)
A,B,K = map(int,input().split())
T = A - K
O = 0
if T >= 0:
	print(T, 0)
	else:
      print(0,O-T)

### FIXED CODE ###

A,B,K = map(int,input().split())
T = A - K
O = B

if T >= 0:
    print(T, O)
elif O+T >=0:
    print(0,O+T)
else:
    print(0,0)
a,b,c = list(map(int, input().split()))

if sqrt(a) + sqrt(b) < sqrt(c):
    print('Yes')
else:
    print('No')

### FIXED CODE ###

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

if c-a-b > 0 and 4*a*b< (c-a-b)**2:
    print('Yes')
else:
    print('No')
r = int(input())
ptint(r**2)


### FIXED CODE ###

r = int(input())
print(r**2)
n = input()
n = int(n)

li = [int(input()) for i in range(n)]
m = max(li)
for j in range(n):
  if m < li[j]:
    print(m)
  else:
    buf=li.pop(j)
    print(max(li))

### FIXED CODE ###

n = input()
n = int(n)

li = [int(input()) for i in range(n)]
m = max(li)
m2 = sorted(li)[-2]

for j in range(n):
  if m == li[j]:
    print(m2)
  else:
    print(m)
from scipy.sparse.csgraph import csgraph_from_dense,dijkstra

xs, ys, xt, yt = map(int, input().split())
n = int(input())

p = [(xs,ys,0),(xt,yt,0)]
for i in range(2,n+2):
    p.append(tuple(map(int,input().split())))
edge = [[-1]*(n+2)for i in range(n+2)]
 
for i in range(n+2):
    for j in range(i+1,n+2):
        edge[i][j] = edge[j][i] =  max(((p[i][0]-p[j][0])**2+(p[i][1]-p[j][1])**2)**0.5 - p[i][2] - p[j][2],0.0)

G = csgraph_from_dense(edge,null_value=-1)
print(dijkstra(G,indices=0)[1])

#print(d[1])


### FIXED CODE ###

Xs,Ys,Xt,Yt = map(int,input().split())
n = int(input())
p = [(Xs,Ys,0),(Xt,Yt,0)]
for i in range(2,n+2):
    p.append(tuple(map(int,input().split())))
cost = [[0]*(n+2)for i in range(n+2)]

for i in range(n+2):
    for j in range(i,n+2):
        cost[i][j] = cost[j][i] =  max(((p[i][0]-p[j][0])**2+(p[i][1]-p[j][1])**2)**0.5 - p[i][2] - p[j][2],0)
n += 2
s = 0
#始点sから各頂点への最短距離
#n:頂点数,　w:辺の数, cost[u][v] : 辺uvのコスト(存在しないときはinf)
d = [float("inf")] * n
used = [False] * n
d[s] = 0
    
while True:
    v = -1
    #まだ使われてない頂点の中から最小の距離のものを探す
    for i in range(n):
        if (not used[i]) and (v == -1):
           v = i
        elif (not used[i]) and d[i] < d[v]:
            v = i
    if v == -1:
           break
    used[v] = True
           
    for j in range(n):
           d[j] = min(d[j],d[v]+cost[v][j])
print(d[1])
if S=='AAA' or S='BBB':
  print('No')
else
  print('Yes')
  

### FIXED CODE ###

S = input()
if 'A' in S and 'B' in S:
    print('Yes')
else:
    print('No')
print (x^3)

### FIXED CODE ###

x = raw_input()
print(int(x)**3)
import sys
#from collections import defaultdict, deque, Counter
#import bisect
#import heapq
#import math
#from itertools import accumulate
#from itertools import permutations as perm
#from itertools import combinations as comb
#from itertools import combinations_with_replacement as combr
#from fractions import gcd
#import numpy as np

stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)
MIN = -10 ** 9
MOD = 10 ** 9 + 7
INF = float("inf")
IINF = 10 ** 18

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

def is_prime(n):
    if n == 1:
        return False
    for i in range(2,int(n**0.5)+1):
        if n % i == 0:
            return False
    return True

def main():
    n = int(stdin.readline().rstrip())
    l = factorization(n)
    z = []
    for i in range(len(l)):
        #[i][0]がpの候補
        if is_prime(l[i][0]):
            for j in range(l[i][1]):
                z.append(l[i][0] ** (j+1))
    z = list(set(z))
    z.sort()
    ans = 0
    for i in range(len(z)):
        if n % z[i] == 0:
            n = n / z[i]
            ans += 1
        if n < z[i+1]:
            print(ans)
            exit()
    print(ans)

main()


### FIXED CODE ###

import sys
#import string
#from collections import defaultdict, deque, Counter
#import bisect
#import heapq
#import math
#from itertools import accumulate
#from itertools import permutations as perm
#from itertools import combinations as comb
#from itertools import combinations_with_replacement as combr
#from fractions import gcd
#import numpy as np

stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)
MIN = -10 ** 9
MOD = 10 ** 9 + 7
INF = float("inf")
IINF = 10 ** 18
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])
    if arr==[]:
        arr.append([n, 1])
    return arr

def solve():
    x = int(stdin.readline().rstrip())
    p = factorization(x)
    num = []
    if x == 1:
        print(0)
        exit()
    for i in p:
        for j in range(i[1]):
            if x%(i[0] ** (j+1)) == 0:
                num.append(i[0] ** (j+1))
                x = x/(i[0] ** (j+1))
            else:
                break
    print(len(num))
    exit()



if __name__ == '__main__':
    solve()
import itertools
import numpy as np

# = int(input())
N, M, X = map(int, input().split())
# = list(map(int, input().split()))
# = [int(input()) for i in range(N)]
CA = [list(map(int, input().split())) for i in range(N)]

cost = []

skill = list(zip(*CA))

for i in range(1, M+1):
    if sum(skill[i]) < X:
        print(-1)
        exit()

for i in range(1, N):
    for balls in list(itertools.combinations(CA, i)):
        test = np.zeros(M+1)
        for j in balls:
            jtest = np.asarray(j)
            test = test + jtest

        if min(test[1:])>=X:
            cost.append(test[0])

print(int(min(cost)))


### FIXED CODE ###

import itertools
import numpy as np

# = int(input())
N, M, X = map(int, input().split())
# = list(map(int, input().split()))
# = [int(input()) for i in range(N)]
CA = [list(map(int, input().split())) for i in range(N)]

cost = []

skill = list(zip(*CA))

for i in range(1, M+1):
    if sum(skill[i]) < X:
        print(-1)
        exit()

for i in range(1, N+1):
    for balls in list(itertools.combinations(CA, i)):
        test = np.zeros(M+1)
        for j in balls:
            jtest = np.asarray(j)
            test = test + jtest

        if min(test[1:])>=X:
            cost.append(test[0])

print(int(min(cost)))
m = max(l)
ans = [m]*n
if len(set(l)) == 1:
    for i in ans:
        print(i)
else:
    x = sorted(set(l))[-2]
    a = l.index(m)
    ans[a] = x
    for i in ans:
        print(i)


### FIXED CODE ###

n = int(input())
l = []
for i in range(n):
    l.append(int(input()))
m = max(l)
ans = [m]*n
if len(set(l)) == 1 or l.count(m) > 1:
    for i in ans:
        print(i)
else:
    x = sorted(set(l))[-2]
    a = l.index(m)
    ans[a] = x
    for i in ans:
        print(i)
n = int(import())

print(n*n*n)

### FIXED CODE ###

N = int(input())
print(N*N*N)
c=input()
print(c+1)

### FIXED CODE ###

c=str(input())
if c == 'a' :
    print("b")
elif c == 'b' :
    print("c")
elif c == 'c' :
    print("d")
elif c == 'd' :
    print("e")
elif c == 'e' :
    print ("f")
elif c == 'f' :
    print("g")
elif c == 'g' :
    print("h")
elif c == 'h' :
    print("i")
elif c == 'i' :
    print("j")
elif c == 'j' :
    print("k")
elif c == 'k' :
    print("l")
elif c == 'l' :
    print("m")
elif c == 'm' :
    print("n")
elif c == 'n' :
    print("o")
elif c == 'o' :
    print("p")
elif c == 'p' :
    print("q")
elif c == 'q' :
    print("r")
elif c == 'r' :
    print("s")
elif c == 's' :
    print("t")
elif c == 't' :
    print("u")
elif c == 'u' :
    print("v")
elif c == 'v' :
    print("w")
elif c == 'w' :
    print("x")
elif c == 'x' :
    print("y")
elif c == 'y' :
    print("z")
import math
N, M = map(int, input().split())

if int(math.sqrt(M)) > N:
    divlist = []
    for i in range (N, int(math.sqrt(M))):
        if M%i == 0:
            divlist.append(i)
        else:
            continue
    
    if divlist != []:
        for i in range(N, int(math.sqrt(M))):
            if M%i == 0:
                ans = M//i
                break
            else:
                continue
    else:
        for i in range(N,0,-1):
            if M%i == 0:
                ans = i
                break
            else:
                continue
            
else:
    for i in range(M//N,0,-1):
        if M%i == 0:
            ans = i
            break
        else:
            continue

print(ans)

### FIXED CODE ###

G = int(input())
if G == 1:
    print('Hello World')
if G == 2:
    ANS = 0
    for i in range(2):
        ANS += int(input())
    print(ANS)
def solve(string):
    n, m, *a = map(int, string.split())
    needs = {i + 1: n for i, n in enumerate(map(int, "2 5 5 4 5 6 3 7 6".split()))}
    b = sorted(a, key=lambda x: needs[x])
    index = 0
    base = str(b[0]) * (n // needs[b[0]])
    n %= needs[b[0]]
    while n > 0:
        use = [_b for _b in b if needs[_b] <= needs[b[0]] + n]
        if max(use) == b[0]:
            tmp_n = use[-1]
            tmp_c = n // (needs[tmp_n] - needs[b[0]])
            base = base[:-tmp_c] + (str(tmp_n) * tmp_c)
            n -= (needs[tmp_n] - needs[b[0]]) * tmp_c
        else:
            tmp_n = use[-1]
            tmp_n = max(use)
            tmp_c = n // (needs[tmp_n] - needs[b[0]])
            base = base[:index] + str(tmp_n) * tmp_c + base[index + tmp_c:]
            n -= (needs[tmp_n] - needs[b[0]]) * tmp_c
            index += tmp_c
    return base


if __name__ == '__main__':
    print(solve('\n'.join([input(), input()])))


### FIXED CODE ###

def solve(string):
    n, m, *a = map(int, string.split())
    needs = {i + 1: n for i, n in enumerate(map(int, "2 5 5 4 5 6 3 7 6".split()))}
    if 2 in a and 5 in a:
        a.remove(2)
    if 3 in a and 5 in a:
        a.remove(3)
    if 2 in a and 3 in a:
        a.remove(2)
    if 6 in a and 9 in a:
        a.remove(6)
    b = sorted(a, key=lambda x: needs[x])
    index = 0
    base = str(b[0]) * (n // needs[b[0]])
    n %= needs[b[0]]
    while n > 0:
        use = [_b for _b in b if needs[_b] <= needs[b[0]] + n]
        if len(use) == 1:
            base = base[:-1]
            n += needs[b[0]]
        elif max(use) == b[0]:
            tmp_n = use[-1]
            tmp_c = n // (needs[tmp_n] - needs[b[0]])
            base = base[:-tmp_c] + str(tmp_n) * tmp_c
            n -= (needs[tmp_n] - needs[b[0]]) * tmp_c
        else:
            tmp_n = max(use)
            tmp_c = n // (needs[tmp_n] - needs[b[0]])
            base = base[:index] + str(tmp_n) * tmp_c + base[index + tmp_c:]
            n -= (needs[tmp_n] - needs[b[0]]) * tmp_c
            index += tmp_c
    return base


if __name__ == '__main__':
    print(solve('\n'.join([input(), input()])))
import sys

N = int(sys.stdin.readline())
D = list(map(int, sys.stdin.readline().split()))

times = [0] * 24
for d in D:
    times[d] += 1

if max(times) > 2 or times[0] == 2 or times[12] == 2:
    print(0)
else:
    ans = 0
    # 1 - 11時間の時差の場合、Diと24 - Diの両方を試す
    for i in range(2**11):
        positions = []
        if times[0] == 1:
            positions.append(0)
        for j in range(11):
            if times[j+1] == 2:
                positions.append(j+1)
                positions.append(24 - j-1)
            elif times[j+1] == 1:
                if (i >> j) & 1:
                    positions.append(24 - j-1)
                else:
                    positions.append(j+1)
        if times[12] == 1:
            positions.append(12)
        positions.sort()
        # print(positions)
        lp = len(positions)
        d = float("inf")
        for p in range(lp):
            # 0をまたぐ場合がある
            if p == lp -1:
                diff = 24 - positions[p] + positions[0]
            else:
                diff = positions[p+1] - positions[p]
            d = min(d, diff if diff != 24 else 0)
        ans = max(ans, d)

print(ans)

### FIXED CODE ###

import sys

N = int(sys.stdin.readline())
D = list(map(int, sys.stdin.readline().split()))

times = [0] * 24
times[0] = 1
for d in D:
    times[d] += 1

if max(times) > 2 or times[0] == 2 or times[12] == 2:
    print(0)
else:
    ans = 0
    # 1 - 11時間の時差の場合、Diと24 - Diの両方を試す
    for i in range(2**11):
        positions = [0]
        for j in range(1, 12):
            if times[j] == 2:
                positions.append(j)
                positions.append(24 - j)
            elif times[j] == 1:
                if (i >> j) & 1:
                    positions.append(24 - j)
                else:
                    positions.append(j)
        if times[12] == 1:
            positions.append(12)
        positions.sort()
        # print(positions)
        lp = len(positions)
        d = float("inf")
        for p in range(lp):
            # 0をまたぐ場合がある
            if p == lp -1:
                diff = 24 - positions[p] + positions[0]
            else:
                diff = positions[p+1] - positions[p]
            d = min(d, diff if diff != 24 else 0)
        ans = max(ans, d)

    print(ans)
import itertools

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

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

arr=[[_] for _ in range(n)]

for i in range(n):
    a,b=map(int,input().split())
    
    arr[a-1].append(b-1)
    arr[b-1].append(a-1)

#print("arr",arr)

route=list(itertools.permutations(range(1,n)))
#print("route",route) 
ans=0
for i in route:
    chk0=False
    chk=True
    if i[0] in arr[0]:
        #print(i)
        for j in range(1,n-1):
            if i[j] in arr[i[j-1]]:
                chk0=True
                #print(i[j],arr[j])
                pass
            else:
                chk=False
    if chk==True and chk0==True:
        #print(i)
        ans+=1

print(ans)

### FIXED CODE ###

import itertools

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

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

arr=[[_] for _ in range(n)]

for i in range(m):
    a,b=map(int,input().split())
    #print(a,b)
    
    arr[a-1].append(b-1)
    arr[b-1].append(a-1)

#print("arr",arr)

route=list(itertools.permutations(range(1,n)))
#print("route",route) 
ans=0
for i in route:
    chk0=0
    chk=True
    if i[0] in arr[0]:
        chk0 =True
        #print(i)
        for j in range(1,n-1):
            if i[j] in arr[i[j-1]]:
                chk0+=1
                
                pass
            else:
                #print(1,i[j],arr[i[j-1]])
                break
                
    if chk0==n-1:
        
        ans+=1

print(ans)
import numpy as np
def main():
  N,M=map(int,input().split())
  str_list = [list(input().split()) for _ in range(M)]
  np_str_list=np.array(str_list)
  wacount=0
  for i in range(1,N+1):
    tgtarray=np_str_list[np.where(np_str_list[:,0]==str(i)),1][0]
    ac_index=np.where(tgtarray=='AC')[0][0]
    wacount=wacount+tgtarray[0:ac_index].shape[0]
  account=len(np_str_list[np_str_list[:,1]=='AC',0])
print(wacount,account)

if __name__=='__main__':
  main()

### FIXED CODE ###

n,m=map(int,input().split())
ps=[list(input().split()) for i in range(m)]
pen=[0]*n#ペナ数
rig=[0]*n#ACorWA

for i in range(m):
    if ps[i][1]=="AC":
        rig[int(ps[i][0])-1]=1
    else:
        if rig[int(ps[i][0])-1]==0:
            pen[int(ps[i][0])-1]+=1
cnt1,cnt2=0,0
for i in range(n):
    if rig[i]==1:
        cnt1+=rig[i]
        cnt2+=pen[i]

print(str(cnt1)+" "+str(cnt2))
t = int(input())
list_v = list(map(int,input().split()))
 
res = 1
for v in list_v:
  if v == 0:
    return 0
  res = res * v
  if res > 10**18:
    res = -1
    break
print(res)

### FIXED CODE ###

t = int(input())
list_v = list(map(int,input().split()))
 
res = 1
if 0 in list_v:
  res = 0
else:
  for v in list_v:
    res *= v
    if res > 10**18:
      res = -1
      break
print(res)