import java.io.*; import java.util.*; public class ss { public static void main(String[] args) throws Exception { BufferedReader bf = new BufferedReader(new InputStreamReader(System.in)); ArrayList pole = new ArrayList(); while(true) { pole.clear(); String s = bf.readLine(); if(s==null || s.equals("0")) break; StringTokenizer st = new StringTokenizer(s); int p = Integer.parseInt(st.nextToken()); int c = Integer.parseInt(st.nextToken()); int[] a = new int[p]; s = bf.readLine(); //st = new StringTokenizer(s); for(int i = 0; i < p; i++) { //a[i] = Integer.parseInt(st.nextToken()); a[i] = 1; } boolean m = true; int n = a[0]; for(int i = 1; i < p; i++) { if(m) { if(a[i - 1] >= a[i]) { n = a[i]; } else { m = false; pole.add(n); n = a[i]; } } else { if(a[i - 1] <= a[i]) { n = a[i]; } else { /* no) no = k; } System.out.println(no + ""); } } public static int getMin(ArrayList list,int l, int p) { int min = list.get(l); int pos = l; for (int i=l+2;i list,int l, int p) { int max = list.get(l); int pos = l; for (int i=l+2;imax) { max= k; pos = i; } } return pos; } }