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

ab = [list(map(int, input().split())) for i in range(M)]

visited = {i:False for i in range(N)}

visited[0] = True

ans = 0



def DFS(x):

#  print(visited)

  global ans

  nextx = []

  if False not in list(visited.values()):

    ans += 1

    return

  for i in range(M):

    if x in ab[i]:

      xcol = ab[i].index(x)

      if visited[ab[i][1-xcol]-1]:

        continue

      else:

        nextx.append(ab[i][1-xcol])

#  print(nextx)

  for i in nextx:

    visited[i-1] = True

    DFS(i)

    visited[i-1] = False

  return



DFS(1)

print(ans)
N, M = list(map(int,input().split()))

C = [[] for i in range(N)]

for i in range(M):

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

  a -= 1

  b -= 1

  C[a].append(b)

  C[b].append(a)

visited = [0]*N

ans = 0

def dfs(x):

  global ans

  visited[x] = 1  

  if all(visited):

    ans += 1

    return

  for i in C[x]:

    if visited[i] == 0:

      dfs(i)

      visited[i] = 0

  return

dfs(0)

print(ans)
N, M = list(map(int, input().split()))
ab = [list(map(int, input().split())) for i in range(M)]
visited = {i: False for i in range(N)}
visited[0] = True
ans = 0


def DFS(x):
    #  print(visited)
    global ans
    nextx = []
    if False not in list(visited.values()):
        ans += 1
        return
    for i in range(M):
        if x in ab[i]:
            xcol = ab[i].index(x)
            if visited[ab[i][1 - xcol] - 1]:
                continue
            else:
                nextx.append(ab[i][1 - xcol])
    #  print(nextx)
    for i in nextx:
        visited[i - 1] = True
        DFS(i)
        visited[i - 1] = False
    return


DFS(1)
print(ans)

N, M = list(map(int, input().split()))
C = [[] for i in range(N)]
for i in range(M):
    a, b = list(map(int, input().split()))
    a -= 1
    b -= 1
    C[a].append(b)
    C[b].append(a)
visited = [0] * N
ans = 0


def dfs(x):
    global ans
    visited[x] = 1
    if all(visited):
        ans += 1
        return
    for i in C[x]:
        if visited[i] == 0:
            dfs(i)
            visited[i] = 0
    return


dfs(0)
print(ans)

-ab = [list(map(int, input().split())) for i in range(M)] -visited = {i: False for i in range(N)} -visited[0] = True +C = [[] for i in range(N)] +for i in range(M): +    a, b = list(map(int, input().split())) +    a -= 1 +    b -= 1 +    C[a].append(b) +    C[b].append(a) +visited = [0] * N -def DFS(x): -    #  print(visited) +def dfs(x): -    nextx = [] -    if False not in list(visited.values()): +    visited[x] = 1 +    if all(visited): -    for i in range(M): -        if x in ab[i]: -            xcol = ab[i].index(x) -            if visited[ab[i][1 - xcol] - 1]: -                continue -            else: -                nextx.append(ab[i][1 - xcol]) -    #  print(nextx) -    for i in nextx: -        visited[i - 1] = True -        DFS(i) -        visited[i - 1] = False +    for i in C[x]: +        if visited[i] == 0: +            dfs(i) +            visited[i] = 0 -DFS(1) +dfs(0)