def sieve_of_eratosthenes(N):
    A = [True] * N
    A[0] = A[1] = False
    for k in range(2, N):
        if A[k]:
            for m in range(2 * k, N, k):
                A[m] = False
    for k in range(N):
        print(k, '-', 'prime' if A[k] else 'composite')


sieve_of_eratosthenes(10)

037db9a4d764e6ed08da83d1f342d8b59199f8b2
<mask token>

def sieve_of_eratosthenes(N):
    A = [True] * N
    A[0] = A[1] = False
    for k in range(2, N):
        if A[k]:
            for m in range(2 * k, N, k):
                A[m] = False
    for k in range(N):
        print(k, '-', 'prime' if A[k] else 'composite')


<mask token>

def sieve_of_eratosthenes(N):
    A = [True] * N
    A[0] = A[1] = False
    for k in range(2, N):
        if A[k]:
            for m in range(2 * k, N, k):
                A[m] = False
    for k in range(N):
        print(k, '-', 'prime' if A[k] else 'composite')


sieve_of_eratosthenes(10)
