#include "stdio.h"
void main()
{
int n;
scanf("%d",&n);
if(n<1||n>7)
printf("Input error!");
else
{
switch(n)
{
case 1:printf("MON");break;
case 2:printf("TUE");break;
case 3:printf("WED");break;
case 4:printf("THU");break;
case 5:printf("FRI");break;
case 6:printf("SAT");break;
default:printf("SUN");
}
}
}