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