Moved print() up
Moved print in loop