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

let scores = [];

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

    if(output.length === 1 && output[0] === 0) break;
    else if((output.length === 1 && output[0] > 0)) continue;
    else

    scores.push(output.sort((a, b) => a-b));
}

scores.forEach(list => {
	let temp = -1;

	list.forEach((item, index) => {
		try {
			const result= Math.abs(item - list[index + 1]);

			if(temp === -1) temp = result

			else if(temp > result) temp = result;
		} catch (e) {
			return;
		}
	});

	console.log(temp);
});
