import java.util.Scanner;
 
public class Main {
	  public static void main(String args[]) {
		    Scanner scanner = new Scanner(System.in);
 
 
		    String str1 = scanner.next();
		    int N = Integer.parseInt(str1);
		    int[] array = new int[N];
		    String str2 = scanner.next();
                    int  M =Integer.parseInt(str2);
                    array[0] = M;
		    int maximum = array[0];
		    int minimum = array[0];
		    
		    for(int i = 1; i<array.length; i++)
		    {
		    	array[i] = scanner.nextInt();
		    	int v = array[i];
		    	if(v > maximum)
		    	{
		    		maximum = v;
		    	}
		    	if(v < minimum)
		    	{
		    		minimum = v;
		    	}
		    }
		    
		    int Delta = maximum - minimum ;
		    System.out.println(Delta);
		    
        	scanner.close();}
		  } import java.util.Scanner; Scanner java.util public class Main {
	  public static void main(String args[]) {
		    Scanner scanner = new Scanner(System.in);
 
 
		    String str1 = scanner.next();
		    int N = Integer.parseInt(str1);
		    int[] array = new int[N];
		    String str2 = scanner.next();
                    int  M =Integer.parseInt(str2);
                    array[0] = M;
		    int maximum = array[0];
		    int minimum = array[0];
		    
		    for(int i = 1; i<array.length; i++)
		    {
		    	array[i] = scanner.nextInt();
		    	int v = array[i];
		    	if(v > maximum)
		    	{
		    		maximum = v;
		    	}
		    	if(v < minimum)
		    	{
		    		minimum = v;
		    	}
		    }
		    
		    int Delta = maximum - minimum ;
		    System.out.println(Delta);
		    
        	scanner.close();}
		  } Main public static void main(String args[]) {
		    Scanner scanner = new Scanner(System.in);
 
 
		    String str1 = scanner.next();
		    int N = Integer.parseInt(str1);
		    int[] array = new int[N];
		    String str2 = scanner.next();
                    int  M =Integer.parseInt(str2);
                    array[0] = M;
		    int maximum = array[0];
		    int minimum = array[0];
		    
		    for(int i = 1; i<array.length; i++)
		    {
		    	array[i] = scanner.nextInt();
		    	int v = array[i];
		    	if(v > maximum)
		    	{
		    		maximum = v;
		    	}
		    	if(v < minimum)
		    	{
		    		minimum = v;
		    	}
		    }
		    
		    int Delta = maximum - minimum ;
		    System.out.println(Delta);
		    
        	scanner.close();} main {
		    Scanner scanner = new Scanner(System.in);
 
 
		    String str1 = scanner.next();
		    int N = Integer.parseInt(str1);
		    int[] array = new int[N];
		    String str2 = scanner.next();
                    int  M =Integer.parseInt(str2);
                    array[0] = M;
		    int maximum = array[0];
		    int minimum = array[0];
		    
		    for(int i = 1; i<array.length; i++)
		    {
		    	array[i] = scanner.nextInt();
		    	int v = array[i];
		    	if(v > maximum)
		    	{
		    		maximum = v;
		    	}
		    	if(v < minimum)
		    	{
		    		minimum = v;
		    	}
		    }
		    
		    int Delta = maximum - minimum ;
		    System.out.println(Delta);
		    
        	scanner.close();} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) String str1 = scanner.next(); str1 scanner.next() scanner.next scanner int N = Integer.parseInt(str1); N Integer.parseInt(str1) Integer.parseInt Integer str1 int[] array = new int[N]; array new int[N] N String str2 = scanner.next(); str2 scanner.next() scanner.next scanner int  M =Integer.parseInt(str2); M Integer.parseInt(str2) Integer.parseInt Integer str2 array[0] = M array[0] array 0 M int maximum = array[0]; maximum array[0] array 0 int minimum = array[0]; minimum array[0] array 0 for(int i = 1; i<array.length; i++)
		    {
		    	array[i] = scanner.nextInt();
		    	int v = array[i];
		    	if(v > maximum)
		    	{
		    		maximum = v;
		    	}
		    	if(v < minimum)
		    	{
		    		minimum = v;
		    	}
		    } int i = 1; int i = 1; i 1 i<array.length i array.length array array.length i++ i++ i {
		    	array[i] = scanner.nextInt();
		    	int v = array[i];
		    	if(v > maximum)
		    	{
		    		maximum = v;
		    	}
		    	if(v < minimum)
		    	{
		    		minimum = v;
		    	}
		    } {
		    	array[i] = scanner.nextInt();
		    	int v = array[i];
		    	if(v > maximum)
		    	{
		    		maximum = v;
		    	}
		    	if(v < minimum)
		    	{
		    		minimum = v;
		    	}
		    } array[i] = scanner.nextInt() array[i] array i scanner.nextInt() scanner.nextInt scanner int v = array[i]; v array[i] array i if(v > maximum)
		    	{
		    		maximum = v;
		    	} v > maximum v maximum {
		    		maximum = v;
		    	} maximum = v maximum v if(v < minimum)
		    	{
		    		minimum = v;
		    	} v < minimum v minimum {
		    		minimum = v;
		    	} minimum = v minimum v int Delta = maximum - minimum ; Delta maximum - minimum maximum minimum System.out.println(Delta) System.out.println System.out System System.out Delta scanner.close() scanner.close scanner String args[] args public class Main {
	  public static void main(String args[]) {
		    Scanner scanner = new Scanner(System.in);
 
 
		    String str1 = scanner.next();
		    int N = Integer.parseInt(str1);
		    int[] array = new int[N];
		    String str2 = scanner.next();
                    int  M =Integer.parseInt(str2);
                    array[0] = M;
		    int maximum = array[0];
		    int minimum = array[0];
		    
		    for(int i = 1; i<array.length; i++)
		    {
		    	array[i] = scanner.nextInt();
		    	int v = array[i];
		    	if(v > maximum)
		    	{
		    		maximum = v;
		    	}
		    	if(v < minimum)
		    	{
		    		minimum = v;
		    	}
		    }
		    
		    int Delta = maximum - minimum ;
		    System.out.println(Delta);
		    
        	scanner.close();}
		  } public class Main {
	  public static void main(String args[]) {
		    Scanner scanner = new Scanner(System.in);
 
 
		    String str1 = scanner.next();
		    int N = Integer.parseInt(str1);
		    int[] array = new int[N];
		    String str2 = scanner.next();
                    int  M =Integer.parseInt(str2);
                    array[0] = M;
		    int maximum = array[0];
		    int minimum = array[0];
		    
		    for(int i = 1; i<array.length; i++)
		    {
		    	array[i] = scanner.nextInt();
		    	int v = array[i];
		    	if(v > maximum)
		    	{
		    		maximum = v;
		    	}
		    	if(v < minimum)
		    	{
		    		minimum = v;
		    	}
		    }
		    
		    int Delta = maximum - minimum ;
		    System.out.println(Delta);
		    
        	scanner.close();}
		  } Main
import java.util.Scanner;
 
public class Main {
	  public static void main(String args[]) {
		    Scanner scanner = new Scanner(System.in);
 
 
		    String str1 = scanner.next();
		    int N = Integer.parseInt(str1);
		    int[] array = new int[N];
		    String str2 = scanner.next();
                    int  M =Integer.parseInt(str2);
                    array[0] = M;
		    int maximum = array[0];
		    int minimum = array[0];
		    
		    for(int i = 1; i<array.length; i++)
		    {
		    	array[i] = scanner.nextInt();
		    	int v = array[i];
		    	if(v > maximum)
		    	{
		    		maximum = v;
		    	}
		    	if(v < minimum)
		    	{
		    		minimum = v;
		    	}
		    }
		    
		    int Delta = maximum - minimum ;
		    System.out.println(Delta);
		    
        	scanner.close();}
		  }