using System;
public class Test
{
public static void Main()
{
// your code goes here
for (int i = 1989; i <= 2000; i ++)
{
Console.WriteLine("{0}\t{1}", i, getLeap(i));
}
for (int i = 2000; i <= 3000; i += 100)
{
Console.WriteLine("{0}\t{1}", i, getLeap(i));
}
}
static int getLeap(int y)
{
return (1 - (y % 4 + 2) % (y % 4 + 1)) * ((y % 100 + 2) % (y % 100 + 1)) + (1 - (y % 400 + 2) % (y % 400 + 1));
}
}
dXNpbmcgU3lzdGVtOwoKcHVibGljIGNsYXNzIFRlc3QKewoJcHVibGljIHN0YXRpYyB2b2lkIE1haW4oKQoJewoJCS8vIHlvdXIgY29kZSBnb2VzIGhlcmUKCQlmb3IgKGludCBpID0gMTk4OTsgaSA8PSAyMDAwOyBpICsrKQoJCXsKCQkJQ29uc29sZS5Xcml0ZUxpbmUoInswfVx0ezF9IiwgaSwgZ2V0TGVhcChpKSk7CgkJfQoJCWZvciAoaW50IGkgPSAyMDAwOyBpIDw9IDMwMDA7IGkgKz0gMTAwKQoJCXsKCQkJQ29uc29sZS5Xcml0ZUxpbmUoInswfVx0ezF9IiwgaSwgZ2V0TGVhcChpKSk7CgkJfQoJfQoJCglzdGF0aWMgaW50IGdldExlYXAoaW50IHkpIAoJewoJCXJldHVybiAoMSAtICh5ICUgNCArIDIpICUgKHkgJSA0ICsgMSkpICogKCh5ICUgMTAwICsgMikgJSAoeSAlIDEwMCArIDEpKSArICgxIC0gKHkgJSA0MDAgKyAyKSAlICh5ICUgNDAwICsgMSkpOwoJfQp9