Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
def inpl(): return tuple(map(int, input().split()))

n = int(input())
A = inpl()

F = [1 for _ in range(n+2)]
f = 1

for x in range(1, n+2):
    f *= x
    F[x] = f
    
def comb(n, r):
    global F
    if n < r:
        return 0
    elif r <= 0:
        return 0
    else:
        return F[n]//(F[r] * F[n-r])


C = ["" for i in range(n+1)]

for l, a in enumerate(A):
    if type(C[a]) == int:
        i, j = C[a], l
        break
    else:
        C[a] = l

print(n)

for k in range(2, n+2):
    total = comb(n+1, k)
    b = comb(n+i-j, k-1)
    res = (total-b)%(10**9 + 7)
    print(res)

Fixed submission:
# -*- coding: utf-8 -*-
def inpl(): return tuple(map(int, input().split()))

n = int(input())
A = inpl()
mod = 10**9 + 7

fct = [1]
inv = [1]

for i in range(1, n+2):
    fct.append((fct[-1]*i)%mod)
    inv.append((pow(fct[i], mod-2, mod)))

def comb(n, k):
    if k < 0 or k > n:
        return 0
    return (fct[n] * inv[n - k] * inv[k]) % mod    

C = ["" for i in range(n+1)]

for l, a in enumerate(A):
    if type(C[a]) == int:
        i, j = C[a], l
        break
    else:
        C[a] = l

print(n)

for k in range(2, n+2):
    total = comb(n+1, k)
    b = comb(n+i-j, k-1)
    res = (total-b)%(mod)
    print(res)

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
from math import factorial
from scipy.misc import comb
def inpl(): return tuple(map(int, input().split()))

def combination(n, r):
    if n < r:
        return 0
    else:
        return factorial(n)//(factorial(r) * factorial(n-r))

n = int(input())
A = inpl()
C = ["" for i in range(n+1)]

for l, a in enumerate(A):
    if type(C[a]) == int:
        i, j = C[a], l
        break
    else:
        C[a] = l

print(n)

for k in range(2, n+2):
    total = comb(n+1, k, 1)
    b = comb(n+i-j, k-1, 1)
    res = (total-b)%(10**9 + 7)
    print(res)

Fixed submission:
# -*- coding: utf-8 -*-
def inpl(): return tuple(map(int, input().split()))

n = int(input())
A = inpl()
mod = 10**9 + 7

fct = [1]
inv = [1]

for i in range(1, n+2):
    fct.append((fct[-1]*i)%mod)
    inv.append((pow(fct[i], mod-2, mod)))

def comb(n, k):
    if k < 0 or k > n:
        return 0
    return (fct[n] * inv[n - k] * inv[k]) % mod    

C = ["" for i in range(n+1)]

for l, a in enumerate(A):
    if type(C[a]) == int:
        i, j = C[a], l
        break
    else:
        C[a] = l

print(n)

for k in range(2, n+2):
    total = comb(n+1, k)
    b = comb(n+i-j, k-1)
    res = (total-b)%(mod)
    print(res)

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
from math import factorial
def inpl(): return tuple(map(int, input().split()))

def combination(n, r):
    if n < r:
        return 0
    else:
        return factorial(n)//(factorial(r) * factorial(n-r))

N = int(input())
A = inpl()
C = ["" for i in range(N+1)]

for l, a in enumerate(A):
    if type(C[a]) == int:
        i, j = C[a], l
        break
    else:
        C[a] = l

print(N)

X = i + N - j
for k in range(2, N+2):
    total = combination(N+1, k)
    b = combination(X, k-1)
    print((total-b)%(10**9 + 7))

Fixed submission:
# -*- coding: utf-8 -*-
def inpl(): return tuple(map(int, input().split()))

n = int(input())
A = inpl()
mod = 10**9 + 7

fct = [1]
inv = [1]

for i in range(1, n+2):
    fct.append((fct[-1]*i)%mod)
    inv.append((pow(fct[i], mod-2, mod)))

def comb(n, k):
    if k < 0 or k > n:
        return 0
    return (fct[n] * inv[n - k] * inv[k]) % mod    

C = ["" for i in range(n+1)]

for l, a in enumerate(A):
    if type(C[a]) == int:
        i, j = C[a], l
        break
    else:
        C[a] = l

print(n)

for k in range(2, n+2):
    total = comb(n+1, k)
    b = comb(n+i-j, k-1)
    res = (total-b)%(mod)
    print(res)

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
from math import factorial
def inpl(): return tuple(map(int, input().split()))

def combination(n, r):
    if n < r:
        return 0
    else:
        return factorial(n)//(factorial(r) * factorial(n-r))

N = int(input())
A = inpl()
C = ["" for i in range(N+1)]

for l, a in enumerate(A):
    if type(C[a]) == int:
        i, j = C[a], l
        break
    else:
        C[a] = l

print(N)

X = i + N - j
for k in range(2, N+2):
    total = combination(N+1, k)
    b = combination(X, k-1)
    print((total-b)%(10**9 + 7))

Fixed submission:
# -*- coding: utf-8 -*-
def inpl(): return tuple(map(int, input().split()))

n = int(input())
A = inpl()
mod = 10**9 + 7

fct = [1]
inv = [1]

for i in range(1, n+2):
    fct.append((fct[-1]*i)%mod)
    inv.append((pow(fct[i], mod-2, mod)))

def comb(n, k):
    if k < 0 or k > n:
        return 0
    return (fct[n] * inv[n - k] * inv[k]) % mod    

C = ["" for i in range(n+1)]

for l, a in enumerate(A):
    if type(C[a]) == int:
        i, j = C[a], l
        break
    else:
        C[a] = l

print(n)

for k in range(2, n+2):
    total = comb(n+1, k)
    b = comb(n+i-j, k-1)
    res = (total-b)%(mod)
    print(res)

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
from collections import Counter
from math import factorial
def inpl(): return tuple(map(int, input().split()))

def combination(n, r):
    if n < r:
        return 0
    elif r < 0:
        return 0
    else:
        return factorial(n)//(factorial(r) * factorial(n-r))

N = int(input())
A = inpl()
C = ["" for i in range(N+1)]

for l, a in enumerate(A):
    if type(C[a]) == int:
        i, j = C[a], l
    else:
        C[a] = l

print(N)
for k in range(2, N+2):
    total = combination(N+1, k)
    b = combination(i + (N-j), k-1)
    print((total-b)%(10**9 + 7))

Fixed submission:
# -*- coding: utf-8 -*-
def inpl(): return tuple(map(int, input().split()))

n = int(input())
A = inpl()
mod = 10**9 + 7

fct = [1]
inv = [1]

for i in range(1, n+2):
    fct.append((fct[-1]*i)%mod)
    inv.append((pow(fct[i], mod-2, mod)))

def comb(n, k):
    if k < 0 or k > n:
        return 0
    return (fct[n] * inv[n - k] * inv[k]) % mod    

C = ["" for i in range(n+1)]

for l, a in enumerate(A):
    if type(C[a]) == int:
        i, j = C[a], l
        break
    else:
        C[a] = l

print(n)

for k in range(2, n+2):
    total = comb(n+1, k)
    b = comb(n+i-j, k-1)
    res = (total-b)%(mod)
    print(res)