package yukicoder; import java.util.Scanner; public class Yuki135 { public static void main(String[] args ) { Scanner scan = new Scanner(System.in); int n = scan.nextInt(); int x[] = new int[n]; for(int i = 0; i < n; i++) { x[i] = scan.nextInt(); } scan.close(); int ans = 0; int perseAns = 0; for(int i = 0; i < n; i++) { for(int j = 0; j < n; j++) { if( x[i] > x[j] ){ ans = x[i]-x[j]; } else { ans = x[j]-x[i]; } if(perseAns == 0) { perseAns = ans; }else if ( ans < perseAns && ans != 0) { perseAns = ans; } } } System.out.println(perseAns); } }