Go: package main

import "fmt"

func main() {
	week := []string{"fri", "sat", "sun", "mon", "tue", "wed", "thu"}

	var day int
	fmt.Scan(&day)
	dayOfWeek := -1
	for i := 0; i < day; i++ {
		if dayOfWeek == 6 {
			dayOfWeek = -1
		}
		dayOfWeek++
	}
	fmt.Println(week[dayOfWeek])
}

C++: //============================================================================
// Name        : JOI.cpp
// Author      :
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
typedef long long ll;
int N;
int main() {
	cin>>N;

	if(N==1 || N==8 || N==15 || N==22 || N==29)cout<<"fri"<<endl;
	if(N==2 || N==9 || N==16 || N==23 || N==30)cout<<"sat"<<endl;
	if(N==3 || N==10 || N==17 || N==24 || N==31)cout<<"sun"<<endl;
	if(N==4 || N==11 || N==18 || N==25)cout<<"mon"<<endl;
	if(N==5 || N==12 || N==19 || N==26)cout<<"tue"<<endl;
	if(N==6 || N==13 || N==20 || N==27)cout<<"wed"<<endl;
	if(N==7 || N==14 || N==21 || N==28)cout<<"thu"<<endl;

	return 0;
}

C++: #include<stdio.h>
int main(void)
{
	int x,n;
	scanf("%d",&x);
	n=x%7;
	if(x==3 || x==10 || x==17 || x==24)	{
		printf("sun\n");
	}
	if(x==4 || x==11 || x==18 || x==25) {
		printf("mon\n");
	}
	if(x==5 || x==12 || x==19 || x==26) {
		printf("tue\n");
	}
	if(x==6 || x==13 || x==20 || x==27) {
		printf("wed\n");
	}
	if(x==7 || x==14 || x==21 || x==28) {
		printf("thu\n");
	}
	if(x==1 || x==8 || x==15 || x==22 || x==29) {
		printf("fri\n");
	}
	if(x==2 || x==9 || x==16 || x==23 || x==30) {
		printf("sat\n");
	}
}

C++: #include <iostream>
#include <vector>
#include <queue>
#include<map>
#include<algorithm>
#include<set>
#include<iomanip>
#define rep(i,n) for(int i = 0;i < n;i++)
#define req(i,n) for(int i = 1; i<=n;i++)
#define rrep(i,n) for(int i = n-1;i >=0;i--)
#define ALL(a) a.begin(),a.end()
#define PI  acos(-1)
using namespace std;
template<typename A, size_t N, typename T>
void Fill(A(&array)[N], const T & val) {
    std::fill((T*)array, (T*)(array + N), val);
}
typedef long long int ll;
typedef long double ld;
const int MOD = 1e9 + 7;
int dx[4] = { 0,0,1,-1 }, dy[4] = { 1,-1,0,0 }, sum = 0,h,w;
int main() {
    int n; cin >> n;
    string c[7] = { "thu","fri","sat","sun","mon","tue","wed" };
    cout << c[n % 7] << endl;
}

C++: #include<algorithm>
#include<cstdio>
#include<cmath>
#include<iostream>
using namespace std;
int main(void){
	char Week[7][4]={"thu","fri","sat","sun","mon","tue","wed"};
	int day=0;
	cin>>day;
	day%=7;
	cout<<Week[day]<<endl;
	return 0;
}

C++: 
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<string>
#include<cstring>
#include<queue>
#include<vector>
#include<functional>
#include<cmath>
#include<map>
#include<stack>
#include<set>
#include<numeric>
#include<limits>
#include<iomanip>
#include<iterator>

#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define rep(i,n) for(int i=0; i<n; i++)
#define FOR(i,a,n) for(int i=a; i<n; i++)

using namespace std;
typedef long long ll;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<ll, char> plc;

string mon[] = { "","fri","sat","sun","mon","tue","wed","thu"};

