#!/bin/python3 import sys def printShortestPath(n, i_start, j_start, i_end, j_end): path=[] step=0 possibility=1 while (i_start != i_end or j_start !=j_end) and possibility: if i_start==i_end: jdif=abs(j_start-j_end) if jdif%2 !=0: print ("Impossible") possibility=0 elif j_startj_end: j_start-=2 path.append("L") step+=1 elif j_start==j_end: idif=abs(i_start-i_end) if idif%4 !=0: print("Impossible") possibility=0 elif i_starti_end: i_start-=4 path.append("UL") path.append("UR") step+=2 elif i_startj_end: i_start+=2 j_start-=1 path.append("LL") step+=1 elif i_start>i_end and j_start>j_end: i_start-=2 j_start-=1 path.append("UL") step+=1 elif i_start>i_end and j_start