• Source
    1. def denovo():
    2. s = input()
    3. if s in ('S', 'N'):
    4. return s
    5. else:
    6. denovo()
    7.  
    8. denovo()