diff --git a/CHANGELOG.md b/CHANGELOG.md
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,12 @@
 Changes
 =======
 
+Version 0.1.5.0
+----------------
+
+Convenient combinators for linear forms and constraints.
+New experimental functions in Math.ExpPairs.Kratzel: tauabcd and tauA for general multidimensional divisor problems.
+
 Version 0.1.4.0
 ----------------
 
diff --git a/Math/ExpPairs.hs b/Math/ExpPairs.hs
--- a/Math/ExpPairs.hs
+++ b/Math/ExpPairs.hs
@@ -14,7 +14,9 @@
 A set of useful applications can be found in
 "Math.ExpPairs.Ivic", "Math.ExpPairs.Kratzel" and "Math.ExpPairs.MenzerNowak".
 -}
-{-# LANGUAGE CPP  #-}
+{-# LANGUAGE CPP             #-}
+{-# LANGUAGE PatternSynonyms #-}
+{-# LANGUAGE TemplateHaskell #-}
 
 module Math.ExpPairs
   ( optimize
@@ -24,14 +26,19 @@
   , optimalPath
   , simulateOptimize
   , simulateOptimize'
-  , LinearForm (..)
+  , LinearForm
   , RationalForm (..)
-  , IneqType (..)
-  , Constraint (..)
+  , IneqType
+  , Constraint
   , InitPair
   , Path
   , RatioInf (..)
   , RationalInf
+  , pattern K
+  , pattern L
+  , pattern M
+  , (>.), (>=.), (<.), (<=.)
+  , scaleLF
   ) where
 
 import Control.Arrow hiding ((<+>))
@@ -39,18 +46,47 @@
 import Data.Ord      (comparing)
 import Data.List     (minimumBy)
 import Data.Monoid
+import Data.Ratio
 import Text.PrettyPrint.Leijen hiding ((<$>), (<>))
 import qualified Text.PrettyPrint.Leijen as PP
 import Text.Printf
+import Data.Function.Memoize (deriveMemoizable)
 
 import Math.ExpPairs.LinearForm
 import Math.ExpPairs.Process
 import Math.ExpPairs.Pair
 import Math.ExpPairs.RatioInf
 
+-- | For a given @c@ returns linear form @c * k@
+pattern K n = LinearForm n 0 0
+-- | For a given @c@ returns linear form @c * l@
+pattern L n = LinearForm 0 n 0
+-- | For a given @c@ returns linear form @c * m@
+pattern M n = LinearForm 0 0 n
+
+-- | Build a constraint, which states that the value of the first linear form is greater than the value of the second one.
+(>.) :: Num t => LinearForm t -> LinearForm t -> Constraint t
+lf1 >. lf2  = Constraint (lf1 - lf2) Strict
+infix 5 >.
+
+-- | Build a constraint, which states that the value of the first linear form is greater or equal to the value of the second one.
+(>=.) :: Num t => LinearForm t -> LinearForm t -> Constraint t
+lf1 >=. lf2 = Constraint (lf1 - lf2) NonStrict
+infix 5 >=.
+
+-- | Build a constraint, which states that the value of the first linear form is less than the value of the second one.
+(<.) :: Num t => LinearForm t -> LinearForm t -> Constraint t
+lf1 <. lf2  = Constraint (lf2 - lf1) Strict
+infix 5 <.
+
+-- | Build a constraint, which states that the value of the first linear form is less or equal to the value of the second one.
+(<=.) :: Num t => LinearForm t -> LinearForm t -> Constraint t
+lf1 <=. lf2 = Constraint (lf2 - lf1) NonStrict
+infix 5 <=.
+
 evalFunctional :: [InitPair] -> [InitPair] -> [RationalForm Rational] -> [Constraint Rational] -> Path -> (RationalInf, InitPair)
 evalFunctional corners interiors rfs cons path = case rs of
-  [] -> (InfPlus, undefined)
+  [] -> (InfPlus, error "evalFunctional: cannot find any exponential pair, which satisfies constraints")
   _  -> minimumBy (comparing fst) rs
   where
     applyPath  = map (evalPath path . initPairToProjValue &&& id)
@@ -58,9 +94,10 @@
     interiors' = applyPath interiors
 
     predicate (p, _) = all (checkConstraint p) cons
-    qs = if all predicate corners'
-          then corners'
-          else filter predicate interiors'
+    qs
+      | all predicate corners' = corners'
+      | any predicate corners' = filter predicate interiors'
+      | otherwise              = []
 
     rs = map (first $ \p -> maximum (map (evalRF p) rfs)) qs
 
@@ -80,11 +117,18 @@
   }
   deriving (Show)
 
+deriveMemoizable ''OptimizeResult
+
 instance Pretty OptimizeResult where
-  pretty (OptimizeResult r' ip p) = pretty' r' PP.<$> pretty ip </> pretty p where
-    pretty' r@(Finite rr) = text (printf "%.6f" (fromRational rr :: Double)) <+> equals <+> pretty r
-    pretty' r = pretty r
+  pretty (OptimizeResult r' ip p) = pretty1 r' PP.<$>
+    (parens (pretty (k%m) PP.<> comma PP.<> pretty (l%m)) <+> equals <+> pretty p </> pretty ip)
+    where
+      pretty1 r@(Finite rr) = text (printf "%.6f" (fromRational rr :: Double)) <+> equals <+> pretty r
+      pretty1 r = pretty r
 
+      (k, l, m) = evalPath p $ initPairToProjValue ip
+
+
 instance Eq OptimizeResult where
   (==) = (==) `on` optimalValue
 
@@ -127,5 +171,5 @@
       pathba  = path <> baPath
       branchB@(OptimizeResult r2' _ _) = optimize' rfs cons (OptimizeResult r1 ip1 pathba)
 
-    consBuilder rr (RationalForm num den) = Constraint (substituteLF (num, den, 1) (LinearForm (-1) (toRational rr) 0)) Strict
+    consBuilder rr (num :/: den) = (substituteLF (num, den, 1) (L (toRational rr) - K 1)) >. 0
 
diff --git a/Math/ExpPairs/Ivic.hs b/Math/ExpPairs/Ivic.hs
--- a/Math/ExpPairs/Ivic.hs
+++ b/Math/ExpPairs/Ivic.hs
@@ -21,6 +21,7 @@
   , findMinAbscissa
   , mBigOnHalf
   , reverseMBigOnHalf
+  , kolpakova2011
   ) where
 
 import Data.Ratio
@@ -35,8 +36,8 @@
 zetaOnS s
   | s >= 1  = simulateOptimize 0
   | s >= 1%2 = optimize
-    [RationalForm (LinearForm 1 1 (-s)) 2]
-    [Constraint (LinearForm (-1) 1 (-s)) NonStrict]
+    [K 1 + L 1 - M s :/: 2]
+    [L 1 >=. K 1 + M s]
   | otherwise = optRes {optimalValue = r} where
     optRes = zetaOnS (1-s)
     r = Finite (1%2 - s) + optimalValue optRes
@@ -48,10 +49,10 @@
 reverseZetaOnS :: Rational -> OptimizeResult
 reverseZetaOnS mu
   | mu >= 1%2   = simulateOptimize 0
-  | mu > zetaOnHalf = optimize [RationalForm (LinearForm 1 (-1) 1) 1] [Constraint (LinearForm 0 (-2) (1+2*mu)) NonStrict]
+  | mu > zetaOnHalf = optimize [K 1 - L 1 + M 1 :/: 1] [M (1 + 2 * mu) >=. L 2]
   | mu == zetaOnHalf = simulateOptimize (1 % 2)
   | otherwise = optRes {optimalValue = negate $ optimalValue optRes} where
-  optRes = optimize [RationalForm (LinearForm 1 (-1) 0) 1] [Constraint (LinearForm 1 0 (-mu)) NonStrict, Constraint (LinearForm (-1) 1 (-1%2)) NonStrict]
+  optRes = optimize [K 1 - L 1 :/: 1] [K 1 >=. M mu, L 2 >=. K 2 + 1]
 
 lemma82_f :: Rational -> Rational
 lemma82_f s
@@ -77,42 +78,58 @@
     beta1  = -12/(1+2*s)
     x1 = optRes {optimalValue = Finite $ (1-alpha1)/muS - beta1}
 
-    --alpha2 = 4*(1-s)*(k+l)/((2*m+4*l)*s-m+2*k-2*l)
-    --beta2  = -4*(m+2*k+2*l)/((2*m+4*l)*s-m+2*k-2*l)
-    --ratio = (1-alpha2)/muS - beta2
-    --numer = numerator ratio
-    --denom = denominator ratio
-    numer = LinearForm
-      (-4*s + (-8*muS + 2))
-      (-8*s + (-8*muS + 6))
-      (-2*s + (-4*muS + 1))
-    denom = LinearForm
-      (2*muS)
-      (4*muS*s - 2*muS)
-      (2*muS*s - muS)
+    -- alpha2 = 4*(1-s)*(k+l)/((2*m+4*l)*s-m+2*k-2*l)
+    -- beta2  = -4*(m+2*k+2*l)/((2*m+4*l)*s-m+2*k-2*l)
+    -- numer % denom = (1-alpha2)/muS - beta2
+    t     = scaleLF s (L 4 + 2) - 1 + K 2 - L 2
+    numer = t - scaleLF (4 * (1-s)) (K 1 + L 1) + scaleLF (4 * muS) (K 2 + L 2 + 1)
+    denom = scaleLF muS t
 
-    cons = if s >= 2%3 then [] else [Constraint
-      (LinearForm (4*s-2) (8*s-6) (2*s-1)) NonStrict
-      ]
+    cons = if s >= 2%3 then [] else [scaleLF s (K 4 + L 8 + 2) >=. K 2 + L 6 + 1]
 
-    x2' = optimize [RationalForm numer denom] cons
+    x2' = optimize [- numer :/: denom] cons
     x2 = x2' {optimalValue = negate $ optimalValue x2'}
 
+data Choice = Least | Median | Greatest
+
+binarySearch :: (Rational -> Bool) -> Choice -> Rational -> Rational -> Rational -> Rational
+binarySearch predicate choice precision = go
+  where
+    go a b
+      | b - a < precision = case choice of
+                            Least    -> a
+                            Median   -> c
+                            Greatest -> b
+      | predicate c = go a c
+      | otherwise   = go c b
+      where
+        c = (numerator a + numerator b) % (denominator a + denominator b)
+
+mOnSTwoThird :: RationalInf
+mOnSTwoThird = optimalValue $ mOnS $ 2 % 3
+
 -- | Try to reverse 'mOnS': for a given precision and m compute minimal possible σ.
 -- Implementation is usual try-and-divide search, so performance is very poor.
 -- Sometimes, when 'mOnS' gets especially lucky exponent pair, 'reverseMOnS' can miss
--- real σ and returns bigger value.
+-- real σ and returns significantly bigger value.
+--
+-- For integer m>=4 this function corresponds to the multidimensional Dirichlet problem
+-- and returns σ from error term O(x^{σ+ε}). See Ch. 13 in Ivić2003.
 reverseMOnS :: Rational -> RationalInf -> Rational
-reverseMOnS prec m = reverseMOnS' from to where
-  from = 1 % 2
-  to   = 1
-  reverseMOnS' a b
-    | b - a < prec = c
-    | optimalValue (mOnS c) > m = reverseMOnS' a c
-    | otherwise = reverseMOnS' c b
-    where
-      c = (numerator a + numerator b) % (denominator a + denominator b)
+reverseMOnS _ InfPlus = 1
+reverseMOnS _ (Finite m)
+  | m <= 4 = 1 % 2
+  | m <= 8 = 3 % 4 - recip m
+reverseMOnS prec m
+  | m < mOnSTwoThird = go (5 % 8) (2 % 3)
+  | otherwise        = go (2 % 3) 1
+  where
+    go = binarySearch (\c -> optimalValue (mOnS c) > m) Greatest prec
 
+-- | An estimate of the symmetric multidimensional divisor function from Kolpakova, 2011.
+kolpakova2011 :: Integer -> Double
+kolpakova2011 k = 1 - 1/3 * 2**(2/3) * (4.45 * fromInteger k)**(-2/3)
+
 -- | Check whether ∫_1^T   Π_i |ζ(n_i*σ+it)|^m_i dt ≪ T^(1+ε) for a given list of pairs [(n_1, m_1), ...] and fixed σ.
 checkAbscissa :: [(Rational, Rational)] -> Rational -> Bool
 checkAbscissa xs s = sum rs < Finite 1 where
@@ -122,15 +139,7 @@
 -- | Find for a given precision and list of pairs [(n_1, m_1), ...] the minimal σ
 -- such that ∫_1^T   Π_i|ζ(n_i*σ+it)|^m_i dt ≪ T^(1+ε).
 findMinAbscissa :: Rational -> [(Rational, Rational)] -> Rational
-findMinAbscissa prec xs = searchMinAbscissa' from to where
-  from = 1 % 2 / minimum (map fst xs)
-  to   = 1 % 1
-  searchMinAbscissa' a b
-    | b - a < prec = b
-    | checkAbscissa xs c = searchMinAbscissa' a c
-    | otherwise = searchMinAbscissa' c b
-    where
-      c = (numerator a + numerator b) % (denominator a + denominator b)
+findMinAbscissa prec xs = binarySearch (checkAbscissa xs) Greatest prec (1 % 2 / minimum (map fst xs)) 1
 
 -- | Compute minimal M(A) such that ∫_1^T |ζ(1/2+it)|^A dt ≪ T^(M(A)+ε).
 -- See Ch. 8 in Ivić2003. Further justification will be published elsewhere.
@@ -138,16 +147,16 @@
 mBigOnHalf a
   | a < 4     = simulateOptimize 1
   | a < 12    = simulateOptimize $ 1+(a-4)/8
-  | a > 41614060315296730740083860226662 % 2636743270445733804969041895717 = simulateOptimize $ 1 + 32*(a-6)/205
+  | a > 41614060315296730740083860226662 % 2636743270445733804969041895717 = simulateOptimize $ 1 + (a - 6) * zetaOnHalf
   | otherwise = if Finite x >= optimalValue optRes
     then simulateOptimize x
     else optRes where
-      optRes = optimize [RationalForm (LinearForm 1 1 0) (LinearForm 1 0 0)]
-        [Constraint (LinearForm (4-a) 4 2) NonStrict]
+      optRes = optimize [K 1 + L 1 :/: K 1]
+        [K (4 - a) + L 4 + 2 >=. 0]
       x = 1 + 32*(a-6)/205
 -- Constant 41614060315296730740083860226662 % 2636743270445733804969041895717
 -- is produced by
--- optimize [RationalForm (LinearForm 4 4 2) (LinearForm 1 0 0)] [Constraint (LinearForm (-64) (-77) 64) Strict]
+-- optimize [K 4 + L 4 + 2 :/: K 1] [64 >. K 64 + L 77]
 
 -- | Try to reverse 'mBigOnHalf': for a given M(A) find maximal possible A.
 -- Sometimes, when 'mBigOnHalf' gets especially lucky exponent pair, 'reverseMBigOnHalf' can miss
@@ -158,7 +167,5 @@
   | otherwise = if Finite a <= optimalValue optRes
     then simulateOptimize a
     else optRes where
-    a = (m-1)*205/32 + 6
-    optRes = optimize [RationalForm (LinearForm 4 4 2) (LinearForm 1 0 0)] [Constraint (LinearForm (1-m) 1 0) NonStrict]
-
-
+    a = (m - 1) / zetaOnHalf + 6
+    optRes = optimize [K 4 + L 4 + 2 :/: K 1] [K (1 - m) + L 1 >=. 0]
diff --git a/Math/ExpPairs/Kratzel.hs b/Math/ExpPairs/Kratzel.hs
--- a/Math/ExpPairs/Kratzel.hs
+++ b/Math/ExpPairs/Kratzel.hs
@@ -24,20 +24,32 @@
 He also provided a set of theorems to estimate Θ(a, b) and Θ(a, b, c).
 
 -}
+
+{-# LANGUAGE TemplateHaskell #-}
+
 module Math.ExpPairs.Kratzel
   ( TauabTheorem (..)
   , tauab
   , TauabcTheorem (..)
   , tauabc
+  , TauabcdTheorem (..)
+  , tauabcd
+  , Theorem (..)
+  , TauAResult (..)
+  , tauA
   ) where
 
-import Control.Arrow
-import Data.Ratio ((%))
+import Control.Arrow hiding ((<+>))
+import Data.Function
+import Data.Maybe
+import Data.Ratio
 import Data.Ord   (comparing)
-import Data.List  (minimumBy)
+import Data.List  (minimumBy, sort)
 import Text.PrettyPrint.Leijen
+import Data.Function.Memoize    (memoize, deriveMemoizable)
 
 import Math.ExpPairs
+import Math.ExpPairs.Ivic
 
 -- |Special type to specify the theorem of Krätzel1988,
 -- which provided the best estimate of Θ(a, b)
@@ -58,32 +70,36 @@
 divideResult :: Real a => a -> (b, OptimizeResult) -> (b, OptimizeResult)
 divideResult d = second (\o -> o {optimalValue = optimalValue o / Finite (toRational d)})
 
+tauab' :: Rational -> Rational -> (TauabTheorem, OptimizeResult)
+tauab' a b = minimumBy (comparing snd) [kr511a, kr511b, kr512a, kr512b]
+  where
+    kr511a = (Kr511a, optimize
+      [K 2 + L 2 - 1 :/: M (a+b)]
+      [L (2 * a) >=. K (2 * b) + M a])
+    kr511b = (Kr511b, optimize
+      [K 1 :/: K b - L a + M a]
+      [K (2 * b) + M a >. L (2 * a)])
+    kr512a = (Kr512a, simulateOptimize r)
+      where
+        r = if 11*a >= 8*b then 19/29/(a+b) else 1%1
+    kr512b = if 11*a >= 8*b then kr512a else (Kr512b, optimize
+      [L 8 - K 11 - 4 :/: L (29 * a) - K (29 * b) + M (4*b-20*a)]
+      [ L (2 * a) >=. K (2 * b) + M a
+      , 4 >. K 29
+      , K 29 + L 29 >. 24
+      ])
+
 -- |Compute Θ(a, b) for given a and b.
 tauab :: Integer -> Integer -> (TauabTheorem, OptimizeResult)
-tauab a' b'
-  | d /= 1 = divideResult d $ tauab (a'`div` d) (b' `div` d) where
-      d = gcd a' b'
-tauab a' b' = minimumBy (comparing (optimalValue . snd)) [kr511a, kr511b, kr512a, kr512b] where
-  a = toRational a'
-  b = toRational b'
-  kr511a = (Kr511a, optimize
-    [RationalForm (LinearForm 2 2 (-1)) (LinearForm 0 0 (a+b))]
-    [Constraint (LinearForm (-2*b) (2*a) (-a)) NonStrict])
-  kr511b = (Kr511b, optimize
-    [RationalForm (LinearForm 1 0 0) (LinearForm b (-a) a)]
-    [Constraint (LinearForm (2*b) (-2*a) a) Strict])
-  kr512a = (Kr512a, simulateOptimize r) where
-    r = if 11*a >= 8*b then 19/29/(a+b) else 1%1
-  kr512b = if 11*a >= 8*b then kr512a else (Kr512b, optimize
-    [
-      RationalForm (LinearForm (-11) 8 (-4)) (LinearForm (-29*b) (29*a) (4*b-20*a))
-    ]
-    [
-      Constraint (LinearForm (-2*b) (2*a) (-a)) NonStrict,
-      Constraint (LinearForm (-29) 0 4) Strict,
-      Constraint (LinearForm 29 29 (-24)) Strict
-    ])
+tauab a b
+  | d /= 1 = divideResult d $ tauab (a `div` d) (b `div` d)
+    where
+      d = a `gcd` b
+tauab a b = tauab' a' b'
+  where
+    [a', b'] = sort $ map toRational [a, b]
 
+
 -- |Special type to specify the theorem of Krätzel1988,
 -- which provided the best estimate of Θ(a, b, c)
 data TauabcTheorem
@@ -113,35 +129,224 @@
   pretty (Tauab t) = pretty t
   pretty t         = pretty (show t)
 
+tauabc' :: Rational -> Rational -> Rational -> (TauabcTheorem, OptimizeResult)
+tauabc' a b c = minimumBy (comparing snd) [kr61, kr62, kr63, kr64, kr65, kr66]
+  where
+    abc = a + b + c
+    kr61
+      | c<a+b = (Kr61, simulateOptimize $ 2/abc)
+      | optimalValue optRes < Finite (recip c) = (Kr61, simulateOptimize $ 1/c)
+      | otherwise = (Tauab th, optRes)
+      where
+        (th, optRes) = tauab' a b
+    kr62 = (Kr62, optimize
+      [K 2 + L 2 :/: M (a + b + c)]
+      [ L a >=. K (b + c)
+      , M (a + b + c) >=. K (2 * c) + L (2 * c)
+      ])
+    kr63 = (Kr63, optimize
+      [K 4 + L 2 + 3 :/: K (2 * abc) + M (3 * abc)]
+      [scaleLF (2 * a) (K 1 + L 1 + 1) >=. scaleLF (b + c) (K 2 + 1)])
+    kr64 = (Kr64, simulateOptimize r) where
+      r = recip abc * minimum (abc:[2-4*(k-1)%(3*2^k-4) | k<-[1..maxk], (3*2^k-2*k-4)%1 * a >= 2 * (b+c), (3*2^k-8)%1 * (a+b) >= (3*2^k-4*k+4)%1 * c])
+      maxk = 4 `max` floor (logBase 2 (fromRational $ b+c) :: Double)
+    kr65 = (Kr65, simulateOptimize r) where
+      r = if 7*a>=2*(b+c) && 4*(a+b)>=5*c then 3%2/abc else 1%1
+    kr66 = (Kr66, simulateOptimize r) where
+      r = if 18*a>=7*(b+c) && 2*(a+b)>=3*c then 25%17/abc else 1%1
+
 -- |Compute Θ(a, b, c) for given a, b and c.
 tauabc :: Integer -> Integer -> Integer -> (TauabcTheorem, OptimizeResult)
-tauabc a' b' c'
-  | d /= 1 = divideResult d $ tauabc (a'`div` d) (b' `div` d) (c' `div` d) where
-      d = gcd (gcd a' b') c'
 tauabc 1 1 1 = (Kolesnik, simulateOptimize $ 43%96)
-tauabc a' b' c' = minimumBy (comparing (optimalValue . snd)) [kr61, kr62, kr63, kr64, kr65, kr66] where
-  a = toRational a'
-  b = toRational b'
-  c = toRational c'
-  kr61
-    | c<a+b = (Kr61, simulateOptimize $ 2/(a+b+c))
-    | optimalValue optRes < Finite (recip c) = (Kr61, simulateOptimize $ 1/c)
-    | otherwise = (Tauab th, optRes)
+tauabc a b c
+  | d /= 1 = divideResult d $ tauabc (a `div` d) (b `div` d) (c `div` d)
     where
-      (th, optRes) = tauab a' b'
-  kr62 = (Kr62, optimize
-    [RationalForm (LinearForm 2 2 0) (LinearForm 0 0 (a+b+c))]
-    [
-      Constraint (LinearForm (-b-c) a 0) NonStrict,
-      Constraint (LinearForm (-2*c) (-2*c) (a+b+c)) NonStrict
-    ])
-  kr63 = (Kr63, optimize
-    [RationalForm (LinearForm 4 2 3) (LinearForm (2*(a+b+c)) 0 (3*(a+b+c)))]
-    [Constraint (LinearForm (2*(a-b-c)) (2*a) (2*a-b-c)) NonStrict])
-  kr64 = (Kr64, simulateOptimize r) where
-    r = recip (a+b+c) * minimum ((a+b+c):[2-4*(k-1)%(3*2^k-4) | k<-[1..maxk], (3*2^k-2*k-4)%1 * a >= 2 * (b+c), (3*2^k-8)%1 * (a+b) >= (3*2^k-4*k+4)%1 * c])
-    maxk = 4 `max` floor (logBase 2 (fromRational $ b+c) :: Double)
-  kr65 = (Kr65, simulateOptimize r) where
-    r = if 7*a>=2*(b+c) && 4*(a+b)>=5*c then 3%2/(a+b+c) else 1%1
-  kr66 = (Kr66, simulateOptimize r) where
-    r = if 18*a>=7*(b+c) && 2*(a+b)>=3*c then 25%17/(a+b+c) else 1%1
+      d = a `gcd` b `gcd` c
+tauabc a b c = tauabc' a' b' c'
+  where
+    [a', b', c'] = sort $ map toRational [a, b, c]
+
+
+-- |Special type to specify the theorem of Krätzel1988,
+-- which provided the best estimate of Θ(a, b, c, d)
+data TauabcdTheorem
+  = HeathBrown
+  | Tauabc TauabcTheorem
+  | Kr611
+  | Kr1992_2
+  | Kr1992_31
+  | Kr1992_32
+  | Kr2010_1a
+  | Kr2010_1b
+  | Kr2010_2
+  | Kr2010_3
+  | CaoZhai
+  deriving (Eq, Ord, Show)
+
+instance Pretty TauabcdTheorem where
+  pretty (Tauabc t) = pretty t
+  pretty t          = pretty (show t)
+
+tauabcd' :: Rational -> Rational -> Rational -> Rational -> (TauabcdTheorem, OptimizeResult)
+tauabcd' a1 a2 a3 a4 = minimumBy (comparing snd) [kr611, kr1992_2, kr1992_31, kr1992_32, kr2010_1a, kr2010_1b, kr2010_2, kr2010_3]
+  where
+    a12 = a1 + a2
+    a123 = a1 + a2 + a3
+    a1234 = a1 + a2 + a3 + a4
+
+    kr611
+      | optimalValue optRes3 < Finite (recip a4) = (Kr611, optimize [form] cons)
+      | otherwise = (Tauabc th3, optRes3)
+      where
+        (th3, optRes3) = tauabc' a1 a2 a3
+        form = K 2 + L 2 + 1 :/: M (a1 + a2 + a3 + a4)                              -- (6.46)
+        cons =
+          [ scaleLF a1 (L 2 - 1) >. K (2 * a4)                                      -- (6.41)
+          , scaleLF a3 (scaleLF a2 (K 2 + L 2) + M a4) <. M ((a1 + a2) * (a2 + a4)) -- (6.42)
+          , scaleLF a1 (K 2 + L 2 + 1) >=. M (a2 + a3)
+          , M (a1 + a2) >=. scaleLF a3 (K 2 + L 2 - 1)
+          ]
+
+    kr1992_2 = (Kr1992_2, optimize [form] cons)
+      where
+        form = K 3 + L 1 + 4 :/: scaleLF a1234 (K 1 + 2)
+        cons =
+          [ scaleLF a4 (K 6 + L 2 + 8) <. scaleLF a1234 (K 2 + 4)
+          , scaleLF a1234 (K 2 + 2) <=. scaleLF a1 (K 6 + L 2 + 8)
+          ]
+
+    kr1992_31 = (Kr1992_31, optimize [form] cons1)
+      where
+        form = K 1 + L 1 + 2 :/: K a1 + L a1 + M a1234
+        cons0 =
+          [ scaleLF a4 (K 1 + L 1 + 2) <. K a1 + L a1 + M a1234
+          , scaleLF a1 (K 2 + L 2 + 2) <=. scaleLF (a2 + a3) (K 2 + 1)
+          ]
+        cons1 = cons0 ++
+          [ L a1 <=. K a2
+          , scaleLF a1 (K 1 + L 1 + 1) >=. K (a2 + a3)
+          ]
+
+    kr1992_32 = (Kr1992_32, simulateOptimize $ if cond then val else 1)
+      where
+        k = 32 % 205
+        l = k + 1 % 2
+        val = (k + l + 2) / ((k + l) * a1 + a1234)
+        cond = (k + l - 2) * a4 < (k + l) * a1 + a1234
+          && 2 * (k + l + 1) * a1 <= (2 * k + l) * (a2 + a3)
+          && l * a1 >= k * a2
+          && (l - k) * (2 * k + 1) * a3 <= (2 * l - 2 * k - 1) * (k + l + 1) * a1 + (2 * k * (k - l + 1) + 1) * a2
+
+    kr2010_1a = (Kr2010_1a, simulateOptimize $ if cond then val else 1)
+      where
+        val = 45 % 19 / a1234
+        cond = 5 * a1 >= a1234 && 9 * a123 >= 34 * a1 && 9 * a12 >= 20 * a1
+
+    kr2010_1b = (Kr2010_1b, simulateOptimize $ if cond then val else 1)
+      where
+        val = 45 / (15 * a1 + 16 * a1234)
+        cond = 5 * a1 <= a1234 && a1234 <= 15%2 * a1 && 2 * a123 >= 9 * a1 && 2 * a12 >= 5 * a1
+
+    kr2010_2 = (Kr2010_2, simulateOptimize $ if cond then val else 1)
+      where
+        val = 35 / (11 * a4 + 16 * a123)
+        cond = 2 * a123 >= 3 * a4 && 34 * a1 >= 9 * a123 && 7 * a12 >= 10 * a3
+
+    kr2010_3 = (Kr2010_3, simulateOptimize $ if cond then val else 1)
+      where
+        val = 235 / (406 * a1 + 81 * a4)
+        cond = a1 == a2 && 2 * a1 == a3 && 29 * a1 >= 11 * a4
+
+
+-- |Compute Θ(a, b, c, d) for given a, b, c and d.
+tauabcd :: Integer -> Integer -> Integer -> Integer -> (TauabcdTheorem, OptimizeResult)
+tauabcd 1 1 1 1 = (HeathBrown, simulateOptimize $ 1%2)
+tauabcd a1 a2 a3 a4
+  | d /= 1 = divideResult d $ tauabcd (a1 `div` d) (a2 `div` d) (a3 `div` d) (a4 `div` d)
+    where
+      d = a1 `gcd` a2 `gcd` a3 `gcd` a4
+tauabcd a1 a2 a3 a4 = tauabcd' a1' a2' a3' a4'
+  where
+    [a1', a2', a3', a4'] = sort $ map toRational [a1, a2, a3, a4]
+
+
+-- |Special type to specify the theorem of Krätzel1988,
+-- which provided the best estimate of Θ(a1, a2...)
+data Theorem
+  = NoTheorem
+  | Ivic
+  | Ab   TauabTheorem
+  | Abc  TauabcTheorem
+  | Abcd TauabcdTheorem
+  deriving (Eq, Ord, Show)
+
+instance Pretty Theorem where
+  pretty NoTheorem = text ""
+  pretty Ivic = text "Ivic"
+  pretty (Ab t) = pretty t
+  pretty (Abc t) = pretty t
+  pretty (Abcd t) = pretty t
+
+-- |Special type to specify the theorem of Krätzel1988,
+-- which provided the best estimate of Θ(a1, a2...)
+data TauAResult
+  = Node Theorem OptimizeResult
+  | Combination TauAResult TauAResult Rational
+  deriving (Show)
+
+instance Pretty TauAResult where
+  pretty (Node th o) = pretty th <+> pretty o
+  pretty (Combination t1 t2 r) = pretty t1 <+> pretty t2 <+> pretty r
+
+
+deriveMemoizable ''Theorem
+deriveMemoizable ''TauabTheorem
+deriveMemoizable ''TauabcTheorem
+deriveMemoizable ''TauabcdTheorem
+deriveMemoizable ''TauAResult
+
+extractValue :: TauAResult -> Rational
+extractValue (Node _ o) = toRational $ optimalValue o
+extractValue (Combination _ _ r1) = r1
+
+instance Eq TauAResult where
+  (==) = (==) `on` extractValue
+
+instance Ord TauAResult where
+  compare = compare `on` extractValue
+
+-- | Compute Θ(a1, a2...) for given list [a1, a2...].
+tauA :: [Integer] -> TauAResult
+tauA = go' . sort
+  where
+    fi :: Integer -> Rational
+    fi = fromIntegral
+
+    go' = memoize go
+
+    go :: [Integer] -> TauAResult
+    go [] = Node NoTheorem (simulateOptimize 0)
+    go [_] = Node NoTheorem (simulateOptimize 0)
+    go [a, b]    = (\(t, o) -> Node (Ab t) o) $ tauab a b
+    go [a, b, c] = (\(t, o) -> Node (Abc t) o) $ tauabc a b c
+    go as@[a,b,c,d] = (\(t, o) -> Node (Abcd t) o) (tauabcd a b c d) `min` go608 as
+    go as@(a:_)
+      | all (== a) as
+      = Node Ivic $ simulateOptimize $ reverseMOnS 1e-6 (fromIntegral $ length as) / fi a
+    go as = go608' as
+
+    go608' = memoize go608
+
+    go608 as = minimum $ mapMaybe f [1 .. length as - 1]
+      where
+        f q = if (alphaV `max` betaV) < 1 / fi (last as)
+          then Just $ Combination alpha beta ret
+          else Nothing
+          where
+            alpha = go' $ take q as
+            alphaV = extractValue alpha
+            beta  = go' $ drop q as
+            betaV = extractValue beta
+            a0 = fi $ head as
+            aq = fi $ as !! q
+            ret = (1 - a0 * aq * alphaV * betaV) / (a0 + aq - a0 * aq * (alphaV + betaV))
diff --git a/Math/ExpPairs/LinearForm.hs b/Math/ExpPairs/LinearForm.hs
--- a/Math/ExpPairs/LinearForm.hs
+++ b/Math/ExpPairs/LinearForm.hs
@@ -12,6 +12,7 @@
 -}
 module Math.ExpPairs.LinearForm
   ( LinearForm (..)
+  , scaleLF
   , evalLF
   , substituteLF
   , RationalForm (..)
@@ -33,7 +34,7 @@
 
 import Math.ExpPairs.RatioInf
 
--- |Define an affine linear form of two variables: a*k + b*l + c*m.
+-- |Define an affine linear form of three variables: a*k + b*l + c*m.
 -- First argument of 'LinearForm' stands for a, second for b
 -- and third for c. Linear forms form a monoid by addition.
 data LinearForm t = LinearForm !t !t !t
@@ -62,6 +63,7 @@
   mempty  = 0
   mappend = (+)
 
+-- | Multiply a linear form by a given coefficient.
 scaleLF :: (Num t, Eq t) => t -> LinearForm t -> LinearForm t
 scaleLF 0 = const 0
 scaleLF s = fmap (* s)
@@ -77,26 +79,27 @@
 substituteLF (k, l, m) (LinearForm a b c) = scaleLF a k + scaleLF b l + scaleLF c m
 
 -- | Define a rational form of two variables, equal to the ratio of two 'LinearForm'.
-data RationalForm t = RationalForm (LinearForm t) (LinearForm t)
+data RationalForm t = (LinearForm t) :/: (LinearForm t)
   deriving (Eq, Show, Functor, Foldable, Generic)
+infix 5 :/:
 
 instance (Num t, Eq t, Pretty t) => Pretty (RationalForm t) where
-  pretty (RationalForm l1 l2) = parens (pretty l1) </> parens (pretty l2)
+  pretty (l1 :/: l2) = parens (pretty l1) </> parens (pretty l2)
 
 instance NFData t => NFData (RationalForm t) where
   rnf = rnf . toList
 
 instance Num t => Num (RationalForm t) where
-  (+) = error "Addition of RationalForm is undefined"
-  (*) = error "Multiplication of RationalForm is undefined"
-  negate (RationalForm a b) = RationalForm (negate a) b
-  abs = error "Absolute value of RationalForm is undefined"
-  signum = error "Signum of RationalForm is undefined"
-  fromInteger n = RationalForm (fromInteger n) 1
+  (+)              = error "Addition of RationalForm is undefined"
+  (*)              = error "Multiplication of RationalForm is undefined"
+  negate (a :/: b) = negate a :/: b
+  abs              = error "Absolute value of RationalForm is undefined"
+  signum           = error "Signum of RationalForm is undefined"
+  fromInteger n    = fromInteger n :/: 1
 
 instance Num t => Fractional (RationalForm t) where
-  fromRational r = RationalForm (fromInteger $ numerator r) (fromInteger $ denominator r)
-  recip (RationalForm a b) = RationalForm b a
+  fromRational r = fromInteger (numerator r) :/: fromInteger (denominator r)
+  recip (a :/: b) = b :/: a
 
 mapTriple :: (a -> b) -> (a, a, a) -> (b, b, b)
 mapTriple f (x, y, z) = (f x, f y, f z)
@@ -105,7 +108,7 @@
 -- |Evaluate a rational form (a*k + b*l + c*m) \/ (a'*k + b'*l + c'*m)
 -- for given k, l and m.
 evalRF :: (Real t, Num t) => (Integer, Integer, Integer) -> RationalForm t -> RationalInf
-evalRF (k, l, m) (RationalForm num den) = if denom==0 then InfPlus else Finite (numer / denom) where
+evalRF (k, l, m) (num :/: den) = if denom==0 then InfPlus else Finite (numer / denom) where
   klm = mapTriple fromInteger (k, l, m)
   numer = toRational $ evalLF klm num
   denom = toRational $ evalLF klm den
diff --git a/Math/ExpPairs/Matrix3.hs b/Math/ExpPairs/Matrix3.hs
--- a/Math/ExpPairs/Matrix3.hs
+++ b/Math/ExpPairs/Matrix3.hs
@@ -1,4 +1,3 @@
-{-# LANGUAGE RecordWildCards, DeriveFunctor, DeriveFoldable, DeriveGeneric #-}
 {-|
 Module      : Math.ExpPairs.Matrix3
 Description : Implements matrices of order 3
@@ -11,6 +10,13 @@
 Provides types and functions for matrices and vectors of order 3.
 Can be used instead of "Data.Matrix" to reduce overhead and simplify code.
 -}
+
+{-# LANGUAGE DeriveFunctor   #-}
+{-# LANGUAGE DeriveFoldable  #-}
+{-# LANGUAGE DeriveGeneric   #-}
+{-# LANGUAGE RecordWildCards #-}
+{-# LANGUAGE TemplateHaskell #-}
+
 module Math.ExpPairs.Matrix3
   ( Matrix3 (..)
   , fromList
@@ -29,6 +35,7 @@
 import Data.List      (transpose)
 import GHC.Generics   (Generic (..))
 import Text.PrettyPrint.Leijen
+import Data.Function.Memoize (deriveMemoizable)
 
 -- |Matrix of order 3. Instances of 'Num' and 'Fractional'
 -- are given in terms of the multiplicative group of matrices,
@@ -83,7 +90,7 @@
 
   negate = fmap negate
 
-  abs = undefined
+  abs = error "abs of Matrix3 is undefined"
 
   signum = diag . signum . det
 
@@ -299,3 +306,5 @@
   a31 * a1 + a32 * a2 + a33 * a3
   )
 {-# INLINE multCol #-}
+
+deriveMemoizable ''Matrix3
diff --git a/Math/ExpPairs/MenzerNowak.hs b/Math/ExpPairs/MenzerNowak.hs
--- a/Math/ExpPairs/MenzerNowak.hs
+++ b/Math/ExpPairs/MenzerNowak.hs
@@ -21,17 +21,14 @@
   ( menzerNowak
   ) where
 
-import Data.Ratio    ((%))
-
 import Math.ExpPairs
 
 -- |Compute Θ(a, b) for given a and b.
 menzerNowak :: Integer -> Integer -> OptimizeResult
 menzerNowak a' b' = optimize
-  [
-    RationalForm (LinearForm 1 1 0) (LinearForm (a+b) 0 (a+b)),
-    RationalForm (LinearForm 1 0 0) (LinearForm (a+b) (-a) a)
-  ]
-  [] where
-    a = a'%1
-    b = b'%1
+  [ K 1 + L 1 :/: K (a + b) + M (a + b)
+  , K 1       :/: K (a + b) - L a + M a
+  ] []
+  where
+    a = fromInteger a'
+    b = fromInteger b'
diff --git a/Math/ExpPairs/Pair.hs b/Math/ExpPairs/Pair.hs
--- a/Math/ExpPairs/Pair.hs
+++ b/Math/ExpPairs/Pair.hs
@@ -14,6 +14,7 @@
 -}
 {-# LANGUAGE DeriveGeneric        #-}
 {-# LANGUAGE FlexibleInstances    #-}
+{-# LANGUAGE TemplateHaskell      #-}
 {-# LANGUAGE TypeSynonymInstances #-}
 
 {-# OPTIONS_GHC -fno-warn-orphans #-}
@@ -31,6 +32,7 @@
 import Data.Ratio
 import GHC.Generics (Generic (..))
 import Text.PrettyPrint.Leijen
+import Data.Function.Memoize
 
 -- |Vertices of the triangle of initial exponent pairs.
 data Triangle
@@ -63,7 +65,9 @@
   -- Exactly
   -- 'Mix' a b = a * 'Corput16' + b * 'HuxW87b1' + (1-a-b) * 'Hux05'
   | Mix !t !t
-  deriving (Eq, Show, Generic)
+  deriving (Eq, Ord, Show, Generic)
+
+deriveMemoizable ''InitPair'
 
 -- |Exponent pair built from rational fractions of
 -- 'Corput16', 'HuxW87b1' and 'Hux05'
diff --git a/Math/ExpPairs/PrettyProcess.hs b/Math/ExpPairs/PrettyProcess.hs
--- a/Math/ExpPairs/PrettyProcess.hs
+++ b/Math/ExpPairs/PrettyProcess.hs
@@ -110,7 +110,7 @@
 
     bcs = takeWhile (not . null . snd) $ iterate bcf ([head xs], tail xs)
 
-    bcf (_, [])    = undefined
+    bcf (_, [])    = error "prettify': unexpected second argument of bcf"
     bcf (zs, y:ys) = (zs++[y], ys)
 
     f (bs, cs) = PPWL (Sequence bsP csP) (bsW + csW) where
diff --git a/Math/ExpPairs/Process.hs b/Math/ExpPairs/Process.hs
--- a/Math/ExpPairs/Process.hs
+++ b/Math/ExpPairs/Process.hs
@@ -9,7 +9,11 @@
 
 Provides types for sequences of /A/- and /B/-processes of van der Corput. A good account on this topic can be found in /Graham S. W.,  Kolesnik G. A./ Van Der Corput's Method of Exponential Sums, Cambridge University Press, 1991, especially Ch. 5.
 -}
-{-# LANGUAGE DeriveGeneric, CPP #-}
+
+{-# LANGUAGE CPP             #-}
+{-# LANGUAGE DeriveGeneric   #-}
+{-# LANGUAGE TemplateHaskell #-}
+
 module Math.ExpPairs.Process
   ( Process ()
   , Path (Path)
@@ -22,19 +26,18 @@
 import GHC.Generics             (Generic)
 import Data.Monoid
 import Text.PrettyPrint.Leijen hiding ((<>))
+import Data.Function.Memoize (deriveMemoizable)
 
 import Math.ExpPairs.ProcessMatrix
 import Math.ExpPairs.PrettyProcess
 
 -- | Holds a list of 'Process' and a matrix of projective
--- transformation, which they define. It also provides a fancy 'Show'
--- instance. E. g.,
---
--- > show (mconcat $ replicate 10 aPath) == "A^10"
---
+-- transformation, which they define.
 data Path = Path !ProcessMatrix ![Process]
   deriving (Eq, Show, Generic)
 
+deriveMemoizable ''Path
+
 instance Monoid Path where
   mempty  = Path mempty mempty
   mappend (Path m1 p1) (Path m2 p2) = Path (m1 <> m2) (p1 <> p2)
@@ -52,13 +55,14 @@
     reads' xs = (mempty, xs)
 
 instance Ord Path where
-  (Path _ q1) <= (Path _ q2) = cmp q1 q2 where
-    cmp (A:p1)  (A:p2)  = cmp p1 p2
-    cmp (BA:p1) (BA:p2) = cmp p2 p1
-    cmp (A:_)   (BA:_)  = True
-    cmp (BA:_)  (A:_)   = False
-    cmp []      _       = True
-    cmp _       []      = False
+  compare (Path _ x) (Path _ y) = cmp x y where
+    cmp     []      []  = EQ
+    cmp ( A:u) ( A:v) = cmp u v
+    cmp (BA:u) (BA:v) = cmp v u
+    cmp ( A:_)     _  = LT
+    cmp (BA:_)     _  = GT
+    cmp     _  ( A:_) = GT
+    cmp     _  (BA:_) = LT
 
 -- | Path consisting of a single process 'A'.
 aPath :: Path
diff --git a/Math/ExpPairs/ProcessMatrix.hs b/Math/ExpPairs/ProcessMatrix.hs
--- a/Math/ExpPairs/ProcessMatrix.hs
+++ b/Math/ExpPairs/ProcessMatrix.hs
@@ -40,8 +40,11 @@
 
 deriveMemoizable ''Process
 
+-- | Sequence of processes, represented as a matrix 3x3.
 newtype ProcessMatrix = ProcessMatrix (Matrix3 Integer)
   deriving (Eq, Num, Show, Pretty)
+
+deriveMemoizable ''ProcessMatrix
 
 instance Monoid ProcessMatrix where
   mempty = 1
diff --git a/Math/ExpPairs/RatioInf.hs b/Math/ExpPairs/RatioInf.hs
--- a/Math/ExpPairs/RatioInf.hs
+++ b/Math/ExpPairs/RatioInf.hs
@@ -9,6 +9,11 @@
 
 Provides types and necessary instances for rational numbers, extended with infinite values. Just use 'RationalInf' instead of 'Rational' from "Data.Ratio".
 -}
+
+{-# LANGUAGE TemplateHaskell #-}
+
+{-# OPTIONS_GHC -fno-warn-orphans #-}
+
 module Math.ExpPairs.RatioInf
   ( RatioInf (..)
   , RationalInf
@@ -16,6 +21,7 @@
 
 import Data.Ratio (Ratio, numerator, denominator)
 import Text.PrettyPrint.Leijen
+import Data.Function.Memoize (deriveMemoizable)
 
 -- |Extends a rational type with positive and negative
 -- infinities.
@@ -27,6 +33,9 @@
   -- |Positive infinity
   | InfPlus
   deriving (Eq, Ord, Show)
+
+deriveMemoizable ''Ratio
+deriveMemoizable ''RatioInf
 
 -- |Arbitrary-precision rational numbers with positive and negative
 -- infinities.
diff --git a/exp-pairs.cabal b/exp-pairs.cabal
--- a/exp-pairs.cabal
+++ b/exp-pairs.cabal
@@ -1,5 +1,5 @@
 name:                exp-pairs
-version:             0.1.4.1
+version:             0.1.5.0
 synopsis:            Linear programming over exponent pairs
 description:         Package implements an algorithm to minimize rational objective function over the set of exponent pairs
 homepage:            https://github.com/Bodigrim/exp-pairs
@@ -9,7 +9,7 @@
 maintainer:          andrew.lelechenko@gmail.com
 category:            Math
 build-type:          Simple
-extra-source-files:  CHANGELOG.md
+extra-source-files:  CHANGELOG.md, tests/*.txt
 cabal-version:       >=1.10
 
 source-repository head
@@ -47,6 +47,7 @@
                        Matrix3,
                        MenzerNowak,
                        Pair,
+                       Process,
                        PrettyProcess,
                        RatioInf
   build-depends:       base >=4 && <5,
diff --git a/tests/Instances.hs b/tests/Instances.hs
--- a/tests/Instances.hs
+++ b/tests/Instances.hs
@@ -6,9 +6,13 @@
 import Test.SmallCheck.Series
 import Control.Applicative
 import Control.Monad
+#if __GLASGOW_HASKELL__ < 710
+import Data.Foldable
+#endif
 import GHC.Generics          (Generic (..))
 
 import Math.ExpPairs.LinearForm
+import Math.ExpPairs.Process
 import Math.ExpPairs.ProcessMatrix
 import Math.ExpPairs.Pair (InitPair' (..))
 import Math.ExpPairs.Matrix3 as M3 (Matrix3, fromList)
@@ -21,11 +25,11 @@
   series = cons3 LinearForm
 
 instance Arbitrary a => Arbitrary (RationalForm a) where
-  arbitrary = RationalForm <$> arbitrary <*> arbitrary
+  arbitrary = (:/:) <$> arbitrary <*> arbitrary
   shrink = genericShrink
 
 instance (Monad m, Serial m a) => Serial m (RationalForm a) where
-  series = cons2 RationalForm
+  series = cons2 (:/:)
 
 instance Arbitrary a => Arbitrary (Constraint a) where
   arbitrary = Constraint <$> arbitrary <*> arbitrary
@@ -55,7 +59,7 @@
 
 instance (Ord t, Fractional t, Arbitrary t) => Arbitrary (Ratio01 t) where
   arbitrary = Ratio01 <$> (arbitrary `suchThat` (\x -> 0 <= x && x <= 1))
-  shrink = genericShrink
+  shrink (Ratio01 y) = Ratio01 <$> filter (\x -> 0 <= x && x <= 1) (shrink y)
 
 instance (Ord t, Fractional t, Serial m t) => Serial m (Ratio01 t) where
   series = Ratio01 <$> (series `suchThatSerial` (\x -> 0 <= x && x <= 1))
@@ -163,3 +167,9 @@
 instance (Ord t, Serial m t) => Serial m (Sorted (t, t, t, t, t, t)) where
   series = Sorted <$> (series `suchThatSerial` (\(a, b, c, d, e, f) -> a <= b && b <= c && c <= d && d <= e && e <= f))
 
+
+instance Arbitrary Path where
+  arbitrary = foldMap (\x -> if x then aPath else baPath) <$> (arbitrary :: Gen [Bool])
+
+instance Monad m => Serial m Path where
+  series = foldMap (\x -> if x then aPath else baPath) <$> (series :: Monad m => Series m [Bool])
diff --git a/tests/Ivic.hs b/tests/Ivic.hs
--- a/tests/Ivic.hs
+++ b/tests/Ivic.hs
@@ -6,9 +6,11 @@
 
 import Test.Tasty
 import Test.Tasty.SmallCheck as SC
-import Test.Tasty.QuickCheck as QC
+import Test.Tasty.QuickCheck as QC hiding (Positive)
 import Test.Tasty.HUnit
 
+import Debug.Trace
+
 import Instances
 import Etalon (testEtalon)
 
@@ -56,26 +58,45 @@
 testMOnSInf (Ratio01 a') = a < 1 || (optimalValue . mOnS) a == InfPlus where
   a = fromMinus3To3 a'
 
-testZetaReverse :: Ratio01 Rational -> Bool
-testZetaReverse (Ratio01 s') = abs (s - t) <= 5 % 1000 where
-  s = s' / 2
+testZetaReverse1 :: Ratio01 Rational -> Bool
+testZetaReverse1 (Ratio01 s') = if t <= s + 2e-2 && s <= t + 2e-3 then True else trace (show $ fromRational $ s-t) False where
+  s = fromHalfToOne s'
   zs = zetaOnS s
   t = toRational $ optimalValue $ reverseZetaOnS $ toRational $ optimalValue zs
 
--- Convexity tests - they fail and it is OK
-testZetaConvex :: Sorted (Ratio01 Rational, Ratio01 Rational, Ratio01 Rational) -> Bool
-testZetaConvex (Sorted (Ratio01 a, Ratio01 b, Ratio01 c)) = a == b || b == c || zb <= k * Finite b + l where
-  [za, zb, zc] = map (optimalValue . zetaOnS) [a, b, c]
-  k = (za - zc) / Finite (a - c)
-  l = za - k * Finite a
+testZetaReverse2 :: Ratio01 Rational -> Bool
+testZetaReverse2 (Ratio01 s') = if t <= s + 1e-10 && s <= t + 4e-3 then True else trace (show $ fromRational $ s-t) False where
+  s = s' * 32 / 205
+  zs = reverseZetaOnS s
+  t = toRational $ optimalValue $ zetaOnS $ toRational $ optimalValue zs
 
--- Ivic, Th. 8.1, p. 205
-testMConvex :: Sorted (Ratio01 Rational, Ratio01 Rational, Ratio01 Rational) -> Bool
-testMConvex (Sorted (Ratio01 a', Ratio01 b', Ratio01 c')) = a==b || b==c || za==InfPlus || zc==InfPlus
-  || zb>= za*zc*Finite(c-a)/(zc*Finite(c-b) + za*Finite(b-a)) where
-    [a,b,c] = map fromHalfToOne [a', b', c']
-    [za, zb, zc] = map (optimalValue . mOnS) [a,b,c] :: [RationalInf]
+testMOnSReverse1 :: Ratio01 Rational -> Bool
+testMOnSReverse1 (Ratio01 s') =
+  if t <= s + 4e-2 && s <= t + 1e-3 then True else trace (show $ fromRational $ s-t) False
+  where
+    s = fromHalfToOne s'
+    zs = mOnS s
+    t = toRational $ reverseMOnS 1e-3 $ optimalValue zs
 
+testMOnSReverse2 :: Ratio01 Rational -> Bool
+testMOnSReverse2 (Ratio01 s') = s' == 0 || if recip t <= recip s + 1e-3 && recip s <= recip t + 1e-3 then True else trace (show $ fromRational $ recip s - recip t) False where
+  s = 4 * recip s'
+  zs = reverseMOnS 1e-3 (Finite s)
+  t = toRational $ optimalValue $ mOnS $ toRational zs
+
+testMBigOnHalfReverse1 :: Positive Rational -> Bool
+testMBigOnHalfReverse1 (Positive s') = if recip t <= recip s + 2e-3 && recip s <= recip t + 1e-10 then True else trace (show $ fromRational $ recip s - recip t) False where
+  s = s' + 4
+  zs = mBigOnHalf s
+  t = toRational $ optimalValue $ reverseMBigOnHalf $ toRational $ optimalValue zs
+
+testMBigOnHalfReverse2 :: Positive Rational -> Bool
+testMBigOnHalfReverse2 (Positive s') = if recip t <= recip s + 2e-3 && recip s <= recip t + 1e-10 then True else trace (show $ fromRational $ recip s - recip t) False where
+  s = s' + 1
+  zs = reverseMBigOnHalf s
+  t = toRational $ optimalValue $ mBigOnHalf $ toRational $ optimalValue zs
+
+
 etalonZetaOnS :: Integer -> Integer -> Integer -> Integer -> Bool
 etalonZetaOnS a b c d = Finite (c%d) >= optimalValue (zetaOnS $ a%b)
 
@@ -100,8 +121,24 @@
   , adjustOption (\(SC.SmallCheckDepth n) -> SC.SmallCheckDepth (n `div` 2)) $
       SC.testProperty "mOnS strict monotonic" testMOnS2
   , QC.testProperty "mOnS strict monotonic" testMOnS2
-  , SC.testProperty "zetaOnS reverse" testZetaReverse
-  , QC.testProperty "zetaOnS reverse" testZetaReverse
+
+  , SC.testProperty "reverseZetaOnS . zetaOnS == id" testZetaReverse1
+  , QC.testProperty "reverseZetaOnS . zetaOnS == id" testZetaReverse1
+  , SC.testProperty "zetaOnS . reverseZetaOnS == id" testZetaReverse2
+  , QC.testProperty "zetaOnS . reverseZetaOnS == id" testZetaReverse2
+
+  , SC.testProperty "reverseMOnS . mOnS == id" testMOnSReverse1
+  , adjustOption (\(QC.QuickCheckTests n) -> QC.QuickCheckTests (n `min` 100)) $
+      QC.testProperty "reverseMOnS . mOnS == id" testMOnSReverse1
+  , SC.testProperty "mOnS . reverseMOnS == id" testMOnSReverse2
+  , adjustOption (\(QC.QuickCheckTests n) -> QC.QuickCheckTests (n `min` 100)) $
+      QC.testProperty "mOnS . reverseMOnS == id" testMOnSReverse2
+
+  , SC.testProperty "reverseMBigOnHalf . mBigOnHalf == id" testMBigOnHalfReverse1
+  , QC.testProperty "reverseMBigOnHalf . mBigOnHalf == id" testMBigOnHalfReverse1
+  , SC.testProperty "mBigOnHalf . reverseMBigOnHalf == id" testMBigOnHalfReverse2
+  , QC.testProperty "mBigOnHalf . reverseMBigOnHalf == id" testMBigOnHalfReverse2
+
   , SC.testProperty "zetaOnS symmetry" testZetaOnSsym
   , QC.testProperty "zetaOnS symmetry" testZetaOnSsym
   , SC.testProperty "zetaOnS above s=1" testZetaOnSZero
diff --git a/tests/Process.hs b/tests/Process.hs
new file mode 100644
--- /dev/null
+++ b/tests/Process.hs
@@ -0,0 +1,29 @@
+module Process where
+
+import Math.ExpPairs.Process
+
+import Test.Tasty
+import Test.Tasty.SmallCheck as SC
+import Test.Tasty.QuickCheck as QC hiding (Positive)
+
+import Instances ()
+
+testReadShow :: Path -> Bool
+testReadShow p@(Path _ xs) = read (concatMap show xs) == p
+
+testOrd :: Path -> Path -> Bool
+testOrd p1 p2 = compare p1 p2 == compare (x1 / z1) (x2 / z2)
+  && compare (y2 / z2) (y1 / z1) == compare (x1 / z1) (x2 / z2)
+  where
+    (x1, y1, z1) = evalPath p1 (1, 4, 6)
+    (x2, y2, z2) = evalPath p2 (1, 4, 6)
+
+testSuite :: TestTree
+testSuite = testGroup "Process"
+  [ adjustOption (\(SC.SmallCheckDepth n) -> SC.SmallCheckDepth (n `min` 13)) $
+      SC.testProperty "read . show == id" testReadShow
+  , QC.testProperty "read . show == id" testReadShow
+  , adjustOption (\(SC.SmallCheckDepth n) -> SC.SmallCheckDepth (n `min` 8)) $
+      SC.testProperty "Ord of Processes" testOrd
+  , QC.testProperty "Ord of Processes" testOrd
+  ]
diff --git a/tests/Tests.hs b/tests/Tests.hs
--- a/tests/Tests.hs
+++ b/tests/Tests.hs
@@ -3,6 +3,7 @@
 import qualified RatioInf (testSuite)
 import qualified Pair (testSuite)
 import qualified PrettyProcess (testSuite)
+import qualified Process (testSuite)
 
 import qualified Ivic (testSuite)
 import qualified Kratzel (testSuite)
@@ -20,6 +21,7 @@
   , RatioInf.testSuite
   , Pair.testSuite
   , PrettyProcess.testSuite
+  , Process.testSuite
   , Ivic.testSuite
   , Kratzel.testSuite
   , MenzerNowak.testSuite
diff --git a/tests/etalon-mOnS.txt b/tests/etalon-mOnS.txt
new file mode 100644
--- /dev/null
+++ b/tests/etalon-mOnS.txt
@@ -0,0 +1,791 @@
+101 132 477435698018201574 29229448099906007
+101 140 2423764 192441
+101 144 47394576 4153039
+101 158 66682636 7708275
+101 160 3877826508800 467138272673
+103 104 57752214 55831
+103 112 138502457443 1852958281
+103 142 3569603670778024952 277562542967901079
+103 144 243093168 19623695
+107 108 1080 1
+107 152 44215128 3819271
+107 160 26752454981667520 2724371422927733
+109 140 341350796332861 19126491351885
+109 144 5510389341894498 355393196283539
+109 152 371104431997769372695423927 30193707971262898992038820
+109 154 66486252 5617019
+111 112 1120 1
+111 116 28362 169
+111 136 23398462378211570722978426649046405157798741091526 995047397952694751322305782904094250618613818729
+111 176 9856 1191
+11 12 1791162 25177
+11 14 43827931168 2335831431
+11 15 105869142730 7868949657
+11 16 359841 33722
+11 17 20944 2337
+113 140 5843450521859968583685242480 266309045050759864594080921
+113 146 1718921875 99273206
+113 158 9877212 797779
+113 160 295203680 25165257
+113 164 43170113218986677272587413 4017391584083859861113156
+115 116 1160 1
+115 124 2507996038 29268543
+115 154 748172292 51367657
+117 136 335336919557660005133413929827 9584642445059238255029573073
+117 184 659662470722564432 77545998724611569
+119 120 1200 1
+119 122 4287124887654307936 12704712105579945
+119 146 81329531557608761051020307905944429 3488122975460256846283462130582794
+119 184 54468416 6085663
+121 128 12002304 96755
+121 144 3146768714778 109602391783
+121 148 59944283723935906584746 2521482319636978522669
+121 166 67091403785273409357752595805616324 5113537259107081891678204893301255
+121 168 5442171 435290
+121 172 56568091 4899018
+121 184 328094 35007
+121 190 590792964488 69115505345
+12 17 106570076 9104117
+12 19 138385981018496 16640880070721
+123 124 1240 1
+123 136 25233168 422683
+123 176 32030384 2845817
+125 134 332543177 3502316
+125 158 1178581078579747775528950337135750 60431177943897038270524308858699
+125 176 10903472 907943
+125 182 13153062261804556 1236501981034245
+125 192 478990065080 52471840941
+127 128 1280 1
+127 136 1258 13
+127 140 205800 3349
+127 142 221099981451189103646 4281813901441949301
+127 176 933024 74005
+127 178 197456468 16119225
+127 190 57203066580523168790739060 5833561417508198158671383
+127 196 41893607982226 4645158828459
+129 160 24139850074160 1107656219813
+129 184 4203176 368927
+131 132 1320 1
+131 140 4175106830 41537119
+131 146 19662204195899690 367177721494067
+131 160 2342216752506 97612749097
+131 182 25139507848 2015829341
+131 184 1715272 141345
+131 208 32676635180800 3967963243431
+13 14 407120838053575044 4650281458640375
+13 16 428248 18733
+13 17 1957065543705534118807383728 120158143510689856918705771
+13 18 4012164 316981
+13 20 2771652460 304875553
+133 160 1095324960 41295451
+133 172 85104456001281365114 4944040805429554319
+133 184 285113 22440
+133 202 170062184 18084261
+135 136 1360 1
+135 152 791650662519381537319151 16549897323467996115082
+137 146 128550557445609287225650482 1212132752642594243040755
+137 152 772160637396130765507734 13698856816799099515369
+137 164 2316619392 82319363
+137 192 430805568 35155781
+137 194 1157184004 98683377
+137 208 811828784 86243003
+137 216 2615476608 310010273
+139 140 1400 1
+139 144 2198713190698771206 9980492035236655
+139 154 68146873565001 1189714248304
+139 160 5484544160 143378181
+139 192 9539008 745405
+139 196 14846167 1243990
+141 200 230096600 19756739
+14 17 960823884 38571391
+14 19 9957026 725169
+143 144 1440 1
+143 152 62065039 556333
+143 160 229157221166565 4472359950724
+143 200 39057800 3158451
+145 202 40401232787624911845727251380191785224650465838464 3274349623873850766446446327538887881181568246785
+145 208 36907 3308
+147 176 121247984 4317343
+147 208 1637168 139175
+149 184 355408350400912698 15874550404628441
+149 206 526479556 41312757
+149 212 3503406 304535
+151 152 1520 1
+151 214 40187916 3438635
+151 216 265446936 23557387
+15 16 112662 1081
+15 19 41390132050806 2147937279967
+153 184 7876051 295817
+153 224 1198015475769393977521 114574951397326311947
+153 232 505882844 53554021
+155 164 52541336 428733
+155 218 210599772 17454403
+157 166 1129381 9070
+157 172 10432914870390074768786720537025771353289952454 156105846494533281838012066745967945531027123
+157 214 9929479732 736700701
+157 216 175017487293 13495080112
+157 220 1224495 99866
+157 224 572886944 50338137
+159 160 1600 1
+159 224 582407392 48615769
+161 208 20934921072 1208341375
+16 25 27229803600 3135869143
+163 172 14101979786814 108007134491
+163 196 3289344912 123353273
+163 214 43424044675946205325276328 2718220043629888112306295
+163 232 10274584 894345
+165 224 333481821301384392 24320729872434985
+165 232 313167752 25924133
+165 248 15209445584566382329163794 1571648480042242034289365
+167 168 1680 1
+167 170 10540 21
+167 200 215206725 7688837
+167 206 180363931262177 8000684081816
+167 208 4925545045855249259704 231855938346296187777
+167 236 2083762 176215
+169 232 5178965812 395767995
+169 240 661658160 57082463
+171 184 4209084814685247176576471104698 47386152772799265182124975229
+171 208 13268022576 538545073
+17 18 1566 13
+17 22 496509160719146676 28943421368007515
+17 24 119064 10027
+17 25 13924640525 1349905747
+17 26 192189671000435108 20820142690014595
+173 206 470852758 16396007
+173 208 1852514768 69375525
+173 212 1810639 77084
+173 224 342840288 20033135
+173 240 2964800 236269
+175 176 1760 1
+175 244 17464606216105999303 1420120666481329676
+175 248 354218152 30301713
+175 256 9896675584 944108777
+177 200 12750 277
+177 248 35948840 2930543
+179 200 647275138250 12435628269
+179 206 22734618659 592159974
+179 208 270436102768 7706499055
+179 216 19892772739790482810438143298971 766638753445383241928999059936
+179 240 124542480 8602009
+179 248 11891011 942086
+179 256 3044608 269985
+179 272 770334736 82029075
+181 192 14487255882725688 124721818224613
+181 256 252269824 21407863
+181 280 243299491120 27218165543
+183 184 1840 1
+183 256 767689984 62140957
+185 248 85248482407222372883 5883350078319962076
+185 256 152279808 11998109
+185 264 36161688 3179807
+187 208 100163013728205552459867042836 1828872118454352651167661649
+187 224 2159032736 77340939
+191 192 1920 1
+191 236 82477650992 3696884723
+191 264 1228629 96298
+191 272 282260112 24621461
+19 21 188748 3127
+19 24 73065837669880734497772 3732179061729095618641
+19 27 267742044 23159305
+19 28 4668246380 455440723
+19 30 202660 24139
+193 208 6735883823118853 77930724560337
+193 232 1152644556 43065521
+193 272 171668176 14352303
+195 248 18202633506134726 966176488026525
+197 218 2542534 43581
+197 236 4792534128 171869861
+197 240 34794596676804944434135843550675 1426573469166311964455524985602
+197 272 57463264 4481571
+197 280 224899640 19468053
+197 288 5372635104 511434073
+197 296 8577797288777503766951795088 885558989812068294124748375
+199 200 2000 1
+199 220 44019800 734287
+199 224 1626616092696 33908029885
+199 280 151916520 12613213
+201 256 29957220096 1602877169
+20 21 874314 5917
+20 31 52922704 5952351
+203 248 6390818576531769165 266761449073011433
+203 260 1764247355 97350653
+203 272 433953597084324531697076154 29885482591279493946440903
+203 284 314903886 25498805
+203 288 954011808 81979241
+205 232 1492378834184816721989710656 32946675896978398502566387
+205 272 93832050073063 6176472673708
+205 288 966252384 79696241
+205 292 325203758 28391337
+207 208 2080 1
+207 248 1322932316 47490751
+209 280 10196976895 701785793
+209 296 33667336 2872849
+209 332 7104800 864167
+211 268 420247286416337388021079534346 22145396112379653686357376831
+211 280 1938100290805 127658111022
+211 292 264135316 20818201
+21 29 125387532 9786919
+21 31 2581277 253123
+213 256 2807516416 104696879
+215 216 2160 1
+215 256 142032 4943
+215 288 86317776864 5936280899
+217 240 818550 13817
+217 272 291309264020 14233651479
+217 304 360181328 29342589
+221 296 15198949244 1044541659
+221 320 4495307840 415255091
+22 23 405452726614689376234058744095027158 2442098019903115439532582107475961
+22 31 118951092 9937855
+223 224 2240 1
+223 268 6154349856 229317335
+223 272 2895564151 119636061
+223 288 13383898848 770644883
+223 316 4853602 415081
+225 256 1870580016281574720 43623405321409177
+225 272 15020006970898237967 585712761878448750
+227 232 1020379587 2571128
+227 272 3182149488 114432385
+227 288 582692695250760 30514684343827
+227 320 395871680 33133119
+227 332 4757051376 453490589
+229 256 374170397077642871125796352 7231150774521216153947917
+229 316 310457044 24147753
+229 328 203687016 18164893
+229 340 2396671519058288 239072814877305
+229 352 5861500190515124912 643310405461818945
+231 232 2320 1
+23 24 708390 4039
+23 28 301201173072555 12291654197303
+23 30 918131960 55665693
+233 248 1047118 9639
+233 280 839799170 31268259
+233 332 42020991 3673628
+233 368 1939342336 231222295
+23 34 38289508 3770459
+23 36 924 107
+235 304 3592520731728558622420 209014807517728002843
+237 272 689673 17531
+239 240 2400 1
+239 280 108640756427 3325971461
+239 288 5918538 226025
+239 320 35541730880 2438001373
+239 332 220542081496 17674581195
+239 356 12271107112 1235733429
+241 340 446450430 37489061
+241 376 26968034134655664044656 3091422157882426773631
+24 31 1063141776 61277657
+245 332 1299977374664 94066639307
+245 344 114963768 9458837
+247 248 2480 1
+247 352 6133408 536511
+251 356 34719701 2980172
+25 28 2039237959472 40243915413
+253 256 7206535168 8748903
+253 280 35652400 612949
+253 304 3960329904 147259513
+253 364 79600749513628707 7203482368536955
+25 34 9453969210232 694752094189
+25 36 71882325 6523522
+25 38 135260848 14414887
+255 256 2560 1
+257 284 73356632 1208837
+257 308 741691104 26727829
+257 332 35560459576 2051440701
+257 356 392137204 31041385
+257 368 4460720 397383
+259 304 28066422736 872991355
+26 29 751390 14157
+263 264 2640 1
+263 280 2969969359526396237501668338630 27471057441287251708087987699
+263 296 516492928214639902231 10750845717411348937
+263 368 3283376 266057
+265 376 135488968 11647627
+269 380 278363395 23503068
+271 272 2720 1
+271 280 11879690 49183
+271 376 3897757 310788
+271 388 285173307 25393135
+271 412 3532388296 376650753
+27 32 2136145140 71989639
+27 38 26852092 2231983
+27 40 65181560 6460247
+275 392 36594768 3204167
+275 416 463022560 48708299
+277 340 6320747110291362964823064747330 271842930290020455494724423281
+277 388 117367478 9555437
+279 280 2800 1
+28 31 1674 29
+283 292 347322904 1353781
+283 304 3846441813419317880358782306 42025932375000856638525615
+283 340 9909508080 367867157
+283 364 77851075111545267940295010499408669 4395607836721280366692416938785680
+283 400 616424400 52167269
+283 436 5495495573213776754 606672758011739615
+287 288 2880 1
+287 344 62045388 2239597
+287 404 316081419 26293732
+289 400 24778400 1954207
+289 412 323348827 28323465
+29 32 3545707803058539871484 58693166330428562925
+293 356 1238555462712441745354916 49912886117803707110443
+293 416 662834848 57131899
+29 36 166530437165727 7681634711762
+29 40 186645 14488
+29 41 41434436 3510303
+29 44 11018776 1168407
+29 46 5132 621
+295 328 298874543 5432877
+295 412 664208478 53367647
+295 448 6274565696 667046319
+299 380 32398980643785097731413344933675 1713002339224210365698938536413
+299 428 694193102 61765911
+301 424 69567800 5804163
+301 436 48838649 4516870
+305 428 356191979 29233196
+307 424 34895359 2725114
+307 436 363916883 31402595
+311 344 53813296 911099
+311 440 33860840 2877033
+31 32 76326933880257 305628965932
+31 33 198359227576623978 1830612693488581
+313 376 757555917 28085108
+313 436 378258385547214676071376685377398561601 30644883569917283820491390403098407566
+313 448 760675776 67658327
+31 36 276431485450691503504083 7834269710947693115701
+31 40 23955 1376
+31 43 91380676 7277885
+31 44 404630 34833
+31 46 17574639969593918558 1750166620134216445
+31 48 1633788216 183227851
+317 356 550532322919319520377112338 11190669014692523233071645
+317 380 12414823440 448728137
+317 404 475472298447179 25530820250077
+317 440 678985 54236
+319 364 4004799653574646985786 96152512552532104205
+319 412 54777235048 3155033975
+319 448 779716672 64213591
+325 328 3280 3
+329 332 3320 3
+329 464 831827184 69755153
+329 512 79805497266176 9079971092297
+331 412 162720636 7627951
+331 472 424239736 37199043
+331 520 8483926034287817572476480320 994000814681544504944449651
+33 46 417246074 33895163
+33 50 2893820148687953002065572200 305759302273331365882937469
+335 428 414140582752 22544164191
+335 464 166559296 13178763
+337 340 3400 3
+337 472 54283776 4417697
+341 344 3440 3
+341 488 64482856 5732025
+341 512 17318488576 1784328215
+343 412 14554819584 539002739
+347 416 7438370784 269154403
+347 440 2829228387234155054244827106200 147699439919128374187041437667
+347 488 46175048 3825659
+349 352 3520 3
+349 496 26887664 2326727
+353 356 3560 3
+353 428 15858971087934494636780013744371543 630446207869643028542667527767840
+353 440 1198666478240 56629636513
+353 488 46169131 3621514
+353 536 2045443 217359
+35 36 221381073251018730 763170344336593
+35 47 194591254769385909106 13532824604979581343
+355 496 962149232 77450313
+359 464 4958438096 287050351
+359 512 998198784 87574175
+361 364 3640 3
+361 388 23283810320717309486474 256876949536804008345
+365 368 3680 3
+365 404 148444952 2560383
+365 512 145708544 11938401
+367 520 259610520 22192601
+371 512 203728384 15853799
+373 376 3760 3
+373 448 8605641408 318395095
+37 50 3747763700 267958669
+37 52 10494926 867027
+37 56 94183246199 9921958800
+37 58 4297764236 499799437
+377 380 3800 3
+377 536 34325708 2974925
+379 388 8640447567913182114 23818845519019789
+383 536 560601864 45461017
+383 560 1895530224 180528595
+383 608 20575619840 2496730751
+385 388 3880 3
+385 544 1140600992 96402963
+389 392 3920 3
+389 488 2770811596345800695872 136039289675162182885
+39 44 18320264094 391459753
+395 404 105906142255157616043255142370 277803905583887299290150637
+39 62 992 121
+397 400 4000 3
+397 568 30585096 2716229
+401 404 4040 3
+401 440 1715250543000828927983855015270 26247108088374587786209863149
+401 536 2430191007829500997 165538531856087008
+401 560 1227232720 98572861
+403 568 623772488 52166561
+40 43 91495493697425270 1012876217298531
+407 488 2558524098 92738683
+409 412 4120 3
+409 436 1322279 12540
+413 416 4160 3
+413 464 709710743308 14490862185
+413 584 656612808 55668625
+41 48 3520672 107133
+41 50 4134065975 170607724
+41 52 81259944312534 4247413612877
+41 53 136685728 7921575
+415 592 1334112848 117147117
+41 56 566953786 42428933
+41 58 310702636 26387235
+41 62 5879956 617937
+41 64 853592 98007
+419 536 1061048355042883465970589239779801 58162241677679044736536051651472
+421 424 4240 3
+421 520 63928712357260768810 2859100006978301771
+421 544 2807242912 162237459
+421 592 1359274032 112560881
+421 640 12786962560 1363187007
+425 428 4280 3
+425 608 223136 19809
+425 632 289395259810755 29001720221552
+427 472 5959472 99047
+427 520 896055805775 36645800536
+427 592 270799744 21520211
+431 560 1066100298758105213176308 63404226704792381853719
+431 608 1427804704 119853475
+433 436 4360 3
+433 520 5797956060 214201103
+433 616 1080184 93847
+43 48 141637307220936 2692816292717
+43 61 456565236 39220363
+43 62 641785374793382723146404234184 58487205704605428744938648163
+43 64 25728 2585
+43 66 2968413459918477916 324571505267984029
+43 67 51124510117136 5837642671863
+437 440 4400 3
+439 616 838516 68799
+439 664 589931132 62035655
+443 632 274920 24149
+445 448 4480 3
+445 616 6676649 526892
+449 608 3531736804299238779836 254759755835339732779
+449 632 80264 6675
+451 544 132998508684555768884 5111842745745408469
+451 640 224269440 19290833
+451 712 39382018901275408222464 4688484806862877739737
+45 52 5787535 156849
+455 512 25498229384824680313685190784 529724353597504276289361357
+455 608 1724901950874094 117336319968435
+45 56 228636542418452 10706435977925
+45 62 10093209303979794708164 782827997797329937175
+45 64 46960576 4075309
+4 5 673781 32397
+457 640 26181760 2129659
+461 464 4640 3
+461 656 1643436784 142925593
+461 680 105405865 10312341
+463 640 63536000 4981347
+463 664 73830623804 6611940795
+46 61 53702056242663292526 3525694286080552779
+467 536 2455353820241744746 62451709154832515
+467 560 13474898640 489047941
+467 632 9197059933840593096278645051 661732279615861153367727222
+467 656 238759728 19682675
+469 472 4720 3
+469 496 120148064 952893
+469 664 423737576 36106647
+469 712 7928052004 842029635
+473 488 485039792 1869697
+473 608 25465205762887566277872914 1432933868656272952719597
+473 656 5448736 433671
+47 48 17562322278 42480791
+47 50 4181719286668267000 38107671710464229
+47 52 7377864 125779
+47 53 49452710 1051183
+475 592 2170194549824 102423504865
+47 56 17383856 610087
+475 664 17583384 1418671
+475 712 3051063913 312861352
+47 65 41917460 3293921
+47 66 36926724 3039845
+47 70 574463720820456250 57830319169531099
+479 680 110709440 9537801
+479 728 8275293572 881640531
+481 664 1403779 109388
+481 688 1795558224 159302285
+485 488 4880 3
+485 536 130647856 2158349
+485 752 708138530646452608 79718780135739361
+487 688 364959920 30822989
+487 712 175719286 16730369
+491 680 2555525 202106
+491 704 274438976 24557259
+493 496 4960 3
+493 592 15031259472 554702197
+49 58 139520885 4653428
+49 60 5390413405045623683458094821970 228351068618392413063126876531
+49 68 42823068 3417803
+497 704 173095488 14780149
+497 776 375584 43157
+499 712 241146568 21194805
+503 608 225005112408 8767528901
+503 704 175815616 14263125
+505 616 38020179467965039431064594866019 1571466014496981278887933256265
+505 664 50915140441 3209773230
+505 712 979716984 82050451
+50 71 88248172 7610793
+509 512 5120 3
+509 704 34918976 2745109
+509 728 502648328 44583459
+515 728 1020767384 86428031
+517 520 5200 3
+517 736 89894432 7830965
+517 784 6418343792 679588311
+521 728 259059528 20862325
+523 736 91254496 7581933
+52 55 1890988 15105
+52 73 2705380 222427
+527 632 108612516 3945785
+527 656 84975398208 3985420019
+527 728 102844651 8039502
+527 752 2151842736 189176057
+527 800 953314400 101232543
+52 79 3120084776 332048283
+529 640 153718637852977985011469832 6024760822792568916592673
+529 760 164177229749195 14788334099736
+533 536 5360 3
+533 752 436760848 36685617
+533 800 13134605948590567475 1351926685839808641
+535 592 19921688 340987
+53 58 472749283122 6962332795
+53 60 2927872620 64854623
+53 71 2152052600 148055431
+53 74 24497404 1965855
+53 76 11608427264 1039157717
+53 84 1152 139
+541 544 5440 3
+541 592 243558547444687 3583655693577
+541 760 140191120 11560351
+545 704 559118656 32239961
+545 752 439583104 34180267
+545 776 164134088 14308277
+551 776 582714696 48574427
+553 664 4727920866 174323767
+55 56 15397336114007656515 31081495413387976
+55 58 928 7
+55 62 11307814659606 239474697473
+55 67 11521782387824312813 472161068762439591
+55 68 76837359829638624163 3457263548507678710
+55 72 2373551010 146495297
+557 560 5600 3
+55 76 2560972 200471
+559 784 2392047504 195844373
+559 880 287836396486949032800 33947288213944818491
+5 6 206054 7543
+563 800 2448696800 211753299
+565 568 5680 3
+565 784 474425056 37847363
+565 808 1238569464 109808851
+56 89 92551391475 11276988589
+569 800 354671200 29352133
+569 872 322994023716 35175661205
+571 688 1688125874146648233833 64427639483502543132
+571 808 627870136 53389765
+5 7 18348988 1490457
+575 656 131573469 3153577
+575 704 134804032 5706235
+57 58 28074262 54223
+575 872 2977300447 315289893
+57 64 354359856 7187551
+577 664 472439855848 12294575421
+577 808 353096 28713
+57 80 74650960 6131107
+581 584 5840 3
+581 824 8138442 698401
+583 760 619452429740 37450567491
+583 808 126170311 10011004
+583 832 526731712 46326411
+58 67 1649028443012092 44555675261197
+587 608 106572027049832112414 480643244838332939
+587 704 1935612096 70373909
+587 824 1319661544 108464877
+58 85 54934011149712678782000 5269825788607836690257
+589 592 5920 3
+589 832 2669020224 225303215
+593 656 48923824 831049
+593 848 2728649456 241870017
+595 832 2704381888 218494687
+59 71 3449508588 130529263
+59 76 7411374208219496963 421834109077670761
+59 83 854530484 70894067
+59 84 40392681 3519997
+59 92 45872672 5249863
+599 848 2764691152 235520941
+601 832 76553152 6043017
+601 856 349370408 30493001
+605 608 6080 3
+605 728 566713329 21427174
+605 848 2800732848 228692177
+607 712 1213956368088 37543259599
+607 784 99170743280 5713907697
+607 856 1415672488 118672485
+611 848 554904064 44307075
+611 872 723201048 63617609
+613 616 6160 3
+613 736 1010312352 37225253
+613 856 716931672 57566561
+61 70 1601707428486458895049 40666387345350552332
+617 872 1464932968 123925581
+61 80 711875910101206912226682801530 44329062975930287890417190417
+61 88 13721941750340872535111 1252638412336324244440
+619 856 141999379 11154668
+619 880 269186640 23323051
+623 872 74173192 6018805
+625 808 862470916 50015591
+62 77 226501542093442 10476590586397
+62 95 3883869938060071286980 422790254480350650149
+629 632 6320 3
+629 848 22872510254352162199999392778 1618589258548885335643978905
+629 872 146897011 11670400
+637 640 6400 3
+637 712 22425908472252330466481206 432681307420269112741067
+637 880 30784 2407
+63 80 211987100 11156141
+63 88 4131304 332173
+63 92 405320053355454565329068529858570906247772102611 38458528259602065757217406740369621389921333902
+643 736 2349612950193993636339516635588 58189747605535213164784539673
+64 67 189878 1187
+647 776 3233470653 117635606
+64 91 202606404 17565491
+653 656 6560 3
+653 800 184407247200 7835559329
+655 784 5294965872 187891325
+655 856 3297515140088500321 201833821852521154
+65 83 3657548716 198513737
+65 84 2275425096 131605931
+65 86 4325905632866773677677941204 280980356243247679229813691
+65 92 707613 60227
+659 680 941793200 3699963
+661 664 6640 3
+6 7 10705450028 316037291
+673 712 495157552 4014129
+673 808 52059036 1917025
+67 70 1866014677730 11035422619
+677 680 6800 3
+67 94 274973124 22546777
+685 688 6880 3
+68 95 1129604340 90893383
+697 784 3404362107124972 70417119108897
+69 88 1847403 99592
+701 704 7040 3
+70 73 139301082 780289
+707 848 30888874032 1124349577
+707 872 34236240847352 1517502001011
+709 712 7120 3
+70 97 465591076 36915973
+709 784 69878704 1173299
+7 10 3039620 268397
+71 100 58055425 4840929
+71 101 1247154868 108324171
+71 110 20680 2323
+715 856 3155192460 112260067
+71 74 9957884 54819
+71 84 9310905778962470332154771 309312691722716040540357
+71 98 119397124 9298405
+725 728 7280 3
+725 872 3254279148 122397847
+73 103 1310906132 110134499
+73 104 61864504 5404935
+73 116 160840452406736 19586683322813
+733 736 7360 3
+733 808 163216 2653
+733 880 274573680 10106041
+73 84 2520531076 65498273
+73 88 458809560621687 17565069102308
+73 91 29294569304 1385139607
+73 92 2586364317931361819012254201976 130392844500272639499029255823
+739 880 2147997280 74834783
+74 101 4340374 323843
+74 89 5424360252 203907565
+749 752 7520 3
+75 104 6266637 498406
+751 808 14929152531424038 167732593950845
+751 832 1619914041356 28264167781
+757 760 7600 3
+761 848 102666787178648940581728 1913748583083825691785
+767 848 40876568 683237
+76 91 5704292412 203304145
+77 108 13616613 1115159
+773 776 7760 3
+77 92 1189629123140424431 42749743513159851
+77 95 762173074384307211512753 33848741696267119943389
+77 96 3802911616 180041871
+779 824 663189808 5320197
+779 872 4845927232 95011785
+7 8 157422 3839
+781 784 7840 3
+787 832 77736869437764506961663263190404 622281702698477841687285348597
+79 109 591106564 45951341
+79 112 48137264 4124745
+79 118 26999574638029333921808 2740797596939325889839
+79 120 675061980 71810303
+791 872 1330672 21677
+7 9 5178505770 291766481
+797 800 8000 3
+805 808 8080 3
+809 848 106044014668699221902585698 686086151112096112942293
+81 112 29175552 2290657
+81 116 21840886 1946677
+81 128 113880836608 13602779789
+817 832 3155607 6439
+821 824 8240 3
+82 85 16555923093433771246695490 76655763495343125744361
+829 832 8320 3
+83 104 92475429528357926581830238378374 4509163544371135900175725017247
+83 116 26302739 2120087
+83 86 25703969906 117339971
+845 848 8480 3
+85 118 171859684 13737597
+85 132 8393576287888 949095058129
+853 856 8560 3
+857 872 3172892336 6064601
+85 94 4018171 67639
+869 872 8720 3
+87 124 175791514 15384937
+87 136 289083240704 33339684607
+877 880 8800 3
+87 88 26185523330110 30669672971
+89 104 529896063229 15863762521
+89 107 7844288556 293578747
+89 112 162876368368 8142684563
+89 132 2948337891148056 293186575939535
+89 136 162959514140233742 17613617940340169
+89 140 37782021474067360 4444920405809809
+9 10 95850 1729
+91 108 206351848812177421119 7031173753139727287
+91 109 8180207148 292854643
+91 120 232189600025045660868782025 14845201675228847355463606
+91 128 190562432 15800565
+9 11 37508576518761587924246383733296 1570175268289310200702148989751
+9 13 30214121666138076014729719 2769380327578530456720327
+9 14 41608 4727
+91 97 2386394 22599
+93 136 4191546316 399406251
+94 103 26041339024866 390694663201
+95 112 2671325482 86216455
+95 134 554906596 46559889
+95 136 52562504 4678491
+95 98 11416872577951540099547 44514448262602980906
+97 136 36005048 2943755
+97 144 48341915904665622 4820481061106971
+97 154 83717592 10162333
+99 140 226387210 19198933
+99 152 728396312 79707025
diff --git a/tests/etalon-tauab.txt b/tests/etalon-tauab.txt
new file mode 100644
--- /dev/null
+++ b/tests/etalon-tauab.txt
@@ -0,0 +1,974 @@
+1 2 269 1217
+1 3 1486 8647
+1 4 1448 10331
+1 6 669 6305
+1 10 150509 2096993
+1 11 1048 15811
+1 12 64 1037
+1 13 2516635 43324033
+1 14 75 1373
+1 16 15 307
+1 17 223719847217121 4818899500742111
+1 18 11576873 261780300
+1 19 275869 6532095
+1 21 1771 45681
+1 22 13 349
+1 23 239355515695 6676324696363
+1 24 247 7147
+1 26 13336 413975
+1 27 13336 428823
+1 28 64 2125
+1 29 64 2189
+1 31 31868239 1155220065
+1 32 93607 3490915
+1 33 14299 548165
+1 36 2844315012 117898533653
+1 37 35 1487
+1 38 269 11708
+1 43 108159466379 5266052621833
+1 45 638073389 32378276423
+1 46 57 2951
+2 3 269 2047
+2 4 269 2434
+2 6 743 8647
+2 7 724 9363
+2 8 724 10331
+2 9 32 493
+2 11 218024379851983 3853043458377914
+2 12 669 12610
+2 13 11081 222023
+2 15 14857678 331509943
+2 17 625865993 15373292652
+2 19 1094143543 29296160013
+2 20 150509 4193986
+2 21 524 15187
+2 22 524 15811
+2 23 524 16435
+2 24 32 1037
+2 25 32 1069
+2 26 2516635 86648066
+2 27 1035509 36783338
+2 28 75 2746
+2 29 48968995 1846162586
+2 32 15 614
+2 33 32705 1374481
+2 34 223719847217121 9637799001484222
+2 35 13 574
+2 36 11576873 523560600
+2 37 4981 230578
+2 38 275869 13064190
+2 39 901 43624
+2 42 1771 91362
+2 43 95746813491517 5040237686324834
+2 44 13 698
+2 45 353949443 19374944132
+2 46 239355515695 13352649392726
+2 48 247 14294
+3 4 19 203
+3 5 269 3264
+3 6 269 3651
+3 7 5867 87301
+3 9 1486 25941
+3 10 1448 27121
+3 11 1448 29057
+3 12 1448 30993
+3 13 64 1447
+3 14 64 1511
+3 17 1409 38185
+3 18 223 6305
+3 19 1583 46589
+3 20 24763 757447
+3 22 1859 61155
+3 23 27 919
+3 25 269 9761
+3 28 279451496671 11070173646688
+3 30 150509 6290979
+3 31 1048 44937
+3 32 1048 46185
+3 33 1048 47433
+3 34 1048 48681
+3 35 64 3047
+3 36 64 3111
+3 37 64 3175
+3 38 64 3239
+3 39 2516635 129972099
+3 40 5832435759679 307592990483371
+3 41 743 39994
+3 42 25 1373
+3 44 1366604910835973 78022928423524953
+3 46 272079231 16121387395
+3 48 5 307
+4 5 16 221
+4 6 269 4094
+4 7 269 4481
+4 8 269 4868
+4 9 349 6768
+4 11 2985 65761
+4 12 743 17294
+4 13 362 8879
+4 14 362 9363
+4 15 362 9847
+4 16 362 10331
+4 17 16 477
+4 18 16 493
+4 19 16 509
+4 22 218024379851983 7706086916755828
+4 24 669 25220
+4 25 81872031 3181281076
+4 26 11081 444046
+4 27 427 17581
+4 30 7428839 331509943
+4 31 7763609 355259308
+4 33 14873 714151
+4 34 625865993 30746585304
+4 35 11517061 578651566
+4 38 1094143543 58592320026
+4 40 150509 8387972
+4 41 21209515 1204939858
+4 42 262 15187
+4 43 262 15499
+4 44 262 15811
+4 45 262 16123
+4 46 262 16435
+4 47 16 1021
+4 48 16 1037
+5 6 64 1089
+5 7 269 4924
+5 8 269 5311
+5 9 269 5698
+5 10 269 6085
+5 11 1494957 35728459
+5 12 31958 806765
+5 13 56902130353 1510899511886
+5 14 154 4285
+5 15 1486 43235
+5 16 1448 43911
+5 17 1448 45847
+5 18 1448 47783
+5 19 1448 49719
+5 20 1448 51655
+5 21 1448 53591
+5 22 64 2433
+5 23 64 2497
+5 24 64 2561
+5 27 37131637 1618420011
+5 30 669 31525
+5 31 67537 3260867
+5 32 11081 548146
+5 33 269 13617
+5 37 67 3699
+5 39 589495295338445 33885343036099771
+5 41 30550 1824549
+5 44 11763209026574867668144257331007414 742037223603544333737920966312790157
+5 47 17281 1147457
+6 7 32 647
+6 8 19 406
+6 9 269 6141
+6 10 269 6528
+6 11 269 6915
+6 12 269 7302
+6 13 15387 437072
+6 14 5867 174602
+6 18 743 25941
+6 20 724 27121
+6 21 724 28089
+6 22 724 29057
+6 23 724 30025
+6 24 724 30993
+6 25 724 31961
+6 26 32 1447
+6 27 32 1479
+6 28 32 1511
+6 29 32 1543
+6 31 22571 1143139
+6 33 218024379851983 11559130375133742
+6 34 1409 76370
+6 36 223 12610
+6 38 1583 93178
+6 39 11081 666069
+6 40 24763 1514894
+6 43 20 1293
+6 44 1859 122310
+6 45 14857678 994529829
+6 46 27 1838
+7 8 64 1499
+7 9 64 1563
+7 10 269 6971
+7 11 269 7358
+7 12 269 7745
+7 13 269 8132
+7 14 269 8519
+7 16 4487779 153815515
+7 17 219685 7822664
+7 19 199 7604
+7 20 68074509 2686722241
+7 21 1486 60529
+7 22 136149018 5713817027
+7 23 1448 62637
+7 24 1448 64573
+7 25 1448 66509
+7 26 1448 68445
+7 27 1448 70381
+7 28 1448 72317
+7 29 1448 74253
+7 30 64 3355
+7 31 64 3419
+7 32 64 3483
+7 33 64 3547
+7 36 22571 1328884
+7 37 4270734388451 256506021665323
+7 39 1832403 114429617
+7 40 12908791557077 821347302331963
+7 42 669 44135
+7 44 44906995144 3066566729547
+7 45 11081 770169
+7 46 269 19010
+8 9 8 213
+8 10 8 221
+8 11 1 29
+8 12 269 8188
+8 13 269 8575
+8 14 269 8962
+8 15 269 9349
+8 16 269 9736
+8 18 349 13536
+8 19 6725252666082473912 269837142815144165315
+8 22 2985 131522
+8 23 94 4257
+8 24 743 34588
+8 25 47 2246
+8 26 181 8879
+8 27 181 9121
+8 28 181 9363
+8 29 181 9605
+8 30 181 9847
+8 31 181 10089
+8 32 181 10331
+8 33 181 10573
+8 34 8 477
+8 35 8 485
+8 36 8 493
+8 37 8 501
+8 38 8 509
+8 39 8927 577503
+8 41 22571 1514629
+8 44 218024379851983 15412173833511656
+8 48 669 50440
+9 10 64 1909
+9 11 64 1973
+9 12 19 609
+9 13 269 9018
+9 14 269 9405
+9 15 269 9792
+9 16 269 10179
+9 17 269 10566
+9 18 269 10953
+9 19 2846636445243 119319375184511
+9 21 5867 261903
+9 25 269 13412
+9 26 213398 10906091
+9 27 1486 77823
+9 28 106699 5719793
+9 29 1448 79427
+9 30 1448 81363
+9 31 1448 83299
+9 32 1448 85235
+9 33 1448 87171
+9 34 1448 89107
+9 35 8 503
+9 36 1448 92979
+9 37 1448 94915
+9 38 64 4277
+9 39 64 4341
+9 40 64 4405
+9 41 64 4469
+9 42 64 4533
+9 43 64 4597
+9 46 22571 1700374
+10 11 32 1057
+10 12 32 1089
+10 13 19 667
+10 14 269 9848
+10 15 269 10235
+10 16 269 10622
+10 17 269 11009
+10 18 269 11396
+10 19 269 11783
+10 20 269 12170
+10 21 22391 1039389
+10 22 1494957 71456918
+10 23 90047 4426279
+10 24 15979 806765
+10 26 56902130353 3021799023772
+10 27 2985 162359
+10 28 77 4285
+10 30 743 43235
+10 32 724 43911
+10 33 724 44879
+10 34 724 45847
+10 35 724 46815
+10 36 724 47783
+10 37 724 48751
+10 38 724 49719
+10 39 724 50687
+10 40 724 51655
+10 41 724 52623
+10 42 724 53591
+10 43 32 2401
+10 44 32 2433
+10 45 32 2465
+10 46 32 2497
+10 47 32 2529
+10 48 32 2561
+11 12 64 2319
+11 13 64 2383
+11 14 64 2447
+11 15 19 754
+11 16 269 11065
+11 17 269 11452
+11 18 269 11839
+11 19 269 12226
+11 20 269 12613
+11 21 269 13000
+11 22 269 13387
+11 23 22391 1140187
+11 24 11439 598352
+11 25 32026 1718785
+11 26 743 40878
+11 27 3 169
+11 29 4915 289628
+11 30 2985 179821
+11 31 211021 12971783
+11 33 1486 95117
+11 35 211021 14026888
+11 36 1448 98153
+11 37 1448 100089
+11 38 1448 102025
+11 39 1448 103961
+11 40 1448 105897
+11 41 1448 107833
+11 42 1448 109769
+11 43 1448 111705
+11 44 1448 113641
+11 45 1448 115577
+11 46 1448 117513
+11 47 64 5263
+11 48 64 5327
+12 13 16 631
+12 14 16 647
+12 15 16 663
+12 16 19 812
+12 17 269 11895
+12 18 269 12282
+12 19 269 12669
+12 20 269 13056
+12 21 269 13443
+12 22 269 13830
+12 23 269 14217
+12 24 269 14604
+12 25 22391 1240985
+12 26 15387 874144
+12 27 349 20304
+12 28 5867 349204
+12 29 1937 117873
+12 33 995 65761
+12 35 619 42442
+12 36 743 51882
+12 37 1238 87979
+12 39 362 26637
+12 40 362 27121
+12 41 362 27605
+12 42 362 28089
+12 43 362 28573
+12 44 362 29057
+12 45 362 29541
+12 46 362 30025
+12 47 362 30509
+12 48 362 30993
+13 14 64 2729
+13 15 64 2793
+13 16 64 2857
+13 17 19 870
+13 18 269 12725
+13 19 269 13112
+13 20 269 13499
+13 21 269 13886
+13 22 269 14273
+13 23 269 14660
+13 24 269 15047
+13 25 269 15434
+13 26 269 15821
+13 27 22391 1341783
+13 30 9785 626588
+13 32 1036934989772687 69159480605522577
+13 33 16359 1112516
+13 35 2985 210658
+13 36 269 19343
+13 37 35 2559
+13 38 62327 4636164
+13 39 1486 112411
+13 40 124654 9583963
+13 41 35 2734
+13 42 1448 114943
+13 43 1448 116879
+13 44 1448 118815
+13 45 1448 120751
+13 46 1448 122687
+13 47 1448 124623
+13 48 1448 126559
+14 15 32 1467
+14 16 32 1499
+14 17 32 1531
+14 18 32 1563
+14 19 19 957
+14 20 269 13942
+14 21 269 14329
+14 22 269 14716
+14 23 269 15103
+14 24 269 15490
+14 25 269 15877
+14 26 269 16264
+14 27 269 16651
+14 28 269 17038
+14 29 22391 1442581
+14 32 4487779 307631030
+14 33 5867 410129
+14 34 219685 15645328
+14 37 325085403505815839 24418612227393898801
+14 38 199 15208
+14 39 269 20893
+14 40 68074509 5373444482
+14 42 743 60529
+14 44 68074509 5713817027
+14 45 724 61669
+14 46 724 62637
+14 47 724 63605
+14 48 724 64573
+15 16 64 3139
+15 17 64 3203
+15 18 64 3267
+15 19 64 3331
+15 20 19 1015
+15 21 269 14772
+15 22 269 15159
+15 23 269 15546
+15 24 269 15933
+15 25 269 16320
+15 26 269 16707
+15 27 269 17094
+15 28 269 17481
+15 29 269 17868
+15 30 269 18255
+15 31 22391 1543379
+15 33 498319 35728459
+15 34 2122540708227654350851 155072213378569359073777
+15 35 5867 436505
+15 36 31958 2420295
+15 37 689201 53108763
+15 38 16359 1281935
+15 39 56902130353 4532698535658
+15 41 2985 245582
+15 42 154 12855
+15 43 7113 602861
+15 45 1486 129705
+15 47 7113 638426
+15 48 1448 131733
+16 17 4 209
+16 18 4 213
+16 19 4 217
+16 20 4 221
+16 21 19 1073
+16 22 1 58
+16 23 269 15989
+16 24 269 16376
+16 25 269 16763
+16 26 269 17150
+16 27 269 17537
+16 28 269 17924
+16 29 269 18311
+16 30 269 18698
+16 31 269 19085
+16 32 269 19472
+16 33 22391 1644177
+16 35 11439 871787
+16 36 349 27072
+16 38 3362626333041236956 269837142815144165315
+16 43 995 86319
+16 44 2985 263044
+16 45 112450 10041383
+16 46 47 4257
+16 47 6340524178 582318638983
+16 48 743 69176
+17 18 64 3549
+17 19 64 3613
+17 20 64 3677
+17 21 64 3741
+17 22 19 1131
+17 23 19 1160
+17 24 269 16819
+17 25 269 17206
+17 26 269 17593
+17 27 269 17980
+17 28 269 18367
+17 29 269 18754
+17 30 269 19141
+17 31 269 19528
+17 32 269 19915
+17 33 269 20302
+17 34 269 20689
+17 35 22391 1744975
+17 36 2654453 210576825
+17 37 11439 923269
+17 40 5867 497430
+17 42 599 52365
+17 46 2985 276419
+17 47 269 25274
+17 48 854 81231
+18 19 32 1877
+18 20 32 1909
+18 21 32 1941
+18 22 32 1973
+18 23 32 2005
+18 24 19 1218
+18 25 269 17649
+18 26 269 18036
+18 27 269 18423
+18 28 269 18810
+18 29 269 19197
+18 30 269 19584
+18 31 269 19971
+18 32 269 20358
+18 33 269 20745
+18 34 269 21132
+18 35 269 21519
+18 36 269 21906
+18 37 269 22175
+18 38 2846636445243 238638750369022
+18 39 5129 437072
+18 42 5867 523806
+19 20 64 3959
+19 21 64 4023
+19 22 64 4087
+19 23 64 4151
+19 24 64 4215
+19 25 19 1276
+19 26 19 1305
+19 27 269 18866
+19 28 269 19253
+19 29 269 19640
+19 30 269 20027
+19 31 269 20414
+19 32 269 20801
+19 33 269 21188
+19 34 269 21575
+19 35 269 21962
+19 36 269 22349
+19 37 269 22736
+19 38 269 23123
+19 39 269 23392
+19 40 28458415 2513830036
+19 45 73 6944
+19 46 68248986 6583441727
+20 21 16 1041
+20 22 16 1057
+20 23 16 1073
+20 24 16 1089
+20 25 16 1105
+20 26 19 1334
+20 27 19 1363
+20 28 269 19696
+20 29 269 20083
+20 30 269 20470
+20 31 269 20857
+20 32 269 21244
+20 33 269 21631
+20 34 269 22018
+20 35 269 22405
+20 36 269 22792
+20 37 269 23179
+20 38 269 23566
+20 39 269 23953
+20 40 269 24340
+20 41 269 24609
+20 42 22391 2078778
+20 44 1494957 142913836
+20 45 349 33840
+20 46 90047 8852558
+20 47 5867 584731
+20 48 15979 1613530
+21 22 64 4369
+21 23 64 4433
+21 24 64 4497
+21 25 64 4561
+21 26 64 4625
+21 27 64 4689
+21 28 19 1421
+21 29 269 20526
+21 30 269 20913
+21 31 269 21300
+21 32 269 21687
+21 33 269 22074
+21 34 269 22461
+21 35 269 22848
+21 36 269 23235
+21 37 269 23622
+21 38 269 24009
+21 39 269 24396
+21 40 269 24783
+21 41 269 25170
+21 42 269 25557
+21 43 269 25826
+21 44 22391 2179576
+21 46 585 58564
+21 47 7500512497 761087553559
+21 48 4487779 461446545
+22 23 32 2287
+22 24 32 2319
+22 25 32 2351
+22 26 32 2383
+22 27 32 2415
+22 28 32 2447
+22 29 19 1479
+22 30 19 1508
+22 31 269 21743
+22 32 269 22130
+22 33 269 22517
+22 34 269 22904
+22 35 269 23291
+22 36 269 23678
+22 37 269 24065
+22 38 269 24452
+22 39 269 24839
+22 40 269 25226
+22 41 269 25613
+22 42 269 26000
+22 43 269 26387
+22 44 269 26774
+22 45 269 27043
+22 46 22391 2280374
+22 48 11439 1196704
+23 24 64 4779
+23 25 64 4843
+23 26 64 4907
+23 27 64 4971
+23 28 64 5035
+23 29 64 5099
+23 30 19 1537
+23 31 19 1566
+23 32 269 22573
+23 33 269 22960
+23 34 269 23347
+23 35 269 23734
+23 36 269 24121
+23 37 269 24508
+23 38 269 24895
+23 39 269 25282
+23 40 269 25669
+23 41 269 26056
+23 42 269 26443
+23 43 269 26830
+23 44 269 27217
+23 45 269 27604
+23 46 269 27991
+23 47 269 28260
+23 48 22391 2381172
+24 25 8 623
+24 26 8 631
+24 27 8 639
+24 28 8 647
+24 29 8 655
+24 30 8 663
+24 31 19 1595
+24 32 19 1624
+24 33 1 87
+24 34 269 23790
+24 35 269 24177
+24 36 269 24564
+24 37 269 24951
+24 38 269 25338
+24 39 269 25725
+24 40 269 26112
+24 41 269 26499
+24 42 269 26886
+24 43 269 27273
+24 44 269 27660
+24 45 269 28047
+24 46 269 28434
+24 47 269 28821
+24 48 269 29208
+25 26 64 5189
+25 27 64 5253
+25 28 64 5317
+25 29 64 5381
+25 30 64 5445
+25 31 64 5509
+25 32 64 5573
+25 33 19 1682
+25 34 19 1711
+25 35 269 24620
+25 36 269 25007
+25 37 269 25394
+25 38 269 25781
+25 39 269 26168
+25 40 269 26555
+25 41 269 26942
+25 42 269 27329
+25 43 269 27716
+25 44 269 28103
+25 45 269 28490
+25 46 269 28877
+25 47 269 29264
+25 48 269 29651
+26 27 32 2697
+26 28 32 2729
+26 29 32 2761
+26 30 32 2793
+26 31 32 2825
+26 32 32 2857
+26 33 32 2889
+26 34 19 1740
+26 35 19 1769
+26 36 269 25450
+26 37 269 25837
+26 38 269 26224
+26 39 269 26611
+26 40 269 26998
+26 41 269 27385
+26 42 269 27772
+26 43 269 28159
+26 44 269 28546
+26 45 269 28933
+26 46 269 29320
+26 47 269 29707
+26 48 269 30094
+27 28 64 5599
+27 29 64 5663
+27 30 64 5727
+27 31 64 5791
+27 32 64 5855
+27 33 64 5919
+27 34 64 5983
+27 35 19 1798
+27 36 19 1827
+27 37 19 1856
+27 38 269 26667
+27 39 269 27054
+27 40 269 27441
+27 41 269 27828
+27 42 269 28215
+27 43 269 28602
+27 44 269 28989
+27 45 269 29376
+27 46 269 29763
+27 47 269 30150
+27 48 269 30537
+28 29 16 1451
+28 30 16 1467
+28 31 16 1483
+28 32 16 1499
+28 33 16 1515
+28 34 16 1531
+28 35 16 1547
+28 36 16 1563
+28 37 19 1885
+28 38 19 1914
+28 39 269 27497
+28 40 269 27884
+28 41 269 28271
+28 42 269 28658
+28 43 269 29045
+28 44 269 29432
+28 45 269 29819
+28 46 269 30206
+28 47 269 30593
+28 48 269 30980
+29 30 64 6009
+29 31 64 6073
+29 32 64 6137
+29 33 64 6201
+29 34 64 6265
+29 35 64 6329
+29 36 64 6393
+29 37 64 6457
+29 38 19 1943
+29 39 19 1972
+29 40 269 28327
+29 41 269 28714
+29 42 269 29101
+29 43 269 29488
+29 44 269 29875
+29 45 269 30262
+29 46 269 30649
+29 47 269 31036
+29 48 269 31423
+30 31 32 3107
+30 32 32 3139
+30 33 32 3171
+30 34 32 3203
+30 35 32 3235
+30 36 32 3267
+30 37 32 3299
+30 38 32 3331
+30 39 19 2001
+30 40 19 2030
+30 41 19 2059
+30 42 269 29544
+30 43 269 29931
+30 44 269 30318
+30 45 269 30705
+30 46 269 31092
+30 47 269 31479
+30 48 269 31866
+31 32 64 6419
+31 33 64 6483
+31 34 64 6547
+31 35 64 6611
+31 36 64 6675
+31 37 64 6739
+31 38 64 6803
+31 39 64 6867
+31 40 19 2059
+31 41 19 2088
+31 42 19 2117
+31 43 269 30374
+31 44 269 30761
+31 45 269 31148
+31 46 269 31535
+31 47 269 31922
+31 48 269 32309
+32 33 2 207
+32 34 2 209
+32 35 2 211
+32 36 2 213
+32 37 2 215
+32 38 2 217
+32 39 2 219
+32 40 2 221
+32 41 2 223
+32 42 19 2146
+32 43 19 2175
+32 44 1 116
+32 45 269 31591
+32 46 269 31978
+32 47 269 32365
+32 48 269 32752
+33 34 64 6829
+33 35 64 6893
+33 36 64 6957
+33 37 64 7021
+33 38 64 7085
+33 39 64 7149
+33 40 64 7213
+33 41 64 7277
+33 42 64 7341
+33 43 1 116
+33 44 19 2233
+33 45 19 2262
+33 46 269 32421
+33 47 269 32808
+33 48 269 33195
+34 35 32 3517
+34 36 32 3549
+34 37 32 3581
+34 38 32 3613
+34 39 32 3645
+34 40 32 3677
+34 41 32 3709
+34 42 32 3741
+34 43 32 3773
+34 44 19 2262
+34 45 19 2291
+34 46 19 2320
+34 47 269 33251
+34 48 269 33638
+35 36 64 7239
+35 37 64 7303
+35 38 64 7367
+35 39 64 7431
+35 40 64 7495
+35 41 64 7559
+35 42 64 7623
+35 43 64 7687
+35 44 64 7751
+35 45 64 7815
+35 46 19 2349
+35 47 19 2378
+35 48 19 2407
+36 37 16 1861
+36 38 16 1877
+36 39 16 1893
+36 40 16 1909
+36 41 16 1925
+36 42 16 1941
+36 43 16 1957
+36 44 16 1973
+36 45 16 1989
+36 46 16 2005
+36 47 19 2407
+36 48 19 2436
+37 38 64 7649
+37 39 64 7713
+37 40 64 7777
+37 41 64 7841
+37 42 64 7905
+37 43 64 7969
+37 44 64 8033
+37 45 64 8097
+37 46 64 8161
+37 47 64 8225
+37 48 19 2465
+38 39 32 3927
+38 40 32 3959
+38 41 32 3991
+38 42 32 4023
+38 43 32 4055
+38 44 32 4087
+38 45 32 4119
+38 46 32 4151
+38 47 32 4183
+38 48 32 4215
+39 40 64 8059
+39 41 64 8123
+39 42 64 8187
+39 43 64 8251
+39 44 64 8315
+39 45 64 8379
+39 46 64 8443
+39 47 64 8507
+39 48 64 8571
+40 41 8 1033
+40 42 8 1041
+40 43 8 1049
+40 44 8 1057
+40 45 8 1065
+40 46 8 1073
+40 47 8 1081
+40 48 8 1089
+41 42 64 8469
+41 43 64 8533
+41 44 64 8597
+41 45 64 8661
+41 46 64 8725
+41 47 64 8789
+41 48 64 8853
+42 43 32 4337
+42 44 32 4369
+42 45 32 4401
+42 46 32 4433
+42 47 32 4465
+42 48 32 4497
+43 44 64 8879
+43 45 64 8943
+43 46 64 9007
+43 47 64 9071
+43 48 64 9135
+44 45 16 2271
+44 46 16 2287
+44 47 16 2303
+44 48 16 2319
+45 46 64 9289
+45 47 64 9353
+45 48 64 9417
+46 47 32 4747
+46 48 32 4779
+47 48 64 9699
diff --git a/tests/etalon-tauabc.txt b/tests/etalon-tauabc.txt
new file mode 100644
--- /dev/null
+++ b/tests/etalon-tauabc.txt
@@ -0,0 +1,966 @@
+1 2 2 333 1025
+1 2 3 2293 8301
+1 3 3 669 2818
+1 5 5 150509 973242
+1 5 6 269 1896
+1 6 6 56101 423967
+1 6 7 2516635 20403699
+1 7 7 75 649
+1 8 8 15 146
+1 8 9 223719847217121 2297589826762495
+1 9 9 23153746 250203427
+1 9 10 275869 3128113
+1 10 11 1771 21955
+1 11 11 13 168
+1 11 12 239355515695 3218484590334
+1 12 12 247 3450
+1 13 13 1819 27324
+1 13 14 1819 28336
+1 15 16 31868239 561675913
+1 16 16 93607 1698654
+1 16 17 14299 266933
+1 18 18 5688630024 115054218641
+1 18 19 37163 770843
+1 19 19 122549345354977673 2605376534034571879
+2 3 3 743 3920
+2 3 4 10133 57826
+2 3 5 333 2050
+2 4 4 333 2050
+2 4 5 4586 30437
+2 4 6 2293 16602
+2 5 5 2293 16602
+2 5 6 218024379851983 1708497349336974
+2 5 7 669 5636
+2 6 6 669 5636
+2 6 7 2024 18255
+2 7 8 29715356 301794587
+2 8 9 625865993 7060780333
+2 9 10 2188287086 27107872927
+2 9 11 150509 1946484
+2 10 10 150509 1946484
+2 10 11 269 3634
+2 10 12 269 3792
+2 11 11 269 3792
+2 11 12 269 3950
+2 11 13 56101 847934
+2 12 12 56101 847934
+2 12 14 2516635 40807398
+2 13 13 2516635 40807398
+2 13 14 1035509 17356160
+2 13 15 75 1298
+2 14 14 75 1298
+2 14 15 48968995 874112298
+2 15 17 15 292
+2 16 16 15 292
+2 16 17 4727 94605
+2 16 18 223719847217121 4595179653524990
+2 17 17 223719847217121 4595179653524990
+2 17 18 13 274
+2 17 19 11576873 250203427
+2 18 18 11576873 250203427
+2 18 19 4981 110308
+2 18 20 275869 6256226
+2 19 19 275869 6256226
+2 19 20 901 20911
+3 4 4 92 679
+3 4 5 743 5880
+3 4 7 1283 11207
+3 5 6 1283 11207
+3 5 7 111 1025
+3 5 8 43 416
+3 6 6 111 1025
+3 6 7 43 416
+3 6 8 4586 47039
+3 6 9 2293 24903
+3 7 7 4586 47039
+3 7 8 2293 24903
+3 7 9 16051 183882
+3 7 10 1409 16979
+3 8 8 16051 183882
+3 8 9 1409 16979
+3 8 10 223 2818
+3 8 11 92 1217
+3 9 9 223 2818
+3 9 10 92 1217
+3 9 11 24763 341579
+3 10 10 24763 341579
+3 10 12 6213 92875
+3 10 13 27 419
+3 11 11 6213 92875
+3 11 12 27 419
+3 11 14 53 882
+3 12 13 53 882
+3 13 15 558902993342 10231819156675
+3 14 14 558902993342 10231819156675
+3 14 16 150509 2919726
+3 14 17 269 5372
+3 15 15 150509 2919726
+3 15 16 269 5372
+3 15 17 269 5530
+3 15 18 269 5688
+3 16 16 269 5530
+3 16 17 269 5688
+3 16 18 269 5846
+3 16 19 103 2280
+3 17 17 269 5846
+3 17 18 103 2280
+3 17 19 56101 1271901
+3 18 18 56101 1271901
+3 18 21 2516635 61211097
+3 19 20 2516635 61211097
+3 19 21 5832435759679 145047841602167
+4 5 6 1012 10185
+4 5 7 743 7840
+4 5 8 2293 25262
+4 5 9 10133 115652
+4 6 6 743 7840
+4 6 7 2293 25262
+4 6 8 10133 115652
+4 6 9 4 47
+4 6 10 333 4100
+4 7 7 10133 115652
+4 7 8 4 47
+4 7 9 333 4100
+4 7 10 43 546
+4 7 11 2293 30437
+4 8 8 333 4100
+4 8 9 43 546
+4 8 10 2293 30437
+4 8 11 4586 63641
+4 8 12 2293 33204
+4 9 9 2293 30437
+4 9 10 4586 63641
+4 9 11 2293 33204
+4 9 12 3093 46625
+4 9 13 218024379851983 3416994698673948
+4 10 10 2293 33204
+4 10 11 3093 46625
+4 10 12 218024379851983 3416994698673948
+4 10 13 11888 193347
+4 10 14 669 11272
+4 11 11 218024379851983 3416994698673948
+4 11 12 11888 193347
+4 11 13 669 11272
+4 11 14 2024 35293
+4 11 15 1012 18255
+4 12 12 669 11272
+4 12 13 2024 35293
+4 12 14 1012 18255
+4 13 13 1012 18255
+4 13 17 14857678 301794587
+4 14 16 14857678 301794587
+4 14 17 7763609 162102436
+4 15 15 14857678 301794587
+4 15 16 7763609 162102436
+4 15 18 1249 27491
+4 15 19 625865993 14121560666
+4 16 17 1249 27491
+4 16 18 625865993 14121560666
+4 16 19 11517061 266291661
+4 17 17 625865993 14121560666
+4 17 18 11517061 266291661
+4 17 21 1094143543 27107872927
+4 18 20 1094143543 27107872927
+4 18 22 150509 3892968
+4 19 19 1094143543 27107872927
+4 19 21 150509 3892968
+4 19 22 269 7110
+4 19 23 269 7268
+5 6 6 15979 183584
+5 6 7 56902130353 688811679299
+5 6 8 77 974
+5 6 9 743 9800
+5 6 10 77 1051
+5 7 7 77 974
+5 7 8 743 9800
+5 7 9 77 1051
+5 7 11 455217042824 6575189113303
+5 7 12 111 1640
+5 8 8 77 1051
+5 8 10 455217042824 6575189113303
+5 8 11 111 1640
+5 8 12 333 5125
+5 8 13 333 5330
+5 9 9 455217042824 6575189113303
+5 9 10 111 1640
+5 9 11 333 5125
+5 9 12 333 5330
+5 9 13 4586 74709
+5 9 14 2293 38738
+5 10 10 333 5125
+5 10 11 333 5330
+5 10 12 4586 74709
+5 10 13 2293 38738
+5 10 14 4586 80243
+5 10 15 2293 41505
+5 11 11 4586 74709
+5 11 12 2293 38738
+5 11 13 4586 80243
+5 11 14 2293 41505
+5 11 15 3093 57815
+5 11 16 37131637 716380913
+5 12 12 4586 80243
+5 12 13 2293 41505
+5 12 14 3093 57815
+5 12 15 37131637 716380913
+5 13 13 3093 57815
+5 13 14 37131637 716380913
+5 13 17 669 14090
+5 13 18 506 10953
+5 14 16 669 14090
+5 14 17 506 10953
+5 14 18 2024 45029
+5 15 15 669 14090
+5 15 16 506 10953
+5 15 17 2024 45029
+5 16 16 2024 45029
+5 16 21 67 1682
+5 17 20 67 1682
+5 17 22 589495295338445 15468933279703773
+5 18 19 67 1682
+5 18 21 589495295338445 15468933279703773
+5 18 23 1249 34178
+5 19 20 589495295338445 15468933279703773
+5 19 22 1249 34178
+6 7 7 1249 16910
+6 7 9 46 679
+6 7 11 743 11760
+6 8 8 46 679
+6 8 10 743 11760
+6 8 13 10133 173478
+6 8 14 1283 22414
+6 9 9 743 11760
+6 9 12 10133 173478
+6 9 13 1283 22414
+6 9 14 333 5945
+6 9 15 111 2050
+6 10 11 10133 173478
+6 10 12 1283 22414
+6 10 13 333 5945
+6 10 14 111 2050
+6 10 15 333 6355
+6 10 16 43 832
+6 11 11 1283 22414
+6 11 12 333 5945
+6 11 13 111 2050
+6 11 14 333 6355
+6 11 15 43 832
+6 11 16 4586 91311
+6 11 17 2293 47039
+6 12 12 111 2050
+6 12 13 333 6355
+6 12 14 43 832
+6 12 15 4586 91311
+6 12 16 2293 47039
+6 12 17 4586 96845
+6 12 18 2293 49806
+6 13 13 43 832
+6 13 14 4586 91311
+6 13 15 2293 47039
+6 13 16 4586 96845
+6 13 17 2293 49806
+6 13 18 4586 102379
+6 13 19 16051 367764
+6 14 14 2293 47039
+6 14 15 4586 96845
+6 14 16 2293 49806
+6 14 17 4586 102379
+6 14 18 16051 367764
+6 14 19 218024379851983 5125492048010922
+6 14 20 1409 33958
+6 15 15 2293 49806
+6 15 16 4586 102379
+6 15 17 16051 367764
+6 15 18 218024379851983 5125492048010922
+6 15 19 1409 33958
+6 15 21 223 5636
+6 16 16 16051 367764
+6 16 17 218024379851983 5125492048010922
+6 16 18 1409 33958
+6 16 20 223 5636
+6 16 21 2024 52331
+6 16 22 46 1217
+6 17 17 1409 33958
+6 17 19 223 5636
+6 17 20 2024 52331
+6 17 21 46 1217
+6 17 22 2024 54765
+6 17 23 24763 683158
+6 18 18 223 5636
+6 18 19 2024 52331
+6 18 20 46 1217
+6 18 21 2024 54765
+6 18 22 24763 683158
+6 19 19 46 1217
+6 19 20 2024 54765
+6 19 21 24763 683158
+6 19 24 40 1173
+6 19 25 6213 185750
+7 8 8 2498 38893
+7 8 9 219685 3562653
+7 8 11 506 8827
+7 8 12 68074509 1220899433
+7 8 13 743 13720
+7 8 14 68074509 1288973942
+7 9 10 506 8827
+7 9 11 68074509 1220899433
+7 9 12 743 13720
+7 9 13 68074509 1288973942
+7 9 16 4919 99200
+7 10 10 68074509 1220899433
+7 10 11 743 13720
+7 10 12 68074509 1288973942
+7 10 15 4919 99200
+7 10 17 333 6970
+7 11 11 68074509 1288973942
+7 11 14 4919 99200
+7 11 16 333 6970
+7 11 17 333 7175
+7 11 18 37 820
+7 12 13 4919 99200
+7 12 15 333 6970
+7 12 16 333 7175
+7 12 17 37 820
+7 12 18 43 962
+7 12 19 2293 52573
+7 13 14 333 6970
+7 13 15 333 7175
+7 13 16 37 820
+7 13 17 43 962
+7 13 18 2293 52573
+7 13 19 4586 107913
+7 13 20 2293 55340
+7 14 14 333 7175
+7 14 15 37 820
+7 14 16 43 962
+7 14 17 2293 52573
+7 14 18 4586 107913
+7 14 19 2293 55340
+7 14 20 4586 113447
+7 14 21 2293 58107
+7 15 15 43 962
+7 15 16 2293 52573
+7 15 17 4586 107913
+7 15 18 2293 55340
+7 15 19 4586 113447
+7 15 20 2293 58107
+7 15 21 4586 118981
+7 15 22 4270734388451 113305440473083
+7 16 16 4586 107913
+7 16 17 2293 55340
+7 16 18 4586 113447
+7 16 19 2293 58107
+7 16 20 4586 118981
+7 16 21 4270734388451 113305440473083
+7 16 23 1832403 50801398
+7 17 17 4586 113447
+7 17 18 2293 58107
+7 17 19 4586 118981
+7 17 20 4270734388451 113305440473083
+7 17 22 1832403 50801398
+7 17 23 12908791557077 365492880716212
+7 17 24 2113 61068
+7 18 18 4586 118981
+7 18 19 4270734388451 113305440473083
+7 18 21 1832403 50801398
+7 18 22 12908791557077 365492880716212
+7 18 23 2113 61068
+7 18 24 669 19726
+7 19 20 1832403 50801398
+7 19 21 12908791557077 365492880716212
+7 19 22 2113 61068
+7 19 23 669 19726
+7 19 25 2024 62067
+7 19 26 506 15821
+8 9 9 1249 21983
+8 9 10 18395 335664
+8 9 13 506 10185
+8 9 14 47 967
+8 9 15 743 15680
+8 9 16 47 1014
+8 9 17 2293 50524
+8 10 12 506 10185
+8 10 13 47 967
+8 10 14 743 15680
+8 10 15 47 1014
+8 10 16 2293 50524
+8 10 17 21499 482368
+8 10 18 10133 231304
+8 11 11 506 10185
+8 11 12 47 967
+8 11 13 743 15680
+8 11 14 47 1014
+8 11 15 2293 50524
+8 11 16 21499 482368
+8 11 17 10133 231304
+8 11 19 2 47
+8 12 12 743 15680
+8 12 13 47 1014
+8 12 14 2293 50524
+8 12 15 21499 482368
+8 12 16 10133 231304
+8 12 18 2 47
+8 12 19 111 2665
+8 12 20 333 8200
+8 13 13 2293 50524
+8 13 14 21499 482368
+8 13 15 10133 231304
+8 13 17 2 47
+8 13 18 111 2665
+8 13 19 333 8200
+8 13 20 333 8405
+8 13 21 43 1092
+8 14 14 10133 231304
+8 14 16 2 47
+8 14 17 111 2665
+8 14 18 333 8200
+8 14 19 333 8405
+8 14 20 43 1092
+8 14 21 1 26
+8 14 22 2293 60874
+8 15 15 2 47
+8 15 16 111 2665
+8 15 17 333 8200
+8 15 18 333 8405
+8 15 19 43 1092
+8 15 20 1 26
+8 15 21 2293 60874
+8 15 22 4586 124515
+8 15 23 2293 63641
+8 16 16 333 8200
+8 16 17 333 8405
+8 16 18 43 1092
+8 16 19 1 26
+8 16 20 2293 60874
+8 16 21 4586 124515
+8 16 22 2293 63641
+8 16 23 4586 130049
+8 16 24 2293 66408
+8 17 17 43 1092
+8 17 18 1 26
+8 17 19 2293 60874
+8 17 20 4586 124515
+8 17 21 2293 63641
+8 17 22 4586 130049
+8 17 23 2293 66408
+8 17 24 4586 135583
+8 17 25 3093 93250
+8 18 18 2293 60874
+8 18 19 4586 124515
+8 18 20 2293 63641
+8 18 21 4586 130049
+8 18 22 2293 66408
+8 18 23 4586 135583
+8 18 24 3093 93250
+8 18 26 218024379851983 6833989397347896
+8 19 19 2293 63641
+8 19 20 4586 130049
+8 19 21 2293 66408
+8 19 22 4586 135583
+8 19 23 3093 93250
+8 19 25 218024379851983 6833989397347896
+8 19 27 5944 193347
+9 10 10 2498 49039
+9 10 11 1249 25365
+9 10 14 92 2037
+9 10 15 3 68
+9 10 16 106699 2476870
+9 10 17 743 17640
+9 10 18 106699 2583569
+9 11 13 92 2037
+9 11 14 3 68
+9 11 15 106699 2476870
+9 11 16 743 17640
+9 11 17 106699 2583569
+9 12 12 92 2037
+9 12 13 3 68
+9 12 14 106699 2476870
+9 12 15 743 17640
+9 12 16 106699 2583569
+9 12 21 1283 33621
+9 13 13 106699 2476870
+9 13 14 743 17640
+9 13 15 106699 2583569
+9 13 20 1283 33621
+9 13 22 333 9020
+9 14 14 106699 2583569
+9 14 19 1283 33621
+9 14 21 333 9020
+9 14 22 37 1025
+9 14 23 333 9430
+9 15 18 1283 33621
+9 15 20 333 9020
+9 15 21 37 1025
+9 15 22 333 9430
+9 15 23 43 1222
+9 15 24 43 1248
+9 16 17 1283 33621
+9 16 19 333 9020
+9 16 20 37 1025
+9 16 21 333 9430
+9 16 22 43 1222
+9 16 23 43 1248
+9 16 24 4586 135583
+9 16 25 2293 69175
+9 17 18 333 9020
+9 17 19 37 1025
+9 17 20 333 9430
+9 17 21 43 1222
+9 17 22 43 1248
+9 17 23 4586 135583
+9 17 24 2293 69175
+9 17 25 4586 141117
+9 17 26 2293 71942
+9 18 18 37 1025
+9 18 19 333 9430
+9 18 20 43 1222
+9 18 21 43 1248
+9 18 22 4586 135583
+9 18 23 2293 69175
+9 18 24 4586 141117
+9 18 25 2293 71942
+9 18 26 4586 146651
+9 18 27 2293 74709
+9 19 19 43 1222
+9 19 20 43 1248
+9 19 21 4586 135583
+9 19 22 2293 69175
+9 19 23 4586 141117
+9 19 24 2293 71942
+9 19 25 4586 146651
+9 19 26 2293 74709
+9 19 27 4586 152185
+9 19 28 3093 104440
+10 11 11 1249 27056
+10 11 12 2498 55803
+10 11 13 15979 367168
+10 11 15 56902130353 1377623358598
+10 11 16 1012 25123
+10 11 17 77 1948
+10 11 19 743 19600
+10 11 21 77 2102
+10 12 12 15979 367168
+10 12 14 56902130353 1377623358598
+10 12 15 1012 25123
+10 12 16 77 1948
+10 12 18 743 19600
+10 12 20 77 2102
+10 13 13 56902130353 1377623358598
+10 13 14 1012 25123
+10 13 15 77 1948
+10 13 17 743 19600
+10 13 19 77 2102
+10 13 22 10133 289130
+10 13 23 227608521412 6575189113303
+10 14 14 77 1948
+10 14 16 743 19600
+10 14 18 77 2102
+10 14 21 10133 289130
+10 14 22 227608521412 6575189113303
+10 14 23 1494957 43689865
+10 14 24 111 3280
+10 15 15 743 19600
+10 15 17 77 2102
+10 15 20 10133 289130
+10 15 21 227608521412 6575189113303
+10 15 22 1494957 43689865
+10 15 23 111 3280
+10 15 24 333 10045
+10 15 25 333 10250
+10 16 16 77 2102
+10 16 19 10133 289130
+10 16 20 227608521412 6575189113303
+10 16 21 1494957 43689865
+10 16 22 111 3280
+10 16 23 333 10045
+10 16 24 333 10250
+10 16 25 111 3485
+10 16 26 333 10660
+10 17 18 10133 289130
+10 17 19 227608521412 6575189113303
+10 17 20 1494957 43689865
+10 17 21 111 3280
+10 17 22 333 10045
+10 17 23 333 10250
+10 17 24 111 3485
+10 17 25 333 10660
+10 17 26 43 1378
+10 17 27 2293 74709
+10 18 18 227608521412 6575189113303
+10 18 19 1494957 43689865
+10 18 20 111 3280
+10 18 21 333 10045
+10 18 22 333 10250
+10 18 23 111 3485
+10 18 24 333 10660
+10 18 25 43 1378
+10 18 26 2293 74709
+10 18 27 4586 152185
+10 18 28 2293 77476
+10 19 19 111 3280
+10 19 20 333 10045
+10 19 21 333 10250
+10 19 22 111 3485
+10 19 23 333 10660
+10 19 24 43 1378
+10 19 25 2293 74709
+10 19 26 4586 152185
+10 19 27 2293 77476
+10 19 28 4586 157719
+10 19 29 2293 80243
+11 12 12 2498 59185
+11 12 13 1249 30438
+11 12 14 18395 459984
+11 12 15 3 77
+11 12 16 791 20787
+11 12 17 1771 47560
+11 12 18 1012 27839
+11 12 19 211021 5896571
+11 12 21 743 21560
+11 12 23 211021 6318613
+11 13 13 18395 459984
+11 13 14 3 77
+11 13 15 791 20787
+11 13 16 1771 47560
+11 13 17 1012 27839
+11 13 18 211021 5896571
+11 13 20 743 21560
+11 13 22 211021 6318613
+11 14 14 791 20787
+11 14 15 1771 47560
+11 14 16 1012 27839
+11 14 17 211021 5896571
+11 14 19 743 21560
+11 14 21 211021 6318613
+11 14 25 44950934202285 1418801946268517
+11 15 15 1012 27839
+11 15 16 211021 5896571
+11 15 18 743 21560
+11 15 20 211021 6318613
+11 15 24 44950934202285 1418801946268517
+11 15 25 12 383
+11 16 17 743 21560
+11 16 19 211021 6318613
+11 16 23 44950934202285 1418801946268517
+11 16 24 12 383
+11 16 26 333 10865
+11 16 27 37 1230
+11 17 18 211021 6318613
+11 17 22 44950934202285 1418801946268517
+11 17 23 12 383
+11 17 25 333 10865
+11 17 26 37 1230
+11 17 27 333 11275
+11 17 28 333 11480
+11 18 21 44950934202285 1418801946268517
+11 18 22 12 383
+11 18 24 333 10865
+11 18 25 37 1230
+11 18 26 333 11275
+11 18 27 333 11480
+11 18 28 111 3895
+11 18 29 43 1508
+11 19 20 44950934202285 1418801946268517
+11 19 21 12 383
+11 19 23 333 10865
+11 19 24 37 1230
+11 19 25 333 11275
+11 19 26 333 11480
+11 19 27 111 3895
+11 19 28 43 1508
+11 19 29 43 1534
+11 19 30 2293 83010
+12 13 13 1249 32129
+12 13 14 2498 65949
+12 13 15 1249 33820
+12 13 16 1937 53668
+12 13 19 23 679
+12 13 20 1012 30555
+12 13 22 619 19270
+12 13 23 743 23520
+12 13 24 619 19889
+12 14 14 1249 33820
+12 14 15 1937 53668
+12 14 18 23 679
+12 14 19 1012 30555
+12 14 21 619 19270
+12 14 22 743 23520
+12 14 23 619 19889
+12 14 25 2293 75786
+12 15 17 23 679
+12 15 18 1012 30555
+12 15 20 619 19270
+12 15 21 743 23520
+12 15 22 619 19889
+12 15 24 2293 75786
+12 15 26 70188 2376259
+12 15 27 10133 346956
+12 16 16 23 679
+12 16 17 1012 30555
+12 16 19 619 19270
+12 16 20 743 23520
+12 16 21 619 19889
+12 16 23 2293 75786
+12 16 25 70188 2376259
+12 16 26 10133 346956
+12 16 28 1283 44828
+12 17 18 619 19270
+12 17 19 743 23520
+12 17 20 619 19889
+12 17 22 2293 75786
+12 17 24 70188 2376259
+12 17 25 10133 346956
+12 17 27 1283 44828
+12 17 28 4 141
+12 17 29 333 11890
+12 18 18 743 23520
+12 18 19 619 19889
+12 18 21 2293 75786
+12 18 23 70188 2376259
+12 18 24 10133 346956
+12 18 26 1283 44828
+12 18 27 4 141
+12 18 28 333 11890
+12 18 29 333 12095
+12 18 30 111 4100
+12 19 20 2293 75786
+12 19 22 70188 2376259
+12 19 23 10133 346956
+12 19 25 1283 44828
+12 19 26 4 141
+12 19 27 333 11890
+12 19 28 333 12095
+12 19 29 111 4100
+12 19 30 333 12505
+12 19 31 333 12710
+13 14 14 2498 69331
+13 14 15 1249 35511
+13 14 16 2498 72713
+13 14 17 18395 547008
+13 14 18 1036934989772687 31514657264458393
+13 14 19 6213 192694
+13 14 21 253 8148
+13 14 22 3 98
+13 14 23 35 1163
+13 14 24 62327 2104723
+13 14 25 743 25480
+13 14 26 62327 2167050
+13 14 27 35 1233
+13 15 15 2498 72713
+13 15 16 18395 547008
+13 15 17 1036934989772687 31514657264458393
+13 15 18 6213 192694
+13 15 20 253 8148
+13 15 21 3 98
+13 15 22 35 1163
+13 15 23 62327 2104723
+13 15 24 743 25480
+13 15 25 62327 2167050
+13 15 26 35 1233
+13 15 28 3886795819 140271950650
+13 16 16 1036934989772687 31514657264458393
+13 16 17 6213 192694
+13 16 19 253 8148
+13 16 20 3 98
+13 16 21 35 1163
+13 16 22 62327 2104723
+13 16 23 743 25480
+13 16 24 62327 2167050
+13 16 25 35 1233
+13 16 27 3886795819 140271950650
+13 17 18 253 8148
+13 17 19 3 98
+13 17 20 35 1163
+13 17 21 62327 2104723
+13 17 22 743 25480
+13 17 23 62327 2167050
+13 17 24 35 1233
+13 17 26 3886795819 140271950650
+13 17 30 8 301
+13 18 18 3 98
+13 18 19 35 1163
+13 18 20 62327 2104723
+13 18 21 743 25480
+13 18 22 62327 2167050
+13 18 23 35 1233
+13 18 25 3886795819 140271950650
+13 18 29 8 301
+13 19 19 62327 2104723
+13 19 20 743 25480
+13 19 21 62327 2167050
+13 19 22 35 1233
+13 19 24 3886795819 140271950650
+13 19 28 8 301
+13 19 31 37 1435
+13 19 32 333 13120
+14 15 15 1249 37202
+14 15 16 2498 76095
+14 15 17 1249 38893
+14 15 18 2498 79477
+14 15 19 219685 7125306
+14 15 22 325085403505815839 11127317648113160278
+14 15 23 253 8827
+14 15 24 3 106
+14 15 25 68074509 2441798866
+14 15 27 743 27440
+14 15 29 68074509 2577947884
+14 16 16 1249 38893
+14 16 17 2498 79477
+14 16 18 219685 7125306
+14 16 21 325085403505815839 11127317648113160278
+14 16 22 253 8827
+14 16 23 3 106
+14 16 24 68074509 2441798866
+14 16 26 743 27440
+14 16 28 68074509 2577947884
+14 16 29 1819951438032391 69706840889366278
+14 17 17 219685 7125306
+14 17 20 325085403505815839 11127317648113160278
+14 17 21 253 8827
+14 17 22 3 106
+14 17 23 68074509 2441798866
+14 17 25 743 27440
+14 17 27 68074509 2577947884
+14 17 28 1819951438032391 69706840889366278
+14 18 19 325085403505815839 11127317648113160278
+14 18 20 253 8827
+14 18 21 3 106
+14 18 22 68074509 2441798866
+14 18 24 743 27440
+14 18 26 68074509 2577947884
+14 18 27 1819951438032391 69706840889366278
+14 18 31 10133 404782
+14 18 32 4919 198400
+14 19 19 253 8827
+14 19 20 3 106
+14 19 21 68074509 2441798866
+14 19 23 743 27440
+14 19 25 68074509 2577947884
+14 19 26 1819951438032391 69706840889366278
+14 19 30 10133 404782
+14 19 31 4919 198400
+14 19 32 878740 35722659
+15 16 16 2498 79477
+15 16 17 1249 40584
+15 16 18 2498 82859
+15 16 19 1249 42275
+15 16 20 15979 550752
+15 16 21 689201 24202607
+15 16 22 6213 222017
+15 16 23 56902130353 2066435037897
+15 16 24 92 3395
+15 16 25 253 9506
+15 16 26 77 2922
+15 16 27 7113 273919
+15 16 29 743 29400
+15 16 31 7113 288145
+15 17 17 2498 82859
+15 17 18 1249 42275
+15 17 19 15979 550752
+15 17 20 689201 24202607
+15 17 21 6213 222017
+15 17 22 56902130353 2066435037897
+15 17 23 92 3395
+15 17 24 253 9506
+15 17 25 77 2922
+15 17 26 7113 273919
+15 17 28 743 29400
+15 17 30 7113 288145
+15 17 31 77 3153
+15 18 18 15979 550752
+15 18 19 689201 24202607
+15 18 20 6213 222017
+15 18 21 56902130353 2066435037897
+15 18 22 92 3395
+15 18 23 253 9506
+15 18 24 77 2922
+15 18 25 7113 273919
+15 18 27 743 29400
+15 18 29 7113 288145
+15 18 30 77 3153
+15 19 19 6213 222017
+15 19 20 56902130353 2066435037897
+15 19 21 92 3395
+15 19 22 253 9506
+15 19 23 77 2922
+15 19 24 7113 273919
+15 19 26 743 29400
+15 19 28 7113 288145
+15 19 29 77 3153
+16 17 17 1249 42275
+16 17 18 2498 86241
+16 17 19 1249 43966
+16 17 20 2498 89623
+16 17 21 18395 671328
+16 17 26 1012 40061
+16 17 27 253 10185
+16 17 28 56225 2282333
+16 17 29 47 1934
+16 17 30 3170262089 132141422345
+16 17 31 743 31360
+16 17 32 3170262089 135311684434
+16 17 33 47 2028
+16 18 18 1249 43966
+16 18 19 2498 89623
+16 18 20 18395 671328
+16 18 25 1012 40061
+16 18 26 253 10185
+16 18 27 56225 2282333
+16 18 28 47 1934
+16 18 29 3170262089 132141422345
+16 18 30 743 31360
+16 18 31 3170262089 135311684434
+16 18 32 47 2028
+16 18 33 56225 2451008
+16 18 34 2293 101048
+16 19 19 18395 671328
+16 19 24 1012 40061
+16 19 25 253 10185
+16 19 26 56225 2282333
+16 19 27 47 1934
+16 19 28 3170262089 132141422345
+16 19 29 743 31360
+16 19 30 3170262089 135311684434
+16 19 31 47 2028
+16 19 32 56225 2451008
+16 19 33 2293 101048
+16 19 34 326645851 14519806250
+16 19 35 21499 964736
+17 18 18 2498 89623
+17 18 19 1249 45657
+17 18 20 2498 93005
+17 18 21 1249 47348
+17 18 22 2498 96387
+17 18 23 1439 56405
+17 18 24 599 23865
+17 18 25 2071 83780
+17 18 28 1012 42777
+17 18 29 3 128
+17 18 31 6815 298452
+17 18 33 743 33320
+17 19 19 2498 93005
+17 19 20 1249 47348
+17 19 21 2498 96387
+17 19 22 1439 56405
+17 19 23 599 23865
+17 19 24 2071 83780
+17 19 27 1012 42777
+17 19 28 3 128
+17 19 30 6815 298452
+17 19 32 743 33320
+17 19 35 16051 742163
+17 19 36 2293 106992
+18 19 19 1249 47348
+18 19 20 2498 96387
+18 19 21 1249 49039
+18 19 22 2498 99769
+18 19 23 1249 50730
+18 19 24 18395 758352
+18 19 29 46 2037
+18 19 30 1012 45493
+18 19 31 3 136
+18 19 33 106699 4953740
+18 19 34 6258413099 293873117617
+18 19 35 743 35280
+18 19 36 6258413099 300131530716
+18 19 37 106699 5167138
diff --git a/tests/etalon-zetaOnS.txt b/tests/etalon-zetaOnS.txt
new file mode 100644
--- /dev/null
+++ b/tests/etalon-zetaOnS.txt
@@ -0,0 +1,894 @@
+101 106 9210542615639205 1432875253204022774
+101 132 12093276003271 227788219785852
+101 138 223 3450
+101 140 23 336
+101 142 3141 44872
+101 144 1705 22752
+101 166 45075 404044
+101 168 47099 408912
+101 178 451061 3445368
+101 180 18001 134280
+10 19 15897 105146
+103 104 1801 1879982
+103 112 34961477 2780235885
+103 114 2545 158688
+103 138 13433441014093830750443840177663 225933938932347489300134610051186
+103 142 16174030823839 241111139555130
+103 144 1547 22752
+103 146 3363 46136
+103 156 71510732950909227809816265846391 790730200392651666134106160283736
+103 162 30152 300915
+103 170 46689 413780
+105 148 829 11692
+105 164 68302723 694398796
+105 172 46279 418648
+105 176 677195 5771744
+107 108 6362302118623 6948722511187650
+107 126 6405961 221944086
+107 148 601 8880
+107 150 3269 47400
+107 152 1769 24016
+107 160 223107970103 2561073739840
+107 176 47893 428384
+107 178 49917 433252
+109 140 656162865 13441576162
+109 144 175156824191 3138959104488
+109 146 54403 916442
+109 152 2243217531297392198517 31916765979576876078500
+109 154 3491 48664
+109 156 235 3081
+109 162 10282123 120159855
+109 180 49507 438120
+111 116 1 174
+111 136 80459885012751253442411723368973417208588487 2134362058821206290584928475054586893470746380
+111 154 1271 18480
+111 158 47 632
+111 164 8867 105452
+11 12 1481 112302
+11 14 3544509 76158670
+11 15 707703 11039050
+11 16 13 162
+11 17 14924 156145
+11 18 1 9
+11 19 103943 829008
+11 20 15423 110680
+11 21 8858 58107
+113 140 1730526841104691463289 43057123810665785054360
+113 146 9908 197319
+113 154 49310046338004123673455235199618887037217290071 771093564492191219151577850592347792761532423082
+113 156 209 3120
+113 158 43 632
+113 160 1833 25280
+113 164 1127847160046002206938 14150282143126497498907
+113 176 105245349227 1078121994576
+115 122 4634391223 562840218630
+115 124 496077 44999414
+115 154 28649 483329
+115 162 3619 51192
+115 164 243 3239
+117 136 695093367543639006093957 26773170960540871143525602
+117 148 3666241457290288 81370118576599513
+117 154 188852860101419 3441750981980850
+117 164 893 12956
+117 166 3841 52456
+117 172 57 688
+119 122 846980807038663 292100624718962034
+119 130 113079 8402290
+119 146 263493199536203115748864037663 6935392361502897193614931138186
+119 174 93731 1150140
+119 178 59685 684499
+119 180 227 2520
+121 128 523 67840
+121 144 23626297 754392036
+121 148 186679671254681167 5002508081890159612
+121 158 5398501748548991 102102579908422146
+121 162 60193 1016874
+121 166 252383261394160302634529632955 3839203422877840634510928999434
+121 168 29 420
+121 170 3747 53720
+121 172 251 3397
+12 17 781 10744
+12 23 19535 127282
+123 136 2213 141984
+123 148 5065 149776
+123 170 55 816
+123 172 925 13588
+123 176 2119 27808
+125 134 875579 87690270
+125 148 1136589275 37737598626
+125 158 6107596563827829050889680513 136108629520164028986786485222
+125 166 45397262569 794512660934
+125 174 4250739461 60922730838
+125 176 1961 27808
+125 178 4191 56248
+127 136 1 102
+127 140 17 1120
+127 142 129751936407331797 7238400231476713874
+127 164 44333 886584
+127 176 361 5280
+127 178 3875 56248
+127 180 259 3555
+129 160 6311899 156050960
+129 164 4935739265 106671534586
+129 178 1427 21360
+131 140 619957 65598670
+131 146 21598689499651 1247275852581046
+131 148 39879 1998296
+131 156 625 19968
+131 160 6664351 180124196
+131 166 123375 2713436
+13 14 930056291728075 86131034650507882
+13 16 13 336
+13 17 8782848001658494036891 164983975083330937057700
+13 18 49 720
+13 20 745417 7895680
+13 21 141814380293367034145076111 1319625357659765692126461374
+13 22 34462894030490579197 287493488567963085342
+13 24 19061 132816
+13 25 10677 69175
+133 156 115979 4148664
+133 160 2731 80960
+133 172 10489775111239825 207602349026713028
+135 152 235306597016132646186 12205380627567410387773
+137 146 34632364361216978372593 3859194757777237761976622
+137 152 192941645307029570639 11696825856111373377598
+137 164 5257 165968
+137 178 289163 5598812
+139 144 47300910119605 10735548280375286
+139 154 297428562076 18307027855655
+139 160 8667 363200
+139 180 421 8280
+141 170 2292 66895
+14 17 12241 342431
+14 19 561 8930
+14 23 3119 27991
+14 25 18587 138350
+14 27 433 2808
+143 148 140350767417 32906003028622
+143 152 7621 891765
+143 160 20055425788 1110603240265
+143 172 5859 174064
+143 178 3027 73336
+147 158 17572021 1681776806
+147 176 257 8096
+151 162 733 72414
+15 16 47 5150
+15 19 345272027 7607380170
+15 26 7881687332158312 62386002265082821
+15 28 22699 154952
+15 29 467 3016
+153 154 3569 5905438
+155 164 5427 695360
+155 166 1437927189487 146430143549506
+157 162 3521 922752
+157 166 907 118026
+157 170 299334341415631 25369053065480674
+157 172 1927232672772015825160642799332937599148483 137604884943049314435654357944440011537786962
+159 172 46385 3996936
+161 166 1333 358560
+161 178 11555 743328
+16 27 248792207830437092147 2088742160942844847587
+16 29 22225 160486
+16 31 501 3224
+163 172 1301290777 177329035838
+165 166 27887583 50286583682
+167 170 1 510
+17 18 1 126
+17 22 35253862811215 695466782309706
+17 24 271 3792
+17 25 1960957 23645375
+17 26 8278386755473 89110334913964
+17 28 7647 68152
+17 31 12022 85777
+17 32 26337 177088
+17 33 535 3432
+175 176 44976606361084912792135061 86617999042811308605386837302
+18 35 569 3640
+19 21 901 58464
+19 24 2007627252140449499 44901201575192280012
+19 27 1259 17064
+19 28 309613 3710224
+19 33 12029 94798
+19 34 25389 188156
+19 35 13841 96845
+19 36 29975 199224
+19 37 603 3848
+20 21 97 14910
+20 31 45113388387 468240353554
+20 33 4528 40161
+20 37 29501 204758
+20 39 49 312
+21 29 467 6960
+21 31 13 155
+21 37 187411 1432344
+21 38 29027 210292
+21 40 33613 221360
+21 41 671 4264
+22 23 255144569243609075772060817198981 43932526749072849662306705128861450
+22 31 1387 19592
+22 39 38567 290940
+22 41 33139 226894
+22 43 705 4472
+23 24 577 104814
+23 28 1795410163651 49474854757286
+23 30 32121 610630
+23 34 1771 21029
+23 38 10465 92492
+23 41 41023 305860
+23 42 32665 232428
+23 43 17479 118981
+23 44 37251 243496
+23 45 739 4680
+24 31 16793 335172
+24 43 32191 237962
+24 47 773 4888
+25 28 3095685801 169625414056
+25 34 164516243 2595491442
+25 36 547 7029
+25 38 1289 14117
+25 41 11067 99794
+25 43 7850528083131 63185647491542
+25 44 6822205 52259592
+25 46 36303 254564
+25 47 19298 130049
+25 48 40889 265632
+25 49 807 5096
+26 29 1573 90074
+26 37 1737 23384
+26 41 38464076341899338121 381149475193059339586
+26 43 5937 52331
+26 47 35829 260098
+26 49 40415 271166
+26 51 841 5304
+27 32 23081 760456
+27 37 2087 31894
+27 38 845 12008
+27 40 8293 97840
+27 41 11087 121852
+27 49 18824 135583
+27 50 39941 276700
+27 52 2 13
+27 53 875 5512
+28 31 1 62
+28 39 13438421 192121098
+28 45 2033 19170
+28 51 39467 282234
+28 53 44053 293302
+28 55 909 5720
+29 32 3912877755361904195 253483355901182923308
+29 36 4092506506 100682981595
+29 39 20692411 342467086
+29 40 1 15
+29 41 1865 25912
+29 44 5931 65384
+29 46 205081 2001184
+29 48 13283 116832
+29 49 88524837 741088838
+29 51 153481537 1177679454
+29 52 38993 287768
+29 53 20643 146651
+29 54 43579 298836
+29 55 22936 152185
+29 56 225 1456
+29 57 943 5928
+30 59 977 6136
+31 32 6502743956 1668409045349
+31 33 96348036499399 10961405924475378
+31 36 6426800419153152679 249538037115920074146
+31 39 13096284289053021879569878345 299340374583620159563482398742
+31 40 1 20
+31 43 709 10320
+31 44 255 3476
+31 45 1202215622439829057 15074300827295459325
+31 46 228282602626202145 2680437547589667163
+31 51 13885 124134
+31 52 1206782156626159 10268214942194404
+31 53 93041 759066
+31 55 10897 82060
+31 56 42631 309904
+31 57 22462 157719
+31 58 47217 320972
+31 59 24755 163253
+31 60 121 780
+31 61 1011 6344
+32 45 1993 28440
+32 53 7346 64501
+32 57 56941 425220
+32 59 46743 326506
+32 61 51329 337574
+32 63 1045 6552
+33 46 191228 2725247
+33 47 2215 29704
+33 49 991771 11622408
+33 50 20630139820074985890489 227857747492148193733150
+33 58 666650797 5121789084
+33 59 21988 163253
+33 61 24281 168787
+33 62 50855 343108
+33 64 259 1664
+33 65 83 520
+34 47 761 11280
+34 59 57842 456719
+34 61 45795 337574
+34 63 50381 348642
+34 65 54967 359710
+34 67 1113 6968
+3 5 1409 12170
+35 36 14399440459181 4279819492388934
+35 47 1130278510396691 18824907933438670
+35 58 16101 141172
+35 62 7652 57815
+35 64 49907 354176
+35 66 54493 365244
+35 67 28393 185389
+35 68 69 442
+35 69 1147 7176
+36 59 7948 71803
+36 65 49433 359710
+36 67 54019 370778
+36 71 1181 7384
+37 50 14201 230200
+37 51 1379975279400427 20587899165190714
+37 52 287 4108
+37 53 2565 33496
+37 56 9540345 105707392
+37 58 378923 3814718
+37 61 16703 148474
+37 62 238371 2033228
+37 63 724008412670854187 5957774348526525042
+37 66 8266 61545
+37 67 25626 185389
+37 68 53545 376312
+37 69 27919 190923
+37 70 58131 387380
+37 71 30212 196457
+37 72 293 1872
+37 73 1215 7592
+38 63 8755 76671
+38 65 57121 465465
+38 69 53071 381846
+38 71 57657 392914
+38 73 62243 403982
+38 75 1249 7800
+39 41 15237 2272097
+39 43 21 1376
+39 44 6417373 326001522
+39 55 2471 34760
+39 59 335 3717
+39 64 17305 155776
+39 70 52597 387380
+39 71 27445 196457
+39 73 29738 201991
+39 74 61769 409516
+39 76 155 988
+39 77 1283 8008
+40 43 24704297982891 2358009579577514
+40 57 2693 36024
+40 59 69548081850496431 831221420062648288
+40 69 1087 8694
+40 71 70403 529660
+40 73 56709 403982
+40 77 65881 426118
+40 79 1317 8216
+41 48 67 2432
+41 50 148613 4053200
+41 52 62523569 1368290170
+41 53 545 10812
+41 56 98443 1525104
+41 58 1323 18328
+41 62 703 7812
+41 67 830757549667 7503420200894
+41 68 18919 165512
+41 69 2938463 24820266
+41 70 15627 127820
+41 71 235876249157030738094379838482285933 1870823362662469677326742321268065250
+41 73 72859 544580
+41 74 56235 409516
+41 75 29264 207525
+41 76 60821 420584
+41 77 31557 213059
+41 78 65407 431652
+41 79 1265 8216
+41 80 327 2080
+41 81 1351 8424
+42 47 17 940
+42 53 33 742
+42 59 2599 37288
+42 79 64933 437186
+42 83 1385 8632
+43 48 40191287951 2281793268264
+43 61 2821 38552
+43 62 2855402319221082299708961 36547931805636723559501754
+43 64 11 128
+43 66 17085408499657 182127444712102
+43 69 49460585 468259392
+43 71 19521 172814
+43 73 3795089307 31436334706
+43 75 83651 653325
+43 76 2446426647413733 18572766566479870
+43 77 28790 213059
+43 78 59873 431652
+43 79 31083 218593
+43 80 64459 442720
+43 81 33376 224127
+43 82 69045 453788
+43 83 1333 8632
+43 84 43 273
+43 85 1419 8840
+44 61 1003 14640
+44 63 3043 39816
+44 67 671114894 7310753307
+44 69 7479017268963752068938 75213242591420145344129
+44 73 10164 88841
+44 79 59399 437186
+44 81 63985 448254
+44 83 68571 459322
+44 85 1367 8840
+44 87 1453 9048
+4 5 3 71
+45 52 147 5954
+45 56 175472195 4256446012
+45 59 116342939523199601753579613985931203966074251 2159021834056451937114354400723634832245315266
+45 62 34781534535803525 519841969978905278
+45 64 749 10112
+45 74 20123 180116
+45 77 1759 14322
+45 82 63511 453788
+45 83 32902 229661
+45 86 72683 475924
+45 88 361 2288
+45 89 1487 9256
+46 61 221365874683277 3899502162550850
+46 63 191 2926
+46 65 2949 41080
+46 83 63037 459322
+46 85 67623 470390
+46 87 72209 481458
+46 89 1435 9256
+47 48 598321 252029070
+47 50 38107671710464229 4388658895863272050
+47 52 1723 108576
+47 53 150169 7666662
+47 56 113 3584
+47 63 938935 15760374
+47 65 211 3120
+47 66 1451 20856
+47 67 3171 42344
+47 70 2682421224061 31153535189245
+47 77 20725 187418
+47 78 21737 189852
+47 80 28007 230640
+47 82 183033 1428604
+47 83 400072 3042697
+4 7 8379415 64974378
+47 84 62563 464856
+47 85 32428 235195
+47 86 67149 475924
+47 87 34721 240729
+47 88 71735 486992
+47 89 37014 246263
+47 90 76321 498060
+47 92 189 1196
+48 73 19849 216956
+48 79 10766 96143
+48 85 16773 126820
+48 89 71261 492526
+49 58 821 27318
+49 60 125398719724542785866626511 3338391723097516156574302820
+49 68 281 4080
+49 69 3077 43608
+49 74 22719055891720660 253346931347317211
+49 75 671269 7210200
+49 81 22339 197154
+49 87 86321 649020
+49 88 66201 486992
+49 89 34247 246263
+49 90 70787 498060
+49 92 75373 509128
+49 94 79959 520196
+49 96 395 2496
+50 63 364621540975444682275729 8265551600712043552057542
+50 69 123 1840
+50 71 3299 44872
+50 73 4965 61174
+50 83 11573 101011
+50 89 88777 663940
+51 100 103 650
+51 73 3521 46136
+51 89 99382 775279
+51 92 69839 509128
+51 94 74425 520196
+51 98 83597 542332
+52 55 285 37312
+52 73 3205 46136
+52 79 21399 234788
+52 87 924458759 7912152012
+52 89 78322 637329
+53 100 82649 553400
+53 102 87235 564468
+53 104 33 208
+53 57 1341925 127129494
+53 58 169812995 12311161722
+53 60 17971763 882191820
+53 61 8243 346175
+53 71 105911 1782668
+53 74 1579 23384
+53 75 3427 47400
+53 76 81817 1065064
+53 78 161270 1940289
+53 82 5055 52726
+53 87 23543 211758
+53 88 24555 214192
+53 94 23263 175310
+53 96 73477 531264
+53 98 78063 542332
+54 77 3649 48664
+54 85 16151 160820
+54 89 12175 108313
+55 102 81701 564468
+55 104 86287 575536
+55 106 849 5512
+55 108 223 1404
+55 56 1123427545062216 565611564035581049
+55 58 13 1798
+55 62 5569179011 285331871210
+55 63 693725650197475009937 30408617520822620835630
+55 67 191390785878573 5253767526509591
+55 68 285017604988267 7176412217389707
+55 71 38287 767652
+55 72 81071 1515312
+55 76 307 4560
+55 78 1801 24648
+55 81 286808 3443553
+55 86 2346 23779
+55 92 2765884768122378463233 23683599925238346328888
+55 96 214495 1672512
+55 98 24491 182770
+5 6 397 12144
+56 73 561137 10698004
+56 75 111701 1883100
+56 79 45 632
+56 85 22949 252620
+56 87 66173717325395 682567865540836
+57 104 80753 575536
+57 106 85339 586604
+57 110 883 5720
+57 112 463 2912
+5 7 303 4424
+57 58 3783 1989632
+57 61 619823778270139274276571 63965476645212965021681828
+57 64 80759 4311312
+57 79 1297 18960
+57 80 877 12640
+57 92 37917303 353599628
+57 94 25759 228796
+57 98 149566 1204861
+5 8 13 124
+58 67 3238763921 131555713236
+58 81 3461 51192
+58 83 3999 52456
+58 85 291488787466554383 3550708974195979020
+59 104 131825 1006512
+59 106 79805 586604
+59 108 84391 597672
+59 110 88977 608740
+59 112 93563 619808
+59 114 917 5928
+59 116 60 377
+5 9 3401 24903
+59 71 9733 287408
+59 76 26805242999153 540886845485098
+59 78 96815667381239908180769 1729454049788804599382070
+59 79 117491 1983532
+59 83 3683 52456
+59 84 247 3318
+59 98 27373 238532
+60 83 1349 19920
+61 100 26963 243400
+61 110 83443 608740
+61 112 88029 619808
+61 114 92615 630876
+61 116 97201 641944
+61 118 951 6136
+61 120 497 3120
+6 11 8621 60874
+61 70 10166596836337638083 438089841184784685722
+61 75 1 26
+61 80 5539055726094000736026139 102657160428359089756628920
+61 86 1929 27176
+61 87 4127 54984
+61 88 2846905482582555101 36380669292699633770
+62 77 62187791 1526018802
+62 87 3811 54984
+63 104 28577 253136
+63 110 245957 1916420
+63 116 91667 641944
+63 118 96253 653012
+63 122 985 6344
+63 124 257 1612
+63 65 8371 2221440
+63 71 498441 25604872
+63 80 321 6980
+63 88 941 13904
+63 89 4033 56248
+63 92 29905542970141575238893784401531587394962157 368178967925701239264834919541462278276372163
+64 67 1187 197114
+64 77 87 2576
+64 81 906986164713158724569 20072773435265702999622
+65 108 30191 262872
+65 116 58169 432680
+65 118 90719 653012
+65 122 99891 675148
+65 124 104477 686216
+65 126 1019 6552
+65 128 531 3328
+65 83 8521 179944
+65 84 7613 151368
+65 86 523240886858934225753843 9313275514522864597542914
+65 92 263 3634
+66 71 1278113937 120535456222
+66 73 9595 609696
+66 79 10117 319792
+67 104 8742581 90387232
+67 110 29781 267740
+67 116 2036177855 16157014296
+67 118 298583 2284008
+67 120 89771 664080
+67 122 94357 675148
+67 124 98943 686216
+67 126 103529 697284
+67 128 108115 708352
+67 130 81 520
+67 132 137 858
+6 7 224299 8379210
+67 69 38461225688834595868997083 10845713886039135532613596938
+67 70 649142507 113785918890
+67 74 2468307543367272909997626518347864592467 157950900276401786851381240979990475452746
+67 75 10093 556275
+67 94 2057 29704
+67 98 52867 647780
+68 81 1303 41472
+69 118 207283 1689996
+69 124 93409 686216
+69 128 102581 708352
+69 130 107167 719420
+69 134 1087 6968
+69 136 565 3536
+69 73 9611 1238080
+69 74 1037 103082
+69 83 11321 335984
+69 86 5787 139363
+69 88 59 1254
+69 98 2279 30968
+70 73 780289 144216902
+7 10 239 3160
+71 100 279 3950
+71 106 938078 10818413
+7 11 1 10
+71 118 33009 287212
+71 126 15611 117495
+71 128 97047 708352
+71 130 101633 719420
+71 132 106219 730488
+71 134 110805 741556
+71 136 115391 752624
+71 138 1121 7176
+71 140 291 1820
+7 12 233805 1895396
+7 13 5220 35971
+71 74 6091 1145002
+71 84 564645293396706901315 18859336899670066368954
+71 85 10911 344080
+71 98 787 11760
+72 89 1270954505533 32038484832316
+73 102 2185 32232
+73 104 1227 16432
+73 110 4094886911 45961338335
+73 118 113409 1053563
+73 120 32599 292080
+73 126 2217539 17713332
+73 130 649 4849
+73 132 100685 730488
+73 134 105271 741556
+73 136 109857 752624
+73 138 114443 763692
+73 140 119029 774760
+73 142 1155 7384
+73 144 599 3744
+73 74 19947 14035580
+73 77 150997030519567521 20769024486688463678
+73 81 46655 2825667
+73 84 22609 953400
+73 87 1409 44544
+73 88 7423951438 216884914895
+73 92 4007032497473115131650203 90728680101849187418453872
+74 89 12115 360272
+75 104 107 1560
+75 106 2407 33496
+75 118 43971 438370
+75 124 34213 301816
+75 128 28549 233728
+75 134 99737 741556
+75 136 104323 752624
+75 142 118081 785828
+75 146 1189 7592
+75 148 77 481
+75 83 11081 693216
+75 98 9374271 176739374
+77 108 295 4266
+77 118 453503 4855228
+77 120 1331983 13623024
+77 128 35827 311552
+77 138 103375 763692
+77 142 112547 785828
+77 144 117133 796896
+77 146 121719 807964
+77 148 126305 819032
+77 150 1223 7800
+77 152 633 3952
+77 78 310065899948556945711259 232254462528343272220640970
+77 92 4847459293929 150233216472058
+77 96 25915 622272
+7 8 349 15630
+79 102 45 901
+79 112 1291 17696
+79 118 227697731738749347 2622263140525281194
+79 120 16243 178320
+79 122 3887 40748
+79 126 3894456818741 37458472073904
+79 130 35417 316420
+79 132 3349901 28756200
+79 140 2767 20888
+79 142 107013 785828
+79 144 111599 796896
+79 146 116185 807964
+79 148 120771 819032
+79 150 125357 830100
+79 152 129943 841168
+79 154 1257 8008
+79 156 25 156
+7 9 39001 794718
+79 83 17233831 2608893682
+81 112 227 3360
+81 116 701 9164
+81 118 284908261789 3533725258137
+81 134 37031 326156
+81 140 14756090150676449 117520289793946180
+81 146 110651 807964
+81 148 115237 819032
+81 152 124409 841168
+81 154 128995 852236
+81 158 1291 8216
+81 160 667 4160
+8 15 12259 83010
+81 89 143628208391843 9848867188229114
+82 85 923563415606543683667 205593816862374004990490
+82 87 9512774402371595651 1153118171073255248826
+83 104 327108430398662879449117225 7641368101019751345198328793
+83 112 4856833521367002050433551689797519956852826137729 79220723384788890141402270840371148555585514231080
+83 116 311 4582
+83 118 2757 37288
+83 126 8509 93618
+83 132 1436179045987629556 13918192629634808031
+83 136 36621 331024
+83 138 38645 335892
+83 142 249685 2033724
+83 144 1964833 15521184
+83 148 74087 552040
+83 150 114289 830100
+83 152 118875 841168
+83 154 123461 852236
+83 156 128047 863304
+83 158 132633 874372
+83 160 641 4160
+83 162 1325 8424
+83 164 171 1066
+83 86 16762853 3783515218
+83 87 6499471702095844561311 1044182350361305138876738
+85 118 977 14160
+85 122 40139811361148520453740473 520937315226744763514201007
+85 152 113341 841168
+85 154 117927 852236
+85 156 122513 863304
+85 158 127099 874372
+85 162 136271 896508
+85 164 329 2132
+85 166 1359 8632
+85 168 701 4368
+85 94 6149 392544
+87 122 2663 38552
+87 124 733 9796
+87 154 25695707 194448716
+87 158 121565 874372
+87 160 126151 885440
+87 164 135323 907576
+87 166 139909 918644
+87 170 1393 8840
+87 172 359 2236
+87 88 702358923 606090887434
+89 104 1520537 56054310
+89 106 851 27136
+89 112 5791 132160
+89 126 2885 39816
+89 132 157204598359 1848531160344
+89 136 3563345729383 38447327517952
+89 140 4171 41608
+89 146 39439 355364
+89 148 41463 360232
+89 158 39181 294670
+89 160 120617 885440
+89 162 125203 896508
+89 164 129789 907576
+89 166 134375 918644
+89 168 138961 929712
+89 170 143547 940780
+89 172 173 1118
+89 174 1427 9048
+89 176 735 4576
+89 94 753 100768
+9 10 247 14740
+91 108 2009480924018213 65518380855328770
+91 120 1249806505744135995577 22585668753337155128580
+91 122 2898 48617
+91 128 1419 20224
+91 138 4642 51267
+91 146 1329539 12592354
+91 150 41053 365100
+91 160 81265263147697872907275791212241018708640569 623844120448361834836718828259604131400963360
+91 162 40409 302130
+91 164 124255 907576
+91 166 128841 918644
+91 170 138013 940780
+91 172 142599 951848
+91 174 147185 962916
+91 176 709 4576
+9 11 780793271153311884983664341 21016436699918950523107607876
+91 178 1461 9256
+91 180 94 585
+9 13 323639164143803956611 4119880849210379275087
+9 14 10603 108990
+9 16 7959 59680
+9 17 7039 47039
+93 118 44877045 979977374
+93 130 2791 41080
+93 136 73299 898960
+93 154 42667 374836
+93 160 1712967 13779520
+93 166 41637 309590
+93 170 132479 940780
+93 172 137065 951848
+93 176 146237 973984
+93 178 150823 985052
+95 112 7813 268212
+95 134 3013 42344
+95 136 1641 21488
+95 142 390465640939943913957 4487370651059355869741
+95 156 42257 379704
+95 158 44281 384572
+95 168 899953 6824202
+95 172 131531 951848
+95 174 136117 962916
+95 176 140703 973984
+95 178 145289 985052
+95 98 7419074710433830151 1953931347399288914930
+97 122 21892903537503429221957324895 501112498788984911962793920274
+97 126 106621103 2066659938
+97 134 1081 16080
+97 136 1483 21488
+97 138 3235 43608
+97 144 431671985413 5061846176616
+97 156 1580863 14880216
+97 160 43871 389440
+97 166 292087 2377452
+97 170 445711 3445220
+97 172 85093 641560
+97 174 130583 962916
+97 176 135169 973984
+97 178 139755 985052
+97 180 144341 996120
+99 118 957 30208
+99 140 797 11060
+99 152 14585 155344
+99 158 181 1738
+99 164 45485 399176
+99 178 134221 985052
