In [6]: p = 6
...: for i in range(10):
...: print('i=' + str(i), i % p)
...: print('-i=' + str(-i), -i % p)
...:
...:
...:
...:
('i=0', 0)
('-i=0', 0)
('i=1', 1)
('-i=-1', 5)
('i=2', 2)
('-i=-2', 4)
('i=3', 3)
('-i=-3', 3)
('i=4', 4)
('-i=-4', 2)
('i=5', 5)
('-i=-5', 1)
('i=6', 0)
('-i=-6', 0)
('i=7', 1)
('-i=-7', 5)
('i=8', 2)
('-i=-8', 4)
('i=9', 3)
('-i=-9', 3)