﻿import math as M

def brocard(n,m):
    if M.factorial(n)+1==m**2:
        return (n,m)
    else:
        return False

n,m=1,1
end=100
paire=[]

for n in range(end):
    for m in range (end):
        if brocard(n,m) != False:

            paire.append(brocard(n,m))

print(paire)