5 2 2000{dup 2 sub 1 3 2 3 index 1 sub{3 index 3 index mul exch mod mul}for 0 ne{=only(,)print =}if}for