import java.util.Scanner;
public class Main{
    public static void main(String[] args){
        Scanner scan=new Scanner(System.in);
        int N=scan.nextInt();
        int[] A=new int[N];
        int i;
        int answer=0;
        for(i=0;i<N;i++){
            A[i]=scan.nextInt();
            for(int j=0;j<i;j++){
                if(answer<Math.abs(A[i]-A[j])){
                    answer=Math.abs(A[i]-A[j]);
                }
            }
        }
        System.out.println(answer);
    }
} import java.util.Scanner; Scanner java.util public class Main{
    public static void main(String[] args){
        Scanner scan=new Scanner(System.in);
        int N=scan.nextInt();
        int[] A=new int[N];
        int i;
        int answer=0;
        for(i=0;i<N;i++){
            A[i]=scan.nextInt();
            for(int j=0;j<i;j++){
                if(answer<Math.abs(A[i]-A[j])){
                    answer=Math.abs(A[i]-A[j]);
                }
            }
        }
        System.out.println(answer);
    }
} Main public static void main(String[] args){
        Scanner scan=new Scanner(System.in);
        int N=scan.nextInt();
        int[] A=new int[N];
        int i;
        int answer=0;
        for(i=0;i<N;i++){
            A[i]=scan.nextInt();
            for(int j=0;j<i;j++){
                if(answer<Math.abs(A[i]-A[j])){
                    answer=Math.abs(A[i]-A[j]);
                }
            }
        }
        System.out.println(answer);
    } main {
        Scanner scan=new Scanner(System.in);
        int N=scan.nextInt();
        int[] A=new int[N];
        int i;
        int answer=0;
        for(i=0;i<N;i++){
            A[i]=scan.nextInt();
            for(int j=0;j<i;j++){
                if(answer<Math.abs(A[i]-A[j])){
                    answer=Math.abs(A[i]-A[j]);
                }
            }
        }
        System.out.println(answer);
    } Scanner scan=new Scanner(System.in); scan new Scanner(System.in) int N=scan.nextInt(); N scan.nextInt() scan.nextInt scan int[] A=new int[N]; A new int[N] N int i; i int answer=0; answer 0 for(i=0;i<N;i++){
            A[i]=scan.nextInt();
            for(int j=0;j<i;j++){
                if(answer<Math.abs(A[i]-A[j])){
                    answer=Math.abs(A[i]-A[j]);
                }
            }
        } i=0; i=0 i 0 i<N i N i++ i++ i {
            A[i]=scan.nextInt();
            for(int j=0;j<i;j++){
                if(answer<Math.abs(A[i]-A[j])){
                    answer=Math.abs(A[i]-A[j]);
                }
            }
        } {
            A[i]=scan.nextInt();
            for(int j=0;j<i;j++){
                if(answer<Math.abs(A[i]-A[j])){
                    answer=Math.abs(A[i]-A[j]);
                }
            }
        } A[i]=scan.nextInt() A[i] A i scan.nextInt() scan.nextInt scan for(int j=0;j<i;j++){
                if(answer<Math.abs(A[i]-A[j])){
                    answer=Math.abs(A[i]-A[j]);
                }
            } int j=0; int j=0; j 0 j<i j i j++ j++ j {
                if(answer<Math.abs(A[i]-A[j])){
                    answer=Math.abs(A[i]-A[j]);
                }
            } {
                if(answer<Math.abs(A[i]-A[j])){
                    answer=Math.abs(A[i]-A[j]);
                }
            } if(answer<Math.abs(A[i]-A[j])){
                    answer=Math.abs(A[i]-A[j]);
                } answer<Math.abs(A[i]-A[j]) answer Math.abs(A[i]-A[j]) Math.abs Math A[i]-A[j] A[i] A i A[j] A j {
                    answer=Math.abs(A[i]-A[j]);
                } answer=Math.abs(A[i]-A[j]) answer Math.abs(A[i]-A[j]) Math.abs Math A[i]-A[j] A[i] A i A[j] A j System.out.println(answer) System.out.println System.out System System.out answer String[] args args public class Main{
    public static void main(String[] args){
        Scanner scan=new Scanner(System.in);
        int N=scan.nextInt();
        int[] A=new int[N];
        int i;
        int answer=0;
        for(i=0;i<N;i++){
            A[i]=scan.nextInt();
            for(int j=0;j<i;j++){
                if(answer<Math.abs(A[i]-A[j])){
                    answer=Math.abs(A[i]-A[j]);
                }
            }
        }
        System.out.println(answer);
    }
} public class Main{
    public static void main(String[] args){
        Scanner scan=new Scanner(System.in);
        int N=scan.nextInt();
        int[] A=new int[N];
        int i;
        int answer=0;
        for(i=0;i<N;i++){
            A[i]=scan.nextInt();
            for(int j=0;j<i;j++){
                if(answer<Math.abs(A[i]-A[j])){
                    answer=Math.abs(A[i]-A[j]);
                }
            }
        }
        System.out.println(answer);
    }
} Main
import java.util.Scanner;
public class Main{
    public static void main(String[] args){
        Scanner scan=new Scanner(System.in);
        int N=scan.nextInt();
        int[] A=new int[N];
        int i;
        int answer=0;
        for(i=0;i<N;i++){
            A[i]=scan.nextInt();
            for(int j=0;j<i;j++){
                if(answer<Math.abs(A[i]-A[j])){
                    answer=Math.abs(A[i]-A[j]);
                }
            }
        }
        System.out.println(answer);
    }
}