import java.util.*; import java.io.*; class Main{ public static void main(String args[]){ long n = readLong(); int s=readI(); ArrayList list = new ArrayList(); for(int i=0;i();for(int i=0;i= 0; i--) { if (a[i] < a[i + 1]) { for (int j = a.length - 1;; j--) { if (a[i] < a[j]) { int temp = a[i]; a[i] = a[j]; a[j] = temp; for (i++, j = a.length - 1; i < j; i++, j--) { temp = a[i]; a[i] = a[j]; a[j] = temp; } return true; } } } } return false; } static final BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); public static void pr(String str){ System.out.print(str); } public static void pl(String str){ System.out.println(str); } public static String read(){ try{ return ctos((char)br.read()); }catch(IOException e){ e.printStackTrace(); return ""; } } public static char readC(){ try{ return (char)br.read(); }catch(IOException e){ e.printStackTrace(); return (char)-1; } } public static String readL(){ try{ return br.readLine(); }catch(IOException e){ e.printStackTrace(); return ""; } } public static String readS(){ StringBuilder sb = new StringBuilder(); while(true){ try{ int k = br.read(); if(k==-1||(char)k==' '||(char)k=='\n'){break;} sb.append((char)k); }catch(IOException e){ e.printStackTrace(); } } return sb.toString(); } public static int readI(){ return stoi(readS()); } public static long readLong(){ return stol(readS()); } public static long stol(String s){ return Long.parseLong(s); } public static String[] readSs(){ return readL().split(" "); } public static int[] readIs(){ return stoi(readSs()); } public static int stoi(String s){ return Integer.parseInt(s); } public static int[] stoi(String s[]){ int a[]=new int[s.length]; for(int i=0;i