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>
#define rep(i, a, n) for(int i = a; i < n; i++)
#define REP(i, n) rep(i, 0, n)
#define repb(i, a, b) for(int i = a; i >= b; i--)
#define all(a) a.begin(), a.end()
#define int long long
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
using namespace std;
typedef pair<int, int> P;
const int mod = 1000000007;
const int INF = 1e12;

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

C++: #include <bits/stdc++.h>
#include <typeinfo>
#include <cxxabi.h>
#ifdef LOCAL
  #include "dbgtoki.hpp"
  #define DUMP(i) DEB dump((string)TOSTRING(i), demangle(typeid(i).name()), __LINE__ , i)  
#else
  #define DUMP(i)  
#endif

#define GETTYPE(i) 
#define TOSTRING(x) #x
#define REP(i,n) for(int i=0;i<(n);i++)
#define FOR(i,a,b) for(int i=(a):i<(b);i++)
#define SSTR( x ) static_cast< std::ostringstream & >( \
        ( std::ostringstream() << std::dec << x ) ).str()
#define ALL(s) (s).begin(), (s).end()
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()) , v.end());
using namespace std;
typedef long long unsigned int llu;
typedef long long ll;

int main (){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int x;
  while(cin >> x){
    string ans;
    switch((x + 5) % 7){
    case 0:
      ans  = "sat";
      break;
    case 1:
      ans = "sun";
      break;
    case 2:
      ans = "mon";
      break;
    case 3:
      ans = "tue";
      break;
    case 4:
      ans = "wed";
      break;
    case 5:
      ans = "thu";
      break;
    case 6:
      ans = "fri";
      break;
    }
    cout << ans << endl;
  }
  return 0;
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
#include <map>
#include <string>
#include <queue>
#include <stack>
#include <math.h>
#include <cmath>
#include <numeric>
#include <iomanip>


#define log(x) cout<<x<<endl
#define pb push_back
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
typedef long long lint;
using namespace std;


// <<fixed<<setprecision(6)<<


int gcd(lint x, lint y){
  return y==0 ? x:gcd(y,x % y);
}


int combi(int n, int r){
  int num = 1;
  for(int i = 1; i <= r; i++){
    num = num * (n - i + 1) / i;
  }
  return num;
}

int stringcount(string s, char c) {
  return count(s.cbegin(), s.cend(), c);
}

bool isPrime(int x){
  int i;
  if(x < 2)return 0;
  else if(x == 2) return 1;
  if(x%2 == 0) return 0;
  for(i = 3; i*i <= x; i += 2) if(x%i == 0) return 0;
  return 1;
}

int binary(vector<int> a,lint key) {
  lint left = 0;
  lint right = a.size();
  while(left<right){
    lint mid = (left+right)/2;
    if(a[mid] == key){
      return 1;
    }
    else if(key<a[mid]){
      right = mid;
    }
    else{
      left = mid+1;
    }
  }
  return 0;
}



int main(){
  int a;
  cin>>a;
  if(a<=7){
  }
  else{
    while(a>7){
      a-=7;
    }
  }
  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;
  }
}

C++: #include<stdio.h>
#include<string.h>
char day[7][4]={"thu","fri","sat","sun","mon","tue","wed"};
int main(void)
{
	
	int x;
	scanf("%d",&x);
	printf("%s\n",day[x%7]);
	return 0;
}

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

int main( ){
  int X;
  cin>>X;
  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;
    }else if (X%7==0){cout<<"thu"<<endl;
    }
  return 0;
}

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

int main(){
  int X;
  cin>>X;
  switch(X%7){
    case 0:
      cout<<"thu";
      break;
    case 1:
      cout<<"fri";
      break;
    case 2:
      cout<<"sat";
      break;
    case 3:
      cout<<"sun";
      break;
    case 4:
      cout<<"mon";
      break;
    case 5:
      cout<<"tue";
      break;
    case 6:
      cout<<"wed";
      break;
  }
  cout<<endl;
  return 0;
}

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())
#define _1 first
#define _2 second
#define pb push_back
#define INF 1145141919
#define MOD 1000000007
#define DEBUG(x) cout << #x << ": " << x << endl;

int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};

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

int main() {
    vector<string> weeks = {"sat", "sun", "mon", "tue",  "wed", "thu", "fri"};
    int X;
    cin >> X;
    int i = ((X - 9) + 14) % 7;
    
    cout << weeks[i] << endl;
}

C++: #include <bits/stdc++.h>
#define rep(i,n) for (long long i = 0; i < (n); ++i)
const int INF = 2147483647;//int max
const long long int MOD = 1000000007;
using namespace std;
using ll = long long;
using P = pair<int,int>;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
//ミョ(-ω- ?)
int main() {
    int x;
    cin >> x;
    if(x%7 == 0)cout << "thu\n";
    else if(x%7 == 1)cout << "fri\n";
    else if(x%7 == 2)cout << "sat\n";
    else if(x%7 == 3)cout << "sun\n";
    else if(x%7 == 4)cout << "mon\n";
    else if(x%7 == 5)cout << "tue\n";
    else if(x%7 == 6)cout << "wed\n";
    return 0;
}

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

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

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

	int day = 1;
	while(day <= x) day += 7;
	day -= 7;
	cout << s[x - day] << endl;

	return 0;
}

C++: #include <iostream>
using namespace std;
int main(){

  int n;
  cin>>n;

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

  return 0;

}

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

int main() {
  int x; cin >> x;
  vector<string> v = {"thu", "fri", "sat", "sun", "mon", "tue", "wed"};
  cout << v.at(x % 7) << endl;
}

C++: #include<iostream>
#include<algorithm>
#include<queue>
#define lol(i,n) for(int i=0;i<n;i++)
#define mod 1000000007
typedef long long ll;
using namespace std;

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