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

public class GenPics {

	String[] s = { "", "1->2;", "1->3;", "2->1;", "2->3;", "3->1;", "3->2;",
			"1->2->3",
			"1->3->2",
			"2->1->3",
			"2->3->1",
			"3->1->2",
			"3->2->1",
			"1->3;2->3",
			"1->2;3->2",
			"2->1;3->1",
			"1->2;1->3",
			"2->3;2->1",
			"3->1;3->2",
			"1->2->3;1->3",
			"1->3->2;1->2",
			"2->1->3;2->3",
			"2->3->1;2->1",
			"3->1->2;3->2",
			"3->2->1;3->1",
			};

	void solve() throws IOException {
		for (int i = 1; i <= 25; i++) {
			out = new PrintWriter(i / 10 + "" + i % 10);
			out.println("digraph G {");
			out.println("node[shape=circle];");
			out.println("rankdir=TB;");
			out.println("{rank=same;1;2;3;}");
			out.println(s[i - 1]);
			out.println("}");
			out.close();
		}
	}

	void run() throws IOException {
		in = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);
		solve();
		out.close();
	}

	public static void main(String[] args) throws IOException {
		new GenPics().run();
	}

	BufferedReader in;
	StringTokenizer st;
	PrintWriter out;

	String next() throws IOException {
		while (st == null || !st.hasMoreTokens()) {
			st = new StringTokenizer(in.readLine());
		}
		return st.nextToken();
	}

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

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

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

}
