Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
	"time"
)

var sc = bufio.NewScanner(os.Stdin)

//Sliceconvtoi ...
func Sliceconvtoi() []int {
	strs := strings.Split(sc.Text(), " ")

	var ints []int
	var x int

	for _, s := range strs {
		x, _ = strconv.Atoi(s)
		ints = append(ints, x)
	}

	return ints
}

func main() {
	for sc.Scan() {
		var dt string
		i := Sliceconvtoi()
		t := time.Date(2017, 9, i[0], 0, 0, 0, 0, time.Local)

		switch t.Weekday() {
		case time.Monday:
			dt = "mon"
		case time.Tuesday:
			dt = "tue"
		case time.Wednesday:
			dt = "wed"
		case time.Thursday:
			dt = "thu"
		case time.Friday:
			dt = "fri"
		case time.Saturday:
			dt = "sat"
		case time.Sunday:
			dt = "sun"
		default:
		}

		fmt.Println(dt)
	}

}

C++: #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define INF 1<<30
#define LINF 1LL<<60

/*
<url:http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0359>
?????????============================================================
 ??????????????´???????????\???????????\??§????????????????????´??????????????\???????????\??§???????????????
 
 ??????????????´???????????\??????????????????????????¨??????????????\???????????\?????±?????????????????°????????????????????????
 
 ?????????????????\????????\???????????????????????????
 ????????????
 ????????\??? "mon"???????????\???"tue"????°´?????\??? "wed"?????¨?????\??? "thu"???
 ????????\??? "fri"???????????\??? "sat"?????\?????\??? "sun" ??¨???????????????
 

=================================================================

?§£??¬=============================================================
hai
================================================================
*/

string youbi[7] = {"fri","sat","sun","mon","tue","wed","thu"};
int main(void) {
	cin.tie(0); ios::sync_with_stdio(false);
    int X; cin >> X;
    cout << youbi[(X-1)%7] << endl;
	return 0;
}

C++: #include<iostream>
using namespace std;
int main() {
	int x; cin >> x;
	switch (x%7){
	case 2:
		cout << "sat\n"; break;
	case 3:
		cout << "sun\n"; break;
	case 4:
		cout << "mon\n"; break;
	case 5:
		cout << "tue\n"; break;
	case 6:
		cout << "wed\n"; break;
	case 0:
		cout << "thu\n"; break;
	case 1:
		cout << "fri\n"; break;
	default: break;
	}
}

C++: #include <iostream>
using namespace std;
int main(void){
    int x;
    cin >> x;
    if(x <= 9){
        int y;
        y = (9-x) % 7;
        if(y == 0){
            cout << "sat" << endl; 
        }else if(y == 1){
            cout << "fri" << endl;
        }else if(y == 2){
            cout << "thu" << endl;
        }else if(y == 3){
            cout << "wed" << endl;
        }else if(y == 4){
            cout << "tue" << endl;
        }else if(y == 5){
            cout << "mon" << endl;
        }else{
            cout << "sun" << endl;
        }
        
        
    }else{
        int y;
        y = (x-9) % 7;
        if(y == 0){
            cout << "sat" << endl; 
        }else if(y == 1){
            cout << "sun" << endl;
        }else if(y == 2){
            cout << "mon" << endl;
        }else if(y == 3){
            cout << "tue" << endl;
        }else if(y == 4){
            cout << "wed" << endl;
        }else if(y == 5){
            cout << "thu" << endl;
        }else{
            cout << "fri" << endl;
        }
        
    }
}

C++: #include <iostream>
#include <string>
#include <map>
#include <vector>
#include <utility>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <algorithm>
#include <cmath>

#define rep(i,j,k) for(int i=(int)j;i<(int)k;i++)
#define itrep(i,x) for(auto i=(x).begin(); i!=(x).end();i++)
#define Sort(x) sort((x).begin(),(x).end())
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define vec vector
#define INF (int)1e9
#define INFL 1e18
#define MOD 1000000007
#define pb push_back
#define MP make_pair
#define PI 3.1415926535
typedef long long int ll;
typedef std::pair<int,int> P;
int D=1;
int dx[4]={0,1,0,-1},dy[4]={-1,0,1,0};

