import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); // your code goes here for(int a =1;a= 0 && y+b= 0 && y+a=0 &&(x+a+y-b!=prev_y+prev_x)){ prev_x = x; prev_y = y; x+=a; y-=b; }else if(x+b < n && y-a >= 0&&(x-a+y+b!=prev_y+prev_x)){ prev_x = x; prev_y = y; x+=b; y-=a; }else if(x-a >= 0 && y-b >= 0&&(x-a+y-b!=prev_y+prev_x)){ prev_x = x; prev_y = y; x-=a; y-=b; }else if(x-b >= 0 && y-a >= 0&&(x-a+y-b!=prev_y+prev_x)){ prev_x = x; prev_y = y; x-=b; y-=a; }else break; }while(true); if(x==n-1&&y==n-1) System.out.print(moves+" "); else System.out.print(-1+" "); } System.out.print("\n"); } } }