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++: //============================================================================
// 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;
    }
  }