using namespace std;

int main(){
    string s[]={"mon","tue","wed","thu","fri","sat","sun"};
    int index=3;
    int x; cin>>x;
    rep(i,0,x){
        index++;
        if(index==7)index=0;
    }
    cout<<s[index]<<endl;

    return 0;
}

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

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

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

typedef long long ll;
using namespace std;

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

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

	int x; cin >> x;
	cout << w[x%7] << endl;	

	return 0;

}

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

C++: #include <iostream>
using namespace std;
int main (void){
   string D[] = {"thu", "fri", "sat", "sun", "mon", "tue", "wed"};
  int x; cin >> x;
  cout << D[x%7] << endl;
}

C++: #include <cstdio>
#include <cctype>
#include <utility>
#include <string>
using namespace std;

#define _gp(l) const auto gcu{getchar##l}; const auto pcu{putchar##l}
#ifdef __linux
_gp(_unlocked);
#else
_gp();
#endif
#define _DEF(r, n, ...) inline r n(__VA_ARGS__) noexcept
#define _T template<typename T>
#define _HT template<typename H,typename... T>
_T _DEF(T,in,int c){T n{};int m{1};while(isspace(c)){c=gcu();}if(c=='-')m=-1,c=gcu();do{n=10*n+(c-'0'),c=gcu();}while(c>='0'&&c<='9');return m*n;}
_DEF(int,in,){return in<int>(gcu());}
#define _SCAN(...) _DEF(bool,scan,__VA_ARGS__)
_SCAN(char &c){c=gcu();gcu();return c!=EOF;}
_T _SCAN(T &n){int c{gcu()};return c==EOF?false:(n=in<T>(c),true);}
#define _OUT(...) _DEF(void,out,__VA_ARGS__)
#define _OUTL(...) _DEF(void,outl,__VA_ARGS__)
_OUT(bool b){pcu('0'+b);}
_OUT(char c){pcu(c);}
#ifdef _GLIBCXX_STRING
_SCAN(string &s){int c;s="";for(;;){c=gcu();if(c=='\n'||c==' ')return true;else if(c==EOF)return false;s+=(char)c;}}
_OUT(string s){for(char c:s)pcu(c);}
#endif
_OUT(const char *s){while(*s)pcu(*s++);}
_T _OUT(T n){static char b[20];char *p{b};T m=n<0?pcu('-'),-1:1;if(!n)*p++='0';else while(n)*p++=(char)(n%10*m+'0'),n/=10;while(p!=b)pcu(*--p);}
_OUTL(){out('\n');}
#ifdef _GLIBCXX_VECTOR
_T _OUT(vector<T> v){for(T &x:v)out(&x == &v[0]?"":" "),out(x);}
#endif
_HT _SCAN(H &h,T&&... t){return scan(h)&&scan(t...);}
_HT _OUT(H&& h, T&&... t){out(h);out(move(t)...);}
template <typename... T> _OUTL(T&&... t){out(move(t)...);outl();}
struct range{int e,b{0},s{1};range(int _b,int _e,int _s):e(_e),b(_b),s(_s){}range(int _b,int _e):e(_e),b(_b){}range(int _e):e(_e){}
	struct it{int v,s;it(int _v,int _s):v(_v),s(_s){}operator int()const{return v;}operator int&(){return v;}int operator*()const{return v;}it& operator++(){v+=s;return *this;}};
	it begin(){return{b, s};}it end(){return{e,s};}};

int main() {
	const string s {"thufrisatsunmontuewed"};
	outl(s.substr(in() % 7 * 3, 3));
}

C++: #include<bits/stdc++.h>
using namespace std;



int main(){

  int a;
  cin>>a;
  if(a%7 == 1)cout<<"fri"<<endl;
  if(a%7 == 2)cout<<"sat"<<endl;
  if(a%7 == 3)cout<<"sun"<<endl;
  if(a%7 == 4)cout<<"mon"<<endl;
  if(a%7 == 5)cout<<"tue"<<endl;
  if(a%7 == 6)cout<<"wed"<<endl;
  if(a%7 == 0)cout<<"thu"<<endl;
  return 0;
}