description: Alice and Bob are playing a game. They are given an array A of length N. The array consists of integers. They are building a sequence together. In the beginning, the sequence is empty. In one turn a player can remove a number from the left or right side of the array and append it to the sequence. The rule is that the sequence they are building must be strictly increasing. The winner is the player that makes the last move. Alice is playing first. Given the starting array, under the assumption that they both play optimally, who wins the game?
  
  Input
  
  The first line contains one integer N (1 ≤ N ≤ 2*10^5) - the length of the array A.
  
  The second line contains N integers A_1, A_2,...,A_N (0 ≤ A_i ≤ 10^9)
  
  Output
  
  The first and only line of output consists of one string, the name of the winner. If Alice won, print "Alice", otherwise, print "Bob".
  
  Examples
  
  Input
  
  
  1
  5
  
  
  Output
  
  
  Alice
  
  
  Input
  
  
  3
  5 4 5
  
  
  Output
  
  
  Alice
  
  
  Input
  
  
  6
  5 8 2 1 10 9
  
  
  Output
  
  
  Bob
solution: import java.io.*;
  import java.util.*;
  
  public class game{
      //--------------------------INPUT READER--------------------------------//
      static class fs {
          public BufferedReader br;
          StringTokenizer st = new StringTokenizer("");
  
          public fs() { this(System.in); }
          public fs(InputStream is) {
              br = new BufferedReader(new InputStreamReader(is));
          }
          String next() {
              while (!st.hasMoreTokens()) {
                  try { st = new StringTokenizer(br.readLine()); }
                  catch (IOException e) { e.printStackTrace(); }
              }
              return st.nextToken();
          }
  
          int ni() { return Integer.parseInt(next()); }
          long nl() { return Long.parseLong(next()); }
          double nd() { return Double.parseDouble(next()); }
          String ns() { return next(); }
  
          int[] na(int n) {
              int[] a = new int[n];
              for (int i = 0; i < n; i++) a[i] = ni();
              return a;
          }
  
          long[] nal(int n) {
              long[] l = new long[n];
              for(int i = 0; i < n; i++) l[i] = nl();
              return l;
          }
      }
      //-----------------------------------------------------------------------//
  
      //---------------------------PRINTER-------------------------------------//
      static class Printer {
          static PrintWriter w;
          public Printer() {this(System.out);}
          public Printer(OutputStream os) {
              w = new PrintWriter(os);
          }
          public void p(int i) {w.println(i);};
          public void p(long l) {w.println(l);};
          public void p(double d) {w.println(d);};
          public void p(String s) { w.println(s);};
          public void pr(int i) {w.println(i);};
          public void pr(long l) {w.print(l);};
          public void pr(double d) {w.print(d);};
          public void pr(String s) { w.print(s);};
          public void pl() {w.println();};
          public void close() {w.close();};
      }
      //------------------------------------------------------------------------//
  
      //--------------------------VARIABLES------------------------------------//
      static fs sc = new fs();
      static OutputStream outputStream = System.out;
      static Printer w = new Printer(outputStream);
      //-----------------------------------------------------------------------//
  
      //--------------------------ADMIN_MODE-----------------------------------//
      private static void ADMIN_MODE() throws IOException {
          if (System.getProperty("ONLINE_JUDGE") == null) {
              w = new Printer(new FileOutputStream("output.txt"));
              sc = new fs(new FileInputStream("input.txt"));
          }
      }
      //-----------------------------------------------------------------------//
  
      //----------------------------START--------------------------------------//
      public static void main(String[] args)
              throws IOException {
  
          ADMIN_MODE();
  
          //int t = sc.ni();while(t-->0)
              solve();
  
  
          w.close();
      }
  
      static void solve() throws IOException {
          int n = sc.ni();
          long[] arr = sc.nal(n);
          if(n == 1) {
              w.p("Alice");
              return;
          }
          int pt1 = 0, pt2 = n-1;
          int ct = 0;
          int[] bef = new int[n];
          int[] aft = new int[n];
          for(int i = 1; i < n; i++) {
              if(arr[i]<arr[i-1]) ct++;
              else ct=0;
              bef[i] = ct;
          }
          ct = 0;
          for(int i = n-2; i >= 0; i--) {
              if(arr[i]<arr[i+1]) ct++;
              else ct = 0;
              aft[i] = ct;
          }
          boolean turn = true;
          while(true) {
              if(pt1==pt2) {
                  w.p(turn ? "Alice" : "Bob");
                  return;
              }
              if(arr[pt1]>arr[pt2]) {
                  if(aft[pt1]%2==0) {
                      w.p(turn ? "Alice" : "Bob");
                      return;
                  } else {
                      if(arr[pt2-1] > arr[pt2]) {
                          pt2--;
                      } else {
                          w.p(turn ? "Alice" : "Bob");
                          return;
                      }
                  }
              } else if(arr[pt2]>arr[pt1]) {
                  if(bef[pt2]%2==0) {
                      w.p(turn ? "Alice" : "Bob");
                      return;
                  } else {
                      if(arr[pt1+1] > arr[pt1]) {
                          pt1++;
                      } else {
                          w.p(turn ? "Alice" : "Bob");
                          return;
                      }
                  }
              } else {
                  if(aft[pt1]%2==0 || bef[pt2]%2==0) {
                      w.p(turn ? "Alice" : "Bob");
                      return;
                  } else if(arr[pt1+1] == arr[pt2-1]) {
                      pt1++;
                  } else {
                      w.p(!turn ? "Alice" : "Bob");
                      return;
                  }
              }
              turn = !turn;
          }
      }
  }