

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

q=[]

for i in range(m):

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

    q.append([a,b])

    q.append([b,a])

p=[[1]]

count=0

route=set()

while len(p)!=0:

    p1=p.pop()

    for i,j in q:

        #print(i,j)

        if i == p1[-1]:

            if j not in p1:

                p.append(p1+[j])

    if len(p1)==n: count+=1

    route |= {tuple(p1)}

    #print(p,p1)

print(count)
n,m=list(map(int, input().split()))

q=[]

for i in range(m):

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

    q+=[[a,b],[b,a]]

p=[[1]]

count=0

while p:

    p1=p.pop()

    if len(p1)==n:count+=1

    else:

        for i,j in q:

            if i == p1[-1] and j not in p1:

                p.append(p1+[j])

    #print(p1,p)

print(count)
n, m = list(map(int, input().split()))
q = []
for i in range(m):
    a, b = list(map(int, input().split()))
    q.append([a, b])
    q.append([b, a])
p = [[1]]
count = 0
route = set()
while len(p) != 0:
    p1 = p.pop()
    for i, j in q:
        # print(i,j)
        if i == p1[-1]:
            if j not in p1:
                p.append(p1 + [j])
    if len(p1) == n:
        count += 1
    route |= {tuple(p1)}
    # print(p,p1)
print(count)

n, m = list(map(int, input().split()))
q = []
for i in range(m):
    a, b = list(map(int, input().split()))
    q += [[a, b], [b, a]]
p = [[1]]
count = 0
while p:
    p1 = p.pop()
    if len(p1) == n:
        count += 1
    else:
        for i, j in q:
            if i == p1[-1] and j not in p1:
                p.append(p1 + [j])
    # print(p1,p)
print(count)

-    q.append([a, b]) -    q.append([b, a]) +    q += [[a, b], [b, a]] -route = set() -while len(p) != 0: +while p: -    for i, j in q: -        # print(i,j) -        if i == p1[-1]: -            if j not in p1: -                p.append(p1 + [j]) -    route |= {tuple(p1)} -    # print(p,p1) +    else: +        for i, j in q: +            if i == p1[-1] and j not in p1: +                p.append(p1 + [j]) +    # print(p1,p)