
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

public class Main{

	public static void main(String[] args) throws IOException {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));


		int n 	     = Integer.parseInt(br.readLine());
		long max     = 0;
		long[] list  = new long[n];
		String[] tmp = br.readLine().split(" ");

		for(int i = 0; i < n; i++) {

			list[i] = Long.parseLong(tmp[i]);

		}

		for(int i = 0; i < n; i++) {
			for(int j = 0; j < n; j++) {

				max = Math.max(Math.abs(list[i] - list[j]), max);
			}
		}
		System.out.println(max);
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.ArrayList; ArrayList java.util import java.util.List; List java.util public class Main{

	public static void main(String[] args) throws IOException {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));


		int n 	     = Integer.parseInt(br.readLine());
		long max     = 0;
		long[] list  = new long[n];
		String[] tmp = br.readLine().split(" ");

		for(int i = 0; i < n; i++) {

			list[i] = Long.parseLong(tmp[i]);

		}

		for(int i = 0; i < n; i++) {
			for(int j = 0; j < n; j++) {

				max = Math.max(Math.abs(list[i] - list[j]), max);
			}
		}
		System.out.println(max);
	}
} Main public static void main(String[] args) throws IOException {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));


		int n 	     = Integer.parseInt(br.readLine());
		long max     = 0;
		long[] list  = new long[n];
		String[] tmp = br.readLine().split(" ");

		for(int i = 0; i < n; i++) {

			list[i] = Long.parseLong(tmp[i]);

		}

		for(int i = 0; i < n; i++) {
			for(int j = 0; j < n; j++) {

				max = Math.max(Math.abs(list[i] - list[j]), max);
			}
		}
		System.out.println(max);
	} main {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));


		int n 	     = Integer.parseInt(br.readLine());
		long max     = 0;
		long[] list  = new long[n];
		String[] tmp = br.readLine().split(" ");

		for(int i = 0; i < n; i++) {

			list[i] = Long.parseLong(tmp[i]);

		}

		for(int i = 0; i < n; i++) {
			for(int j = 0; j < n; j++) {

				max = Math.max(Math.abs(list[i] - list[j]), max);
			}
		}
		System.out.println(max);
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int n 	     = Integer.parseInt(br.readLine()); n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br long max     = 0; max 0 long[] list  = new long[n]; list new long[n] n String[] tmp = br.readLine().split(" "); tmp br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " for(int i = 0; i < n; i++) {

			list[i] = Long.parseLong(tmp[i]);

		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {

			list[i] = Long.parseLong(tmp[i]);

		} {

			list[i] = Long.parseLong(tmp[i]);

		} list[i] = Long.parseLong(tmp[i]) list[i] list i Long.parseLong(tmp[i]) Long.parseLong Long tmp[i] tmp i for(int i = 0; i < n; i++) {
			for(int j = 0; j < n; j++) {

				max = Math.max(Math.abs(list[i] - list[j]), max);
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			for(int j = 0; j < n; j++) {

				max = Math.max(Math.abs(list[i] - list[j]), max);
			}
		} {
			for(int j = 0; j < n; j++) {

				max = Math.max(Math.abs(list[i] - list[j]), max);
			}
		} for(int j = 0; j < n; j++) {

				max = Math.max(Math.abs(list[i] - list[j]), max);
			} int j = 0; int j = 0; j 0 j < n j n j++ j++ j {

				max = Math.max(Math.abs(list[i] - list[j]), max);
			} {

				max = Math.max(Math.abs(list[i] - list[j]), max);
			} max = Math.max(Math.abs(list[i] - list[j]), max) max Math.max(Math.abs(list[i] - list[j]), max) Math.max Math Math.abs(list[i] - list[j]) Math.abs Math list[i] - list[j] list[i] list i list[j] list j max System.out.println(max) System.out.println System.out System System.out max String[] args args public class Main{

	public static void main(String[] args) throws IOException {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));


		int n 	     = Integer.parseInt(br.readLine());
		long max     = 0;
		long[] list  = new long[n];
		String[] tmp = br.readLine().split(" ");

		for(int i = 0; i < n; i++) {

			list[i] = Long.parseLong(tmp[i]);

		}

		for(int i = 0; i < n; i++) {
			for(int j = 0; j < n; j++) {

				max = Math.max(Math.abs(list[i] - list[j]), max);
			}
		}
		System.out.println(max);
	}
} public class Main{

	public static void main(String[] args) throws IOException {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));


		int n 	     = Integer.parseInt(br.readLine());
		long max     = 0;
		long[] list  = new long[n];
		String[] tmp = br.readLine().split(" ");

		for(int i = 0; i < n; i++) {

			list[i] = Long.parseLong(tmp[i]);

		}

		for(int i = 0; i < n; i++) {
			for(int j = 0; j < n; j++) {

				max = Math.max(Math.abs(list[i] - list[j]), max);
			}
		}
		System.out.println(max);
	}
} Main

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

public class Main{

	public static void main(String[] args) throws IOException {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));


		int n 	     = Integer.parseInt(br.readLine());
		long max     = 0;
		long[] list  = new long[n];
		String[] tmp = br.readLine().split(" ");

		for(int i = 0; i < n; i++) {

			list[i] = Long.parseLong(tmp[i]);

		}

		for(int i = 0; i < n; i++) {
			for(int j = 0; j < n; j++) {

				max = Math.max(Math.abs(list[i] - list[j]), max);
			}
		}
		System.out.println(max);
	}
}
