variants x = sort $ nub $ map (read :: String -> Int) $ u
  where s = show x
        u = filter (\x -> length x > 0) $ tails s ++ inits s
variants x = sort $ nub $ map (read :: String -> Int) $ u
  where s = show x
        u = filter (\x -> length x > 0) $ tails s ++ inits s
variants x = sort $ nub $ map (read :: String -> Int) $ u
  where s = show x
        u = filter (\x -> length x > 0) $ tails s ++ inits s