#include <iostream>
using namespace std;

int getMonth(int m, int y) {
	return 31-(102/m&1)-((4/m&2)>>((!y%4)-(!y%100)+(!y%400)));	
}

int main() {
	// your code goes here
	for (int i = 1; i <= 12; i++) {
		cout << getMonth(i, 1996) << " ";
	}

	return 0;
}