Your program should check if graph is undirected PS-graph.

Undirected PS-graph is undirected graph (or multigraph — graph with multiple edges) that can be produced from
one-edge graph by the applying operations:

1) double edge : from "A-B" make two edges "A-B" and "A-B".

2) split edge: from "A-B" make two edges "A-C" and "C-B", where C is new vertex.

Graph description is set of lines, each line contains edge description.

Edge description is two vertex identifiers delimited by space.
Vertex identifier is nonempty word from B*, B={A..Z, a..z, 0..9}.
Word length is less than 11 letters.

Graph G

ABBCCDADAC

is undirected PS-graph.

It can be produced from edge "A-C" in the following way:

Note that

undirected PS-graph can have cycles.

What are the two vertices of the starting edge A-B is unknown

"A-B" and "B-A" stands for the same edge.

Input. Graph description. Number of edges is less than 21000.

Output. First line should contain YES or NO depending on whether the input graph is PS-graph.
If YES, then next line should have description of operation sequence.

When doubling the edge "A-B" one writes

[A-B A-B]

When spliting the edge "A-B" by vertex C one writes

(A-C C-B)

So for the given sample graph G output can be the following: