Seems that something wrong with the specified rules. How it possible to get values in the specified range 0 > N > 1000?
17
11
1