A quick python script to simulate the scenario described in a riddle