Update 531.py

Less than 490 lines! Amazing!