const int maxn = 2;
struct Matrix{
ll a[maxn][maxn];
void init(){
memset(a, 0, sizeof(a));
for(int i=0;i<maxn;++i){
a[i][i] = 1;
}
}
};
Matrix mul(Matrix a, Matrix b){
Matrix ans;
for(int i=0;i<maxn;++i){
for(int j=0;j<maxn;++j){
ans.a[i][j] = 0;
for(int k=0;k<maxn;++k){
ans.a[i][j] += a.a[i][k] * b.a[k][j];
ans.a[i][j] %= mod;
}
}
}
return ans;
}
Matrix qpow(Matrix a, ll n){
Matrix ans;
ans.init();
while(n){
if(n&1) ans = mul(ans, a);
a = mul(a, a);
n /= 2;
}
return ans;
}
void output(Matrix a){
for(int i=0;i<maxn;++i){
for(int j=0;j<maxn;++j){
cout << a.a[i][j] << " ";
}
cout << endl;
}
}
09-03
1033
08-30
761