Harryxun/stf_run huggingface dataset:
n = int(input())
xy = []
ansp = []
people =[-1]*n
sp = [-1]*n



for i in range(n):
    a = int(input())
    for j in range(a):
        x, y = map(int,input().split())
        xy.append([x-1,y])
def dfs(now,ok):
    global sp
    global people
    if now ==n:
        ansp.append(people.count(1))
        sp = [-1]*n
        people = [-1]*n
        return
    if len(xy[now]) >0:
        for i in range(len(xy[now])):
            x = xy[i][0]
            y = xy[i][1]
            if ok:
                if sp[x] == y or sp[x] == -1:
                    sp[x] = y
                else:continue
            else:
                if sp[x] == y^1 or sp[x] == -1:
                    sp[x] == y^1
                else:continue
    
        
        
    people[now] = ok    
    dfs(now+1,ok)
    dfs(now+1,ok^1)
dfs(0,0)
dfs(0,1)
if len(ansp) == 0:
    print(0)
    exit(0)
print(max(ansp))    
        
        


        
            

### FIXED CODE ###

n = int(input())
a =[0]*n
x = [[0] *n for i in range(n)]
y = [[0] *n for i in range(n)]
ans = []
for i in range(n):
    a[i] = int(input())
    for j in range(a[i]):
        x[i][j],y[i][j] = map(int,input().split())
        x[i][j]-=1
        
ishonest= [-1]*n + [0]
def check(ishonest):
    for i in range(n):
        if not ishonest[i]:continue
        for j in range(a[i]):
            if y[i][j] == 1 and ishonest[x[i][j]] == 0:
                return False
            if y[i][j] == 0 and ishonest[x[i][j]] == 1:
                return False
    return True

def dfs(now,h_or_not= -1):
    ishonest[now] = h_or_not
    if now == n-1:
        if check(ishonest):
      
            return sum(ishonest)+1
        else:
            return 0
  
    return max(dfs(now+1,0),dfs(now+1,1))

print(dfs(-1))
import sys
import collections

def solve(N: int, A: "List[int]"):
    counter = sorted(list(collections.Counter(A).values()),reverse=True)
    for i in range(1,N+1):
        c_index = 0
        n = N
        while counter[c_index]*i > n and c_index<len(counter) and i>1:
            n-=counter[c_index]
            c_index+=1
            i-=1
        print(n//i)
    return

def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, A)

if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys
import collections

def solve(N: int, A: "List[int]"):
    counter = sorted(list(collections.Counter(A).values()),reverse=True)
    c_index = 0
    k=0
    for i in range(1,N+1):
        k+=1
        if len(counter)<i:
            print(0)
            continue
        while counter[c_index]*k > N and c_index<len(counter)-1:
            N-=counter[c_index]
            c_index+=1
            k-=1
        print(N//k)
    return

def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, A)

if __name__ == '__main__':
    main()
n=int(input())
s=input()
k=int(input())
c=s[k-1]
sl=list(s)
for i in range(n):
	if sl[i] != c:
		sl[i] = '*'

print("".join(sl))

### FIXED CODE ###

arr=input().split(' ')
a=int(arr[0])
b=int(arr[1])
c=int(arr[2])
if ( a < c and c < b ) or ( b < c and c < a ):
	print("Yes")
else:
	print("No")
N, A, B, C = [int(i) for i in input().split()]

ans = list()
l = list()

for n in range(N):
    l.append(input())

def dfs(i, a, b, c):
    if i == N:
        return True

    ss = l[i]
    if ss == 'AB':
        if a == 0 and b == 0:
            return False
        if b > 0 and dfs(i + 1, a + 1, b - 1, c):
            ans.append('A')
            return True
        if a > 0 and dfs(i + 1, a - 1, b + 1, c):
            ans.append('B')
            return True
        return False
    if ss == 'AC':
        if a == 0 and c == 0:
            return False
        if c > 0 and dfs(i + 1, a + 1, b, c - 1):
            ans.append('A')
            return True
        if a > 0 and dfs(i + 1, a - 1, b, c + 1):
            ans.append('C')
            return True
        return False
    if ss == 'BC':
        if b == 0 and c == 0:
            return False
        if c > 0 and dfs(i + 1, a, b + 1, c - 1):
            ans.append('B')
            return True
        if b > 0 and dfs(i + 1, a, b - 1, c + 1):
            ans.append('C')
            return True
        return False
    return False

