```<!--/**
* GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
* (http://qbnz.com/highlighter/ and http://geshi.org/)
*/
.haskell .imp {font-weight: bold; color: red;}
.haskell .kw1 {color: #06c; font-weight: bold;}
.haskell .kw2 {color: #06c; font-weight: bold;}
.haskell .kw4 {color: #cccc00; font-weight: bold;}
.haskell .co1 {color: #5d478b; font-style: italic;}
.haskell .co2 {color: #339933; font-weight: bold;}
.haskell .co3 {color: #5d478b; font-style: italic;}
.haskell .coMULTI {color: #5d478b; font-style: italic;}
.haskell .es0 {background-color: #3cb371; font-weight: bold;}
.haskell .sy0 {color: #339933; font-weight: bold;}
.ln, .ln{ vertical-align: top; }
-->{-# OPTIONS_GHC -O2 #-}module Main where import Data.Arrayimport Data.List (unfoldr)import Control.Monad primesFromTo a b = (if a<3 then [2] else [])                      ++ [i | i <- [o,o+2..b], ar ! i]   where     o  = max (if even a then a+1 else a) 3    r  = floor.sqrt.fromInteger \$ b+1    ar = accumArray (\a b-> False) True (o,b)           [(i,()) | p <- [3,5..r]                    , let q  = p*p                           s  = 2*p                           (n,x) = quotRem (o - q) s                           q' = if  o <= q  then q                               else  q + (n + signum x)*s                    , i <- [q',q'+s..b] ]main = do  a <- getLine  b <- getLine  let ps = primesFromTo (read a) (read b)  forM_ (groups 4 ps) print  forM_ (groups 20 \$ zipWith (-) (tail ps) ps) print groups = unfoldr . listMaybe . splitAt listMaybe _ [] = Nothing listMaybe f xs = Just (f xs)```
Success #stdin compilation error #stdout 12.53s 3728KB
stdin
```500111222000000
500111222002350```
compilation info
```[1 of 1] Compiling Main             ( prog.hs, prog.o )
```
stdout
```[500111222000017,500111222000053,500111222000057,500111222000063]
[500111222000069,500111222000123,500111222000167,500111222000179]
[500111222000197,500111222000233,500111222000333,500111222000387]
[500111222000389,500111222000479,500111222000503,500111222000603]
[500111222000659,500111222000707,500111222000713,500111222000849]
[500111222000879,500111222000893,500111222000939,500111222001043]
[500111222001049,500111222001071,500111222001089,500111222001187]
[500111222001203,500111222001221,500111222001227,500111222001263]
[500111222001311,500111222001337,500111222001397,500111222001407]
[500111222001497,500111222001499,500111222001529,500111222001553]
[500111222001593,500111222001637,500111222001733,500111222001739]
[500111222001761,500111222001773,500111222001779,500111222001791]
[500111222001827,500111222001847,500111222001857,500111222001871]
[500111222001889,500111222001901,500111222001983,500111222002009]
[500111222002019,500111222002037,500111222002039,500111222002061]
[500111222002097,500111222002103,500111222002141,500111222002159]
[500111222002169,500111222002199,500111222002211,500111222002279]
[500111222002309,500111222002333]
[36,4,6,6,54,44,12,18,36,100,54,2,90,24,100,56,48,6,136,30]
[14,46,104,6,22,18,98,16,18,6,36,48,26,60,10,90,2,30,24,40]
[44,96,6,22,12,6,12,36,20,10,14,18,12,82,26,10,18,2,22,36]
[6,38,18,10,30,12,68,30,24]
```