#include <iostream>
#include <iomanip>

using namespace std;

long julianDate(int y, int m, int d)
{
    if (m <= 2) {
        y--;
        m += 12;
    };
    long A = y/100;
    A = 2 - A + A/4;
    long J = (1461L * y)/ 4;
    long K = (306001L*(m + 1))/10000L;
    return J + K + d + 1720995L + A;
};

void grigorianDate(long JD,
                   int& y,  int& m, int&  d)
{
    long A = (JD*4 - 7468865L)/146097L;
    A = JD + 1 + A - (A/4L);
    long B = A + 1524;
    long C = (B*20L - 2442L)/7305L;
    long D = (C * 1461L) / 4L;
    long E = (10000L * (B-D)) / 306001L;
    d = B - D - E*306001L/10000L;
    m = ( E <= 13 ) ? E - 1 : E - 13;
    y = ( m > 2 ) ? C - 4716 : C - 4715;
};

int weekday(long jd) { return (jd+1)%7; }

int main()
{
    int cnt[7] {0};
    for(int y = 1900; y < 2300; ++y)
        for(int m = 1; m <= 12; ++m)
            cnt[weekday(julianDate(y,m,13))]++;

    cout << "13:\n";
    cout << "sunday:    " << cnt[0] << " times\n";
    cout << "monday:    " << cnt[1] << " times\n";
    cout << "tuesday:   " << cnt[2] << " times\n";
    cout << "wednesday: " << cnt[3] << " times\n";
    cout << "thursday:  " << cnt[4] << " times\n";
    cout << "friday:    " << cnt[5] << " times\n";
    cout << "saturday:  " << cnt[6] << " times\n";

}
