@@ -0,0 +1,1640 @@
+import java.util.*;%0A%0Aclass Player %7B%0A%0A    public static void main(String args%5B%5D) %7B%0A        Scanner in = new Scanner(System.in);%0A        int N = in.nextInt(); // the total number of nodes in the level, including the gateways%0A        int L = in.nextInt(); // the number of links%0A        int E = in.nextInt(); // the number of exit gateways%0A        int%5B%5D%5B%5D links= new int%5BL%5D%5B2%5D;%0A        for (int i = 0; i %3C L; i++) %7B%0A            links%5Bi%5D%5B0%5D = in.nextInt(); // N1 and N2 defines a link between these nodes%0A            links%5Bi%5D%5B1%5D = in.nextInt();%0A        %7D%0A        int%5B%5D gates = new int%5BE%5D;%0A        for (int i = 0; i %3C E; i++) %7B%0A            gates%5Bi%5D = in.nextInt(); // the index of a gateway node%0A        %7D%0A%0A        int cnt=0;%0A        while (true) %7B%0A            int SI = in.nextInt();%0A            boolean flagnext=false;%0A            for(int i=0;i%3CL;i++)%7B%0A                for(int j=0;j%3CE;j++)%7B%0A                if((links%5Bi%5D%5B0%5D==SI && links%5Bi%5D%5B1%5D==gates%5Bj%5D) %7C%7C (links%5Bi%5D%5B1%5D==SI && links%5Bi%5D%5B0%5D==gates%5Bj%5D))%7B%0A                System.out.println(links%5Bi%5D%5B0%5D+%22 %22+links%5Bi%5D%5B1%5D);%0A                flagnext=true;%0A                %7D%0A            %7D%0A            %7D%0A             if(!flagnext)%7B%0A            for(int i=cnt;i%3CL;i++)%7B%0A                boolean flag=false;%0A                for(int j=0;j%3CE;j++)%7B%0A                    if(links%5Bi%5D%5B0%5D==gates%5Bj%5D %7C%7C links%5Bi%5D%5B1%5D==gates%5Bj%5D)%7B%0A                        System.out.println(links%5Bi%5D%5B0%5D+%22 %22+links%5Bi%5D%5B1%5D);%0A                        cnt=i+1;%0A                        flag=true;%0A                        break;%0A                    %7D%0A                %7D%0A                if(flag)%7Bbreak;%7D%0A            %7D%0A            %7D%0A        %7D%0A    %7D%0A%7D%0A

Create Player.java