对于斐波那契数列 an=an-1+an-2;
//#include <bits/stdc++.h>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
typedef long long ll;
int mod = 10000;
int f=2;
ll n;
struct node{
ll materix[5][5];
};
node mul(node a,node b)
{
node res;
memset(res.materix,0,sizeof(res.materix));
for(int i=1;i<=f;i++)
{
for(int j=1;j<=f;j++)
{
for(int k=1;k<=f;k++)
{
res.materix[i][j]=(res.materix[i][j]+a.materix[i][k]*b.materix[k][j]%mod)%mod;
}
}
}
return res;
}
node ksm(node a,ll b)
{
node ans;
memset(ans.materix,0,