Japanese version is here

Dr. Tsukuba has devised a new method of programming training. In order to evaluate the effectiveness of this method, he plans to carry out a control experiment. Having two students as the participants of the experiment, one of them will be trained under the conventional method and the other under his new method. Comparing the final scores of these two, he will be able to judge the effectiveness of his method.

It is important to select two students having the closest possible scores, for making the comparison fair. He has a list of the scores of all students who can participate in the experiment. You are asked to write a program which selects two of them having the smallest difference in their scores.

The input consists of multiple datasets, each in the following format.

*n*

*a*_{1} *a*_{2} … *a _{n}*

A dataset consists of two lines.
The number of students *n* is given in the first line.
*n* is an integer satisfying 2 ≤ *n* ≤ 1000.
The second line gives scores of *n* students.
*a _{i}* (1 ≤

The end of the input is indicated by a line containing a zero.
The sum of *n*'s of all the datasets does not exceed 50,000.

For each dataset, select two students with the smallest difference in their scores, and output in a line (the absolute value of) the difference.

5 10 10 10 10 10 5 1 5 8 9 11 7 11 34 83 47 59 29 70 0

0 1 5

Source: ACM International Collegiate Programming Contest
, Japan Domestic Contest, Tsukuba, Japan, 2016-06-24

http://icpc.iisf.or.jp/2016-tsukuba/

http://icpc.iisf.or.jp/2016-tsukuba/