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>
using namespace std;
int main(void){
    int a;
    cin>>a;
    if(a==1||a==8||a==15||a==22||a==29)cout<<"fri"<<endl;
    else if(a==2||a==9||a==16||a==23||a==30)cout<<"sat"<<endl;
    else if(a==3||a==10||a==17||a==24)cout<<"sun"<<endl;
    else if(a==4||a==11||a==18||a==25)cout<<"mon"<<endl;
    else if(a==5||a==12||a==19||a==26)cout<<"tue"<<endl;
    else if(a==6||a==13||a==20||a==27)cout<<"wed"<<endl;
    else if(a==7||a==14||a==21||a==28)cout<<"thu"<<endl;
}

C++: #include <iostream>
using namespace std;
int main(void){
   int a;
   cin>>a;
  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 if(a==6){
      cout<<"wed"<<endl;
  }
  else if(a==7){
      cout<<"thu"<<endl;
  }
  else if(a==8){
      cout<<"fri"<<endl;
  }
  else if(a==9){
      cout<<"sat"<<endl;
  }
  else if(a==10){
      cout<<"sun"<<endl;
  }
  else if(a==11){
      cout<<"mon"<<endl;
  }
  else if(a==12){
      cout<<"tue"<<endl;
  }
  else if(a==13){
      cout<<"wed"<<endl;
  }
  else if(a==14){
      cout<<"thu"<<endl;
  }
  else if(a==15){
      cout<<"fri"<<endl;
  }
  else if(a==16){
      cout<<"sat"<<endl;
  }
  else if(a==17){
      cout<<"sun"<<endl;
  }
  else if(a==18){
      cout<<"mon"<<endl;
  }
  else if(a==19){
      cout<<"tue"<<endl;
  }
  else if(a==20){
      cout<<"wed"<<endl;
  }
  else if(a==21){
      cout<<"thu"<<endl;
  }
  else if(a==22){
      cout<<"fri"<<endl;
  }
  else if(a==23){
      cout<<"sat"<<endl;
  }
  else if(a==24){
      cout<<"sun"<<endl;
  }
  else if(a==25){
      cout<<"mon"<<endl;
  }
  else if(a==26){
      cout<<"tue"<<endl;
  }
  else if(a==27){
      cout<<"wed"<<endl;
  }
  else if(a==28){
      cout<<"thu"<<endl;
  }
  else if(a==29){
      cout<<"fri"<<endl;
  }
  else if(a==30){
      cout<<"sat"<<endl;
  }
   return 0;
}

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

C++: #include<cstdio>

int main(void){
    char w[7][4]={"sun", "mon", "tue", "wed", "thu", "fri", "sat"};
    int X;
    scanf("%d", &X);
    printf("%s\n", w[(X+4)%7]);
    return(0);
}

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

