using System;
public class Test
{
public static void Main()
{
for (int i = 1; i <= 12; i++)
{
Console.Write("{0} ", getNumberOfDays(i, 2000));
}
}
public static int getNumberOfDays(int m, int y)
{
int leap = (1 - (y % 4 + 2) % (y % 4 + 1)) * ((y % 100 + 2) % (y % 100 + 1)) + (1 - (y % 400 + 2) % (y % 400 + 1));
return 28 + ((m + (m / 8)) % 2) + 2 % m + ((1 + leap) / m) + (1/m) - (leap/m);
}
}
dXNpbmcgU3lzdGVtOwoKcHVibGljIGNsYXNzIFRlc3QKewoJcHVibGljIHN0YXRpYyB2b2lkIE1haW4oKQoJewoJCWZvciAoaW50IGkgPSAxOyBpIDw9IDEyOyBpKyspCgkJewoJCQlDb25zb2xlLldyaXRlKCJ7MH0gIiwgZ2V0TnVtYmVyT2ZEYXlzKGksIDIwMDApKTsKCQl9Cgl9CgkKCXB1YmxpYyBzdGF0aWMgaW50IGdldE51bWJlck9mRGF5cyhpbnQgbSwgaW50IHkpCgl7CgkJaW50IGxlYXAgPSAoMSAtICh5ICUgNCArIDIpICUgKHkgJSA0ICsgMSkpICogKCh5ICUgMTAwICsgMikgJSAoeSAlIDEwMCArIDEpKSArICgxIC0gKHkgJSA0MDAgKyAyKSAlICh5ICUgNDAwICsgMSkpOwoJCQoJCXJldHVybiAyOCArICgobSArIChtIC8gOCkpICUgMikgKyAyICUgbSArICgoMSArIGxlYXApIC8gbSkgKyAoMS9tKSAtIChsZWFwL20pOwoJfQp9