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 <iostream>
#include <sstream>
#include <vector>
#include <string>
#include <cmath>
#include <algorithm>
#include <map>
#include <iomanip>
#include <stdio.h>

using namespace std;

//typedefリスト
typedef vector<long long int> vint;
typedef vector<vector<long long int>> vvint;
typedef vector<string> vstr;
typedef long long int llint;

llint gcd(llint x, llint y) {
	while (y != 0) {
		if (x > y) {
			llint r = x % y;
			x = y;
			y = r;
		}
		else {
			llint r = y % x;
			y = r;
		}
	}
	return x;
}

int main(void) {
	int X,days;
	cin >> X;
	
		days =abs( X - 9);
		int ans = days % 7;
	if (X >= 9) {
		switch (ans)
		{
		case 0:cout << "sat" << endl;
			break;
		case 1:cout << "sun" << endl;
			break;
		case 2:cout << "mon" << endl;
			break;
		case 3:cout << "tue" << endl;
			break;
		case 4:cout << "wed" << endl;
			break;
		case 5:cout << "thu" << endl;
			break;
		case 6:cout << "fri" << endl;
			break;
		}
	}
	else {
		switch (ans)
		{
		case 0:cout << "sat" << endl;
			break;
		case 6:cout << "sun" << endl;
			break;
		case 5:cout << "mon" << endl;
			break;
		case 4:cout << "tue" << endl;
			break;
		case 3:cout << "wed" << endl;
			break;
		case 2:cout << "thu" << endl;
			break;
		case 1:cout << "fri" << endl;
			break;
		}
	}
}

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

template<class like_bool> inline void YES(like_bool condition){ if(condition) cout << "YES" << endl; else cout << "NO" << endl; }
template<class like_bool> inline void Yes(like_bool condition){ if(condition) cout << "Yes" << endl; else cout << "No" << endl; }
template<class like_bool> inline void POSS(like_bool condition){ if(condition) cout << "POSSIBLE" << endl; else cout << "IMPOSSIBLE" << endl; }
template<class like_bool> inline void Poss(like_bool condition){ if(condition)cout << "Possible" << endl; else cout << "Impossible" << endl; }
template<class like_bool> inline void First(like_bool condition){ if(condition)cout << "First" << endl; else cout << "Second" << endl; }
int character_count(string text, char character){ int ans = 0; for(int i = 0; i < text.size(); i++){ ans += (text[i] == character); } return ans; }
long power(long base, long exponent, long module){ if(exponent % 2){ return power(base, exponent - 1, module) * base % module; }else if(exponent){ long root_ans = power(base, exponent / 2, module); return root_ans * root_ans % module; }else{ return 1; }}
struct position{ int y, x; }; position move_pattern[4] = {{-1, 0}, {0, 1}, {1, 0}, {0, -1}};
template<class itr> void array_output(itr start, itr goal){ string ans; for(auto i = start; i != goal; i++){ ans += to_string(*i) + " "; } ans.pop_back(); cout << ans << endl; }
long gcd(long a, long b){ if(a && b){ return gcd(min(a, b), max(a, b) % min(a, b)); }else{ return a; }}
#define mod long(1e9 + 7)
#define all(x) (x).begin(), (x).end()
#define bitcount(n) __builtin_popcount(n)

int main(){
    string day[7] = {"sat", "sun", "mon", "tue", "wed", "thu", "fri"};
    int X;
    cin >> X;
    cout << day[(X + 5) % 7] << endl;
}

C++: #include <bits/stdc++.h>
using namespace std;
int main(void)
{
	int x;
	cin>>x;
	x=x%7;
	switch(x){
		case 1:
			cout<<"fri"<<endl;
			break;
		case 2:
			cout<<"sat"<<endl;
			break;
		case 3:
			cout<<"sun"<<endl;
			break;
		case 4:
			cout<<"mon"<<endl;
			break;
		case 5:
			cout<<"tue"<<endl;
			break;
		case 6:
			cout<<"wed"<<endl;
			break;
		case 0:
			cout<<"thu"<<endl;
			break;
	}
	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<bits/stdc++.h>
using namespace std;

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

int main(){
    int x;
    cin>>x;
    cout<<A[(x+3)%7]<<endl;
    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 <iostream>
using namespace std;
int main(void){
    // Your code here!
    int x;
    cin >> x;
    int a=x%7;
    if(a==0)
        cout << "thu" << endl;
    else if(a==1)
        cout << "fri" << endl;
    else if(a==2)
        cout << "sat" << endl;
    else if(a==3)
        cout << "sun" << endl;
    else if(a==4)
        cout << "mon" << endl;
    else if(a==5)
        cout << "tue" << endl;
    else
        cout << "wed" << endl;
}

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

int main() {
	int X;
	cin>>X;
		X=9-X;
		if(X<0){
			X=X*-1;
		}
		for(int i=0;i<10;i++){
			X=X-7;
			if(X<8){
				break;
			}
		}
		switch(X){
		case 1:cout<<"sun"<<endl;
			break;
		case 2:cout<<"mon"<<endl;
			break;
		case 3:cout<<"tue"<<endl;
			break;
		case 4:cout<<"wed"<<endl;
			break;
		case 5:cout<<"thu"<<endl;
			break;
		case 6:cout<<"fri"<<endl;
			break;
		case 7:cout<<"sat"<<endl;
			break;
		}
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(void)
{
	char A[10][10]={
		"A","fri","sat","sun","mon","tue","wed","thu"
		};
	int x,s;
	
	cin>>x;
	
	if(x%7==0) s=7;
	else s=x%7;
	
	cout<<A[s]<<endl;
	
	return 0;
}

C++: #include <stdio.h>

int main(void) {
  int x;
  scanf("%d",&x);
  switch(x % 7) {
    case 0:
    printf("thu\n");
    break;
    case 1:
    printf("fri\n");
    break;
    case 2:
    printf("sat\n");
    break;
    case 3:
    printf("sun\n");
    break;
    case 4:
    printf("mon\n");
    break;
    case 5:
    printf("tue\n");
    break;
    case 6:
    printf("wed\n");
    break;
  }
  return 0;
}

C++: // #define _GLIBCXX_DEBUG // for STL debug (optional)
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>
using namespace std;
using ll = long long int;
using int64 = long long int;
 
template<typename T> void chmax(T &a, T b) {a = max(a, b);}
template<typename T> void chmin(T &a, T b) {a = min(a, b);}
template<typename T> void chadd(T &a, T b) {a = a + b;}
 
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
const int INF = 1LL << 29;
const ll LONGINF = 1LL << 60;
const ll MOD = 1000000007LL;
 
int main() {
    int X; cin >> X;
    X %= 7;

    vector<string> day = {"thu", "fri", "sat", "sun", "mon", "tue", "wed"};
    cout << day[X] << endl;
    return 0;
}