import java.io.PrintWriter; import java.util.ArrayDeque; import java.util.Arrays; import java.util.Queue; import java.util.Scanner; public class Main { void run() { Scanner sc=new Scanner(System.in); PrintWriter pw=new PrintWriter(System.out); int H=sc.nextInt(); int W=sc.nextInt(); int N=sc.nextInt(); int[][][] horizontal=new int[2][H+1][W+1]; int[][][] vertical=new int[2][H+1][W+1]; for (int i=0;i que=new ArrayDeque(); que.add(0); while (!que.isEmpty()) { int p=que.poll(); int h=p/W; int w=p%W; int[] dh= {-1,1,0,0}; int[] dw= {0,0,-1,1}; for (int k=0;k<4;++k) { int nh=h+dh[k]; int nw=w+dw[k]; if (nh<0||nw<0||nh>=H||nw>=W) continue; if (dist[nh][nw]<=dist[h][w]+1) continue; if ((dw[k]!=0&&(horizontal[(dw[k]+1)/2][h][w]>0||horizontal[(dw[k]+1)/2^1][h][w+dw[k]]>0))||(dh[k]!=0&&(vertical[(dh[k]+1)/2][h][w]>0||vertical[(dh[k]+1)/2^1][h+dh[k]][w]>0))) { dist[nh][nw]=dist[h][w]+1; que.add(nw+nh*W); } } } pw.println(dist[H-1][W-1]==INF?"Odekakedekinai..":dist[H-1][W-1]); pw.close(); } void tr(Object...objects) {System.out.println(Arrays.deepToString(objects));} public static void main(String[] args) { new Main().run(); } }