import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.ArrayDeque; import java.util.Arrays; import java.util.NoSuchElementException; import java.util.Queue; public class Main { void run() { FastScanner sc=new FastScanner(); 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; if (dist[h][w]==INF) continue; 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(); } } class FastScanner { private final InputStream in = System.in; private final byte[] buffer = new byte[1024]; private int ptr = 0; private int buflen = 0; private boolean hasNextByte() { if (ptr < buflen) { return true; }else{ ptr = 0; try { buflen = in.read(buffer); } catch (IOException e) { e.printStackTrace(); } if (buflen <= 0) { return false; } } return true; } private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;} private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;} private void skipUnprintable() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;} public boolean hasNext() { skipUnprintable(); return hasNextByte();} public String next() { if (!hasNext()) throw new NoSuchElementException(); StringBuilder sb = new StringBuilder(); int b = readByte(); while(isPrintableChar(b)) { sb.appendCodePoint(b); b = readByte(); } return sb.toString(); } public long nextLong() { if (!hasNext()) throw new NoSuchElementException(); long n = 0; boolean minus = false; int b = readByte(); if (b == '-') { minus = true; b = readByte(); } if (b < '0' || '9' < b) { throw new NumberFormatException(); } while(true){ if ('0' <= b && b <= '9') { n *= 10; n += b - '0'; }else if(b == -1 || !isPrintableChar(b)){ return minus ? -n : n; }else{ throw new NumberFormatException(); } b = readByte(); } } public int nextInt() { return (int)nextLong(); } }