cache rindex in 1.py & 2.py