import java.util.Arrays;
public class GreaterEleSME {
public static void main(String args[]) {
int arr[] = { 10, 12, 13, 14, 22, 3, 5, 1 };
int first = arr[0];
int last = arr[arr.length - 1];
int middle = arr[(arr.length / 2) - 1];
if (first > last && first > middle) {
System.out.println("First element is greater");
} else if (last > first && last > middle) {
System.out.println("last element is greater");
} else {
System.out.println("Middle element is greater");
}
}
}