import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static void printShortestPath(int n, int iv, int ih, int fv, int fh) { int z=0,count=0; String str=""; do { if(iv==fv && ih==fh) { System.out.println(count); System.out.println(str.trim()); return; } else if( fv==iv+1&&fh==ih || fv==iv+1&&fh==ih+1 || fv==iv+1&&fh==ih-1 || fv==iv&&fh==ih-1 || fv==iv&&fh==ih+1 || fv==iv-1&&fh==ih || fv==iv-1&&fh==ih+1 || fv==iv-1&&fh==ih-1 ) { System.out.println("Impossible"); return ; } else { int ULv=iv,URv=iv,Lv=iv,Rv=iv,LLv=iv,LRv=iv,ULh=ih,URh=ih,Lh=ih,Rh=ih,LLh=ih,LRh=ih; ULv-=2;ULh-=1;//ul URv-=2;URh+=1;//ur Lv=Lv;Lh-=2;//l Rv=Rv;Rh+=2;//r LLv+=2;LLh-=1;//ll LRv+=2;LRh+=1;//lr double minDis=9999999;//x double [] dist=new double[6]; dist[1]=Math.sqrt(Math.pow(ULh-fh,2)+Math.pow(ULv-fv,2)); dist[0]=Math.sqrt(Math.pow(URh-fh,2)+Math.pow(URv-fv,2)); dist[3]=Math.sqrt(Math.pow(Lh-fh,2)+Math.pow(Lv-fv,2)); dist[2]=Math.sqrt(Math.pow(Rh-fh,2)+Math.pow(Rv-fv,2)); dist[5]=Math.sqrt(Math.pow(LLh-fh,2)+Math.pow(LLv-fv,2)); dist[4]=Math.sqrt(Math.pow(LRh-fh,2)+Math.pow(LRv-fv,2)); double id=Math.sqrt(Math.pow(fh-ih,2)+Math.pow(fv-iv,2)); int move=-1; for(int i=0;i<6;i++) { if(dist[i]