{"raw_statement":[{"iden":"problem statement","content":"You are given a directed graph with $N$ vertices and $M$ edges. The vertices are numbered $1, 2, ..., N$, and the edges are numbered $1, 2, ..., M$. Edge $i$ points from Vertex $a_i$ to Vertex $b_i$.\nFor each edge, determine whether the reversion of that edge would change the number of the strongly connected components in the graph.\nHere, the reversion of Edge $i$ means deleting Edge $i$ and then adding a new edge that points from Vertex $b_i$ to Vertex $a_i$."},{"iden":"constraints","content":"*   $2 \\leq N \\leq 1000$\n*   $1 \\leq M \\leq 200,000$\n*   $1 \\leq a_i, b_i \\leq N$\n*   $a_i \\neq b_i$\n*   If $i \\neq j$, then $a_i \\neq a_j$ or $b_i \\neq b_j$."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$ $M$\n$a_1$ $b_1$\n$a_2$ $b_2$\n$:$\n$a_M$ $b_M$"},{"iden":"sample input 1","content":"3 3\n1 2\n1 3\n2 3"},{"iden":"sample output 1","content":"same\ndiff\nsame\n\nThe number of the strongly connected components is $3$ without reversion of edges, but it will become $1$ if Edge $2$ is reversed."},{"iden":"sample input 2","content":"2 2\n1 2\n2 1"},{"iden":"sample output 2","content":"diff\ndiff\n\nReversion of an edge may result in multiple edges in the graph."},{"iden":"sample input 3","content":"5 9\n3 2\n3 1\n4 1\n4 2\n3 5\n5 3\n3 4\n1 2\n2 5"},{"iden":"sample output 3","content":"same\nsame\nsame\nsame\nsame\ndiff\ndiff\ndiff\ndiff"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}