#include<iostream>
#include<cstdio>
using namespace std;
int main(){
int n;
cin>>n;
// cout << n / 365 << " ano(s)" << endl;
//cout << n % 365 / 30 << " mes(es)" << endl;
//cout << n % 365 % 30 << " dia(s)" << endl;
printf("%d ano(s)\n",n/365); //先除后余的贪心
printf("%d mes(es)\n",n%365/30);
// cout << n % 365 % 30 << " dia(s)" << endl;
printf("%d dia(s)\n",n=n%365%30);
return 0;
}