import Control.Applicative
import Data.Bits
import Data.List
import Data.Tuple
f534 :: Integral a => a -> String
f534 =
flip (map . (((intToDigit . signum) .) . (.&.) . fromIntegral))
=<< takeWhile (not . (== 0)) . iterate (`div` 2) .
bit . floorLogBase2FromIntegral .
f534' :: Integral a => a -> String
f534' =
=<< flip replicate
2 . succ . floorLogBase2FromIntegral
. (if' id (const nnErr) =<< (>= 0))
g534 :: Integral a => a -> String
g534 = if' (const "0") (map intToDigitFromIntegral
. reverse . unfoldr
(if' (const Nothing) (Just . swap . (`divMod` 2)) =<< (== 0)) . (if' id (const nnErr
) =<< (>= 0))) =<< (== 0)
nnErr :: e
nnErr
= error "applied to negative number"
if' :: a -> a -> Bool -> a
if' f g p = if p then f else g
aW1wb3J0IENvbnRyb2wuQXBwbGljYXRpdmUKaW1wb3J0IERhdGEuQml0cwppbXBvcnQgRGF0YS5DaGFyCmltcG9ydCBEYXRhLkxpc3QKaW1wb3J0IERhdGEuVHVwbGUKCm1haW4gOjogSU8gKCkKbWFpbiA9IG1hcE1fIHB1dFN0ckxuICQgW2Y1MzQsIGY1MzQnLCBnNTM0XSA8Kj4gWzAuLjEwXQoKZjUzNCA6OiBJbnRlZ3JhbCBhID0+IGEgLT4gU3RyaW5nCmY1MzQgPQogIGZsaXAgKG1hcCAuICgoKGludFRvRGlnaXQgLiBzaWdudW0pIC4pIC4gKC4mLikgLiBmcm9tSW50ZWdyYWwpKQogICAgPTw8IHRha2VXaGlsZSAobm90IC4gKD09IDApKSAuIGl0ZXJhdGUgKGBkaXZgIDIpIC4KICAgICAgICBiaXQgLiBmbG9vckxvZ0Jhc2UyRnJvbUludGVncmFsIC4KICAgICAgICAoaWYnIGlkIChjb25zdCBubkVycikgPTw8ICg+PSAwKSkKCmY1MzQnIDo6IEludGVncmFsIGEgPT4gYSAtPiBTdHJpbmcKZjUzNCcgPQogICgobWFwIGludFRvRGlnaXRGcm9tSW50ZWdyYWwgLiBzbmQpIC4pIC4gZmxpcCAobWFwQWNjdW1SI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