# <anonymized>
# April 29 2025
# P09 CSCI 141
# A program that prints a calender with the number of days and the day it starts being customized
# Takes two command line arguments as inputs, one for # of day, two for start day
# I made this code very late at night so it's very sloppy but it works :)

import sys
import math

# Gets commmand line arguments
days = int(sys.argv[1])
begin = int(sys.argv[2])
modbegin = begin

# Prints out Days of the week
print("su mo tu we th fr sa")

# Loop that prints days of each week
# With nested loop that constructs the week days
for week in range(math.ceil((days + begin) / 7)):
    week_print = ""
    for wday in range(7):
        today = wday - begin + 1 + (week * 7)
        if modbegin > 0:
            week_print += "   "
            modbegin -= 1
        elif today <= days:
            if (today >= 10):
                week_print += str(today) + " "
            else:
                week_priznt += " " + str(today) + " "
    print(week_print)