int main()
{
	int x;
	cin >> x;
	cout << mon[x % 7] << endl;
	return 0;
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <set>
#include <algorithm>
using namespace std;

int main(){
    int n; cin >> n;
    string d[7]={"fri", "sat", "sun", "mon", "tue", "wed", "thu"};
    cout << d[(n-1)%7] << endl;
    return 0;
}

C++: #include<iostream>
using namespace std;

int main(){
  int X,Y;
  cin>>X;
  X=X+3
  X=X%7;
  switch(X){
    case 0: cout << "mon" << endl;  break;
        case 1: cout << "tue" << endl;  break;
        case 2: cout << "wed" << endl;  break;
        case 3: cout << "thu" << endl;  break;
        case 4: cout << "fri" << endl;  break;
        case 5: cout << "sat" << endl;  break;
        case 6: cout << "sun" << endl;  break;
    }
  }

C++: #include <bits/stdc++.h>

#define rep(i,n) for(long long int (i)=0;(i)<(int)(n);(i)++)
#define rrep(i,a,b) for(long long int i=(a);i<(b);i++)
#define rrrep(i,a,b) for(long long int i=(a);i>=(b);i--)
#define all(v) (v).begin(), (v).end()
#define pb(q) push_back(q)
#define Abs(a,b) max(a,b)-min(a,b)
#define YES(condition) if(condition){cout << "YES" << endl;}else{cout << "NO" << endl;}
#define Yes(condition) if(condition){cout << "Yes" << endl;}else{cout << "No" << endl;}
#define Cout(x) cout<<(x)<<endl
#define POSSIBLE(condition) if(condition){cout << "POSSIBLE" << endl;}else{cout << "IMPOSSIBLE" << endl;}
#define Possible(condition) if(condition){cout << "Possible" << endl;}else{cout << "Impossible" << endl;}
#define possible(condition) if(condition){cout << "possible" << endl;}else{cout << "impossible" << endl;}
#define Size(n) (n).size()

typedef long long ll;


using namespace std;

const int INF = 1e9,MOD = 1e9 + 7;
const ll LINF = 1e18;

/*---------------------------------------------------------------
long long int kaizyo(long long int hh){
    cmp=1;
    while(hh>1){
        cmp=(cmp*hh)%MOD;
        hh--;
    }
    return cmp;
}
long long int ruizyo(long long int aa, long long int bb){
    if(aa==0){
        return 1;
    }
    else if(aa%2==0){
        long long int tt=ruizyo(aa/2,bb);
        return (tt*tt)%MOD;
    }
    else{
        return (ruizyo(aa-1,bb)*bb)%MOD;
    }
}フェルマ－のア
---------------------------------------------------------------

while(x!=0){
            sum+=x%10;
          / x/=10;
        }
        各桁の和
---------------------------------------------------------------

pair<int,int> p[100000];
cin >> tmp;
p[i]=make_pair(tmp,i);
cout << p[i].second+1 << endl;//ペアの右側つまりiを出力
---------------------------------------------------------------

s.find(w[i])==string::npos
findの使い方
---------------------------------------------------------------

for(int i=0;i<n;i++){
    b[i]=x%2;
    x/=2;
  }二進数
---------------------------------------------------------------

bool f[100001];//1000000以下の素数を調べよう！
rrep(i,2,100001){
       f[i]=false;
    }
rrep(i,2,100001){
        if(!f[i]){
            for(int j=i+i;j<=100000;j+=i){
                f[j]=true;
            }
        }
    }
    for(int i=3;i<=100000;i+=2){
        if(!f[i]){
            c[i]++;
        }
    }
---------------------------------------------------------------

visited=vector<vector<bool>>(10,vector<bool>(10,false));アを全部falseに
---------------------------------------------------------------

long long gcd(long long aaa,long long bbb){
    if(bbb==0){
        return aaa;
    }
    return gcd(bbb,aaa%bbb);
}
 
long long lcm(long long aaa,long long bbb){
    long long g = gcd(aaa,bbb);
    return aaa/g * bbb;
}左から最大公約数と最小公倍数


---------------------------------------------------------------

long long int prime_cnt[10000];
       for(int i=2;i*i<=n;i++){
           while(n%i==0){
               n/=i;
               prime_cnt[i]+=1;
           }
           if(n>1){
               prime_cnt[n]+=1;
               break;
           }
      }ある数nを素因数分解しましょう

---------------------------------------------------------------
debug:
cout<<"i: "<<i<<" j: "<<j<<" cnt: "<<cnt<<"\n";

---------------------------------------------------------------*/

long long int n,cnt=0,ans=0,a,b,c,d,cmp,cmpp,m,h,w,x,y,sum=0,pos;
int dy[]={1,0,-1,0};
int dx[]={0,1,0,-1};
string alph("abcdefghijklmnopqrstuvwxyz"),s;
bool fl=true;
struct edge{int to,cost;};

//-------------------------↓↓↓↓↓↓------------------------

int main(void){
       cin.tie(0);
    ios::sync_with_stdio(false);

       cin>>x;
       if(x%7==3)Cout("sun");
       else if(x%7==4)Cout("mon");
       else if(x%7==5)Cout("tue");
       else if(x%7==6)Cout("wed");
       else if(x%7==0)Cout("thu");
       else if(x%7==1)Cout("fri");
       else if(x%7==2)Cout("sat");
       
return 0;
}