import Control.Monad.State
import ShortM

type Driver a = StateT T IO a

main :: IO ()
main = evalStateT (mapM_ (uncurry onLine) $ zip [1..] cs) empty

onLine :: Int -> [[Int]] -> Driver ()
onLine iter l = do liftIO $ putStr $ concat [show iter, " -"]
                   (survived, subsumed) <- partitionM subsumptionCheck l
                   let show_len = show . length
                   liftIO $ putStrLn $ concat [" #surv: ", show_len survived,
                                               " #subs: ", show_len subsumed]


subsumptionCheck :: [Int] -> Driver Bool
subsumptionCheck cl =
    do s <- get
       let wasSubsumed = subsumes s cl
       if wasSubsumed
         then return False
         else do put (add cl s)
                 return True

partitionM :: Monad m => (a -> m Bool) -> [a] -> m ([a],[a])
partitionM p xs = sequence (map p' xs) >>= return . partitionEithers
    where p' a = do r <- p a; return $ if r then Left a else Right a

partitionEithers :: [Either a b] -> ([a],[b])
partitionEithers = foldr (either _left _right) ([],[])
    where _left  a (l, r) = (a:l, r)
          _right a (l, r) = (l, a:r)



cs :: [ [[Int]] ]
cs = [
    [[1],[2],[3],[4],[5]],
    [[(-9),(-8),6,7,10]],
    [[11],[12],[13],[14],[15]],
    [[(-17),16]],
    [[(-18),(-16)]],
    [[(-16),19]],
    [[(-17),20]],
    [[(-21),(-7),22]],
    [[(-25),17,23,24,26,27,28,29,30,31,32]],
    [[(-34),(-33),35]],
    [[36],[37],[38],[39],[40],[41],[42],[43],[44],[45],[46],[47],[48],[49],[50],[51],[52],[53],[54],[55],[56],[57],[58],[59],[60],[61],[62],[63],[64],[65],[66],[67],[68],[69],[70],[71],[72],[73],[74],[75],[76],[77],[78],[79],[80],[81],[82],[83],[84],[85],[86],[87],[88],[89],[90],[91],[92],[93],[94],[95],[96],[97],[98],[99],[100],[101],[102],[103],[104],[105],[106],[107],[108],[109],[110],[111],[112],[113],[114],[115],[116],[117],[118],[119],[120],[121],[122],[123],[124],[125],[126],[127],[128],[129],[130],[131],[132],[133],[134],[135],[136],[137],[138],[139],[140],[141],[142],[143],[144],[145],[146],[147],[148],[149],[150],[151],[152],[153],[154],[155],[156],[157],[158],[159],[160],[161],[162],[163],[164],[165],[166],[167],[168],[169],[170],[171],[172],[173],[174],[175],[176],[177],[178],[179],[180],[181],[182],[183],[184],[185],[186],[187],[188],[189],[190],[191],[192],[193],[194],[195],[196],[197],[198],[199],[200],[201],[202],[203],[204],[205],[206],[207],[208],[209],[210],[211],[212],[213],[214],[215],[216],[217],[218],[219],[220],[221],[222],[223],[224],[225],[226],[227],[228],[229],[230],[231],[232],[233],[234],[235],[236]],
    [[(-238),237]],
    [[(-237),239]],
    [[(-9),(-8),6,7,240],[(-9),(-8),6,7,241]],
    [[(-239),242]],
    [[(-242),243]],
    [[(-243),244]],
    [[(-244),245]],
    [[(-245),246]],
    [[(-239),247]],
    [[(-247),248]],
    [[(-248),249]],
    [[(-249),250]],
    [[(-249),251]],
    [[(-251),252]],
    [[(-252),253]],
    [[(-253),254]],
    [[(-253),255]],
    [[(-255),256]],
    [[(-256),257]],
    [[(-257),258]],
    [[(-255),259]],
    [[(-259),260]],
    [[(-260),261]],
    [[(-17),262],[(-17),263]],
    [[(-261),264]],
    [[(-261),265]],
    [[(-265),266]],
    [[(-266),267]],
    [[(-267),268]],
    [[(-21),(-7),269],[(-21),(-7),270]],
    [[(-265),271]],
    [[(-271),272]],
    [[(-272),273]],
    [[(-273),274]],
    [[(-273),275]],
    [[(-25),17,23,24,27,28,29,30,31,32,276],[(-25),17,23,24,27,28,29,30,31,32,277]],
    [[(-275),278]],
    [[(-278),279]],
    [[(-279),280]],
    [[(-275),281]],
    [[(-281),282]],
    [[(-34),(-33),283],[(-34),(-33),284]],
    [[(-282),285]],
    [[(-285),286]],
    [[(-285),287]],
    [[(-287),288]],
    [[(-288),289]],
    [[238,290,291,292]],
    [[(-289),293]],
    [[(-259),294]],
    [[(-294),295]],
    [[(-295),296]],
    [[(-296),297]],
    [[(-237),298,299]],
    [[(-296),300]],
    [[(-300),301]],
    [[(-301),302]],
    [[(-302),303]],
    [[(-300),304]],
    [[(-299),(-242),305]],
    [[(-304),306]],
    [[(-306),307]],
    [[(-307),308]],
    [[(-307),309]],
    [[(-309),310]],
    [[(-305),(-244),311]],
    [[(-310),312]],
    [[(-312),313]],
    [[(-304),314]],
    [[(-314),315]],
    [[(-315),316]],
    [[(-311),(-246),317]],
    [[(-316),318]],
    [[(-316),319]],
    [[(-319),320]],
    [[(-320),321]],
    [[(-321),322]],
    [[(-317),(-246),323,324]],
    [[(-319),325]],
    [[(-325),326]],
    [[(-326),327]],
    [[(-327),328]],
    [[(-327),329]],
    [[(-324),(-317),(-245),330]],
    [[(-329),331]],
    [[(-331),332]],
    [[(-332),333]],
    [[(-325),334]],
    [[(-334),335]],
    [[(-336),(-324),(-311),(-243)]],
    [[(-335),337]],
    [[(-337),338]],
    [[(-337),339]],
    [[(-339),340]],
    [[(-340),341]],
    [[(-305),(-248),342]],
    [[(-341),343]],
    [[(-339),344]],
    [[(-344),345]],
    [[(-345),346]],
    [[(-346),347]],
    [[(-342),(-250),348]],
    [[(-346),349]],
    [[(-349),350]],
    [[(-350),351]],
    [[(-351),352]],
    [[(-247),353]],
    [[(-348),(-323),(-250),354]],
    [[(-353),355]],
    [[(-355),356]],
    [[(-356),357]],
    [[(-356),358]],
    [[(-358),359]],
    [[(-348),(-252),360]],
    [[(-359),361]],
    [[(-361),362]],
    [[(-360),(-254),363]],
    [[(-363),(-256),364]],
    [[(-364),(-258),365]],
    [[(-363),(-354),(-254),366]],
    [[(-364),(-260),367]],
    [[(-367),(-264),368]],
    [[(-368),(-266),369]],
    [[(-369),(-268),370]],
    [[(-369),(-272),371]],
    [[(-366),(-365),(-258),372]],
    [[(-371),(-274),373]],
    [[(-373),(-278),374]],
    [[(-374),(-280),375]],
    [[(-374),(-282),376]],
    [[(-376),(-286),377]],
    [[(-372),(-365),(-257),378,379]],
    [[(-377),(-288),380]],
    [[(-380),(-293),381]],
    [[(-367),(-295),382]],
    [[(-382),(-297),383]],
    [[(-383),(-301),384]],
    [[(-372),(-368),(-264),385]],
    [[(-384),(-303),386]],
    [[(-384),(-306),387]],
    [[(-387),(-308),388]],
    [[(-388),(-310),389]],
    [[(-389),(-313),390]],
    [[(-385),(-370),(-268),391]],
    [[(-387),(-315),392]],
    [[(-392),(-318),393]],
    [[(-393),(-320),394]],
    [[(-394),(-322),395]],
    [[(-394),(-326),396]],
    [[(-391),(-379),(-370),(-267),397]],
    [[(-396),(-328),398]],
    [[(-398),(-331),399]],
    [[(-399),(-333),400]],
    [[(-396),(-335),401]],
    [[(-401),(-338),402]],
    [[(-391),(-373),(-274),403]],
    [[(-402),(-340),404]],
    [[(-404),(-343),405]],
    [[(-404),(-345),406]],
    [[(-406),(-347),407]],
    [[(-407),(-350),408]],
    [[(-403),(-375),(-280),409]],
    [[(-408),(-352),410]],
    [[(-355),(-342),411]],
    [[(-411),(-357),412]],
    [[(-412),(-359),413]],
    [[(-413),(-362),414]],
    [[(-409),(-397),(-375),(-279),415]],
    [[(-409),(-377),(-286),416]],
    [[(-416),(-381),(-293),417]],
    [[(-385),(-383),(-297),418]],
    [[(-418),(-386),(-303),419]],
    [[(-419),(-388),(-308),420]],
    [[(-417),(-415),(-381),(-289),421]],
    [[(-420),(-390),(-313),422]],
    [[(-420),(-393),(-318),423]],
    [[(-423),(-395),(-322),424]],
    [[(-424),(-398),(-328),425]],
    [[(-425),(-400),(-333),426]],
    [[(-421),(-417),(-380),(-287),427,428]],
    [[(-425),(-402),(-338),429]],
    [[(-429),(-405),(-343),430]],
    [[(-430),(-407),(-347),431]],
    [[(-431),(-410),(-352),432]],
    [[(-412),(-357),(-354),433]],
    [[(-434),(-428),(-421),(-416),(-376),(-281)]],
    [[(-433),(-414),(-362),435]],
    [[(-419),(-397),(-386),(-302),436]],
    [[(-436),(-422),(-390),(-312),437]],
    [[(-437),(-424),(-395),(-321),438]],
    [[(-438),(-426),(-400),(-332),439]],
    [[(-440),(-428),(-415),(-403),(-371),(-271)]],
    [[(-439),(-430),(-405),(-341),441]],
    [[(-441),(-432),(-410),(-351),442]],
    [[(-435),(-414),(-378),(-361),443]],
    [[(-444),(-443),(-435),(-413),(-358)]],
    [[(-378),(-323),(-299),(-238),336]],
    [[(-437),(-427),(-422),(-389),(-309),445]],
    [[(-445),(-439),(-426),(-399),(-329),446]],
    [[(-446),(-442),(-432),(-408),(-349),447]],
    [[(-447),(-442),(-431),(-406),(-344),448,449]],
    [[(-450),(-449),(-447),(-441),(-429),(-401),(-334)]],
    [[(-449),(-446),(-440),(-438),(-423),(-392),(-314)]],
    [[(-448),(-445),(-436),(-418),(-382),(-336),(-294)]],
    [[(-448),(-427),(-379),(-366),(-360),(-251),440]],
    [[(-443),(-433),(-411),(-353),451]],
    [[(-452),(-9),(-8),6,7],[(-453),(-9),(-8),6,7],[(-9),(-8),6,7,454],[(-9),(-8),6,7,455],[(-9),(-8),6,7,456]],
    [[(-457),(-17)],[(-17),458]],
    [[(-459),(-21),(-7)],[(-21),(-7),460],[(-21),(-7),461],[(-21),(-7),462],[(-21),(-7),463],[(-21),(-7),464],[(-21),(-7),465],[(-21),(-7),466],[(-21),(-7),467],[(-21),(-7),468],[(-21),(-7),469],[(-21),(-7),470],[(-21),(-7),471],[(-21),(-7),472],[(-21),(-7),473],[(-21),(-7),474],[(-21),(-7),475],[(-21),(-7),476],[(-21),(-7),477],[(-21),(-7),478],[(-21),(-7),479],[(-21),(-7),480],[(-21),(-7),481],[(-21),(-7),482],[(-21),(-7),483],[(-21),(-7),484],[(-21),(-7),485],[(-21),(-7),486],[(-21),(-7),487],[(-21),(-7),488],[(-21),(-7),489],[(-21),(-7),490],[(-21),(-7),491],[(-21),(-7),492],[(-21),(-7),493],[(-21),(-7),494],[(-21),(-7),495],[(-21),(-7),496],[(-21),(-7),497],[(-21),(-7),498],[(-21),(-7),499],[(-21),(-7),500],[(-21),(-7),501],[(-21),(-7),502],[(-21),(-7),503],[(-21),(-7),504],[(-21),(-7),505],[(-21),(-7),506],[(-21),(-7),507],[(-21),(-7),508],[(-21),(-7),509],[(-21),(-7),510],[(-21),(-7),511]],
    [[(-34),(-33),512],[(-34),(-33),513],[(-34),(-33),514],[(-34),(-33),(-9)],[(-515),(-34),(-33)],[(-450),(-34),(-33)]],
    [[238,290,292,516],[238,290,292,517]],
    [[(-17),518],[(-17),519]],
    [[(-520),(-17)],[(-17),521],[(-17),522]],
    [[(-21),(-7),523,524]],
    [[(-524),(-21),(-7),525]],
    [[(-526),(-524),(-21),(-7)]],
    [[(-523),(-21),(-7),527]],
    [[(-527),(-21),(-7),528]],
    [[(-528),(-21),(-7),529]],
    [[(-529),(-21),(-7),530]],
    [[(-530),(-21),(-7),531]],
    [[(-531),(-21),(-7),532]],
    [[(-532),(-21),(-7),533]],
    [[(-533),(-21),(-7),534]],
    [[(-534),(-21),(-7),535]],
    [[(-530),(-21),(-7),536]],
    [[(-536),(-21),(-7),537]],
    [[(-537),(-21),(-7),538]],
    [[(-538),(-21),(-7),539]],
    [[(-538),(-21),(-7),540]],
    [[(-540),(-21),(-7),541]],
    [[(-541),(-21),(-7),542]],
    [[(-542),(-21),(-7),543]],
    [[(-542),(-21),(-7),544]],
    [[(-544),(-21),(-7),545]],
    [[(-545),(-21),(-7),546]],
    [[(-546),(-21),(-7),547]],
    [[(-527),(-21),(-7),548]],
    [[(-548),(-21),(-7),549]],
    [[(-529),(-21),(-7),550,551]],
    [[(-551),(-531),(-21),(-7),552]],
    [[(-552),(-533),(-21),(-7),553]],
    [[(-553),(-535),(-21),(-7),554]],
    [[(-552),(-537),(-21),(-7),555]],
    [[(-555),(-539),(-21),(-7),556]],
    [[(-556),(-541),(-21),(-7),557]],
    [[(-557),(-543),(-21),(-7),558]],
    [[(-558),(-545),(-21),(-7),559]],
    [[(-559),(-547),(-21),(-7),560]],
    [[(-550),(-549),(-21),(-7),561]],
    [[(-562),(-561),(-549),(-21),(-7)]],
    [[(-561),(-548),(-21),(-7),563]],
    [[(-550),(-523),(-21),(-7),526]],
    [[(-554),(-535),(-21),(-7),564,565]],
    [[(-566),(-565),(-554),(-534),(-21),(-7)]],
    [[(-567),(-565),(-553),(-532),(-21),(-7)]],
    [[(-564),(-556),(-539),(-21),(-7),568]],
    [[(-568),(-558),(-543),(-21),(-7),569]],
    [[(-569),(-560),(-547),(-21),(-7),570]],
    [[(-570),(-560),(-546),(-21),(-7),571,572]],
    [[(-572),(-570),(-559),(-544),(-21),(-7),573]],
    [[(-572),(-569),(-567),(-557),(-540),(-21),(-7)]],
    [[(-571),(-568),(-555),(-536),(-526),(-21),(-7)]],
    [[(-571),(-564),(-551),(-528),(-21),(-7),567]],
    [[(-21),(-7),574],[(-21),(-7),575]],
    [[(-21),(-7),576],[(-21),(-7),577],[(-21),(-7),578],[(-21),(-7),579],[(-21),(-7),580],[(-21),(-7),581],[(-21),(-7),582],[(-21),(-7),583],[(-21),(-7),584],[(-21),(-7),585],[(-21),(-7),586],[(-21),(-7),587],[(-21),(-7),588],[(-21),(-7),589],[(-21),(-7),590],[(-21),(-7),591],[(-21),(-7),592],[(-21),(-7),593],[(-21),(-7),594],[(-21),(-7),595],[(-21),(-7),596],[(-21),(-7),597],[(-21),(-7),598],[(-21),(-7),599],[(-21),(-7),600],[(-21),(-7),601],[(-21),(-7),602],[(-21),(-7),603],[(-21),(-7),604],[(-21),(-7),605],[(-21),(-7),606],[(-21),(-7),607],[(-21),(-7),608],[(-21),(-7),609],[(-21),(-7),610],[(-21),(-7),611],[(-21),(-7),612],[(-21),(-7),613],[(-21),(-7),614],[(-21),(-7),615],[(-21),(-7),616],[(-21),(-7),617],[(-21),(-7),618],[(-21),(-7),619],[(-21),(-7),620],[(-21),(-7),621],[(-21),(-7),622],[(-21),(-7),623],[(-21),(-7),563],[(-624),(-21),(-7)],[(-21),(-7),562]],
    [[(-21),(-7),625,626]],
    [[(-626),(-434),(-21),(-7)]],
    [[(-627),(-626),(-21),(-7)]],
    [[(-625),(-21),(-7),628]],
    [[(-628),(-21),(-7),629]],
    [[(-629),(-21),(-7),630]],
    [[(-630),(-21),(-7),631]],
    [[(-631),(-21),(-7),632]],
    [[(-632),(-21),(-7),633]],
    [[(-633),(-21),(-7),634]],
    [[(-634),(-21),(-7),635]],
    [[(-635),(-21),(-7),636]],
    [[(-631),(-21),(-7),637]],
    [[(-637),(-21),(-7),638]],
    [[(-638),(-21),(-7),639]],
    [[(-639),(-21),(-7),640]],
    [[(-639),(-21),(-7),641]],
    [[(-641),(-21),(-7),642]],
    [[(-642),(-21),(-7),643]],
    [[(-643),(-21),(-7),644]],
    [[(-643),(-21),(-7),645]],
    [[(-645),(-21),(-7),646]],
    [[(-646),(-21),(-7),647]],
    [[(-647),(-21),(-7),648]],
    [[(-630),(-21),(-7),649,650]],
    [[(-650),(-632),(-21),(-7),651]],
    [[(-651),(-634),(-21),(-7),652]],
    [[(-652),(-636),(-21),(-7),653]],
    [[(-651),(-638),(-21),(-7),654]],
    [[(-654),(-640),(-21),(-7),655]],
    [[(-655),(-642),(-21),(-7),656]],
    [[(-656),(-644),(-21),(-7),657]],
    [[(-657),(-646),(-21),(-7),658]],
    [[(-658),(-648),(-21),(-7),659]],
    [[(-649),(-628),(-21),(-7),566]],
    [[(-649),(-625),(-21),(-7),627]],
    [[(-653),(-636),(-21),(-7),660,661]],
    [[(-662),(-661),(-653),(-635),(-21),(-7)]],
    [[(-663),(-661),(-652),(-633),(-21),(-7)]],
    [[(-660),(-655),(-640),(-21),(-7),664]],
    [[(-664),(-657),(-644),(-21),(-7),665]],
    [[(-665),(-659),(-648),(-21),(-7),666]],
    [[(-666),(-659),(-647),(-21),(-7),667,668]],
    [[(-668),(-666),(-658),(-645),(-21),(-7),450]],
    [[(-668),(-665),(-663),(-656),(-641),(-21),(-7)]],
    [[(-667),(-664),(-654),(-637),(-627),(-21),(-7)]],
    [[(-667),(-660),(-650),(-629),(-21),(-7),663]],
    [[(-34),(-33),669],[(-34),(-33),670]],
    [[(-34),(-33),671],[(-34),(-33),672],[(-34),(-33),673],[(-34),(-33),674],[(-34),(-33),675],[(-34),(-33),676],[(-34),(-33),677],[(-34),(-33),678],[(-34),(-33),679],[(-34),(-33),680],[(-34),(-33),681],[(-34),(-33),682],[(-34),(-33),683],[(-34),(-33),684],[(-34),(-33),685],[(-34),(-33),686],[(-34),(-33),687],[(-34),(-33),688],[(-34),(-33),689],[(-34),(-33),690],[(-34),(-33),691],[(-34),(-33),692],[(-34),(-33),693],[(-34),(-33),694],[(-34),(-33),695],[(-34),(-33),696],[(-34),(-33),697],[(-34),(-33),698],[(-34),(-33),699],[(-34),(-33),700],[(-34),(-33),701],[(-34),(-33),702],[(-34),(-33),703],[(-34),(-33),704],[(-34),(-33),705],[(-34),(-33),706],[(-34),(-33),707],[(-34),(-33),708],[(-34),(-33),709],[(-34),(-33),710],[(-34),(-33),711],[(-34),(-33),712],[(-34),(-33),713],[(-34),(-33),714],[(-34),(-33),715],[(-34),(-33),716],[(-34),(-33),717],[(-34),(-33),718],[(-34),(-33),719],[(-34),(-33),720],[(-34),(-33),721],[(-34),(-33),722],[(-34),(-33),290],[(-723),(-34),(-33)],[(-34),(-33),662]],
    [[(-34),(-33),724,725]],
    [[(-726),(-725),(-34),(-33)]],
    [[(-727),(-725),(-34),(-33)]],
    [[(-724),(-34),(-33),728]],
    [[(-728),(-34),(-33),729]],
    [[(-729),(-34),(-33),730]],
    [[(-730),(-34),(-33),731]],
    [[(-731),(-34),(-33),732]],
    [[(-732),(-34),(-33),733]],
    [[(-733),(-34),(-33),734]],
    [[(-734),(-34),(-33),735]],
    [[(-735),(-34),(-33),736]],
    [[(-731),(-34),(-33),737]],
    [[(-737),(-34),(-33),738]],
    [[(-738),(-34),(-33),739]],
    [[(-739),(-34),(-33),740]],
    [[(-739),(-34),(-33),741]],
    [[(-741),(-34),(-33),742]],
    [[(-742),(-34),(-33),743]],
    [[(-743),(-34),(-33),744]],
    [[(-743),(-34),(-33),745]],
    [[(-745),(-34),(-33),746]],
    [[(-746),(-34),(-33),747]],
    [[(-747),(-34),(-33),748]],
    [[(-728),(-34),(-33),749]],
    [[(-749),(-34),(-33),750]],
    [[(-730),(-34),(-33),751,752]],
    [[(-752),(-732),(-34),(-33),753]],
    [[(-753),(-734),(-34),(-33),754]],
    [[(-754),(-736),(-34),(-33),755]],
    [[(-753),(-738),(-34),(-33),756]],
    [[(-756),(-740),(-34),(-33),757]],
    [[(-757),(-742),(-34),(-33),758]],
    [[(-758),(-744),(-34),(-33),759]],
    [[(-759),(-746),(-34),(-33),760]],
    [[(-760),(-748),(-34),(-33),761]],
    [[(-751),(-750),(-34),(-33),762]],
    [[(-762),(-750),(-34),(-33),514]],
    [[(-763),(-762),(-749),(-34),(-33)]],
    [[(-751),(-724),(-34),(-33),727]],
    [[(-755),(-736),(-34),(-33),764,765]],
    [[(-765),(-755),(-735),(-450),(-34),(-33)]],
    [[(-766),(-765),(-754),(-733),(-34),(-33)]],
    [[(-764),(-757),(-740),(-34),(-33),767]],
    [[(-767),(-759),(-744),(-34),(-33),768]],
    [[(-768),(-761),(-748),(-34),(-33),769]],
    [[(-769),(-761),(-747),(-34),(-33),770,771]],
    [[(-771),(-769),(-760),(-745),(-34),(-33),562]],
    [[(-771),(-768),(-766),(-758),(-741),(-34),(-33)]],
    [[(-770),(-767),(-756),(-737),(-727),(-34),(-33)]],
    [[(-770),(-764),(-752),(-729),(-34),(-33),766]],
    [[(-443),(-433),(-411),(-353),772],[(-443),(-433),(-411),(-353),773]],
    [[(-774),(-443),(-433),(-411),(-353)],[(-443),(-433),(-411),(-353),775],[(-443),(-433),(-411),(-353),776]],
    [[(-573),(-443),(-433),(-411),(-353),777]],
    [[(-573),(-443),(-433),(-411),(-353),778],[(-573),(-443),(-433),(-411),(-353),779]],
    [[(-573),(-443),(-433),(-411),(-353),780],[(-781),(-573),(-443),(-433),(-411),(-353)],[(-782),(-573),(-443),(-433),(-411),(-353)]]
 ]
