First, input how many numbers would be inputed use input.split() to make them into a list
then, use a for loop to calculate each number one by one, using the list we just created index i(list[i])
if the number should be in the 1st apartment, it %6 == 0
elif if the number is in the 2nd apartmenet it should be a odd number and %3 != 0
elif the number is in the 3rd apartment, it would be (num ** 0.5) % 1 == 0 or (num % 7 != 0 and num % 2 == 0)
else, if none of the judgements are true, print(0)