const input = require('fs').readFileSync('/dev/stdin', 'utf8');

const lines = input.trim().split('\n');

while (line = lines.shift()) {

    const numbers = line.split(' ').map(Number);
    // Edit from here

    if(numbers.length > 1){
        let keys = [...numbers.keys()]
        let nearest = Math.max(...numbers) - Math.min(...numbers) + 1;
        let result = [];
        for(let key = 0, lngth = numbers.length; key < lngth; key++){

            for(let innerKey = key + 1; innerKey < lngth; innerKey++){
                if( (Math.abs(numbers[keys[key]] - numbers[keys[innerKey]])) < nearest){
                    result = [numbers[keys[key]], numbers[keys[innerKey]]];
                    nearest = (Math.abs(numbers[keys[key]] - numbers[keys[innerKey]]));
                }
            }
            
        }
        if(result.length === 2){
            const [first, sec] = result
            var res = [first > sec ? first - sec : sec - first ]
        }
        console.log(res.toString())
    }
    // to here
}

