#include <bits/stdc++.h>

using namespace std;

template <typename T>
class Matrix {
public:
    vector<vector<T>> matrix;
    
    Matrix() {}

    Matrix(const vector<vector<T>> &reference) : matrix(reference) {}

    Matrix(size_t n, size_t m) {
        matrix = vector<vector<T>>(n, vector<T>(m, 0));
    }

    Matrix(size_t n) {
        matrix = vector<vector<T>>(n, vector<T>(n, 0));
    }
    
    
    static Matrix E(size_t n) {
        Matrix result(n);
        for (size_t i = 0; i < result.matrix.size(); ++i) {
            result.matrix[i][i] = 1;
        }
        return result;
    }

    friend istream& operator>>(istream &in, Matrix &matrix) {
        size_t n, m;
        in >> n >> m;
        matrix.matrix.resize(n, vector<T>(m));
        for (size_t i = 0; i < n; ++i) {
            for (size_t j = 0; j < m; ++j) {
                in >> matrix.matrix[i][j];
            }
        }
        return in;
    }

    friend ostream& operator<<(ostream &out, const Matrix &matrix) {
        for (const auto &row : matrix.matrix) {
            for (const auto &elem : row) {
                out << elem << " ";
            }
            out << endl;
        }
        return out;
    }
    
    //Проверка на равенство
    bool operator=(const Matrix<T> &a) {
        size_t n = a.matrix.size(), m = a.matrix[0].size();
        assert(n == matrix.size());
        assert(m == matrix[0].size());
        for (size_t i = 0; i < n; ++i) {
            for (size_t j = 0; j < m; ++j) {
                if (a.matrix[i][j] != matrix[i][j]) {
                    return false;
                }
            }
        }
        return true;
    }
};

//Умножение на матрицу
template <typename T>
Matrix<T> operator*(const Matrix<T> &a, const Matrix<T> &b) {
    assert(a.matrix[0].size() == b.matrix.size());
    size_t n = a.matrix.size(), m = b.matrix[0].size(), k = b.matrix.size();
    Matrix<T> res(n, m);
    for (size_t i = 0; i < n; ++i) {
        for (size_t j = 0; j < m; ++j) {
            for (size_t p = 0; p < k; ++p) {
                res.matrix[i][j] += a.matrix[i][p] * b.matrix[p][j];
            }
        }
    }
    return res;
}

//Умножение на число
template <typename T, typename S>
Matrix<T> operator*(const Matrix<T> &a, const S &alpha) {
    size_t n = a.matrix.size(), m = a.matrix[0].size();
    Matrix<T> res(n, m);
    for (size_t i = 0; i < n; ++i) {
        for (size_t j = 0; j < m; ++j) {
            res.matrix[i][j] = a.matrix[i][j] * alpha;
        }
    }
    return res;
}

//Прибавление матрицы
template <typename T>
Matrix<T> operator+(const Matrix<T> &a, const Matrix<T> &b) {
    size_t n = a.matrix.size(), m = a.matrix[0].size();
    assert(n == b.matrix.size());
    assert(m == b.matrix[0].size());
    Matrix<T> res(n, m);
    for (size_t i = 0; i < n; ++i) {
        for (size_t j = 0; j < m; ++j) {
            res.matrix[i][j] = a.matrix[i][j] + b.matrix[i][j];
        }
    }
    return res;
}

//Прибавление числа
template <typename T, typename S>
Matrix<T> operator+(const Matrix<T> &a, const S &alpha) {
    size_t n = a.matrix.size(), m = a.matrix[0].size();
    assert(n == m);
    return a + Matrix<T>::E(n) * alpha;
}

//Вычитание матрицы
template <typename T>
Matrix<T> operator-(const Matrix<T> &a, const Matrix<T> &b) {
    size_t n = a.matrix.size(), m = a.matrix[0].size();
    assert(n == b.matrix.size());
    assert(m == b.matrix[0].size());
    Matrix<T> res(n, m);
    for (size_t i = 0; i < n; ++i) {
        for (size_t j = 0; j < m; ++j) {
            res.matrix[i][j] = a.matrix[i][j] - b.matrix[i][j];
        }
    }
    return res;
}

//Вычитание числа
template <typename T, typename S>
Matrix<T> operator-(const Matrix<T> &a, const S &alpha) {
    size_t n = a.matrix.size(), m = a.matrix[0].size();
    assert(n == m);
    return a - Matrix<T>::E(n) * alpha;
}

//Унарный минус
template <typename T>
Matrix<T> operator-(const Matrix<T> &a) {
    size_t n = a.matrix.size(), m = a.matrix[0].size();
    Matrix<T> res(n, m);
    for (size_t i = 0; i < n; ++i) {
        for (size_t j = 0; j < m; ++j) {
            res.matrix[i][j] = -a.matrix[i][j];
        }
    }
    return res;
}



signed main() {
    cout.precision(10);
    
    //Matrix<double> m;
    //cin >> m;
    
    // auto e = Matrix<double>::E(3); // Ematrix 3x3
    
    for (int a = -10; a <= 10; ++a) {
        for (int b = -10; b <= 10; ++b) {
            for (int c = -10; c <= 10; ++c) {
                Matrix<int> A = Matrix<int>({
                    {3, 0, -8},
                    {4, 3, -4},
                    {0, 0, -5}
                });
                
                Matrix<int> B = Matrix<int>({
                    {a, 0, c-a},
                    {-b, a, b},
                    {0, 0, c}
                });
                
                ((A*B) - (B*A)) == Matrix<int>(3);
                
                //cout << (((A*B) - (B*A)) == Matrix<int>(3) ? "" : "FAIL") << endl;
            }
        }
    }
}
Invalid operands to binary expression ('Matrix<int>' and 'Matrix<int>')