const input = require('fs').readFileSync('/dev/stdin', 'utf8');
const lines = input.trim().split('\n');

while (line = lines.shift()) {
    const numbers = line.split(' ').map(Number);

    if(numbers.length > 1){
    	let sorted = numbers.sort((a,b)=> a-b);
    	let minDiff = Math.abs(sorted[0] - sorted[1]), diff = 0;
    	for(let i = 2; i < sorted.length; i++){
    		diff = Math.abs(sorted[i] - sorted[i-1]);
    		if(diff < minDiff){
    			minDiff = diff;
    		}
    	}
    	console.log(minDiff);
    }
    
    
    
}

