import Control.Monad
import Control.Applicative
import Data.List

main :: IO()
main = getLine >>= main' . read
    where
        main' 0 = return ()
        main' _ = do
            as <- map read . words <$> getLine :: IO [Int]
            print $ solve as 
            main

solve :: [Int] -> Int
solve as = head $ sort $ f $ sort as

f :: [Int] -> [Int]
f (_:[])= []
f (a:as) = ((head as) - a) : (f as)
 