import java.io.*;
import java.util.*;

public class chronicle_at_re implements Runnable {
    public static void main(String[] args) {
        new chronicle_at_re().run();
    }

    BufferedReader br;
    StringTokenizer in;
    PrintWriter out;

    public String nextToken() throws IOException {
        while (in == null || !in.hasMoreTokens()) {
            in = new StringTokenizer(br.readLine(), " /");
        }
        return in.nextToken();
    }

    public int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    public long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }

    public double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }

    final int[] months = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };

    ArrayList<String> ans;

    public String norm(int num) {
        if (num < 10) {
            return "0" + num;
        } else {
            return "" + num;
        }
    }

    public void tryPrint(int d, int m, int y) throws IOException {
        if (m < 1 || m > 12) {
            return;
        }
        int monthLen = months[m - 1];
        if (y % 4 == 0 && y != 0 && m == 2) {
            monthLen++;
        }
        if (d > 0 && d <= monthLen) {
            ans.add(norm(d) + "/" + norm(m) + "/" + norm(y));
        }
    }

    public void solve() throws IOException {
        int a = nextInt();
        int b = nextInt();
        int c = nextInt();
        ans = new ArrayList<String>();
        tryPrint(a, b, c);
        tryPrint(a, c, b);
        tryPrint(b, a, c);
        tryPrint(b, c, a);
        tryPrint(c, a, b);
        tryPrint(c, b, a);
        Collections.sort(ans);
        out.println(ans.get(0));
        for (int i = 1; i < ans.size(); i++) {
            if (!ans.get(i).equals(ans.get(i - 1))) {
                out.println(ans.get(i));
            }
        }
    }

    public void run() {
        try {
            br = new BufferedReader(new FileReader("chronicle.in"));
            out = new PrintWriter("chronicle.out");

            solve();

            out.close();
            br.close();
        } catch (IOException e) {
            e.printStackTrace();
            System.exit(1);
        }
    }
}
