01.
import
java.io.*;
02.
import
java.util.*;
03.
04.
public
class
chronicle_at
implements
Runnable {
05.
public
static
void
main(String[] args) {
06.
new
chronicle_at().run();
07.
}
08.
09.
BufferedReader br;
10.
StringTokenizer in;
11.
PrintWriter out;
12.
13.
public
String nextToken()
throws
IOException {
14.
while
(in ==
null
|| !in.hasMoreTokens()) {
15.
in =
new
StringTokenizer(br.readLine(),
" /"
);
16.
}
17.
return
in.nextToken();
18.
}
19.
20.
public
int
nextInt()
throws
IOException {
21.
return
Integer.parseInt(nextToken());
22.
}
23.
24.
public
long
nextLong()
throws
IOException {
25.
return
Long.parseLong(nextToken());
26.
}
27.
28.
public
double
nextDouble()
throws
IOException {
29.
return
Double.parseDouble(nextToken());
30.
}
31.
32.
final
int
[] months = {
31
,
28
,
31
,
30
,
31
,
30
,
31
,
31
,
30
,
31
,
30
,
31
};
33.
34.
ArrayList<String> ans;
35.
36.
public
String norm(
int
num) {
37.
if
(num <
10
) {
38.
return
"0"
+ num;
39.
}
else
{
40.
return
""
+ num;
41.
}
42.
}
43.
44.
public
void
tryPrint(
int
d,
int
m,
int
y)
throws
IOException {
45.
if
(m <
1
|| m >
12
) {
46.
return
;
47.
}
48.
int
monthLen = months[m -
1
];
49.
if
(y %
4
==
0
&& y !=
0
&& m ==
2
) {
50.
monthLen++;
51.
}
52.
if
(d >
0
&& d <= monthLen) {
53.
ans.add(norm(d) +
"/"
+ norm(m) +
"/"
+ norm(y));
54.
}
55.
}
56.
57.
public
void
solve()
throws
IOException {
58.
int
a = nextInt();
59.
int
b = nextInt();
60.
int
c = nextInt();
61.
assert
(
0
<= a && a <
100
);
62.
assert
(
0
<= b && b <
100
);
63.
assert
(
0
<= c && c <
100
);
64.
ans =
new
ArrayList<String>();
65.
tryPrint(a, b, c);
66.
tryPrint(a, c, b);
67.
tryPrint(b, a, c);
68.
tryPrint(b, c, a);
69.
tryPrint(c, a, b);
70.
tryPrint(c, b, a);
71.
Collections.sort(ans);
72.
if
(ans.size() ==
0
) {
73.
out.println(
"No such date"
);
74.
}
else
{
75.
out.println(ans.get(
0
));
76.
for
(
int
i =
1
; i < ans.size(); i++) {
77.
if
(!ans.get(i).equals(ans.get(i -
1
))) {
78.
out.println(ans.get(i));
79.
}
80.
}
81.
}
82.
}
83.
84.
public
void
run() {
85.
try
{
86.
br =
new
BufferedReader(
new
FileReader(
"chronicle.in"
));
87.
out =
new
PrintWriter(
"chronicle.out"
);
88.
89.
solve();
90.
91.
out.close();
92.
br.close();
93.
}
catch
(IOException e) {
94.
e.printStackTrace();
95.
System.exit(
1
);
96.
}
97.
}
98.
}