#include <iostream>
#include <cstring>
#include <algorithm>
using namespace std;
int main()
{
int year, month, day, n;
scanf("%d", &n);
year = n / 365; n %= 365;
month = n / 30; n %= 30;
day = n;
printf("%d ano(s)\n%d mes(es)\n%d dia(s)\n", year, month, day);
return 0;
}