#include <stdio.h>
void CHANGE(int* pcm)
{
int i = (*pcm) / (30.48 * (1 + 1 / 144));
int foot = i ;
int inch = (*pcm / 30.48 - i) * 12;
printf("%d %d", foot, inch);
}
int main()
{
int cm;
scanf("%d", &cm);
CHANGE(&cm);
return 0;
}