dfs(0, A, B, C)

if len(ans) > 0:
    print('Yes')
    for x in reversed(ans):
        print(x)
else:
    print('No')

### FIXED CODE ###

import sys
sys.setrecursionlimit(10 ** 5 + 10)

N, A, B, C = [int(i) for i in input().split()]

ans = list()
l = list()

for n in range(N):
    l.append(input())

def dfs(i, a, b, c):
    if i == N:
        return True

    ss = l[i]
    if ss == 'AB':
        if a == 0 and b == 0:
            return False
        if b > 0 and dfs(i + 1, a + 1, b - 1, c):
            ans.append('A')
            return True
        if a > 0 and dfs(i + 1, a - 1, b + 1, c):
            ans.append('B')
            return True
    if ss == 'AC':
        if a == 0 and c == 0:
            return False
        if c > 0 and dfs(i + 1, a + 1, b, c - 1):
            ans.append('A')
            return True
        if a > 0 and dfs(i + 1, a - 1, b, c + 1):
            ans.append('C')
            return True
    if ss == 'BC':
        if b == 0 and c == 0:
            return False
        if c > 0 and dfs(i + 1, a, b + 1, c - 1):
            ans.append('B')
            return True
        if b > 0 and dfs(i + 1, a, b - 1, c + 1):
            ans.append('C')
            return True
    return False

dfs(0, A, B, C)

if len(ans) > 0:
    print('Yes')
    for x in reversed(ans):
        print(x)
else:
    print('No')
n,k = map(int, input().split())
p = list(map(int, input().split()))


ans = 0
for j in range(n - k + 1):
    sum = 0
    for z in range(j,j + k):
        sum += sum([j for j in range(1, p[z] + 1)]) / p[z]
    ans = max(ans, sum)

print(ans)

### FIXED CODE ###

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

saikoro = [0] * 1001
for i in range(1, 1001):
    saikoro[i] = (saikoro[i-1] + i)

s = [0] * (n + 1)
for u in range(1,n + 1):
    s[u] = saikoro[p[u - 1]] / p[u - 1] + s[u - 1]

ans = 0
for j in range(k - 1,n):
    ans = max(ans, s[j + 1] - s[j + 1 - k])
 
