// Nemes2.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
#include <algorithm>
#include <climits>
#include <vector>
#include <queue>
#include <unordered_set>
using namespace std;
vector<int> solution;
void DFS(int a, vector<vector<int>>& graph, int cameFrom) {
if (graph[a].size() > 2) return;
for (size_t i = 0; i < graph[a].size(); i++)
{
if (graph[a][i] != cameFrom) {
solution.push_back(graph[a][i]);
DFS(graph[a][i], graph, a);
}
}
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
//norm (31, 28/29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31)
//neww (31, 30, 30, 31, 30, 30/31, 31, 30, 30, 31, 30, 31)
vector<int> norm{ 31,28,31,30,31,30,31,31,30,31,30,31 };
vector<int> neww{ 31,30,30,31,30,30,31,30,30,31,30,31 };
int y, m, d;
cin >> y >> m >> d;
if (y % 4 == 0) {
norm[1]++;
neww[5]++;
}
int day = d;
int dayw = 0;
int mw = 0;
int dw = 0;
for (size_t i = 0; i < m-1; i++)
{
day += norm[i];
}
for (size_t i = 0; i < 12; i++)
{
if (day <= dayw + neww[i]) {
dw = day - dayw;
mw = i + 1;
break;
}
else dayw += neww[i];
}
if (y % 4 == 0 && mw == 6 && dw == 31) {
cout << y << " " << mw << " " << "SZN";
}
else if (mw == 12 && dw == 31) {
cout << y << " " << mw << " " << "VN";
}
else cout << y << " " << mw << " " << dw;
}
// Run program: Ctrl + F5 or Debug > Start Without Debugging menu
// Debug program: F5 or Debug > Start Debugging menu
// Tips for Getting Started:
// 1. Use the Solution Explorer window to add/manage files
// 2. Use the Team Explorer window to connect to source control
// 3. Use the Output window to see build output and other messages
// 4. Use the Error List window to view errors
// 5. Go to Project > Add New Item to create new code files, or Project > Add Existing Item to add existing code files to the project
// 6. In the future, to open this project again, go to File > Open > Project and select the .sln file