N,M = map(int,input().split())
AB = [tuple(map(int,input().split())) for i in range(M)]
es = [[0]*N for _ in range(N)]
for a,b in AB:
    a,b = a-1,b-1
    es[a][b] = es[b][a] = 1

ans = 0
import itertools
for ptn in itertools.permutations(range(1,N)):
    ptn = list(ptn)
    for a,b in zip([0]+ptn, ptn):
        if not es[a][b]: break
    else:
        ans += 1
print(ans)
b57d9a531117bea8c6f954c1d8a0203780c445af
<mask token>

<mask token>
for a, b in AB:
    a, b = a - 1, b - 1
    es[a][b] = es[b][a] = 1
<mask token>
for ptn in itertools.permutations(range(1, N)):
    ptn = list(ptn)
    for a, b in zip([0] + ptn, ptn):
        if not es[a][b]:
            break
    else:
        ans += 1
print(ans)

N, M = map(int, input().split())
AB = [tuple(map(int, input().split())) for i in range(M)]
es = [([0] * N) for _ in range(N)]
for a, b in AB:
    a, b = a - 1, b - 1
    es[a][b] = es[b][a] = 1
ans = 0
<mask token>
for ptn in itertools.permutations(range(1, N)):
    ptn = list(ptn)
    for a, b in zip([0] + ptn, ptn):
        if not es[a][b]:
            break
    else:
        ans += 1
print(ans)

N, M = map(int, input().split())
AB = [tuple(map(int, input().split())) for i in range(M)]
es = [([0] * N) for _ in range(N)]
for a, b in AB:
    a, b = a - 1, b - 1
    es[a][b] = es[b][a] = 1
ans = 0
import itertools
for ptn in itertools.permutations(range(1, N)):
    ptn = list(ptn)
    for a, b in zip([0] + ptn, ptn):
        if not es[a][b]:
            break
    else:
        ans += 1
print(ans)

N,M = map(int,input().split())
AB = [tuple(map(int,input().split())) for i in range(M)]
es = [[0]*N for _ in range(N)]
for a,b in AB:
    a,b = a-1,b-1
    es[a][b] = es[b][a] = 1

ans = 0
import itertools
for ptn in itertools.permutations(range(1,N)):
    ptn = list(ptn)
    for a,b in zip([0]+ptn, ptn):
        if not es[a][b]: break
    else:
        ans += 1
print(ans)