print(ans)
a =input()    
print(str(a.count('1'))


### FIXED CODE ###

a =input()
count = print(str(a.count('1')))
N = int(input())
H = list(map(int, input().split()))
h1 = H[0]
h2 = H[1]

ans = 0
for i in range(1,N):
  if H[i] >= h1 and H[i] >=h2 and H[i] >= H[i-1]:
    ans += 1
    
print(ans+1)

### FIXED CODE ###

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

ans = 1
if N > 1:
  for i in range(1, N):
    if H[i] >= max(H[:i]):
      ans += 1
print(ans)
X,t=map(int,input().split())
print(X-t if X-t>0 else 0)

### FIXED CODE ###

x,a,b=map(int,input().split())
if(abs(x-a)>abs(x-b)):
  print("B")
else:
  print("A")
N = int(input() )
for i in range(N):
  C[i] = list(map(int, input().split() ) )

C.sort(key= lambda s:(s[1],s[0]) )


judge = "Yes"
time = 0
for i in range(N):
  time += C[i][0]
  if time > C[i][1]:
    judge = "No"
    break
print(judge)

### FIXED CODE ###

S = input()
judge = "Good"
for num in range(3):
  if int(S[num]) == int(S[num + 1]):
    judge = "Bad"
    break
print(judge)
W,a,b = map(int,input().split())
if((abs(b-a) < W):
    print(0)
else:
    ans = abs(b - a) - W
    print(ans)

### FIXED CODE ###

W,a,b = map(int,input().split())
if(abs(b-a) < W):
    print(0)
else:
    ans = abs(b - a) - W
    print(ans)
string_list = map(str, input().split(" "))
print(string_list[1] + string_list[0])

### FIXED CODE ###

string_list = input()
string_list =  list(map(str, string_list.split(" ")))
print(string_list[1] + string_list[0])
n = int(input())
a = input().split()
alist = set()
adic = {}
for i in a:
    if int(i) in alist:
        adic[int(i)] = adic[int(i)] + 1
    else:
        alist.add(int(i))
        adic[int(i)] = 1

q = int(input())
ans = []

for i in range(q):
    s = input().split()
    b = int(s[0])
    c = int(s[1])
    if b in alist:
        if not(c in alist):
            adic[c] = 0
            alist.add(c)
        adic[c] = adic[c] + adic[b]
        adic[b] = 0
        su = 0
        for j in adic:
            su += j * adic[j]
    ans.append(su)
for i in range(len(ans)):
    print(ans[i])

### FIXED CODE ###

n = int(input())
a = input().split()
alist = set()
adic = {}
su = 0

for i in a:
    su += int(i)
    if int(i) in alist:
        adic[int(i)] = adic[int(i)] + 1
    else:
        alist.add(int(i))
        adic[int(i)] = 1

q = int(input())
ans = []

for i in range(q):
    s = input().split()
    b = int(s[0])
    c = int(s[1])
    if b in alist:
        if not(c in alist):
            adic[c] = 0
            alist.add(c)
        adic[c] = adic[c] + adic[b]
        su = su + (c * adic[b]) - (b * adic[b])
        adic[b] = 0

    ans.append(su)
for i in range(len(ans)):
    print(ans[i])
N=int(input("enter 1st number:"))
M=int(input("enter 2nd number:"))
if N==M:
    print("Yes\n")
else:
    print("No\n")

### FIXED CODE ###

from sys import stdin

def main():
	N,M = map(int,stdin.readline().split())
	if(N == M):
		print("Yes")
	else:
		print("No")
main()
import sys

for x,y in enumerate(map(int, sys.stdin))
	if x==0 and y==0 :
		sys.exist()
	elif x<y :
		print(x,y)
	elif x>y :
		print(y,x)

### FIXED CODE ###

import sys

while(True):
    x,y = map(int, sys.stdin.readline().split())
    if x==0 and y==0 :
        break
    elif x<=y :
        print(x,y)
    elif x>y :
        print(y,x)
A,B,K = map(int,input().split())
x = [A, B]
x.sort()
res = [1]
res_n=[]
i = 2

while i <= x[0]:
    if x[0] % i == 0 and x[1] % i == 0:
        x = [x[0] / i, x[1] / i]
        res.append(i)
    else:
        i += 1
t=[A,B]
for j in res:
  res_n.append(min(t)/j)
ans = list(set(res+res_n))
ans.sort()
print(ans[-K])


### FIXED CODE ###

A,B,K = map(int,input().split())
if A>=B:
  A,B=B,A
new=[]

for i in range(1,A+1):
  if A%i==0 and B%i==0:
    new.append(i)
new.sort()

print(new[-K])
def op_print(data,a,b):
    for i in range(a,b+1):
        print(data[i])
def op_reverse(data,a,b):
    return data[:a] + data[::-1][-b:-a] + data[:b]
def op_replace(data,a,b,q):
    return data.replace(data[a:b],q) 

data = input()
q = int(input())
for _ in range(q):
    op = list(map(str,input().split()))
    if(op[0] = "print"):
        op_print(data,int(num[0]),int(num[1]))
    elif(op[0] = "reverse"):
        data = op_reverse(data,int(num[0]),int(num[1]))
    elif(op[0] = "replace"):
        data = op_replace(data,int(num[0]),int(num[1]),num[2])


### FIXED CODE ###

s=input()
for _ in range(int(input())):
    o=input().split()
    a,b=map(int,o[1:3]);b+=1
    c=o[0][2]
    if c=='p':s=s[:a]+o[3]+s[b:]
    elif c=='i':print(s[a:b])
    elif c=='v':s=s[:a]+s[a:b][::-1]+s[b:]
def main():
    from collections import Counter
    n, *i = map(int, open(0).read().split())
    a = i[:n]
    _ = i[n]
    d = Counter(a)
    s = sum(k * v for k, v in d.items())
    ans = []
    for b, c in zip(*[iter(i[n + 1:])] * 2):
        v, w = d.get(b), d.get(c)
        if v is not None:
            s += (c - b) * v
        ans.append(s)
        d[c] = v if w is None else v + w

    print(*ans, sep="\n")


if __name__ == '__main__':
    main()


### FIXED CODE ###

def main():
    n, *i = map(int, open(0).read().split())
    a = i[:n]
    _ = i[n]
    s = sum(a)

    m = [0] * (10 ** 5 + 1)
    for x in a:
        m[x] += 1

    ans = []
    for b, c in zip(*[iter(i[n + 1:])] * 2):
        m[c] += m[b]
        s += (c - b) * m[b]
        m[b] = 0
        ans.append(s)

    print(*ans, sep="\n")


if __name__ == '__main__':
    main()
H,W = map(int,input().split())

#output = np.ndarray((2*H,W))
output = list()

for i in range(0,H):
    #output[i] = input()
    strings = input()
    print(strings)
    print(strings)

### FIXED CODE ###

# -*- coding: utf-8 -*-
s = input()

vowel_list = ['a','i','u','e','o']
output_string = ['vowel','consonant']

flag = False
for vowel in vowel_list:
    if vowel == s:
        flag = True

print(output_string[0] if flag == True else output_string[1])
A = list(map(input().split()))
B = list(map(input().split()))
max = max([max(A), max(B)])
print(max)

### FIXED CODE ###

A, B = [list(map(int, input().split())) for _ in range(2)]
print(max([sum(A), sum(B)]))
x = int(input())

ans = 1
for b in range(2, sqrt(x) + 1):
  for p in range(1, sqrt(x) + 1):
    bp = b ** p
    if bp <= x:
      ans = max(bp, ans)
    else:
      break
      
print(ans)


### FIXED CODE ###

import math

x = int(input())

ans = 1
for b in range(2, int(math.sqrt(x)) + 1):
  for p in range(1, int(math.sqrt(x)) + 1):
    bp = b ** p
    if bp <= x:
      ans = max(bp, ans)
    else:
      break
      
print(ans)
H, W = map(int, input().split())
grid = []
for i in range(H):
    grid.append(input())

visit = [[False for j in range(W)] for i in range(H)]


queue = [[0,0]]
count = 0
while len(queue) > 0:
    count += 1
    next = []
    for now in queue:
        visit[now[0]][now[1]] = True
        for i, j in [[0,-1], [1,0], [0,1], [-1,0]]:
            if 0 <= now[0]+i <= H-1 and 0 <= now[1]+j <= W-1:
                if not visit[now[0]+i][now[1]+j]:
                    if grid[now[0]+i][now[1]+j] == ".":
                        next.append([now[0]+i, now[1]+j])
    if visit[-1][-1]:
        break
    queue = list(set(next[:]))


black = count
for i in range(H):
    black += grid[i].count("#")

if visit[-1][-1]:
    print(H*W-black)
else:
    print(-1)


### FIXED CODE ###

H, W = map(int, input().split())
grid = []
for i in range(H):
    grid.append(input())

visit = [[False for j in range(W)] for i in range(H)]


queue = [[0,0]]
count = 0
while len(queue) > 0:
    count += 1
    next = []
    for now in queue:
        visit[now[0]][now[1]] = True
        for i, j in [[0,-1], [1,0], [0,1], [-1,0]]:
            if 0 <= now[0]+i <= H-1 and 0 <= now[1]+j <= W-1:
                if [now[0]+i,now[1]+j] not in next and not visit[now[0]+i][now[1]+j] and grid[now[0]+i][now[1]+j] == ".":
                    next.append([now[0]+i, now[1]+j])

    if visit[-1][-1]:
        break
    queue = next[:]


black = count
for i in range(H):
    black += grid[i].count("#")

if visit[-1][-1]:
    print(H*W-black)
else:
    print(-1)
input();a=sorted(list(map(int,input().split())));print(a[-1],sorted(a,key=lambda x:abs(a[-1]-2*x))[0])

### FIXED CODE ###

a,b,x=map(int,input().split())
print("YES"if a+b>=x>=a else"NO")
import math
import numpy as np

n = input()
answer = 1
for i in range(int(n)):
    a = int(input())
    answer = answer * a
    if answer > 10**18:
        print("-1")
    else:
        print(answer)

### FIXED CODE ###

a,b = input().split()
print(int(a) * int(b))
list1=[]
A1,A2,A3=map(int,input().split())
A4,A5,A6=map(int,input().split())
A7,A8,A9=map(int,input().split())
N=int(input())
for i in range(1,N+1):
    list1.append(int(input()))

list2=[A1,A2,A3,
    A4,A5,A6,
    A7,A8,A9]
for x in range(N):
    if (list1[x] in list2)==True:
        list2[x]="Bingo"
    else:list2[x]="Not-Bingo"

if list2[0]==list2[1]==list2[2]:
    print("Yes")
if list2[0]==list2[3]==list2[6]:
    print("Yes")
if list2[3]==list2[4]==list2[5]:
    print("Yes")
if list2[6]==list2[7]==list2[8]:
    print("Yes")
if list2[1]==list2[4]==list2[7]:
    print("Yes")
if list2[2]==list2[5]==list2[8]:
    print("Yes")
if list2[0]==list2[4]==list2[8]:
    print("Yes")
if list2[2]==list2[4]==list2[6]:
    print("Yes")

### FIXED CODE ###

import sys
list1=[]
list3=["Bingo","Bingo","Bingo"]
A1,A2,A3=map(str,input().split())
A4,A5,A6=map(str,input().split())
A7,A8,A9=map(str,input().split())
n=int(input())
list1=[input() for i in range(1,n+1)]
list2=[[A1,A2,A3],
    [A4,A5,A6],
    [A7,A8,A9]]
for y in range(3):
    for x in range(n):
            if (list1[x] in list2[y])==True:
                s=list2[y].index(list1[x])
                list2[y][s]="Bingo"
#横
for i in range(3):
    if list2[i]==list3:
        print("Yes")
        sys.exit()
#斜め
if list2[0][0]==list2[1][1] and list2[1][1]==list2[2][2]:
    print("Yes")
elif list2[0][2]==list2[1][1] and list2[1][1]==list2[2][0]:
    print("Yes")
#縦
elif list2[0][0]==list2[1][0] and list2[1][0]==list2[2][0]:
    print("Yes")
elif list2[0][1]==list2[1][1] and list2[1][1]==list2[2][1]:
    print("Yes")
elif list2[0][2]==list2[1][2] and list2[1][2]==list2[2][2]:
    print("Yes")
elif n<=2:
    print("No")
else:
    print("No")
x = input()
y = input()
count = 0
for i in range(int(x), int(y)):
    if(str(i) == str(i[::-1])):
        count += 1

print(count)

### FIXED CODE ###

x = input().split(" ")
count = 0
for i in range(int(x[0]), int(x[1])+1):
    if(str(i) == str(i)[::-1]):
        count += 1

print(count)
a,b=map(int, input().split())
print('GREATER' if(a>b) else 'LESS' if(b<a) else 'EQUAL')

### FIXED CODE ###

a,b=map(int, open(0))
print('GREATER' if(a>b) else 'LESS' if(b>a) else 'EQUAL')
def main():
    b = input()

    if b == 'A':
        print('T')
    else b == 'T':
        print('A')
    else b == 'C':
        print('G')
    else b == 'G':
        print('C')

if __name__ == '__main__':
    main()

### FIXED CODE ###

def main():
    b = input()

    if b == 'A':
        print('T')
    elif b == 'T':
        print('A')
    elif b == 'C':
        print('G')
    elif b == 'G':
        print('C')

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

This is a temporary script file.
"""

#f = open("/Users/naoki/Documents/Atcoder/input.txt")
N = int(input())
A = list(map(int, input().split()))
A.insert(0, 0)

select_num = N//2


Dp = [[[-9999 for _ in range(2)] for _ in range(select_num+1)] for _ in range(N+1)]

for i in range(1,N+1):
    Start = (i-1)//2
    End = (i+1)//2
    
    for j in range(Start,End+1):
        Dp[i][j][0] = max(Dp[i-1][j][1], Dp[i-1][j][0])   
        # [0] in 3rd dimension  not chosen at last num
        # must be transfered from [i-1]
    for j in range(Start,End+1):
        if j == 1:
            Dp[i][j][1] = 0 + A[i]
        else:
            Dp[i][j][1] = Dp[i-1][j-1][0]+A[i]

print(max(Dp[-1][select_num][0], Dp[-1][select_num][1]))

### FIXED CODE ###


#f = open("C:/Users/naoki/Desktop/Atcoder/input.txt")
N = int(input())
A = list(map(int, input().split()))
A.insert(0, 0)

select_num = N//2
inf = -10e+100

Dp_f = [[inf] * (3) for _ in range(N+1)]
Dp_s = [[inf] * (3) for _ in range(N+1)]
# 3　次元はそれぞれStart~3つに該当

pre_margin = 0
for i in range(1,N+1):
    Start = (i-1)//2
    End = (i+1)//2
    
    cur_margin = Start
    
    for j in range(Start,End+1):
        Dp_f[i][j-cur_margin] = max(Dp_s[i-1][j-pre_margin], Dp_f[i-1][j-pre_margin])   
        # [0] in 3rd dimension  not chosen at last num
        # must be transfered from [i-1]
    for j in range(Start,End+1):
        if j-1 == 0:
            Dp_s[i][j-cur_margin] = 0 + A[i]
        else:
            Dp_s[i][j-cur_margin] = Dp_f[i-1][j-1-pre_margin]+A[i]
    
    pre_margin = cur_margin
print(max(Dp_f[-1][select_num - cur_margin], Dp_s[-1][select_num - cur_margin]))
a=[0]*5
for i in range(5):
  a=int(input())
b=int(input())
if a[4]-a[0]>a[5]:
  print(':(')
else:
  print('Yay!')
  

### FIXED CODE ###

a=[0]*5
for i in range(5):
  a[i]=int(input())
b=int(input())
if a[4]-a[0]>b:
  print(':(')
else:
  print('Yay!')
N, M = map(int, input().split())
list = [list(map(int, input().split())) for _ in range(M)]
ans = ["0"]*M

for i in range(M):
    for  j in range(M):
            if list[i] == [1, 0] and list[i] != list[j] :
                print(-1)
                exit() #答えが0以外で先頭の数字が0になる場合
            elif list[i][0] == list[j][0] and list[i][1] != list[j][1]:
                print(-1)
                exit() #ある桁の数字が異なる場合
            elif list[i] == [1, 0] and N != 1:
                print(-1)
                exit() #Nが1でないのに答えが0になる場合
            elif list[i][0] > N:
                print(-1)
                exit() #指定の桁数と入力が異なる場合

for i in range(M):
    for j in range(M):
        if list[i][0] == j+1 :
            ans[j] = str(list[i][1])

print(int("".join(ans)))


### FIXED CODE ###

n,m=map(int,input().split())
sc=[list(map(int,input().split())) for i in range(m)]

for i in range(10**n): #n桁の数字の全パターン
  number =str(i)
  if len(number)==n and all([number[s-1]==str(c) for s,c in sc]):
      print(number) #all すべての要素がTrueならTrue
      exit()
print(-1)
c_list = []
for i in range(3):
    c_list.append(input().split())

print(c_list[0] + c_list[3] + c_list[6])

### FIXED CODE ###

c_list = []
for i in range(3):
    c_list.append(input())

print(c_list[0][0] + c_list[1][1] + c_list[2][2])
# -*- coding: utf-8 -*-

# 関数定義
def dfs(now_p, visited, comb_p, p_num):
    # N頂点と同じ数のルートを通ったら有効なパスとして1を返す
    if len(visited) == p_num - 1:
        return 1

    ans = 0

    # now_pの検索
    for tmp_p in comb_p:
        if tmp_p[0] == now_p and tmp_p[0] not in visited:
            # comb_pのtmp
            tmp_comb = comb_p[:]
            tmp_comb.remove(tmp_p)
            # 往復対象の削除
            tmp_p_r = [tmp_p[1], tmp_p[0]]
            tmp_comb.remove(tmp_p_r)
            # visitedのtmp
            tmp_visited = visited[:]
            tmp_visited.append(tmp_p[0])
            next_p = tmp_p[1]
            # dfsの再起呼び出し
            ans += dfs(next_p, tmp_visited, tmp_comb, p_num)

    return ans

## 入力読み取り
N, M = map(int, input().split())
a_b = []
tmp = []
tmp_r = []

# 辺読み取り
for i in range(N):
    tmp = list(map(int, input().split()))
    tmp_r = [tmp[1], tmp[0]]
    a_b.append(tmp)
    a_b.append(tmp_r)

visited = []

# 再起関数の実施
pass_num = dfs(1, visited, a_b, N)
print(pass_num)

### FIXED CODE ###

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

# 関数定義
def dfs(now_p, visited, comb_p, p_num):
    # N頂点と同じ数のルートを通ったら有効なパスとして1を返す
    if len(visited) == p_num:
        return 1

    ans = 0

    # now_pの検索
    for tmp_p in comb_p:
        if tmp_p[0] == now_p and tmp_p[1] not in visited:
            # visitedのtmp
            tmp_visited = visited[:]
            tmp_visited.append(tmp_p[1])
            #print(*tmp_visited)
            # 次の頂点
            next_p = tmp_p[1]
            #print('next_p: ', next_p)
            # comb_pのtmp
            tmp_comb = comb_p[:]
            tmp_comb.remove(tmp_p)
            # 往復対象の削除
            tmp_p_r = [tmp_p[1], tmp_p[0]]
            tmp_comb.remove(tmp_p_r)
            #print(*tmp_comb)
            # dfsの再起呼び出し
            ans += dfs(next_p, tmp_visited, tmp_comb, p_num)

    return ans

## 入力読み取り
N, M = map(int, input().split())
a_b = []
tmp = []
tmp_r = []

# 辺読み取り
for i in range(M):
    tmp = list(map(int, input().split()))
    tmp_r = [tmp[1], tmp[0]]
    a_b.append(tmp)
    a_b.append(tmp_r)

visited = [1]

# 再起関数の実施
pass_num = dfs(1, visited, a_b, N)
print(pass_num)
N, M = map(int, input().split())
broken_steps = [int(input()) for _ in range(M)]
pattern = [-1] * N
pattern[0] = 0 if 1 in broken_steps else 1
pattern[1] = 0 if 2 in broken_steps else 1 + pattern[0]

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

print(pattern[-1] % 1000000007)


### FIXED CODE ###

N, M = map(int, input().split())
broken_step = [0] * (N + 1)
for _ in range(M):
    n = int(input())
    broken_step[n] = 1

dp = [1] * (N + 1)
dp[1] = 0 if broken_step[1] == 1 else dp[0]

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

print(dp[-1] % 1000000007)
a = input()
b = input()

if (a * b) % 2 == 0:
	print('even')
else:
	print('odd')


### FIXED CODE ###

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

if a * b % 2 == 0:
    print('Even')
else:
    print('Odd')
tmp = input().split(" ")
a = (int(tmp[0]) - 2) % 13
b = (int(tmp[1]) - 2) % 13
print("Alice") if a > b else print("Draw") if a = b else print("Bob")

### FIXED CODE ###

tmp = input().split(" ")
a = (int(tmp[0]) - 2) % 13
b = (int(tmp[1]) - 2) % 13
print("Alice") if a > b else print("Draw") if a == b else print("Bob")