int main(){
  int x,d,c,i;
  cin>>x;
  d=(x-9)%7;
  c = abs(d);
  if(x<=9){    
    string P[7]={"sat","fri","thu","wed","tue","mon","sun"};
    cout<<P[c]<<endl;
  }else{
    string P[7]={"sat","sun","mon","tue","wed","thu","fri"};
    cout<<P[c]<<endl;
  }
  return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<set>
#include<queue>
#include<stack>
#include<bitset>
#include<functional>
#include<map>
#include<unordered_set>
using namespace std;
/*int p = 998244353;*/
int p = 1000000007;
#define int long long
#define vel vector<long long>
#define vvel vector<vel>
#define rep(i,n) for(int i=0;i<n;i++)
#define sor(v) sort(v.begin(),v.end())
#define mmax(a,b) a=max(a,b)
#define mmin(a,b) a=min(a,b)
#define mkp make_pair
#define pin pair<int,int>
#define qin pair<int,pin>
#define V vector
#define Endl endl
#define veb vector<bool>
#define rev(s) reverse(s.begin(),s.end())
#define end_pr(s) cout << s <<endl;return 0
signed main(){
	V<string> v = { "thu","fri","sat","sun","mon","tue","wed" };
	int x; cin >> x;
	cout << v[x % 7] << endl;
}

C++: #include <bits/stdc++.h>
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define rep(i,n) for (int i=0;i<(int)(n);i++)
#define codefor int test;scanf("%d",&test);while(test--)
#define INT(...) int __VA_ARGS__;in(__VA_ARGS__)
#define LL(...) ll __VA_ARGS__;in(__VA_ARGS__)
#define yn(ans) if(ans)printf("Yes\n");else printf("No\n")
#define YN(ans) if(ans)printf("YES\n");else printf("NO\n")
#define vector2d(type,name,h,...) vector<vector<type>>name(h,vector<type>(__VA_ARGS__))
#define umap unordered_map
#define uset unordered_set
using namespace std;
using ll = long long;
const int MOD=1000000007;
//入力系
void scan(int& a){scanf("%d",&a);}
void scan(long long& a){scanf("%lld",&a);}
template<class T> void scan(T& a){cin>>a;}
template<class T> void scan(vector<T>& vec){for(auto&& it:vec)scan(it);}
void in(){}
template <class Head, class... Tail> void in(Head& head, Tail&... tail){scan(head);in(tail...);}
//出力系
void print(const int& a){printf("%d",a);}
void print(const long long& a){printf("%lld",a);}
void print(const double& a){printf("%.15lf",a);}
template<class T> void print(const T& a){cout<<a;}
template<class T> void print(const vector<T>& vec){if(vec.empty())return;print(vec[0]);for(auto it=vec.begin();++it!= vec.end();){putchar(' ');print(*it);}}
void out(){putchar('\n');}
template<class T> void out(const T& t){print(t);putchar('\n');}
template <class Head, class... Tail> void out(const Head& head,const Tail&... tail){print(head);putchar(' ');out(tail...);}
//デバッグ系
template<class T> void dprint(const T& a){cerr<<a;}
template<class T> void dprint(const vector<T>& vec){if(vec.empty())return;cerr<<vec[0];for(auto it=vec.begin();++it!= vec.end();){cerr<<" "<<*it;}}
void debug(){cerr<<endl;}
template<class T> void debug(const T& t){dprint(t);cerr<<endl;}
template <class Head, class... Tail> void debug(const Head& head, const Tail&... tail){dprint(head);cerr<<" ";debug(tail...);}
ll intpow(ll a, ll b){ ll ans = 1; while(b){ if(b & 1) ans *= a; a *= a; b /= 2; } return ans; }
ll modpow(ll a, ll b, ll p){ ll ans = 1; while(b){ if(b & 1) (ans *= a) %= p; (a *= a) %= p; b /= 2; } return ans; }

int main(){
    vector<string> vec={"thu","fri","sat","sun","mon","tue","wed"};
    INT(n);
    out(vec[n%7]);
}

C++: #include <bits/stdc++.h>  // g++ -std=c++14 -o a a.cpp

using namespace std;

typedef pair<int, int> P;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define repto(i, n) for(int i = 0; i <= (n); i++)
#define all(c) (c).begin(), (c).end()
#define uniq(c) c.erase(unique(all(c)), (c).end()) // ユニークなvectorにする。連続した値を除去して切り出す。
#define _1 first
#define _2 second
#define pb push_back
#define INF 1145141919
#define MOD 1000000007
#define DEBUG(x) cout << #x << ": " << x << endl;

__attribute__((constructor))
void initial() {
  cin.tie(0);
  ios::sync_with_stdio(false);
}

int main() {
  int X;
  cin >> X;
  int dayOfWeek = X % 7;

  if (dayOfWeek == 0) cout << "thu" << endl;
  if (dayOfWeek == 1) cout << "fri" << endl;
  if (dayOfWeek == 2) cout << "sat" << endl;
  if (dayOfWeek == 3) cout << "sun" << endl;
  if (dayOfWeek == 4) cout << "mon" << endl;
  if (dayOfWeek == 5) cout << "tue" << endl;
  if (dayOfWeek == 6) cout << "wed" << endl;
  
}