#include<iostream>
using namespace std;
int func(int year)//判断闰年的个数
{
int count=0;
for(int i=1990;i<year;i++)
if(year%4==0&&year%100!=0||year%400==0)
count++;
return count;
}
int main()
{
int year,month,day;
int count,sum,num;
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
//把08 09 转化为8 9
char a[2],b[2];
cin>>year;
cin>>a[0]>>a[1];
cin>>b[0]>>b[1];
if(a[0]=='0')
month=a[1]-'0';
else month=(a[0]-'0')*10+a[1]-'0';
if(b[0]=='0')
day=b[1]-'0';
else day=(b[0]-'0')*10+b[1]-'0';
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
count=func(year);
switch(month)
{
case 1:
num=0;
break;
case 2:
num=31;
break;
case 3:
num=59;
break;
case 4:
num=90;
break;
case 5:
num=120;
break;
case 6:
num=151;
break;
case 7:
num=181;
break;
case 8:
num=212;
break;
case 9:
num=243;
break;
case 10:
num=273;
break;
case 11:
num=304;
break;
case 12:
num=334;
break;
default:
break;
}
if((year%4==0&&year%100!=0||year%400==0)&&month>2)
num=num+1;
sum=(year-1990)*365+count+num+day;
if(sum%5>=1&&sum%5<=3)
cout<<"Fishing"<<endl;
else cout<<"Sleeping"<<endl;
return 0;
}
using namespace std;
int func(int year)//判断闰年的个数
{
int count=0;
for(int i=1990;i<year;i++)
if(year%4==0&&year%100!=0||year%400==0)
count++;
return count;
}
int main()
{
int year,month,day;
int count,sum,num;
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
//把08 09 转化为8 9
char a[2],b[2];
cin>>year;
cin>>a[0]>>a[1];
cin>>b[0]>>b[1];
if(a[0]=='0')
month=a[1]-'0';
else month=(a[0]-'0')*10+a[1]-'0';
if(b[0]=='0')
day=b[1]-'0';
else day=(b[0]-'0')*10+b[1]-'0';
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
count=func(year);
switch(month)
{
case 1:
num=0;
break;
case 2:
num=31;
break;
case 3:
num=59;
break;
case 4:
num=90;
break;
case 5:
num=120;
break;
case 6:
num=151;
break;
case 7:
num=181;
break;
case 8:
num=212;
break;
case 9:
num=243;
break;
case 10:
num=273;
break;
case 11:
num=304;
break;
case 12:
num=334;
break;
default:
break;
}
if((year%4==0&&year%100!=0||year%400==0)&&month>2)
num=num+1;
sum=(year-1990)*365+count+num+day;
if(sum%5>=1&&sum%5<=3)
cout<<"Fishing"<<endl;
else cout<<"Sleeping"<<endl;
return 0;
}