Many people knows binary search tree. The keys in a binary search tree are always stored in such a way as to satisfy the BST property:
Let x be a node in a binary search tree. If y is a node in the left subtree of x, then key[y] <= key[x]. If y is a node in the right subtree of x, then key[y] > key[x].
For example,
Input consists of several cases. Each case starts with a line containing one positive integer n, which is the length of test vector. The integer n is less than 100. Following this there will be n positive integers, which are less then 10000, on the next line. The input will end with a case starting with n = 0. This case should not be processed.
For each test case, print a line with a single integer, which is the number of different vectors mod 9901.
3 2 1 3 9 5 6 3 18 20 10 4 17 20 0
2 168