Total Recall solution written in Python