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<stdio.h>
using namespace std;
#include<math.h>
int main()
{
	int x;
	cin>>x;
	if(x==4||x==11||x==18||x==25)
		cout<<"mon"<<endl;
	if(x==5||x==12||x==19||x==26)
		cout<<"tue"<<endl;
	if(x==6||x==13||x==20||x==27)
		cout<<""<<endl;
	if(x==7||x==14||x==21||x==28)
		cout<<""<<endl;
	if(x==1||x==8||x==15||x==22||x==29)
		cout<<""<<endl;
	if(x==2||x==9||x==16||x==23||x==30)
		cout<<""<<endl;
	if(x==3||x==10||x==17||x==24)
		cout<<""<<endl;
	return 0;
}