Help me in solving GRAPHROOK problem

My issue

I am unable to understand reverse weight edge from Ui to U0, can you please provide solution in java too

My code

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

class Codechef
{
	public static void main (String[] args) throws java.lang.Exception
	{
		// your code goes here

	}
}

Problem Link: Lexicographic Rook on a Graph Practice Coding Problem - CodeChef