International Mathematics Competition (IMC) 2022, Problem 3, A flea problem modulo p