var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var arr = input.trim().split("\n");
while (arr.shift() != 0) {
    var a = arr.shift().split(" ").map(Number);
    var min = Infinity;
    a.sort(function(a, b) {
        min = Math.min(min, Math.abs(a - b));
        return a - b;
    });
    console.log(min);
}
