1 #include<stdio.h> 2 int main() 3 { 4 int f[15001]={0,1},i,n; 5 for(i=2;i<15000;i++) 6 f[i]=(f[i-1]+f[i-2])%10000; 7 while(scanf("%d",&n),n!=-1) 8 printf("%d ",f[n%15000]); 9 return 0; 10 }