#include <iostream>
#include <cmath>
#include <string>
#include <cstring>
#include <vector>
#include <fstream>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <set>
#include <map>
#include <iomanip>
#define nextLine() { for (int c = getchar(); c != '\n' && c != EOF; c = getchar()); }
#define sqr(a) ((a)*(a))
#define has(mask,i) (((mask) & (1<<(i))) == 0 ? false : true)
#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#define task "chronicle"
using namespace std;

#define pii pair<int,int>
#define mp make_pair
#define pb push_back
#define fi first
#define se second
typedef long long LL;
typedef long double ldb;

const int inf = (1 << 30) - 1;
const ldb eps = 1e-9;
const ldb pi = fabs(atan2(0.0, -1.0));

int p[3];

void Load()
{
	scanf("%d/%d/%d", &p[0], &p[1], &p[2]);
}

int days[2][13] = {{0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},
				   {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}};

inline bool isLeap(int year)
{
	return (year % 4 == 0 && year % 100 != 0) || (year % 400 == 0);
}

inline int check(int dd, int mm, int yy, int year)
{
	if (yy != year % 100) return false;
	return 1 <= mm && mm <= 12 && 1 <= dd && dd <= days[isLeap(year)][mm];
}

void Solve()
{
	sort(p + 0, p + 3);
	vector <pair<pii, int> > ans;
	do
	{
		bool ok = false;
		for (int year = 2001; !ok && year <= 2100; year++)
			ok |= check(p[0], p[1], p[2], year);
		if (ok)
			ans.pb(mp(mp(p[0], p[1]), p[2]));
	} while (next_permutation(p + 0, p + 3));
	
	if (ans.empty())
	{
		puts("No such date");
	}	
	else
	{
		for (int i = 0; i < (int)ans.size(); i++)
			printf("%02d/%02d/%02d\n", ans[i].fi.fi, ans[i].fi.se, ans[i].se);
	}	
}

int main()
{
	freopen(task".in","r",stdin);
	freopen(task".out","w",stdout);
	Load();
	Solve();
	return 0;
}
