#include
int main() {
int year, month, cur_y = 2008, cur_m = 3, m_age, y_age;
scanf("%d%d", &year, &month);
if(month - cur_m > 0) {
m_age = 12 - (month - cur_m);
y_age = (cur_y - year) - 1;
} else {
m_age = cur_m - month;
y_age = cur_y - year;
}
printf("%d years and %d months\n", y_age, m_age);
return 0;
}