#include<iostream>
using namespace std;
int main()
{
int n, y = 0, m = 0, d = 0;
cin >> n;
while(n >= 365)
{
y++;
n -= 365;
}
cout << y << " years
";
while(n >= 30)
{
m++;
n -= 30;
}
cout << m << " months
";
if(n < 30)
{
d += n;
}
cout << d << " days
";
return 0;
}