Find the -th number in array A = \langle a_1, a_2, \ldots, a_n \rangle sorted in increasing order.
Array is generated with the polynom P(x) = 132x^3 + 77x^2 + 1345x + 1577: a_i = P(i)\bmod 1743.
Two positive integers and (1 \leq k \leq n \leq 50000).
Print the -th number in sorted array .
Example 1
Example 2