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++: /*--------------------------------------------------------------------------\
|1週間　= 7日																|
|曜日は7つ　=> x1,x2,x3,x4,x5,x6,x7とする									|
|日にちをxとすると、															|
|x % 7によって得られる値で曜日を定められる。									|
|9月9日は土曜日																|
|		↓																	|
|9 mod 7 = 2だから、x % 7 == 2になるような日にちxの曜日は土曜日				|
|			↓																|
|  |x % 7 | 0 | 1 | 2 | 3 | 4 | 5 | 6 |										|
|  |day   |thu|fri|sat|sun|mon|tue|wed|										|
|			↓																|
|上の表を参考に余りの値を対応させていく。										|
|if文を使ってもいいけど、今回はswitch文を使った方がスマート。					|
\--------------------------------------------------------------------------*/

#include <iostream>
using namespace std;

int main() {
	int x; cin >> x;
	//switch文を使った出力処理
	switch (x % 7) {
	case 0:
		cout << "thu" << endl;
		break;
	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;
	}
	return 0;
}

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

using namespace std;

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

int main() {
	int x;

	cin >> x;
	cout << Days[x % 7] << endl;
	
	return 0;
}

C++: #include <iostream>
using namespace std;char w[]="thufrisatsunmontuewed";int main(){cin >> i;cout << w[(i%7)*3] << w[(i%7)*3+1] << w[(i%7)*3+2] << endl;}

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

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

  int x;
  cin >> x;

  string s;
  switch(x % 7) {
    case 0: s = "thu"; break;
    case 1: s = "fri"; break;
    case 2: s = "sat"; break;
    case 3: s = "sun"; break;
    case 4: s = "mon"; break;
    case 5: s = "tue"; break;
    case 6: s = "wed"; break;
  }
  cout << s << endl;
}

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

int main()
{
  int X;
  cin >> X;

  switch(X%7){
  case 0:
    cout << "thu" << endl;
    break;

  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;

  default:
    cout << "wed" << endl;
    break;
  }

  return 0;
}

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

#define FOR( i, m, n )   for( int i = m; i < n; i++ )
#define REP( i, n )      FOR( i, 0, n )
#define ALL( a )         (a).begin(), (a).end()

int main(){
  int n; cin >> n;
  switch( n % 7 ){
  case 0: cout << "thu" << endl; break;
  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;
  }
}

C++: #include<stdio.h>
int main(void)
{
	int x,y,z;
	scanf("%d",&y);
	x=y%7;
	if(x==1){
		printf("fri\n");
	}
	else if(x==2){
		printf("sat\n");
	}
	else if(x==3){
		printf("sun\n");
	}
	else if(x==4){
		printf("mon\n");
	}
	else if(x==5){
		printf("tue\n");
	}
	else if(x==6){
		printf("wed\n");
	}
	else{
		printf("thu\n");
	}
	return 0;
}

C++: #include<cstdio>

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

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

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

C++: #include <stdio.h>
#include <cmath>
#include <algorithm>
#include <cfloat>
#include <stack>
#include <queue>
#include <vector>
#include <string>
#include <iostream>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;

int main(){

	int table[31];

	int youbi = 5;
	for(int day = 1; day <= 30; day++){
		table[day] = youbi;
		youbi++;
		if(youbi == 8)youbi = 1;
	}

	int X;
	scanf("%d",&X);

	switch(table[X]){
	case 1:
		printf("mon\n");
		break;
	case 2:
		printf("tue\n");
		break;
	case 3:
		printf("wed\n");
		break;
	case 4:
		printf("thu\n");
		break;
	case 5:
		printf("fri\n");
		break;
	case 6:
		printf("sat\n");
		break;
	case 7:
		printf("sun\n");
		break;
	}

	return 0;
}

C++: #include <bits/stdc++.h>
typedef long long ll;
#define ALL(a) a, a+sizeof(a)/sizeof(a[0])
using namespace std;
ll gcd(ll n, ll m) {
	if (m == 0) return n;
	return gcd(m, n % m);
}

ll lcm(ll n, ll m) {
	return m / gcd(n, m) * n;
}

int main(void) {
	int x;
	scanf("%d", &x);
	switch (x%7){
		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;
		default:
			break;
	}
	return 0;
}

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

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

C++: # include <iostream>
# include <algorithm>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <utility>
# include <stack>
# include <queue>
# include <list>
# include <bitset>
# include <complex>
#include<limits.h>
#include<random>
#include<deque>
#include<cstdio>
#include<fstream>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const int N = 2000100;
const int mod = (int)pow(10, 9) + 7;
const ll INF = 1LL << 60;
#define rep(i,n) for(ll i=(ll)0;i<(ll)n;++i)
#define ALL(x) x.begin(),x.end()
#define pp pair<ll,ll>
#define ppp pair<pp,ll>
#define fi first
#define se second
#define pb push_back
#define fix(n) fixed<<setprecision(n)
#define itr vector<ll>::iterator
#define print(s) cout<<s<<endl
#define inp(s) cin>>s
string yn(bool b) { return (b ? "Yes" : "No"); }
string YN(bool b) { return (b ? "YES" : "NO"); }
ll x;
string s[] = { "fri","sat","sun","mon","tue","wed","thu" };
int main(){
	cin >> x;
	cout << s[(x+6) % 7] << endl;
	return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<string>
#include<vector>

using namespace std;

int main(){
	int x;
	string w[]={"thu","fri","sat","sun","mon","tue","wed"};
	scanf("%d",&x);
	x=x%7;
	printf("%s\n",w[x].c_str());
}