Graph Coloring

토너먼트의 각 간선을 14가지 색으로 칠하되, 같은 색 간선이 연속하는 두 간선 경로가 없도록 한다.

어려움8그래프조합론그리디아직 제출이 없습니다시간 제한1초메모리 제한512 MB

문제

You are given a tournament, represented as a complete directed graph (for all pairs i,ji,j of two different vertices, there is exactly one edge among iji \to j and jij \to i), with n3000n \leq 3000 vertices. You need to color its edges into 1414 colors.

There should be no path ijki \to j \to k in this graph such that the colors of edges iji \to j and jkj \to k are the same.

It is guaranteed that this is always possible.

입력

The first line of input contains one integer nn (3n30003 \leq n \leq 3000): the number of vertices in the given tournament.

Next n1n-1 lines contain the description of the graph: the ii-th line contains a binary string with ii characters.

If the jj-th character in this string is equal to '1', then the graph has an edge from (i+1)j(i + 1) \to j. Otherwise, it has an edge from j(i+1)j \to (i+1).

출력

The output should contain n1n-1 lines, where the ii-th line contains a string with ii characters.

The jj-th character in this string should be a lowercase Latin letter between 'a' and 'n'. If the graph has an edge from (i+1)j(i + 1) \to j, then this character represents the color of the edge from (i+1)j(i + 1) \to j. Otherwise it represents the color of the edge from j(i+1)j \to (i + 1).

There should be no path ijki \to j \to k in this graph such that the colors of edges iji \to j and jkj \to k are the same.