Problem1057--sqrt log sin 函数

1057: sqrt log sin 函数

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 32 MiB

Description

小明的老师给小明布置了这样一道作业题,一个序列符合以下定义:

现问你这个序列的第n项是多少?

Input

输入包含多组测试数据。每组输入一个整数n(0<=n<=1000000),当输入-1时,输入结束。

Output

对于每组输入,输出第n项的值,结果请mod 1000000。

Sample Input Copy

0
-1

Sample Output Copy

1

Source/Category