A bank issued credit card numbers and the corresponding PIN (Personal Identification Number). Both are 3-digit numbers up to 996. Pinaki was the last to get the credit card and so he had the last possible credit card number.
He was afraid of forgetting his PIN. He wrote down the number 123 in his diary to remember his PIN. He also wrote out the way to calculate 123 : "Multiply the card number by PIN. Divide the product by 997. The remainder is 123".
Once, Prafull saw his diary in which Pinaki wrote this number 123. Prafull did a lot of purchasing, as he now knows Pinaki's PIN. What is Pinaki's PIN?