import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;


public class F {

	static int [] p = new int[2];
	
	
	/**
	 * @param args
	 * @throws IOException 
	 */
	public static void main(String[] args) throws IOException {
		BufferedReader bfr = new BufferedReader(new InputStreamReader(System.in));
		String line;
		String[] lineSplit;
		
		
		
		
		while((line = bfr.readLine()) != null)
		{
			int n = Integer.parseInt(line);
			lineSplit = bfr.readLine().split(" ");
			boolean inner = false;
		
			boolean t = true;
			
			int[] p = new int[n]; 
			
			for (int i = 0; i < lineSplit.length; i++) {
				p[i] = Integer.parseInt(lineSplit[i]);
			}
			
			for (int i = 2; i < lineSplit.length; i++) {
				
				//System.out.println("");
				
				if(!inner && p[i] <= p[i-2]){
					// uvnitr
					inner = true;
					
					
					if (i == lineSplit.length-1){
						
						break;
					}
					
					int q = i < 3? 0 : p[i-3];
					int w = i < 4? 0 : p[i-4];
					
					if (p[i] < p[i-2] - w){
						if (p[i+1] < p[i-1]){
							//ok
							i++;
						}else{
							System.out.println(i+1);
							//System.out.println("q" + (i+1));
							t = false;
							break;
						}
						
						
					}else
					if(p[i+1] < p[i-1] - q){
						//ok
						i++;
					}else{
						System.out.println(i+1);
						//System.out.println("a" + (i+1));
						t = false;
						break;
					}
					
					
				}else if(inner){
					if(p[i] < p[i-2]){
						//ok
					}else{
						System.out.println(i+1);
						//System.out.println("b" + (i));
						t = false;
						break;
					}
				}
				
				
				
				
				
			}
			
			if(t){
				System.out.println("OK");
			}
			
			
		}

	}

}
