#This finds thte first so many primes and prints them in a table
# with 7 columns

def main():
    total = input ("Enter the number of primes to find: " )
    lineCount = 0
    num = 2
    counter = 0
    while counter < total:
        factor = 2
        while factor < num:
            if num % factor == 0:
                isPrime = False
                break
            factor = factor + 1
        else:
            isPrime = True

        if isPrime:
            print "%10d" % num,
            counter = counter + 1
            lineCount = lineCount + 1
            if lineCount == 7:
                print
                lineCount = 0
        num = num + 1
    
main()
        
