import Data.Complex
import Data.List
main
= mapM_ (print . f
) $ [1 .. 6] ++ [10, 20, 999, 1000]f n = (!! n) $ nub $ sort [magnitude $ x :+ y | x <- a, y <- a]
aW1wb3J0IERhdGEuQ29tcGxleAppbXBvcnQgRGF0YS5MaXN0Cm1haW4gOjogSU8gKCkKbWFpbiA9IG1hcE1fIChwcmludCAuIGYpICQgWzEgLi4gNl0gKysgWzEwLCAyMCwgOTk5LCAxMDAwXQpmIDo6IEludCAtPiBEb3VibGUKZiBuID0gKCEhIG4pICQgbnViICQgc29ydCBbbWFnbml0dWRlICQgeCA6KyB5IHwgeCA8LSBhLCB5IDwtIGFdCiAgd2hlcmUgYSA9IFswIC4uIGZyb21JbnRlZ3JhbCAkIGNlaWxpbmcgJCBzcXJ0ICQgZnJvbUludGVncmFsICQgNCAqIG5dCg==