#include <bits/stdc++.h> // Tomasz Nowak
using namespace std; // XIII LO Szczecin, Poland
template<class T>
struct MyArray {
int offset;
vector<T> vec;
MyArray(int n, int off, T &&values = T()) {
vec.resize(n, values);
offset = off;
}
T& operator[](int i) {
i += offset;
assert(0 <= i and i < int(vec.size()));
return vec[i];
}
};
int main() {
MyArray<MyArray<int>> dp(3, 1, MyArray<int>(3, 1));
for(int i = -1; i <= 1; ++i)
for(int j = -1; j <= 1; ++j) {
dp[i][j] = i * j;
cout << i << ' ' << j << ": " << dp[i][j] << '\n';
}
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+IC8vIFRvbWFzeiBOb3dhawp1c2luZyBuYW1lc3BhY2Ugc3RkOyAgICAgLy8gWElJSSBMTyBTemN6ZWNpbiwgUG9sYW5kCgp0ZW1wbGF0ZTxjbGFzcyBUPgpzdHJ1Y3QgTXlBcnJheSB7CglpbnQgb2Zmc2V0OwoJdmVjdG9yPFQ+IHZlYzsKCglNeUFycmF5KGludCBuLCBpbnQgb2ZmLCBUICYmdmFsdWVzID0gVCgpKSB7CgkJdmVjLnJlc2l6ZShuLCB2YWx1ZXMpOwoJCW9mZnNldCA9IG9mZjsKCX0KCglUJiBvcGVyYXRvcltdKGludCBpKSB7CgkJaSArPSBvZmZzZXQ7CgkJYXNzZXJ0KDAgPD0gaSBhbmQgaSA8IGludCh2ZWMuc2l6ZSgpKSk7CgkJcmV0dXJuIHZlY1tpXTsKCX0KfTsKCmludCBtYWluKCkgewoJTXlBcnJheTxNeUFycmF5PGludD4+IGRwKDMsIDEsIE15QXJyYXk8aW50PigzLCAxKSk7CgoJZm9yKGludCBpID0gLTE7IGkgPD0gMTsgKytpKQoJCWZvcihpbnQgaiA9IC0xOyBqIDw9IDE7ICsraikgewoJCQlkcFtpXVtqXSA9IGkgKiBqOwoJCQljb3V0IDw8IGkgPDwgJyAnIDw8IGogPDwgIjogIiA8PCBkcFtpXVtqXSA8PCAnXG4nOwoJCX0KfQo=