# Ask user to enter age, sex ( M or F ), marital status ( Y or N ) and then using following rules print their place of service.
# if employee is female, then she will work only in urban areas.

# if employee is a male and age is in between 20 to 40 then he may work in anywhere

# if employee is male and age is in between 40 t0 60 then he will work in urban areas only.

# And any other input of age should print "ERROR".

age=int(input("Enter age: "))
sex=str(input('Enter sex(M/F): '))
marital_status=str(input("Enter Martial status as Y/N: "))
if sex=="F":
    print("Allowed to work only in urban areas")
elif sex=="M" and 20<age<40:
    print("May work anywhere")
elif sex=="M" and 40<age<60:
    print("Work in urban areas")
else:
    print("Error")