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>

using namespace std;
using ll = long long;
using VI = vector<int>;
using VL = vector<ll>;
#define FOR(i, a, n) for(int (i)=(a);(i)<(n);(i)++)
#define eFOR(i, a, n) for(int (i)=(a);(i)<=(n);(i)++)
#define rFOR(i, a, n) for(int (i)=(n)-1;(i)>=(a);(i)--)
#define erFOR(i, a, n) for(int (i)=(n);(i)>=(a);(i)--)
#define SORT(i) sort((i).begin(),(i).end())
#define rSORT(i, a) sort((i).begin(),(i).end(),(a))
#define all(i) (i).begin(),(i).end()
constexpr ll INF = 1000000000;
//constexpr ll LLINF = 1LL << 60;
constexpr ll mod = 1000000007;
constexpr ll MOD = 998244353;

//template<class T>
//inline bool chmax(T &a, T b) {
//    if (a < b) {
//        a = b;
//        return 1;
//    }
//    return 0;
//}

template<class T>
inline bool chmin(T &a, T b) {
    if (a > b) {
        a = b;
        return 1;
    }
    return 0;
}

inline void init() {
    cin.tie(nullptr);
    cout.tie(nullptr);
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
}

template<class T>
inline istream &operator>>(istream &input, vector<T> &v) {
    for (auto &elemnt : v)input >> elemnt;
    return input;
}

int main() {
    init();
    int x;
    string day_list[7] = {"fri", "sat", "sun", "mon", "tue", "wed", "thu"};
    cin >> x;
    if(x%7==0) {
        cout << day_list[6] << endl;
        return 0;
    }else{
        cout << day_list[x % 7 - 1] << endl;
    }
    return 0;
}

C++: #include "iostream"
#include "math.h"
#include "algorithm"
#include "string"
#include "vector"
using namespace std;

int main() {
	int x;
	cin >> x;
	int y;
	if (x >= 9) {
		y = (x - 9) % 7;
	}
	else {
		y = (x + 21 - 9) % 7;
	}
	string day;
	switch (y) {
	case 0:
		day = "sat";
		break;
	case 1:
		day = "sun";
		break;
	case 2:
		day = "mon";
		break;
	case 3:
		day = "tue";
		break;
	case 4:
		day = "wed";
		break;
	case 5:
		day = "thu";
		break;
	case 6:
		day = "fri";
		break;
	}
	cout << day << endl;
}

C++: #include<iostream>
using namespace std;
int main() {
	int x; cin >> x;
	switch (x){
	case 2:
		cout << "sat\n";
		break;
	case 3:
		cout << "sun\n";
		break;
	case 4:
		cout << "mon\n";
		break;
	case 5:
		cout << "tue\n";
		break;
	case 6:
		cout << "wed\n"; break;
	case 0:
		cout << "thu\n"; break;
	case 1:cout << "fri\n";
	default:
		break;
	}
}

C++: import java.util.Calendar;
import java.util.Locale;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNextInt()) {
            int X = sc.nextInt();

            Calendar calendar = Calendar.getInstance();
            calendar.set(2017, Calendar.SEPTEMBER, X);
            System.out.println(calendar.getDisplayName(
                Calendar.DAY_OF_WEEK, Calendar.SHORT, Locale.ENGLISH).toLowerCase());
        }
    }
}

C++: #include <iostream>
using namespace std;
int main(void){
    int X,Y;
    cin>>X;
    Y=X%7;
    switch(Y){
        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<iostream>
using namespace std;
int main(){
	int a;
	cin >> a;
	switch (a % 7){
	case 0:
		cout << "thu";
		break;
	case 1:
		cout << "fri";
		break;
	case 2:
		cout << "sat";
		break;
	case 3:
		cout << "san";
		break;
	case 4:
		cout << "mon";
		break;
	case 5:
		cout << "thu";
		break;
	case 6:
		cout << "wed";
		break;
	}



	return 0;
}

C++: #include <bits/stdc++.h>
#define rep(i,n)for(int i=0;i<(n);i++)
using namespace std;

string day[]{"mon","tue","wed","thu","fri","sat","sun"};
int ans[100];
int main(){
	int x;scanf("%d",&x);
	ans[9]=5;
	for(int i=8;i>=1;i--){
		if(ans[i+1]==0)ans[i]=6;
		else ans[i]=ans[i+1]-1;
	}
	for(int i=10;i<=30;i++){
		ans[i]=(ans[i-1]+1)%7;
	}
	cout<<day[ans[x]]<<endl;
}

C++: #include <iostream>

using namespace std;

int main()
{
	int x;

	cin >> x;

	char w[][4] = {"sun", "mon", "tue", "wed", "thu", "fri", "sat"};

	cout << w[(x + 4) % 7] << endl;

	return 0;
}

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

#define int long long
#define pb push_back 
#define mp make_pair
#define fr first
#define sc second
#define Rep(i, n) for( int i = 0; i < (n); i++ )
#define Rrep(i, a, n) for( int i = (a); i < (n); i++ )
#define All(v) v.begin(), v.end()

typedef pair<int, int> Pii; 
typedef pair<int, Pii> Pip;
const int INF = 1107110711071107;

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

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

C++: #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
using namespace std;
int main() {
	int n;
	cin >> n;
	vector<string> v = { "sat","fri","thu","wed","tue","mon","sunn" };
	int dis = (max(n, 9) - min(n, 9)) % 7;
	cout << v[dis] << endl;
}

C++: #include <iostream>

using namespace std;

int main() {
    string date[7] = {"thu", "fri", "sat", "sun", "mon", "tue", "wed"};

    int X;
    cin >> X;

    cout << date[X % 7] << endl;
}

C++: #include <iostream>
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;
}