--- /dev/null
+module s2
+
+import StdEnv
+
+import Data.Func
+import Data.List
+import Data.Tuple
+
+getinput f
+# (ok, c, f) = freadc f
+| not ok = []
+= [c:getinput f]
+
+split :: [Char] [Char] -> [[Char]]
+split [] [] = []
+split c [] = [reverse c]
+split c ['\n':rest] = [reverse c:split [] rest]
+split c [r:rest] = split [r:c] rest
+
+Start w
+# (io, w) = stdio w
+= map (map fst o filter (uncurry (==)) o zip)
+ $ flatten
+ $ filter (not o isEmpty)
+ $ proc
+ $ split []
+ $ getinput io
+
+proc [] = []
+proc [x:xs] = [[(e, x)\\e<-xs | length [()\\a<-x & b<-e | a<>b] <= 1]:proc xs]