{"raw_statement":[{"iden":"problem statement","content":"There is a grid with $N$ rows and $M$ columns. The square at the $i$\\-th row from the top and the $j$\\-th column from the left contains the integer $A_{i,j}$.  \nHere, the squares contain $M$ occurrences of each of $1,\\ldots,N$, for a total of $NM$ integers.\nYou perform the following operations to swap the numbers written on the squares.\n\n*   For $i=1,\\ldots,N$ in this order, do the following.\n    *   Freely rearrange the numbers written in the $i$\\-th row. That is, freely choose a permutation $P=(P_{1},\\ldots,P_{M})$ of $1,\\ldots,M$, and replace $A_{i,1},\\ldots,A_{i,M}$ with $A_{i,P_{1}},\\ldots,A_{i,P_{M}}$ simultaneously.\n\nYour goal is to perform the operations so that each column contains each of $1,\\ldots,N$ once. Determine if this is possible, and if so, print such a resulting grid."},{"iden":"constraints","content":"*   $1 \\leq N,M \\leq 100$\n*   $1 \\leq A_{i,j} \\leq N$\n*   All input values are integers.\n*   The $NM$ numbers $A_{1,1},\\ldots,A_{N,M}$ contain exactly $M$ occurrences of each of $1,\\ldots,N$."},{"iden":"input","content":"The Input is given from Standard Input in the following format:\n\n$N$ $M$\n$A_{1,1}$ $\\ldots$ $A_{1,M}$\n$\\vdots$\n$A_{N,1}$ $\\ldots$ $A_{N,M}$"},{"iden":"sample input 1","content":"3 2\n1 1\n2 3\n2 3"},{"iden":"sample output 1","content":"Yes\n1 1\n3 2\n2 3\n\nAlso, the following output is accepted.\n\nYes\n1 1\n2 3\n3 2"},{"iden":"sample input 2","content":"4 4\n1 2 3 4\n1 1 1 2\n3 2 2 4\n4 4 3 3"},{"iden":"sample output 2","content":"Yes\n1 4 3 2\n2 1 1 1\n4 2 2 3\n3 3 4 4"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}