#include using namespace std; using ll = long long; template using matrix = vector>; template void show(matrix &a){ for (int i=0; i matrix dot(matrix &a, matrix &b){ int N = a.size(); matrix c(N, vector(N)); for (int i=0; i T det(matrix a){ int N = a.size(); T res = 1; for (int i=0; i matrix pow(matrix a, ll N){ int M = a.size(); matrix b(M, vector(M)); for (int i=0; i>= 1; a = dot(a, a); } return b; } int main(){ matrix a(2, vector(2)); for (int i=0; i<2; i++) for (int j=0; j<2; j++) cin >> a[i][j]; a = pow(a, 3); show(a); return 0; }