Python: Beautiful Pretty Sexy

A number k is beautiful if it is of the form 3n+1, is pretty if it is of the form 3n+2 and is sexy if it is of form 3n.
Given a number k, print if it is beautiful, pretty or sexy.

Sample input:
21

Sample output:
sexy

Sample input:
22

Sample output:
beautiful

Sample input:
23

Sample output:
pretty

Solution

#input has been taken for you

k=int(input())

#check if the number is beautiful, pretty or sexy

if k%3==0: #if k is of form 3n
    print('sexy')
elif k%3==1: #else if k is of form 3n+1
    print('beautiful')
elif k%3==2: #else if k is of form 3n+2
    print('pretty')
teststep banner