using System;
public class Test
{
public static void Main()
{
bool fine = true;
for (int i = -5 ; i != 6 ; i++) {
for (int j = -5 ; j != 6 ; j++) {
ulong c = Combine(i, j);
int iBack, jBack;
Decombine(c, out iBack, out jBack);
if (i != iBack || j != jBack) {
fine = false;
Console.WriteLine("{0}/{1} {2}/{3}", i, iBack, j, jBack);
}
}
}
if (fine) {
Console.WriteLine("OK");
}
}
private static ulong Combine(int a, int b) {
uint ua = (uint)a;
ulong ub = (uint)b;
return ub <<32 | ua;
}
private static void Decombine(ulong c, out int a, out int b) {
a = (int)(c & 0xFFFFFFFFUL);
b = (int)(c >> 32);
}
}
dXNpbmcgU3lzdGVtOwoKcHVibGljIGNsYXNzIFRlc3QKewoJcHVibGljIHN0YXRpYyB2b2lkIE1haW4oKQoJewoJCWJvb2wgZmluZSA9IHRydWU7CgkJZm9yIChpbnQgaSA9IC01IDsgaSAhPSA2IDsgaSsrKSB7CgkJCWZvciAoaW50IGogPSAtNSA7IGogIT0gNiA7IGorKykgewoJCQkJdWxvbmcgYyA9IENvbWJpbmUoaSwgaik7CgkJCQlpbnQgaUJhY2ssIGpCYWNrOwoJCQkJRGVjb21iaW5lKGMsIG91dCBpQmFjaywgb3V0IGpCYWNrKTsKCQkJCWlmIChpICE9IGlCYWNrIHx8IGogIT0gakJhY2spIHsKCQkJCQlmaW5lID0gZmFsc2U7CgkJCQkJQ29uc29sZS5Xcml0ZUxpbmUoInswfS97MX0gezJ9L3szfSIsIGksIGlCYWNrLCBqLCBqQmFjayk7CgkJCQl9CgkJCX0KCQl9CgkJaWYgKGZpbmUpIHsKCQkJQ29uc29sZS5Xcml0ZUxpbmUoIk9LIik7CgkJfQoJfQoJcHJpdmF0ZSBzdGF0aWMgdWxvbmcgQ29tYmluZShpbnQgYSwgaW50IGIpIHsKCQl1aW50IHVhID0gKHVpbnQpYTsKCQl1bG9uZyB1YiA9ICh1aW50KWI7CgkJcmV0dXJuIHViIDw8MzIgfCB1YTsKCX0KCXByaXZhdGUgc3RhdGljIHZvaWQgRGVjb21iaW5lKHVsb25nIGMsIG91dCBpbnQgYSwgb3V0IGludCBiKSB7CgkJYSA9IChpbnQpKGMgJiAweEZGRkZGRkZGVUwpOwoJCWIgPSAoaW50KShjID4+IDMyKTsKCX0KfQ==