#
# Posets package: version 2.2.1, vanilla edition.
# This version/edition requires Maple V R1, R2, R3, R4, R5, or Maple 6 or 7.
# The plotting features require V R2 or later.
#
# This is *not* a Maple worksheet.
#
# After loading this file during a Maple session, each function in the
# package can be accessed using the calling sequence
#
#   posets[<functionname>](<arguments>).
#
# In order to use package functions in the abbreviated form
#
#   <functionname>(<arguments>),
#
# run the command 'withposets()' after loading this file. If there is a
# conflict between the names of one of these functions and another name
# in the same session, a warning is printed.
#
# In order to use the abbreviated form for a subset of the procedures in
# the package, run the command
#
#   withposets(<name1>,<name2>,...).
#
# For an introduction, see
#   http://www.math.lsa.umich.edu/~jrs/software/posets.ps
# For documentation on the individual functions, see
#   http://www.math.lsa.umich.edu/~jrs/software/posetshelp.html
#
# Copyright (c) 2002 by John R. Stembridge
#
#########################################################################
#
# The default choices for the edge and vertex colors used by 'plot_poset':
#
`posets/default`['ecolor']:='red':
`posets/default`['vcolor']:='white':
if `+`(0)=0 then  # in Maple >= V.4, plots have a white background
  `posets/default`['vcolor']:='black' fi:
#
posets:=table():
if signum(0)=0 then  #we are using Maple V.3 or later
  unprotect(`&*`,`&+`) fi;
#
# assign short names, printing warnings if conflicts occur.
#
withposets:=proc() local install,f,lpr;
  if [op(I)]<>[1] then lpr:=lprint else # maple6 has a broken lprint
    lpr:=proc(x,y) printf(`%0.70s\n`,cat(x,`  `,y)) end fi;
  install:=proc(x,wrn)
    if not assigned(posets[x]) then
      ERROR(cat(x,` is not a top level function in posets`))
    elif eval(x)<>eval(posets[x]) then
      if x='atomic' or x='W' or x='lattice' then unprotect(x) fi;
      if assigned(x) then wrn(`Warning: new definition for`,x) fi;
      assign(x,posets[x])
    fi; x
  end;
  if nargs>0 then map(install,[args],lpr) else
    f:=proc() map(op,[args]) end; # hack the names w/o full evaluation!
    map(install,f(indices(posets)),lpr)
  fi
end:
#
# J(P,X) returns the poset of order ideals of the poset P with vertex
#  set X. The result is naturally labeled, using vertices 1,2,...,m.
# J(P,n) does the same, assuming X={1,2,...,n}.
# J(P) does the same, assuming there are no isolated vertices.
#
`posets/J`:=proc() local n,P,i,j,X,anti,down,k,code,rk,q;
  if nargs=1 then X:=map(op,args[1])
    elif type(args[2],'integer') then X:=[$1..args[2]]
    else X:=args[2]
  fi;
  n:=nops(X); P:=subs({seq(X[i]=i,i=1..n)},args[1]);
  down:=posets['closure'](P,n,'table');
  P:={seq(seq([i,j],i=down[j]),j=1..n)};
  code:=proc(x,y) local ii,z;
    z:=map(op,{x,seq(y[ii],ii=x)});
    [nops(z),convert(map(w -> 2^(w-1),z),`+`)]
  end;
  anti:=map(code,posets['antichains'](P,n,true),down);
  rk:=taylor(convert([seq(q^j[1],j=anti)],`+`)/(1-q),q,n+1);
  rk:=[0,seq(coeff(rk,q,i),i=0..n)];
  anti:=sort([op(anti)], proc(x,y) if x[1]=y[1] then evalb(x[2]<y[2])
    else evalb(x[1]<y[1]) fi end);
  {seq(seq(seq(`posets/J/cover`([i,j],anti[j][2]-anti[i][2]),
    i=rk[k]+1..rk[k+1]),j=rk[k+1]+1..rk[k+2]),k=1..n)};
end:
#
`posets/J/cover`:=proc(e) local m;
  m:=args[2]; while m>1 and modp(m,2)=0 do m:=m/2 od;
  if m=1 then e fi
end:
#
# Lattices(n) returns a list of all nonisomorphic lattices on {1,...,n}.
#  The lattices are naturally labeled--every relation [i,j] satisfies i<j.
#
# If <property> is a procedure that accepts a lattice as input, and returns
#  true or false for output, then
# Lattices(n,<property>) returns a list consisting of all nonisomorphic
#  lattices on {1,...,n} that satisfy <property>. Any additional arguments
#  will be passed on to the procedure <property>.
#
`posets/Lattices`:=proc(n)
  if not type(n,'integer') or n<1 then
    ERROR(`first argument must be a positive integer`)
  else
    map(`posets/Lattices/cap`,`posets/Lattices/lib`(n),{$2..n-1},args)
  fi
end:
#
`posets/Lattices/cap`:=proc(P,J,n) local i,L;
  L:={seq([1,i],i=J minus map(e->e[2],P)),op(P),
     seq([i,n],i=J minus map(e->e[1],P))};
  if nargs=3 or eval(args[4](L,args[5..nargs])) then L fi;
end:
#
# special vanilla version of Lattices/lib
#
`posets/Lattices/lib`:=proc(n) local k,res,A,c;
  if n=2 then [{[1,2]}] # a kluge
    elif n<4 then [{}]
    elif n=4 then [{},{[2,3]}]
    elif n>10 then ERROR(`input too large`)
    else res:=[{},{[2,3]}];
      for k from 4 to n-2 do
        res:=[seq(seq(`posets/Lattices/merge`(c,A[2],k,[0]),
          c=[0,op(A[1])]),A=zip((x,y)->[x,y],`posets/pcodes`[k-1],res))];
      od; k:=n-1;
      [seq(seq(`posets/Lattices/merge`(c,A[2],k,[]),c=[0,op(A[1])]),
        A=zip((x,y)->[x,y],`posets/pcodes`[n-2],res))];
  fi
end:
#
`posets/Lattices/merge`:=proc(c,P,n,a) local i;
  if P=0 or c<0 then op(a)
    else {op(P),seq([i,n],i=`posets/Posets/getset`(2*c))} fi
end:
#
# Posets(n) returns a list of all nonisomorphic posets on {1,...,n}.
#  The posets are naturally labeled--every relation [i,j] satisfies i<j.
#
# If <property> is a procedure that accepts a poset as input, and returns
#  true or false for output, then
# Posets(n,<property>) returns a list consisting of all nonisomorphic posets
#  on {1,...,n} that satisfy <property>. Any additional arguments will be
#  passed on to the procedure <property>.
#
`posets/Posets`:=proc(n) local tester;
  if not type(n,'integer') or n<1 then
    ERROR(`first argument must be a positive integer`)
  elif nargs=1 then
    `posets/Posets/lib`(n)
  else
    tester:=proc(P,test) if test(P,args[3..nargs]) then P fi end;
    map(tester,`posets/Posets/lib`(n),args[2..nargs])
  fi
end:
#
# special vanilla version of Posets/lib
#
`posets/Posets/lib`:=proc(n) local res,k;
  if n=1 then [{}] 
    elif n>8 then ERROR(`input too large`)
    else res:=[{},{[1,2]}];
      for k from 3 to n do
        res:=map(`posets/Posets/addlayer`,
          zip((x,y)->[x,y],res,`posets/pcodes`[k]),k)
      od; res
  fi
end:
#
`posets/Posets/addlayer`:=proc(A,n) local i,c;
  A[1],seq({op(A[1]),seq([i,n],i=`posets/Posets/getset`(abs(c)))},c=A[2])
end:
#
`posets/Posets/getset`:=proc() local i,A,m; option remember;
  A:=NULL; m:=args[1];
  for i while m>0 do if irem(m,2,'m')=1 then A:=A,i fi od; {A}
end:
#
# W(P,X,q,t) returns the W-polynomial of the poset P,X at (q,t).
# W(P,n,q,t) does the same, using X={1,...,n}.
# W(P,q,t) does the same, assuming P has no isolated vertices.
# W(P,X,q,t,S), where S is a subset of the cover relations of P, returns
#  the W-polynomial relative to a labeling in which descents occur at S.
# W(P,n,q,t,S), W(P,q,t,S) function similarly.
# All of the above calling sequences can have the optional string 'ideals'
#  or 'linear' appended. The former selects an algorithm that is quadratic
#  in the number of order ideals, the latter is linear in the number of
#  linear extensions.
# For the ideals option, q and t must be names or rationals.
#
`posets/W`:=proc(P) local flag,V,X,k,q,t,n,Q,weight;
  k:=nargs; V:={}; flag:=0;
  if type(args[k],'set') then V:=args[k]; k:=k-1 fi;
  if args[k]='linear' then flag:=-1; k:=k-1
    elif args[k]='ideals' then flag:=1; k:=k-1
  fi;
  if type(args[k],'set') then V:=args[k]; k:=k-1 fi;
  q:=args[k-1]; t:=args[k]; k:=k-2;
  if k=1 then X:=map(op,args[k])
    elif type(args[k],'integer') then X:={$1..args[k]}
    else X:=args[k]
  fi;
  Q:=(P minus V) union map(x->[x[2],x[1]],V);
  n:=nops(X); X:=map(op,posets['filter'](Q,X));
  if nops(X)<>n then ERROR(`not an admissible subset`) fi;
  if flag>0 or (flag=0 and n>6 and type(q,'rational'))
    then RETURN(`posets/W/ideals`(P,{op(X)},q,t,V,n)) fi;
  Q:=subs({seq(X[k]=k,k=1..n)},P);
  weight:=proc(w,n,qq,tt) local J;
    J:=[op(map(proc(x,y) if y[x]>y[x+1] then x fi end,[$1..n-1],w)),n];
    qq^convert(J,`+`)*tt^nops(J)
  end;
  convert(map(weight,posets['extensions'](Q,n),n,q,t),`+`)
end:
#
`posets/W/ideals`:=proc(P,X,q,t,V,n)
    local inc,start,wt,anti,f,res,i,j,k,down,m,Q;
  inc:=1; start:=convert([seq(1-q^j*t,j=1..n)],`*`);
  if q=1 then
    wt:=proc(J,q,t,f) f end; start:=1;
    inc:=proc(ii,nn,t) t^ii*(1-t)^(nn-ii) end;
  elif type(t,'name') and start<>0 then
    wt:=proc(J,q,t,f) q^nops(J)*t*quo(f,1-q^nops(J)*t,t) end;
  elif type(q,'name') and start<>0 then
    wt:=proc(J,q,t,f) q^nops(J)*t*quo(f,1-q^nops(J)*t,q) end;
  elif not type(q,'rational') or not type(t,'rational') then
    ERROR(`parameters must be variable names or rationals`)
  elif start=0 then
    f:=`posets/W/ideals`(P,X,q,i,V,n);
    RETURN(subs(i=t,f))
  else
    wt:=proc(J,q,t,f) q^nops(J)*t*f/(1-q^nops(J)*t) end
  fi;
  down:=posets['closure'](P,X,'table');
  Q:={seq(seq([i,j],i=down[j]),j=X)};
  anti:=map(proc(x,y) local ii; map(op,{x,seq(y[ii],ii=x)}) end,
    posets['antichains'](Q,X,true),down);
  anti:=sort([op(anti)],(x,y)->evalb(nops(x)<nops(y)));
  m:=nops(anti); anti:=zip((x,y)->[x,y],[$1..m],anti);
  down:=[seq(map(`posets/W/admit`,[op(1..j-1,anti)],anti[j][2],V),j=1..m)];
  res:=[start,0$(m-1)]; f:=0;
  for i to n do
    res:=[0,seq(wt(anti[j][2],q,t,convert([seq(res[k],k=down[j])],`+`)),
      j=2..m)];
    f:=f+expand(res[m]*inc(i,n,t));
  od; f
end:
#
`posets/W/admit`:=proc(JJ,II,V) local e,c,C;
  c:=nops(II)-nops(JJ[2]);
  C:=II minus JJ[2];
  if nops(C)<>c then RETURN() fi;
  if c=1 then RETURN(JJ[1]) fi;
  for e in V do
    if member(e[1],C) and member(e[2],C) then RETURN() fi;
  od; JJ[1]
end:
#
# antichains(P,X) returns the set of all antichains of the poset P with
#  vertex set X.
# antichains(P,n) does the same, using X={1,...,n}.
# antichains(P) does the same, assuming that P has no isolated points.
# antichains(P,X,k) returns the set of all k-element antichains of P.
# antichains(P,n,k) does the same, using X={1,...,n}.
#
# 'true' at the end specifies that P is transitively closed.
#
`posets/antichains`:=proc() local Q,X,k,n,flag;
  n:=nargs; flag:=false;
  if args[n]=true then flag:=true; n:=n-1 fi;
  if n=1 then X:=map(op,args[1])
    elif type(args[2],'integer') then X:={$1..args[2]}
    else X:=args[2]
  fi;
  if n>2 then k:=args[3] else k:=NULL fi;
  if flag then Q:=args[1] else Q:=posets['closure'](args[1]) fi;
  `posets/antichains/sub`(Q,X,k);
end:
#
`posets/antichains/sub`:=proc(P,X) local P1,P2,X1,k,km1;
  if nargs>2 then
    if args[3]=0 then RETURN({{}})
      elif args[3]=1 then RETURN(map(x->{x},X))
      elif nops(X)<args[3] then RETURN({})
    fi;
    k:=args[3]; km1:=k-1;
    elif nops(X)<2 then RETURN({{},X})
    else k:=NULL; km1:=NULL;
  fi;
  P2:=map(proc(x,y) if x[1]<>y and x[2]<>y then x fi end,P,X[1]);
  X1:=X minus {X[1],op(map(op,P minus P2))};
  P1:=map(proc(e,Y) if member(e[1],Y) and member(e[2],Y) then e fi end,P,X1);
  {op(map((x,y)->{op(x),y},procname(P1,X1,km1),X[1])),
    op(procname(P2,subsop(1=NULL,X),k))};
end:
#
# atomic(L) returns true or false according to whether the lattice L
#  is atomic; i.e., whether every element is the join of atoms.
# The procedure does *not* test whether L is a lattice.
# The criterion: L is atomic iff atoms are the only elements that
# cover only one element.
#
`posets/atomic`:=proc(L) local X,i,e,cov;
  X:=map(op,L); cov:=table([seq(i=NULL,i=X)]);
  for e in L do cov[e[2]]:=cov[e[2]],e[1] od;
  for i in X do
    if nops([cov[i]])=1 and cov[cov[i]]<>NULL then RETURN(false) fi
  od; true
end:
#
# Given a directed graph G with vertex set X, autgroup(G,X) returns a
#  list of generators for the automorphism group of G. Each generator
#  is encoded by a set of equations of the form {x1=y1,x2=y2,...},
#  where X={x1,x2,...}={y1,y2,...}.
# autgroup(G,n) does the same, using X={1,...,n}.
# autgroup(G) does the same, assuming G has no isolated points.
#
# If the final argument is 'permgroup', return a permgroup(...) data
#  structure as in Maple's group package (vertex set must be {1,...,n}).
# If the final argument is 'gap', lprint a sequence of statements
#  that can be pasted into a gap session.
#
`posets/autgroup`:=proc(P) local X,pg,n;
  n:=nargs; if type(args[n],'name') then n:=n-1 fi; 
  if n=1 then X:=map(op,P)
    elif type(args[2],'integer') then X:={$1..args[2]}
    else X:=args[2]
  fi;
  pg:=`posets/autgroup/col`(P,[X]);
  if nargs=n then pg
    elif X<>{$1..nops(X)} then
      ERROR(`vertex set must be {1,...,n} for some n`)
    elif args[nargs]='permgroup' then
      permgroup(nops(X),map(`posets/autgroup/cyc`,{op(pg)}))
    elif args[nargs]='gap' then `posets/autgroup/gap`(pg)
    else ERROR(`invalid arguments`)
  fi
end:
#
# Do the same, but assume that the second argument is a
# partition of the vertices of G into color classes.
#
`posets/autgroup/col`:=proc(G) local pi,mu,nu,i,k,pg,alive;
  pi:=`posets/fastdisc`(args);
  for k to nops(pi) while nops(pi[k])=1 do od;
  if k>nops(pi) then RETURN([]) else i:=pi[k][1] fi;
  alive:=subsop(1=NULL,pi[k]);
  pi:=subsop(k=({i},alive),pi);
  pg:=op(procname(G,pi));
  while nops(alive)>0 do
    mu:=subs({i=alive[1],alive[1]=i},pi);
    if `posets/cisom`(G,pi,G,mu,'nu') then
      pg:=pg,map(proc(x) if not x then x fi end,nu)
    fi;
    alive:=alive minus `posets/orbit`([pg],alive[1])
  od; [pg]
end:
#
# decompose pi into disjoint cycles
#
`posets/autgroup/cyc`:=proc(pi) local alive,mu,i,c;
  alive:=map(x->op(1,x),pi); mu:=NULL;
  while nops(alive)>0 do
    i:=alive[1]; c:=i; i:=subs(pi,i);
    while i<>alive[1] do c:=c,i; i:=subs(pi,i) od;
    mu:=mu,[c]; alive:=alive minus {c};
  od; [mu]
end:
#
`posets/autgroup/gap`:=proc(pg) local pi,i,n,lpr;
  if [op(I)]=[1] then lpr:=proc() printf(`%0.256s\n`,args) end
    else lpr:=proc() lprint(args) end fi;
  lpr(` `); n:=nops(pg);
  for i to n do
    pi:=`posets/autgroup/cyc`(pg[i]);
    pi:=map(convert,pi,'string');
    pi:=map(y->cat(`(`,substring(y,2..length(y)-1),`)`),pi);
    lpr(cat('g',i,`:=`,op(pi),`;`));
  od;
  if n=0 then lpr(`G:=Group(());`)
    else lpr(cat(`G:=Group(g1`,seq(op([`,g`,i]),i=2..n),`);`))
  fi;
  lpr(` `);
end:
#
# Given a directed graph G with vertex set X, canon(G,X) finds a 
# canonical relabeling of G. The vertex set of the relabeled graph
# will be 1,...,n for some n, and another graph (H,Y) will be isomorphic
# to (G,X) if and only if canon(G,X)=canon(H,Y).
#
# If G is acyclic, and the last argument is 'natural', produce a canonical
# labeling that is "natural" (i.e., if [i,j] is an edge, then i<j).
#
# Might be nicer to return a poset "structure".
#
`posets/canon`:=proc(P) local Q,X,pi,i,n;
  n:=nargs; if args[n]='natural' then n:=n-1 fi;
  if n=1 then X:=map(op,P)
    elif type(args[2],'integer') then X:={$1..args[2]}
    else X:=args[2]
  fi;
  pi:=`posets/canorder`(P,[X]);
  Q:=subs({seq(pi[i]=i,i=1..nops(pi))},P);
  if nargs=n then Q else
    pi:=posets['filter'](Q,nops(pi));
    pi:=map(x->op(sort([op(x)])),pi);
    Q:=subs({seq(pi[i]=i,i=1..nops(pi))},Q)
  fi;
end:
#
# Canonically order the vertices of a colored directed graph.
# Calling sequences:
#   `posets/cisom`(G,mu);
#   `posets/cisom`(G,mu,'pi');
#
# G is a set of ordered  pairs [x,y], and mu is an ordered partition of
# the vertex set according to color. A third argument (if present) is
# assigned generators for the automorphism group of G.
#
# Tinkering with `canorder/code` might produce nicer canonical orderings.
#
`posets/canorder`:=proc(G) local pi,i,k,alive,pg,mu,nu,pi1,mu1,c,c1,q;
  pi:=`posets/fastdisc`(G,args[2]);
  for k to nops(pi) while nops(pi[k])=1 do od;
  if k>nops(pi) then
    pi:=map(op,pi); pg:=NULL;
  else
    i:=pi[k][1]; alive:=subsop(1=NULL,pi[k]);
    mu:=subsop(k=({i},alive),pi);
    pi:=procname(G,mu,'pg'); pg:=op(pg);
    c:=`posets/canorder/code`(G,pi,q);
    while nops(alive)>0 do
      mu1:=subs({i=alive[1],alive[1]=i},mu);
      if `posets/cisom`(G,mu,G,mu1,'nu') then
        pg:=pg,map(proc(x) if not x then x fi end,nu)
      else
        pi1:=procname(G,mu1);
        c1:=`posets/canorder/code`(G,pi1,q);
        if tcoeff(c1-c,q)>0 then pi:=pi1; c:=c1 fi;
      fi;
      alive:=alive minus `posets/orbit`([pg],alive[1]);
    od
  fi;
  if nargs>2 then assign(args[3],[pg]) fi; pi
end:
#
# A basic code to assign to (colored) digraphs.
# Used to decide when one relabeling should be preferred over another.
#
`posets/canorder/code`:=proc(G,pi,q) local i,c;
  c:=subs({seq(pi[i]=i,i=1..nops(pi))},G);
  c:=map(x->[max(x[1],x[2]),x[2]-x[1]],c);
  convert([seq(q^(i[1]^2-i[1]+i[2]),i=c)],`+`)
end:
#
# chain(n) returns (the cover relation for) an n-element chain.
#
`posets/chain`:=proc(n) local i; 
  if not type(n,'integer') or n<1 then
      ERROR(`first argument must be a positive integer`)
    elif n=1 then {},1
    else {seq([i,i+1],i=1..n-1)}
  fi
end:
#
# char_poly(P,z) returns the characteristic polynomial of the poset P.
#  P must have a unique minimal element. In particular, it cannot have any
#  isolated points--except in the degenerate case of a poset on one point.
#  Also, it should be ranked, although the procedure doesn't check this.
# char_poly(P,X,z) and char_poly(P,n,z) can also be used for consistency.
#
`posets/char_poly`:=proc(P) local X,i,F,x,y,f,c,up;
  i:=nargs-1;
  if i=0 or i>2 then ERROR(`Wrong number of arguments`)
    elif i=1 then X:=map(op,args[1])
    elif type(args[i],'integer') then X:={$1..args[i]}
    else X:=args[i]
  fi;
  F:=posets['filter'](P,X);
  if nops(F[1])>1 then
     ERROR(`Poset must have a unique minimal element`) fi;
  f:=nops(F); F:=[seq(F[-i],i=-f..-1)];
  up:=posets['closure'](posets['dual'](P),map(op,F),'natural','table');
  for i to f do for x in F[i] do
    c[x]:=args[nargs]^(i-1)-convert([seq(c[y],y=up[x])],`+`)
  od od;
  c[F[f][1]];
end:
#
# An isomorphism tester for vertex-colored directed graphs.
# Based on the fast discriminant (see `posets/fastdisc`).
# Note: this is similar to the algorithm used by Brendan McKay for nauty.
# (See http://cs.anu.edu.au:80/people/bdm/nauty/,
#   Congressus Numerantium 21 (1978), 499-517.)
# 
# Calling sequences:
#   `posets/cisom`(H,mu,G,nu);
#   `posets/cisom`(H,mu,G,nu,'pi');
#
# H and G are sets of ordered pairs [x,y], and mu and nu are ordered
# partitions of the vertex sets according to color.
# A fifth argument is assigned a particular isomorphism, if both exist.
#
# WARNING: The caller is responsible for checking that each graph has the
# same number of vertices of each color (i.e., map(nops,mu)=map(nops,nu)).
#
`posets/cisom`:=proc() local G,H,muG,muH,X,Y,i,j,r,B,f,pi,X0,q,t;
  G:=args[3]; muG:=args[4]; r:=nops(muG);
  Y:=map(op,args[2]); X:=map(op,muG);
  pi:={seq(Y[i]=X[i],i=1..nops(X))}; H:=subs(pi,args[1]);
  if H=G then if nargs=5 then assign(args[5],pi) fi; RETURN(true) fi;
  B:=table([seq(seq(j=i,j=muG[i]),i=1..r)]);
  f:=[convert([seq(t[i[1]]/q^B[i[2]]+t[i[2]]*q^B[i[1]],i=H)],`+`),
      convert([seq(t[i[1]]/q^B[i[2]]+t[i[2]]*q^B[i[1]],i=G)],`+`)];
  muH:=map(`posets/part`,muG,f[1],t);
  muG:=map(`posets/part`,muG,f[2],t);
  if map(nops,muH)<>map(nops,muG) or
    [seq(coeff(f[1],t[i[1]]),i=muH)]<>[seq(coeff(f[2],t[i[1]]),i=muG)]
    then RETURN(false) fi;
  if nops(muG)>r then
    if nargs<5 then RETURN(procname(H,muH,G,muG)) fi;
    f:=procname(H,muH,G,muG,'pi');
    if f then X:=subs(pi,X);
      assign(args[5],{seq(Y[i]=X[i],i=1..nops(X))}) fi; RETURN(f)
  fi;
  muG:=map(proc(x) if nops(x)>1 then x fi end,muG);
  X0:=map(op,muG); r:=nops(X0)+1;
  G:=map(proc(x,y) if member(x[1],y) and member(x[2],y) 
    then x fi end,G,X0);
  H:=map(proc(x,y) if member(x[1],y) and member(x[2],y) 
    then x fi end,H,X0);
  for i to nops(muG) do f:=nops(muG[i]); if f<r then r:=f; j:=i fi od;
  userinfo(2,'isom',cat(`descending to a `,r,`-block`));
  B:=muG[j]; muG:=subsop(j=({B[1]},subsop(1=NULL,B)),muG);
  for i to r do
    muH:=subs({B[1]=B[i],B[i]=B[1]},muG);
    if nargs=5 then f:=procname(H,muH,G,muG,'pi')
      else f:=procname(H,muH,G,muG) fi;
    if f then if nargs=5 then X:=subs(pi,X); 
      assign(args[5],{seq(Y[i]=X[i],i=1..nops(X))}) fi; RETURN(true)
    fi;
  od; false
end: 
#
# closure(R) returns the transitive closure of an acyclic relation R.
# closure(R,X,'natural') will assume that X is a list of the vertices
#  of R, in an ordering consistent with R.
# If the last argument is 'table', then a table of (downward) adjacency
#  sets is returned.
#
`posets/closure`:=proc(R) local X,down,e,x,y;
  if member('natural',[args]) then X:=args[2] else
    X:=map(op,posets['filter'](args)) fi;
  down:=table([seq(x=NULL,x=X)]);
  for e in R do down[e[2]]:=down[e[2]],e[1] od;
  for x in X do down[x]:={down[x],seq(op(down[y]),y=[down[x]])} od;
  if args[nargs]='table' then op(down)
    else {seq(seq([y,x],y=down[x]),x=X)}
  fi;
end:
#
# connected(P,X) returns true or false according to whether the poset P with
#  vertex set X has a connected Hasse diagram.
# connected(P,n) does the same, assuming X={1,...,n}.
# connected(P) does the same, assuming there are no isolated vertices.
#
# connected(P,X,'comps') does the same, and in addition, assigns to the
#  variable name 'comps' the set of vertex sets of the connected components.
#
# The algorithm works correctly if P is the edge set of *any* graph.
#
`posets/connected`:=proc(P) local C,X,Y,Q,i,n,cc_flag;
  X:=map(op,P); n:=nargs; cc_flag:=false;
  if type(args[n],'name') then cc_flag:=true; n:=n-1 fi;
  if n>1 then Y:=X;
    if type(args[n],'integer') then X:={$1..args[2]} else X:=args[2] fi;
    if nops(Y)<nops(X) and not cc_flag then RETURN(evalb(nops(X)=1)) fi;
  fi;
  Q:=[X,op(map(x->[x[1],x[2]],P))]; # in case of *unordered* pairs
  if cc_flag then 
    C:=table([seq(i={i},i=X)]); i:=nops(Q);
    while i>1 and nops(Q[1])>1 do
      C[Q[i][2]]:={op(C[Q[i][2]]),op(C[Q[i][1]])};
      Q:=subs(Q[i][1]=Q[i][2],[op(1..i-1,Q)]); i:=i-1
    od;
    assign(args[nargs],{seq(C[i],i=Q[1])});
  else i:=nops(Q);
    while i>1 and nops(Q[1])>1 do
      Q:=subs(Q[i][1]=Q[i][2],[op(1..i-1,Q)]); i:=i-1
    od;
  fi;
  evalb(nops(Q[1])=1);
end:
#
# covers(R) returns the set of covering pairs in an acyclic relation R.
# covers(R,'closed') assumes that R is transitively closed.
# covers(R,X,'natural') assumes that X is a natural ordering of R.
#
`posets/covers`:=proc(R) local X,down,e,x,y; 
  if args[nargs]='closed' then
    X:=map(op,R);
    down:=table([seq(x=NULL,x=X)]);
    for e in R do down[e[2]]:=down[e[2]],e[1] od;
    for x in X do down[x]:={down[x]} od;
  else
    if args[nargs]='natural' then X:=args[2]
      else X:=map(op,posets['filter'](R)) fi; 
    down:=posets['closure'](R,X,'natural','table');
  fi;
  down:=table([seq(x=down[x] minus {seq(op(down[y]),y=down[x])},x=X)]);
  {seq(seq([y,x],y=down[x]),x=X)};
end: 
#
# P &u Q returns the disjoint union of the posets P and Q. That is, the
#  vertices of P and Q are renamed so as to be disjoint sets, and then
#  the union of P and Q is returned. (One can also use P &u Q &u R, etc).
#  If one or more of the posets, say P, has isolated vertices, then one
#  must use the syntax (P,X) &u Q or (P,n) &u Q, where X or {1,...,n} is
#  the vertex set of P, resp.
# The output will be a poset on the vertex set {1,2,...,m} for some m.
#  If any of the arguments are of the form (P,X) or (P,n), then the
#  output will also be of this form.
#
`&u`:=proc() local P,Q,X,i,n,flag,j;
  flag:=false; n:=0; Q:=NULL;
  for i to nargs do 
    if i=nargs or type(args[i+1],'set'('list')) then
        X:=map(op,args[i]); P:=args[i];
      elif type(args[i+1],'set') then flag:=true;
        X:=args[i+1]; P:=args[i]; i:=i+1;
      elif type(args[i+1],'integer') then flag:=true;
        X:={$1..args[i+1]}; P:=args[i]; i:=i+1;
      else ERROR(`invalid arguments`)
    fi;
    Q:=Q,subs({seq(X[j]=j+n,j=1..nops(X))},P);
    n:=n+nops(X);
  od;
  Q:=map(op,{Q});
  if flag then Q,n else Q fi;
end:
#
# distributive(L) returns true or false according to whether the lattice L
#  is distributive. The procedure does *not* verify that L is a lattice.
# distributive(L,'Irr') does the same, and also assigns the set of join-
#  irreducible elements of L to 'Irr', even if not L is distributive.
#
`posets/distributive`:=proc(L) local X,up,down,e,F,r,i,j;
  r:=nargs; if type(args[r],'name') then r:=r-1 fi;
  if r=1 then X:=map(op,L);
    elif type(args[r],'integer') then X:={$1..args[r]}
    else X:=args[r]
  fi;
  down:=table('sparse');
  for e in L do down[e[2]]:=down[e[2]]+1 od;
  down:=map(proc(x,y) if y[x]=1 then x fi end,X,down);
  if type(args[nargs],'name') then assign(args[nargs],down) fi;
  F:=posets['filter'](L,X);
  if not nops(down)+1=nops(F) then RETURN(false) fi;
  up:=table('sparse');
  for e in L do up[e[1]]:=up[e[1]]+1 od;
  up:=map(proc(x,y) if y[x]=1 then x fi end,X,up);
  if not nops(up)=nops(down) then RETURN(false) fi;
  r:=table([seq(seq(i=j,i=F[j]),j=1..nops(F))]);
  for e in L do if r[e[2]]-r[e[1]]<>1 then RETURN(false) fi od;
  true;
end:
#
# dual(R) returns the dual of the relation R. That is, each ordered pair
# [a,b] in R (a list or set) is replaced by [b,a].
#
`posets/dual`:=proc(R) map(x->[x[2],x[1]],R),args[2..nargs] end:
#
# extensions(P,X) lists all linear extensions of a poset P with v-set X.
# extensions(P,n) does the same, using X={1,...,n}.
# extensions(P) does the same, assuming there are no isolated points.
#
`posets/extensions`:=proc(P) local X,bot,Q,x,res,new;
  if nargs=1 then X:=map(op,P)
    elif type(args[2],'integer') then X:={$1..args[2]}
    else X:=args[2]
  fi;
  if nops(X)<2 then RETURN([[op(X)]]) fi;
  bot:=X minus map(e->e[2],P); res:=NULL;
  for x in bot do
    Q:=map(proc(e,y) if e[1]<>y then e fi end,P,x); 
    new:=`posets/extensions`(Q,X minus {x});
    res:=res,op(map((z,y)->[y,op(z)],new,x))
  od;
  [res]
end:
#
# Given directed graph G and a coloring mu of the vertices of G (i.e., a
# list of subsets of vertices indicating color classes), fastdisc(G,mu)
# returns the "fast discriminant" of G: the coarsest monochromatic
# partition of the vertices such that for all vertices x in block i,
#   the number of edges x -> block j depends only on i and j, and
#   the number of edges x <- block j depends only on i and j.
#
# The result is an ordered partition of the vertices (the ordering
# being determined by the values of the above numbers). If f: G -> H is
# an isomorphism of graphs, then f must map the fast discriminant of G
# to the fast discriminant of H.
#
# The graph must be a set of ordered pairs [x,y] (no multiple edges).
#
# Might be faster to delete singleton vertices as they are created, in
# addition to their edges, but then it is hard to refine the partition
# in place--i.e., without moving blocks.
#
`posets/fastdisc`:=proc() local G,X,Xold,Y,mu,n,f,B,i,j,q,t;
  if args[2]=[{}] then mu:=[] else mu:=args[2] fi;
  G:=args[1]; n:=nops(mu); X:={};
  do
    Xold:=X; X:={op(map(proc(x) if nops(x)=1 then op(x) fi end,mu))};
    if nops(X)=n then RETURN(mu) fi;
    B:=table([seq(seq(j=i,j=mu[i]),i=1..n)]);
    f:=convert([seq(t[i[1]]/q^B[i[2]]+t[i[2]]*q^B[i[1]],i=G)],`+`);
    mu:=map(`posets/part`,mu,f,t);
    if nops(mu)>n then n:=nops(mu) else RETURN(mu) fi;
    if nops(X)>nops(Xold) then Y:=X minus Xold;
      G:=map(proc(x,y) if not (member(x[1],y) or member(x[2],y))
        then x fi end,G,Y)
    fi;
  od; ERROR(`this cannot happen`);
end:
#
# filter(D,X) returns the filtration of acyclic graph D with vertex set X.
#   filtration = [F1,F2,...,F_r], where F1={minimal elements of D},
#   F2={minimal elements of D-F1}, etc...
# filter(D,n) does the same, using the vertex set {1,...,n}.
# filter(D) does the same, assuming that D has no isolated vertices.
#   Reference: Knuth Vol I., Sec. 2.2.3.
#
`posets/filter`:=proc(P) local X,ct,up,e,x,y,F,G,res;
  if nargs=1 then X:=map(op,P)
    elif type(args[2],'integer') then X:={$1..args[2]}
    else X:=args[2]
  fi;
  ct:=table('sparse');
  up:=table([seq(x=NULL,x=X)]);
  for e in P do ct[e[2]]:=ct[e[2]]+1; up[e[1]]:=up[e[1]],e[2] od;
  F:=NULL; for x in X do if ct[x]=0 then F:=F,x fi od;
  F:={F}; res:=NULL;
  while nops(F)>0 do
    res:=res,F; G:=NULL;
    for x in F do
      for y in [up[x]] do
        ct[y]:=ct[y]-1;
        if ct[y]=0 then G:=G,y fi;
      od
    od;
    F:={G}
  od;
  [res]
end:
#
# isom(P,Q) decides if the digraphs P and Q are isomorphic using an
#  algorithm based on the "fast discriminant".
# isom(P,Q,'pi') does the same, and if P is isomorphic to Q, also assigns
#  to the name 'pi' an explicit isomorphism in the form of a set of
#  equations {x1=y1,x2=y2,...}, where x1,x2,... and y1,y2,... are the
#  vertices of P and Q (resp.).
#
`posets/isom`:=proc() local n,flag,Y,P,V;
  n:=0; flag:=NULL;
  for Y in [args] do
    if type(Y,'set'('list')) then
      n:=n+1; P[n]:=Y; V[n]:=map(op,Y)
      elif type(Y,'set') then V[n]:=Y
      elif type(Y,'integer') then V[n]:={$1..Y}
      elif type(Y,'name') and Y=args[nargs] then flag:=Y
      else ERROR(`invalid arguments`)
    fi
  od;
  if n<>2 then ERROR(`invalid arguments`)
    elif nops(V[1])<>nops(V[2]) then false
    else `posets/cisom`(P[1],[V[1]],P[2],[V[2]],flag)
  fi
end:
#
# lattice(L) returns true or false according to whether the poset L is 
#  or is not a lattice. Use lattice(L,X) and lattice(L,n) similarly.
# lattice(L,'semi') will return true or false according to whether L is
#  or is not a meet-semilattice; i.e., a poset in which every pair of
#  vertices has a greatest lower bound.
# lattice(L,X,'semi') and lattice(L,n,'semi') work similarly. To test
#  whether L is a join-semilattice, use lattice(dual(L),'semi').
#
`posets/lattice`:=proc() local X,P,n,down,lbs,i,j;
  if nargs=1 then X:=map(op,args[1])
    elif type(args[2],'set') then X:=args[2]
    elif type(args[2],'integer') then X:={$1..args[2]} 
    else X:=map(op,args[1])
  fi;
  n:=nops(X);
  if args[nargs]<>'semi' and n > 1+nops(map(x->x[1],args[1]))
    then RETURN(false) fi;
  X:=map(op,posets['filter'](args[1],X));
  P:=subs({seq(X[i]=i,i=1..n)},args[1]);
  down:=posets['closure'](P,[$1..n],'natural','table');
  for i to n do
    for j in {$1..i-1} minus down[i] do
      lbs:=down[i] intersect down[j];
      if nops(lbs)=0 or nops(lbs minus down[max(op(lbs))]) > 1 then
        RETURN(false) fi
    od
  od; true
end:
#
# meet(L) returns a symmetric table of values for the meet function of a 
#  lattice or meet-semilattice L. That is, for each pair of vertices [a,b]
#  of L, meet(L)[a,b] is the greatest lower bound for a and b.
# meet(L,[a,b,...]) will return the greatest lower bound for vertices a,b,...
# The procedure does *not* verify that L is a lattice or semilattice.
# In fact, L can be any poset, in which case, the answer returned is a
#  maximal lower bound, or NULL, if there is no such lower bound.
#
`posets/meet`:=proc(L) local X,n,down,i,j,res,elts;
  n:=nargs; if type(args[n],'list') then n:=n-1 fi;
  if n=1 then X:=map(op,L)
    elif type(args[2],'integer') then X:={$1..args[2]}
    else X:=args[2]
  fi;
  X:=map(op,posets['filter'](L,X)); n:=nops(X);
  down:=posets['closure'](subs({seq(X[i]=i,i=1..n)},L),
    [$1..n],'natural','table');
  for i to n do down[i]:={i,op(down[i])} od;
  if type(args[nargs],'list') then res:={$1..n};
    elts:=subs({seq(X[i]=i,i=1..n)},args[nargs]);
    for i in elts do res:=res intersect down[i] od;
    if nops(res)>0 then X[max(op(res))] fi
  else
    res:=table('symmetric');
    for i to n do;
      res[X[i],X[i]]:=X[i];
      for j from i+1 to n do;
        elts:=down[i] intersect down[j];
        if nops(elts)>0 then res[X[i],X[j]]:=X[max(op(elts))] fi;
      od;
    od;
    op(res)
  fi;
end:
#
# mobius(P,X) returns a 'sparse' table of values for the mobius function
#  of the poset P with vertex set X.
# mobius(P,n) does the same but assumes X={1,...,n}
# mobius(P)   does the same, but assumes there are no isolated points. 
# mobius(P,[a,b]) returns the value of the mobius function at [a,b];
# mobius(P,X,[a,b]) and mobius(P,n,[a,b]) function similarly.
#
`posets/mobius`:=proc() local P,X,x,y,z,a,b,down,mu,n;
  n:=nargs; P:=args[1];
  if n=1 then X:=map(op,P)
    elif type(args[n],'integer') then X:={$1..args[n]}
    elif type(args[n],'set') then X:=args[n]
    elif type(args[n],'list') then
      a:=args[n][1]; b:=args[n][2];
      if a=b then RETURN(1) fi;
      P:=posets['subinterval'](P,args[n]);
      if P=NULL then RETURN(0) else X:=map(op,P) fi;
    else ERROR(`wrong type of arguments`)
  fi;
  X:=map(op,posets['filter'](P,X));
  down:=posets['closure'](P,X,'natural','table');
  if type(args[n],'list') then
    mu[a]:=1; X:=subsop(1=NULL,X);
    for x in X do mu[x]:=-convert([seq(mu[y],y=down[x])],`+`) od;
    mu[b];
  else
    mu:=table('sparse');
    for x in X do
      mu[x,x]:=1;
      for y in down[x] do
        mu[y,x]:=-convert([seq(mu[y,z],z=down[x])],`+`)
      od
    od;
    op(mu)
  fi;
end:
#
# modular(L) returns true or false according to whether the lattice L is
#  modular; i.e., L is ranked, and the rank function satisfies r[x]+r[y]=
#  r[meet(x,y)] + r[join(x,y)] for all vertices x and y.
# modular(L,'upper') and (respectively)  modular(L,'lower') returns true or
#  false according to whether the lattice L is upper (resp., lower) semi-
#  modular; i.e., L is ranked and the rank function satisfies r[x]+r[y] >=
#  (resp., <=) r[meet(x,y)] + r[join(x,y)] for all vertices x and y.
# The procedure does *not* check whether L is a lattice.
#
`posets/modular`:=proc(L) local X,over,e,x,i,j,o,res;
  if nops(L)=0 then RETURN(true) fi;
  if args[nargs]='lower' then
    RETURN(`posets/modular`(posets['dual'](L),'upper'))
  elif args[nargs]<>'upper' then
    res:=`posets/modular`(posets['dual'](L),'upper');
    if res then res:=`posets/modular`(L,'upper') fi;
    RETURN(res)
  fi;
  X:=map(op,L); over:=table([seq(x=NULL,x=X)]);
  for e in L do over[e[1]]:=over[e[1]],e[2] od;
  for x in X do
    o:=[over[x]];
    for i to nops(o) do
      for j to i-1 do
        e:={over[o[i]]} intersect {over[o[j]]};
        if nops(e)<>1 then RETURN(false) fi;
      od
    od
  od;
  true
end:
#
# omega(P,X,z) returns the order polynomial of the poset (P,X).
# omega(P,n,z) does the same, using X={1,...,n}.
# omega(P,z) does the same, assuming that P has no isolated vertices.
# omega(P,X,z,S), where S is a subset of the cover relations of P, returns
#  the order polynomial relative to a labeling in which descents occur at S.
# omega(P,n,z,S), omega(P,z,S) function similarly.
# All of the above calling sequences can have the optional string 'ideals'
#  or 'linear' appended. The former selects an algorithm that is quadratic
#  in the number of order ideals, the latter is linear in the number of
#  linear extensions.
#
`posets/omega`:=proc() local flag,V,i,k,n,res,f,bin,z;
  k:=nargs; V:={}; flag:=0;
  if type(args[k],'set') then V:=args[k]; k:=k-1 fi;
  if args[k]='linear' then flag:=-1; k:=k-1
    elif args[k]='ideals' then flag:=1; k:=k-1
  fi;
  if type(args[k],'set') then V:=args[k]; k:=k-1 fi;
  if k=2 then n:=nops(map(op,args[1]))
    elif type(args[k-1],'integer') then n:=args[k-1]
    else n:=nops(args[k-1])
  fi;
  if n=0 then RETURN(1) fi;
  if flag<0 or (flag=0 and n<7) then
    f:=posets['W'](args[1..k-1],1,z,V,'linear')
  else
    f:=posets['W'](args[1..k-1],1,z,V,'ideals')
  fi;
  f:=[seq(coeff(f,z,i)*z^i*(1+z)^(n-i),i=1..degree(f,z))];
  f:=expand(convert(f,`+`)); bin:=args[k]; res:=0;
  for i to degree(f,z) do
    res:=res+coeff(f,z,i)*bin;
    bin:=bin*(args[k]-i)/(i+1);
  od;
  expand(res);
end:
#
# Given a permutation group pg, expressed as a list or set of sets of
# equations defining substitutions that generate the group, determine
# the orbit of a point i under the action of this group. 
#
`posets/orbit`:=proc(pg,i) local orb,n,pi;
  orb:={i}; n:=0;
  while nops(orb)>n do n:=nops(orb);
    orb:={op(orb),seq(op(subs(pi,orb)),pi=pg)}
  od; orb
end:
#
# P &+ Q returns the ordinal sum of the posets P and Q. Similarly, one
#  may use P &+ Q &+ R, etc. If one or more of the posets, say P, has
#  isolated vertices, then one must use (P,X) &+ Q or (P,n) &+ Q,
#  according to whether X or {1,...,n} is the vertex set of P.
# The output will be a poset on the vertex set {1,2,...,m} for some m.
#  Note that P &+ Q never has isolated vertices.
# N.B.: rather than trap errors, we must return bad input unevaluated
#  in order to avoid breaking certain Maple commands in V.3 or later.
# It would be safer to name this `&o` or `&s`....
#
`&+`:=proc() local P,X,i,j,k,v,X0,X1;
  k:=0; i:=1; while i<=nargs do
    if not type(args[i],'set'('list')) then RETURN('procname(args)') fi;
    k:=k+1; P[k]:=args[i]; i:=i+1;
    if i>nargs or type(args[i],'set'('list')) then X[k]:=map(op,P[k])
      elif type(args[i],'set') then X[k]:=args[i]; i:=i+1
      elif type(args[i],'integer') then X[k]:={$1..args[i]}; i:=i+1
      else RETURN('procname(args)')
    fi
  od;
  j:=0; for i to k do
    if i=k then X1:={} else X1:=X[i] minus map(e->e[1],P[i]) fi;
    if i=1 then X0:={} else X0:=X[i] minus map(e->e[2],P[i]) fi;
    P[i]:=subs({seq(X[i][v]=v+j,v=1..nops(X[i]))},[P[i],X0,X1]); 
    j:=j+nops(X[i])
  od;
  {seq(op(P[i][1]),i=1..k),
    seq(seq(seq([i,j],i=P[v][3]),j=P[v+1][2]),v=1..k-1)};
end:
#
# Given a polynomial f that is linear in a set of variables t[i]
# where i ranges over a set of indices X (and perhaps nonlinear in
# other variables), return an ordered expression sequence consisting
# of subsets of X with i,j appearing in the same subset iff t[i] and
# t[j] have the same coefficient in f.
#
# The subsets are sorted by trailing coefficients.
# (Possibly leading coeffs, or reversal, gives nicer orderings).
#
# An error occurs if X is empty.
#
`posets/part`:=proc(X,f,t) local g,i,v,pi,B;
  g:=sort([seq([coeff(f,t[i]),i],i=X)],
    (x,y)->evalb(tcoeff(y[1]-x[1])>0));
  v:=g[1][1]; pi:=NULL; B:=NULL;
  for i in g do
    if i[1]=v then B:=B,i[2] else v:=i[1]; pi:=pi,{B}; B:=i[2] fi
  od;
  pi,{B}
end:
#
# plot_poset(P,<options>) plot the poset P using maple 2D graphics. The
#  embedding algorithm uses 'filter' to arrange the vertices into levels,
#  and then applies 'sort' to each level of vertices. Then the embedding
#  of vertices is adjusted so that no vertex intersects an edge interior.
# Requires MapleV.2 or later.
#
# The <options> may include any of the following in any order...
#  proportional   use horizontal spacing between vertices that is inversely
#                 proportional to the number of vertices in each level
#  ranked         attempt to use the vertex levels returned by
#                 the function 'ranked', if possible.
#  stretch=<num>  stretch the vertical axis by given factor.
#  ecolor=<color> use the specified color for edges (default=red)
#  ecolor=<table> use the <table> to choose the color of each edge. Edges
#                 of P not in the table are given the default color. 
#  vcolor=<color> use the specified color for vertices or their labels
#                 (default=white in V.2 or V.3; black otherwise)
#  labels         label the vertices, rather than plotting them as points
#  labels=<table> use the entries of <table> to produce a label (must be
#                 of type 'string') for each vertex.
# Any other options (e.g., title,...) are passed to plots[display]
#
`posets/plot_poset`:=proc(P)
    local X,f,i,j,F,pt,vclr,eclr,str,lbl,opts,p,C,Q;
  if ceil(0)<>0 then ERROR(`requires MapleV R2 or later`) fi;
  if nargs=1 then X:=map(op,P); j:=2
    elif type(args[2],'integer') then X:={$1..args[2]}; j:=3
    elif type(args[2],'set') then X:=args[2]; j:=3
    else X:=map(op,P); j:=2
  fi;
  if not member('ranked',[args]) or not posets['ranked'](P,X,F)
    then F:=posets['filter'](P,X) fi;
  F:=[seq(sort([op(i)]),i=F)]; f:=nops(F);
  str:=2.0; lbl:=NULL; C:=table(); Q:=P;
  opts:='scaling'='constrained','axes'='none';
  eclr:=eval(`posets/default`['ecolor'],1);
  vclr:=eval(`posets/default`['vcolor'],1);
  for i in [args[j..nargs]] do
    if op(1,i)='vcolor' then vclr:=op(2,i)
      elif op(1,i)='ecolor' then
        if type(op(2,i),'table') then C:=op(2,i);
          Q:=P minus map(x->op(op(x)),{entries(C)});
          elif type(op(2,i),'name') then eclr:=op(2,i)
        fi;
      elif op(1,i)='stretch' then str:=str*op(2,i)
      elif op(1,i)='labels' then
        if nops(i)>1 then lbl:=op(2,i) else
          lbl:=table([seq(p=convert(p,'string'),p=X)]) fi;
      elif i<>'ranked' and i<>'proportional' then opts:=opts,i
    fi
  od;
  if not member([eclr],[indices(C)]) then C[eclr]:={} fi;
  C[eclr]:={op(C[eclr]),op(Q)};
  if member('proportional',[args]) then str:=str/f;
    pt:=true,[seq([seq((2*j-1)/nops(F[i]),j=1..nops(F[i]))],i=1..f)]
  else
    pt:=false,[seq([seq(2*j-nops(F[i]),j=1..nops(F[i]))],i=1..f)]
  fi;
  pt:=`posets/plot_poset/adjust`(P,F,f,pt);
  pt:=table([seq(seq(F[i][j]=(1.0*pt[i][j],str*i),j=1..nops(F[i])),i=1..f)]);
  if lbl=NULL then 
    p:=plot([entries(pt)],'color'=vclr,'style'='point')
  else
    p:=plots['textplot']([seq([pt[i],lbl[i]],i=map(op,F))],'color'=vclr)
  fi;
  p:=p,seq(plot({seq([[pt[i[1]]],[pt[i[2]]]],i=C[op(j)])},
    'color'=op(j)),j=[indices(C)]);
  plots['display']({p},opts);
end:
#
`posets/plot_poset/adjust`:=proc(P,F,f,flag)
    local cords,i,j,vr,hr,bad,e,conflict,v,h,r,d,n,g;
  vr:=table([seq(seq(i=j,i=F[j]),j=1..f)]);
  bad:=table([seq(i=NULL,i=map(op,F))]);
  hr:=map(proc(x,y) if y[x[2]]-y[x[1]]>1 then x fi end,P,vr);
  if nops(hr)=0 then RETURN(args[5]) else cords:=args[5] fi;
  for e in hr do bad[e[2]]:=bad[e[2]],e[1] od;
  hr:=table([seq(seq(F[j][i]=i,i=1..nops(F[j])),j=1..f)]);
  for i from 3 to f do
    n:=nops(F[i]); d:=-1; j:=iquo(n,2)+1;
    while j>0 and j<=n do
      conflict:=true;
      while conflict do
        conflict:=false;
        for e in {bad[F[i][j]]} do
          v:=i-vr[e];
          h:=cords[i][j]-cords[vr[e]][hr[e]];
          for r to v-1 do
            if member(cords[i][j]-r*h/v,cords[i-r]) then
              if flag then g:=1/n else g:=1 fi;
              if d<0 then g:=[0$(j-1),g$(n-j+1)] else g:=[(-g)$j,0$(n-j)] fi;
              cords:=subsop(i=zip((x,y)->x+y,cords[i],g),cords);
              conflict:=true; break
            fi
          od;
          if conflict then break fi
        od
      od;
      j:=j+d; d:=-d-signum(d)
    od
  od; cords
end:
#
# P &* Q returns the direct product of the posets P and Q. Similarly, one
#  may use P &* Q &* R, etc. If any of the posets, say P, has isolated
#  vertices, then one must use the syntax (P,X) &* Q or (P,n) &* Q,
#  according to whether X or {1,...,n} is the vertex set of P.
# The output will be a poset on the vertex set {1,2,...,m} for some m.
#  If all of the arguments are of the form (P,X) or (P,n), then the
#  output will also be of this form.
# N.B.: rather than trap errors, we must return bad input unevaluated
#  in order to avoid breaking certain Maple commands in V.3 or later.
# It would be safer to name this `&p`....
#
`&*`:=proc() local flag,P,Q,X,n,i,x,y,e;
  flag:=true; n:=1; Q:={};
  i:=1; while i<=nargs do 
    if not type(args[i],'set'('list')) then RETURN('procname(args)') fi;
    P:=args[i]; i:=i+1;
    if i>nargs or type(args[i],'set'('list')) then
        flag:=false; X:=map(op,P)
      elif type(args[i],'set') then X:=args[i]; i:=i+1
      elif type(args[i],'integer') then X:={$1..args[i]}; i:=i+1
      else RETURN('procname(args)')
    fi;
    Q:={seq(seq([[e[1],x],[e[2],x]],x=X),e=Q),
      seq(seq([[x,e[1]],[x,e[2]]],x=1..n),e=P)};
    X:=[seq(seq([y,x],y=1..n),x=X)]; n:=nops(X);
    Q:=subs({seq(X[x]=x,x=1..n)},Q);
  od;
  if flag then Q,n else Q fi;
end:
#
# rand_poset(n) generates a random poset on n vertices, by flipping a fair
#  coin to decide whether [i,j] should be a relation, for 1 <= i < j <= n.
#  Then the covering relation of the transitive closure is returned.
# rand_poset(n,p) does the same, except using a biased coin for which the
#  probability of including the edge [i,j] is p. (0<p<1).
#
`posets/rand_poset`:=proc(n) local coin_flip,i,j,bias,P;
  if nargs>1 then bias:=args[2]*10^12 else bias:=0.5*10^12 fi;
  coin_flip:=proc(x,p) if rand()<p then x fi end;
  P:={seq(seq(coin_flip([i,j],bias),j=i+1..n),i=1..n)};
  posets['covers'](P,[$1..n],'natural');
end:
#
# ranked(P,X) returns true or false according to whether the poset P with
#  vertex set X is ranked; i.e., whether there exists an integer-valued
#  function r() on X such that r(y)-r(x)=1 for all (covering) relations
#  [x,y] in P.
# ranked(P,n) does the same, using X={1,...,n}.
# ranked(P) does the same, disregarding any isolated vertices of P.
#
# ranked(P,X,'ranks') does the same, and if the result is true, then the
#  name 'ranks' is assigned an ordered partition [R_1,R_2,...R_l] of X so
#  that assigning rank i to members of R_i yields a suitable rank function.
# ranked(P,n,'ranks') and ranked(P,'ranks') operate similarly. 
#
`posets/ranked`:=proc() local P,n,X,r,e,res,v,rank,i,flag;
  n:=nargs; flag:=false;
  if type(args[n],'name') then flag:=true; n:=n-1 fi;
  if n=1 then X:=map(op,args[1])
    elif type(args[2],'integer') then X:={$1..args[2]}
    else X:=args[2]
  fi;
  n:=nops(X); P:=subs({seq(X[i]=i,i=1..n)},args[1]);
  res:=[seq(r[i],i=1..n)];
  for e in P do
    i:=res[e[2]]-res[e[1]];
    if i=1 then next elif type(i,'integer') then RETURN(false) fi;
    res:=subs(readlib(`solve/linear`)({i=1},indets(i)),res);
  od;
  if not flag then RETURN(true) fi;
  rank:=table([seq(op(i)=n,i=indets(res))]);
  for i in res do
    v:=op(op(indets(i))); rank[v]:=min(rank[v],i-r[v])
  od;
  res:=subs({seq(v=-rank[op(v)],v=indets(res))},res);
  r:=max(-1,op(res)); rank:=table([seq(i=NULL,i=0..r)]);
  for i to n do rank[res[i]]:=rank[res[i]],X[i] od;
  assign(args[nargs],[seq({rank[i]},i=0..r)]); true;
end:
#
# rm_isom(L) removes extra isomorphic copies from a list (or set) L of 
# of directed graphs. Isolated vertices are ignored for the purpose of
# isomorphism testing. If L is a list, the result returned will be the
# sublist of L formed by the earliest instance of each isomorphism class
# in the list. If L is a set, the result will be a subset of L.
#
# Note that the fast discriminant is computed during the initial
# processing. This data could be helpful later but gets discarded.
#
`posets/rm_isom`:=proc() local z,Q,R,shapes,i,j,grp,sh,res,n,can;
  R:=table(args[1]); shapes:=table('sparse');
  for i to nops(args[1]) do
    R[i]:=`posets/rm_isom/norm`(R[i],z,'sh');
    shapes[sh]:=shapes[sh],i
  od;
  shapes:=map(x->subsop(1=NULL,x),[entries(shapes)]);
  n:=0; res:=table();
  for i in shapes do
    grp:=NULL; can:=NULL;
    for j in i do
      if not member(R[j],[can]) then grp:=grp,j; can:=can,R[j] fi
    od; grp:=[grp];
    if nops(grp)=1 then
      n:=n+1; res[n]:=grp[1]
    elif nops(grp)=2 then
      n:=n+1; res[n]:=grp[1];
      if not posets['isom'](R[grp[1]],R[grp[2]]) then
        n:=n+1; res[n]:=grp[2] fi;
    else can:=NULL;
      for j in grp do
        Q:=posets['canon'](R[j]);
        if not member(Q,[can]) then n:=n+1; can:=can,Q; res[n]:=j fi
      od
    fi
  od;
  if type(args[1],'set') then {seq(args[1][res[i]],i=1..n)} else
    res:=sort([seq(res[i],i=1..n)]); [seq(args[1][res[i]],i=1..n)]
  fi
end:
#
# Put directed graph G into normalized form--number the vertices in an
# order consistent with the fast discriminant. Also, assign to args[3]
# the Laurent polys used by fastdisc to distinguish vertices.
#
`posets/rm_isom/norm`:=proc(G,q) local mu,n,f,B,i,j,t;
  mu:=[map(op,G)]; n:=0;
  if mu=[{}] then mu:=[] fi;
  while nops(mu)>n do
    n:=nops(mu); B:=table([seq(seq(j=i,j=mu[i]),i=1..n)]);
    f:=convert([seq(t[i[1]]/q^B[i[2]]+t[i[2]]*q^B[i[1]],i=G)],`+`);
    mu:=map(`posets/part`,mu,f,t);
  od;
  assign(args[3],[seq(coeff(f,t[i[1]])+nops(i),i=mu)]);
  B:=map(op,mu); subs({seq(B[i]=i,i=1..nops(B))},G)
end:
#
# subinterval(P,[a,b]) returns the subposet of P formed by the
#  vertices x such that a <= x <= b.
# subinterval(P,[a,infinity]) does the same for all vertices >= a.
# subinterval(P,[-infinity,b]) does the same for all vertices <= b.
#
`posets/subinterval`:=proc(P) local i,X,up,e,x,new,Q;
  i:=args[nargs];
  if nargs=2 then X:=map(op,P)
    elif type(args[2],'integer') then X:={$1..args[2]}
    else X:=args[2]
  fi;
  if i[2]=infinity then
    if i[1]=-infinity or i[1]=infinity then RETURN(args[1..nargs-1]) fi;
    if not member(i[1],X) then RETURN(NULL) fi;
    up:=table([seq(x=NULL,x=X)]);
    for e in P do up[e[1]]:=up[e[1]],e[2] od;
    X:={i[1]}; new:=X;
    do new:={seq(up[x],x=new)};
      if new={} then break else X:={op(X),op(new)} fi;
    od;
    Q:=map(proc(f,Y) if member(f[1],Y) and member(f[2],Y) then f fi end,P,X);
    if nops(Q)>0 then Q else {},X fi
  else
    Q:=`posets/subinterval`(posets['dual'](P,X),[i[2],infinity]);
    if Q=NULL then RETURN(Q) fi;
    `posets/subinterval`(posets['dual'](Q),[i[1],infinity])
  fi;
end:
#
# subposet(P,X) return the (induced) subposet of P formed by the set of
#  vertices X, a subset of the vertex set of P.
#
`posets/subposet`:=proc(P) local Q,X,Y,down,x,y;
  X:=args[nargs];
  if nargs=2 then Y:=map(op,P)
    elif type(args[2],'integer') then Y:={$1..args[2]}
    else Y:=args[2]
  fi;
  if nops(X minus Y)>0 then
    ERROR(`must specify a subset of the vertex set`) fi;
  down:=posets['closure'](P,Y,'table');
  Q:={seq(seq([y,x],y=down[x] intersect X),x=X)};
  posets['covers'](Q,'closed');
end:
#
# zeta(P,X,z) returns the zeta polynomial of the poset P with vertex
#  set X in the variable z.
# zeta(P,n,z) does the same, using X={1,...,n}.
# zeta(P,z) does the same, assuming there are no isolated points.
#
`posets/zeta`:=proc() local num,poly,x,i,j,X,new,down,bin;
  i:=nargs-1;
  if i=1 then X:=map(op,args[1])
    elif type(args[2],'integer') then X:={$1..args[2]}
    else X:=args[2]
  fi;
  down:=posets['closure'](args[1],X,'table');
  new:=table([seq(x=1,x=X)]);
  poly:=0; num:=nops(X); bin:=1;
  for i while num>0 do;
    poly:=poly+num*bin;
    new:=table([seq(x=convert([seq(new[j],j=down[x])],`+`),x=X)]);
    num:=convert(convert(new,'list'),`+`); 
    bin:=bin*(args[nargs]-i-1)/i;
  od;
  expand(poly);
end:
#
# The full library of posets with <= 8 vertices and lattices with <= 10
# vertices,stored in a highly compressed format.
#
`posets/pcodes`:=
table([(3)=[[3],[1,2]],(4)=[[7],[1,-3,4],[4,6],[1,2,6],[2
,4]],(5)=[[15],[1,-3,-7,8],[8,9,12],[1,2,4,8,-10,12],[1,3,4,
12],[4,8],[14],[10],[1,2,4,-6,8],[8,14],[1,2,14],[4,8,12],[1
,2,-6,8],[8,12],[1,2,4,12],[4,8]],(6)=[[31],[1,-3,-7,-15,16],
[16,17,-19,24],[1,2,8,16,-18,-22,24],[1,3,4,5,8,16,20,24],[
1,3,7,8,24],[8,16],[24,28],[8,16,20],[1,2,4,10,-12,20],[1,4
,8,-12,16],[16,24,28],[1,2,4,8,28],[4,8,-24,28],[8,16,24],[
8,16,-18,20],[1,2,4,8,12,16,20],[1,2,4,8,-12,16],[16,17,20,
28],[1,2,4,16,18,20,28],[1,3,4,12,28],[4,8,16,24],[1,4,12,
16],[16,24],[1,4,8,24],[8,16],[30],[1,2,4,-5,-6,-12,-14,16],
[16,26],[1,2,-10,16],[16,18,20,24],[1,4,8,16,-20,24],[1,2,4,
8,16,-20,24],[4,8,16,-17,-18,24],[1,2,4,5,6,8,24],[8,16],[
30],[8,16,22],[1,2,-6,8,-9,-10,-14,16],[16,30],[1,2,30],[2,4
,16,28],[1,2,-6,-14,16],[16,28],[24],[4,16,20],[1,2,4,8,-12,
16],[16,17,18,24],[1,2,8,16,18,24],[2,4,8,16,-20,24],[1,2,6
,8,24],[8,16],[28],[16,20],[1,2,4,8,-12,16],[16,28],[4,16,28
],[1,2,4,28],[8,16,24],[1,2,4,-12,16],[16,24],[1,2,4,8,24],
[8,16]],(7)=[[63],[1,-3,-7,-15,-31,32],[32,33,-35,-39,48],[1,2,
16,32,-34,-38,-46,48],[1,3,4,5,12,16,32,36,44,48],[1,3,7,8,
9,11,16,32,40,48],[1,3,7,15,16,48],[16,32],[48,49,56],[16,32
,33,40],[1,2,8,16,-17,18,-24,32,-34,-38,40],[1,3,4,5,8,20,
21,24,40],[1,8,16,-24,32],[32,48,-50,56],[1,2,8,16,48,56],[4
,8,16,-48,-52,56],[16,32,48],[16,32,-34,-38,40],[1,2,4,8,16,
18,20,24,32,36,40],[1,2,3,6,8,16,18,24,32,40],[1,2,8,16,-\
24,32],[32,33,36,40,48,52,56],[1,2,4,8,16,32,34,36,40,48,52
,56],[1,3,4,5,8,16,20,24,48,52,56],[4,8,16,32,33,40,48,56]
,[1,2,6,8,16,20,24,48,56],[8,16,32,48],[16,32,36,40],[1,4,
8,16,20,24,32,40],[1,4,8,16,24,32],[32,33,35,40,56],[1,2,8,
32,34,38,40,56],[1,3,4,5,8,24,32,36,40,56],[1,3,7,8,24,56]
,[8,16,32,48],[1,8,24,32],[32,48],[1,8,16,48],[16,32],[60],[
1,4,36],[1,-3,4,8,-9,-12,-24,-28,32],[32,52],[1,4,8,16,52],
[16,32,36],[1,4,8,16,-20,32],[32,33,34,36,52],[1,2,4,32,52],
[2,4,8,16,32,40,-48,52],[4,16,32,-40,48],[1,4,-12,-20,52],[1
,2,4,8,16,18,20,32,48],[1,2,4,-20,32],[32,36,40,48],[1,2,8
,16,32,-40,48],[1,4,8,16,32,-40,48],[8,16,32,-33,-36,48],[1,
3,4,8,9,12,16,48],[16,32],[60],[32,44],[1,2,4,8,16,32,-34,
36],[1,2,-3,4,8,-10,-12,16,-17,-18,-20,-24,-28,32],[32,60],[1
,2,4,8,60],[2,4,8,32,60],[4,8,32,56],[16,32,52],[1,2,-3,4,
8,-10,-12,-24,-28,32],[32,60],[8,32,56],[16,32,-48,52],[1,4,8
,32,36],[1,-3,4,8,-10,-12,-24,-28,32],[32,56],[32,48],[8,32,
40],[1,2,4,8,16,-24,32],[32,48,52],[1,2,4,8,16,52],[16,32,-\
34,36],[1,2,4,8,16,20,32,36],[1,2,4,8,16,-20,32],[32,33,34,
36,40,48,52],[1,2,4,8,16,32,34,36,40,48,52],[2,4,8,16,32,
33,36,40,48,52],[4,32,40,48],[4,8,16,32,34,36,48,52],[1,2,4
,8,16,20,32,48],[4,16,32,36],[1,2,4,8,16,20,32],[32,33,34,
36,40,48],[1,2,4,8,16,32,36,40,48],[2,16,32,36,-40,48],[2,4
,8,16,32,-40,48],[2,8,16,32,-34,-36,48],[1,2,3,4,8,10,12,
16,48],[16,32],[48,60],[16,32,33,36,44],[1,2,4,16,17,18,20,
32,34,36,44],[1,4,8,16,24,32,40],[1,3,4,12,16,17,20,28,32],
[32,48,60],[1,2,4,16,48,60],[4,16,48,60],[8,16,32,48,56],[16
,32,34,36,44],[1,2,4,16,18,20,32,36,44],[1,2,4,8,16,24,32,
40],[1,2,3,4,12,16,18,20,28,32],[32,33,36,60],[1,2,4,32,34,
36,60],[1,3,4,12,60],[4,8,32,40,56],[1,4,16,20,32,48],[1,3,
4,12,28,32],[32,48,56],[1,4,8,16,48,56],[16,48],[16,32,40],[
1,4,8,16,24,32],[32,33,36,48],[1,2,4,16,32,34,36,48],[4,8,
16,32,40,48],[1,3,4,12,16,48],[16,32],[56],[32,40],[1,4,8,16
,-24,32],[32,56],[2,8,32,56],[1,4,8,56],[16,32,48],[1,4,8,-\
24,32],[32,48],[1,4,8,16,48],[16,32],[62],[1,2,4,-5,-6,-12,-\
13,-14,-28,-30,32],[32,33,34,36,-38,-44,48],[1,4,16,32,34,-36
,-44,48],[1,2,4,16,32,-36,-44,48],[4,8,16,32,-33,-34,-40,-41
,-42,48],[1,2,4,5,8,9,12,16,32,34,40,42,48],[1,2,4,5,6,8,
9,10,12,16,32,40,48],[1,2,4,12,16,32,33,34,48],[1,2,4,5,6,
12,13,14,16,48],[16,32],[58],[42],[1,2,-5,-6,-10,16,-17,-18,-\
26,32],[32,33,34,48],[1,4,16,32,34,-40,48],[1,2,4,8,16,32,-\
36,-40,48],[1,2,5,6,10,16,48],[16,32],[48,56],[16,32,36,40],
[1,2,4,8,20,-24,40],[1,2,4,8,16,-24,32,-34,40],[1,2,4,8,16
,-24,32],[32,48,56],[1,2,4,8,16,56],[8,16,32,-48,56],[16,32,
48],[16,32,40],[1,2,4,8,24,40],[1,2,4,8,16,-24,32],[32,48,
56],[4,8,16,32,56],[1,2,4,8,16,56],[8,16,32,-48,56],[16,32,
48],[16,32,-36,40],[1,2,4,8,16,24,32,40],[1,2,4,8,16,-24,32
],[32,48,56],[1,2,4,8,16,48,56],[16,32,48],[16,32,-34,40],[1
,2,8,24,40],[1,2,4,8,16,17,24,32,40],[1,2,4,8,16,-24,32],
[32,33,34,36,40,56],[1,8,32,34,36,40,56],[1,2,4,8,32,36,40,
56],[1,4,8,32,33,34,40,56],[1,2,4,8,24,32,34,40,56],[1,2,4
,5,6,8,24,56],[8,16,32,48],[1,2,4,8,24,32],[32,48],[1,2,4,
8,16,48],[16,32],[62],[1,2,-6,8,-9,-10,-14,-24,-25,-26,-30,32
],[32,54],[2,54],[2,32,38],[1,2,-6,8,-9,-10,16,-17,-18,-22,
32],[32,33,34,-38,40,-41,-42,48],[1,2,8,16,32,34,-40,-42,48],
[2,4,8,16,32,-36,-40,-44,48],[1,2,6,8,9,10,16,32,40,48],[8,
16,32,-33,-34,-38,48],[1,2,8,9,10,16,32,34,38,48],[1,2,4,8,
10,12,16,32,36,48],[1,2,6,8,9,10,14,16,48],[16,32],[62],[16,
32,46],[1,2,-6,-14,16,-17,-18,-22,-30,32],[32,62],[1,2,62],[2
,4,32,60],[1,2,-6,-14,-30,32],[32,60],[4,16,60],[8,56],[4,16
,32,44],[1,2,4,-6,-12,16,-20,-28,32],[32,33,34,-38,48],[1,2,
16,32,34,-38,48],[2,4,16,32,-36,-44,48],[1,2,6,8,10,16,32,
40,48],[1,2,6,14,16,48],[16,32],[60],[44],[1,2,4,-6,8,-12,16
,-17,-18,-20,-24,-28,32],[32,56],[1,2,8,-24,32],[32,52],[32,
48],[4,32,36],[1,2,4,8,16,-20,32],[32,33,34,36,40,48],[1,2,
4,8,16,32,36,40,48],[2,4,8,16,32,-36,40,48],[4,16,32,-34,-\
40,48],[4,8,16,32,-36,48],[1,2,4,6,8,12,16,48],[16,32],[48,
56],[16,32,40],[1,2,8,16,-24,32,40],[1,2,4,8,16,-20,-24,32,
-36,40],[1,2,8,16,-24,32],[32,48,56],[1,2,8,16,48,56],[4,8,
16,32,48,56],[16,32,48],[16,32,40],[1,2,4,8,20,-24,40],[1,2,
8,16,-24,32],[32,48,56],[1,2,4,8,16,48,56],[8,16,-48,56],[16
,32,48],[16,32,-36,40],[1,2,4,8,16,24,32,40],[1,2,4,8,16,-\
24,32],[32,33,34,40,56],[1,8,32,34,40,56],[1,2,4,8,32,36,40
,56],[1,2,6,8,24,56],[8,16,32,48],[1,2,8,24,32],[32,48],[1,
2,8,16,48],[16,32],[60],[1,2,4,8,-9,-10,-12,-24,-28,32],[32,
52],[4,36],[1,2,4,8,16,-20,32],[32,36,40,48],[1,8,16,32,-40,
48],[1,2,4,8,16,32,-40,48],[1,4,8,16,32,-40,48],[8,16,32,-\
33,-36,48],[1,2,4,8,9,10,12,16,48],[16,32],[60],[16,32,44],[
1,2,4,-12,16,-17,-18,-20,-28,32],[32,60],[8,32,56],[4,16,32,
44],[1,2,4,-12,16,-18,-20,-28,32],[32,60],[1,4,32,60],[1,2,4
,60],[4,8,32,56],[1,2,4,-12,-28,32],[32,56],[48],[8,32,40],[
1,2,4,8,16,-24,32],[32,33,34,36,48],[1,16,32,48],[1,2,4,16,
32,36,48],[1,4,8,16,32,-40,48],[1,2,4,12,16,48],[16,32],[56]
,[40],[1,2,4,8,16,-24,32],[32,56],[8,32,56],[1,8,32,56],[1,
2,4,8,56],[16,32,48],[1,2,4,8,-24,32],[32,48],[1,2,4,8,16,
48],[16,32]],(8)=[[127],[1,-3,-7,-15,-31,-63,64],[64,65,-67,-71,
-79,96],[1,2,32,64,-66,-70,-78,-94,96],[1,3,4,5,12,32,64,68,
76,92,96],[1,3,7,8,9,11,24,25,32,64,72,88,96],[1,3,7,15,16
,17,19,23,32,64,80,96],[1,3,7,15,31,32,96],[32,64],[96,97,-\
99,112],[32,64,65,-67,80],[1,2,16,32,-33,34,-48,64,-66,-70,-\
78,80],[1,3,4,5,12,16,32,33,35,36,37,44,48,64,68,76,80],[1,
3,7,8,9,11,16,40,41,43,48,80],[1,16,32,-48,64],[64,96,-98,-\
102,112],[1,2,16,32,96,-98,112],[4,16,32,-96,-100,-108,112],[
32,64,96],[32,64,-66,-70,-78,80],[1,2,4,16,32,34,36,48,64,68
,76,80],[1,2,3,6,8,9,10,16,32,34,38,40,42,48,64,72,80],[1,
2,3,6,7,14,16,32,34,38,48,64,80],[1,2,16,32,-48,64],[64,65,
68,80,96,100,108,112],[1,2,4,16,32,64,66,68,80,96,100,108,
112],[1,3,4,5,12,16,32,36,48,96,100,108,112],[4,8,16,32,64,
65,72,80,96,104,112],[1,2,6,8,9,10,16,32,36,40,48,96,104,
112],[1,16,32,36,48,96,112],[16,32,64,96],[32,64,68,76,80],[1
,4,8,16,32,36,40,48,64,72,80],[1,3,4,5,12,16,32,36,44,48,
64,80],[1,4,16,32,48,64],[64,65,67,72,73,80,96,104,112],[1,2
,8,16,32,64,66,70,72,74,80,96,104,112],[1,3,4,5,8,9,12,16,
32,40,48,64,68,72,76,80,96,104,112],[1,3,7,8,9,11,16,32,40,
48,96,104,112],[8,16,32,64,65,67,80,96,112],[1,2,8,9,10,16,
32,40,48,64,66,70,80,96,112],[1,3,4,5,12,13,16,32,40,48,96,
112],[16,32,64,96],[32,64,72,80],[1,8,16,32,40,48,64,80],[1,
8,16,32,48,64],[64,65,67,71,80,112],[1,2,16,64,66,70,78,80,
112],[1,3,4,5,12,16,48,64,68,76,80,112],[1,3,7,8,9,11,16,
48,64,72,80,112],[1,3,7,15,16,48,112],[16,32,64,96],[1,16,48
,64],[64,96],[1,16,32,96],[32,64],[112,120],[1,8,16,-48,64,65
,72],[1,2,-3,-6,8,18,-24,-56,72],[1,-3,8,16,-17,-24,-48,-56,
64],[64,96,104],[1,8,16,32,96,104],[32,64,65,72],[1,2,8,16,
32,-33,34,-40,64,-66,-70,72],[1,8,16,32,-40,64],[64,65,66,72,
80,96,-98,104],[1,2,8,16,32,64,-80,96,104],[2,4,8,16,32,64,
80,-96,-100,104],[8,32,64,-80,96],[8,16,32,64,-65,66,-72,96,
104],[1,2,3,6,8,16,17,18,24,32,34,40,96,104],[1,4,8,16,20,
-24,32,-34,-36,-40,-96,-100,104],[1,2,8,16,32,34,40,64,96],[
32,64,-66,-70,72],[1,2,4,8,16,32,34,36,40,64,68,72],[1,2,3,
6,8,16,17,18,24,32,34,40,64,72],[1,2,8,16,32,-40,64],[64,65
,67,68,69,72,84,88,104],[1,2,4,8,64,66,68,72,84,88,104],[1,
3,4,5,8,20,24,40,64,68,72,84,88,104],[4,8,16,32,64,65,72,
80,81,88,96,104],[1,2,4,5,6,8,16,17,18,20,24,32,36,40,64,
66,72,80,82,88,96,104],[8,32,64,80,96],[1,4,8,20,24,40,64,
65,67,72,104],[1,2,3,6,8,22,24,40,104],[1,4,8,16,24,32,36,
40,64,96],[1,4,8,40,64],[64,72,80,96],[1,2,16,32,64,-80,96],
[1,8,16,32,64,-80,96],[16,32,64,-65,-72,96],[1,3,8,16,17,24,
32,96],[32,64],[112,120],[64,80,88],[1,2,8,16,32,-48,64,-66,-\
70,72],[1,2,3,4,5,6,8,16,18,20,24,32,33,34,36,40,48,56,64,
68,72],[1,2,-3,-6,8,16,-18,-24,32,-33,-34,-40,-48,-56,64],[64
,120],[1,2,8,16,120],[2,4,8,16,64,120],[8,16,64,112],[32,64,
96,104],[1,2,8,16,-48,64,-66,-70,72],[1,2,-3,-6,8,16,-18,-24
,-48,-56,64],[64,-112,120],[8,16,-112,120],[16,64,112],[32,64,
-96,-100,104],[1,4,8,16,48,64,68,72],[1,3,4,5,8,16,18,20,24
,48,56,64,72],[1,-3,4,-5,8,16,-18,-20,-24,-48,-56,64],[64,
112],[64,96],[16,64,80],[1,2,8,16,32,-48,64],[64,96,-98,104],
[1,2,8,16,32,96,104],[32,64,-66,-70,72],[1,2,4,8,16,32,34,
36,40,64,68,72],[1,2,3,6,8,16,18,24,32,34,40,64,72],[1,2,8
,16,32,-40,64],[64,65,66,68,72,80,96,100,104],[1,2,4,8,16,
32,64,66,68,72,80,96,100,104],[2,4,8,16,32,64,65,68,72,80,
96,100,104],[4,8,32,64,66,72,80,96,104],[8,32,64,80,96],[4,8
,16,32,64,66,68,72,96,100,104],[1,2,3,4,5,6,8,16,18,20,24,
32,36,40,96,100,104],[1,2,8,16,24,32,36,40,96,104],[1,2,4,8
,16,32,36,40,64,96],[32,64,68,72],[1,2,4,8,16,32,36,40,64,
72],[1,2,4,8,16,32,40,64],[64,65,66,67,70,72,80,82,88,96,
104],[1,2,8,16,32,64,66,70,72,80,82,88,96,104],[2,4,8,16,32
,64,65,68,69,72,80,84,88,96,104],[1,2,3,4,5,6,8,16,18,20,
24,32,40,64,68,72,80,84,88,96,104],[1,2,6,8,16,18,24,32,40,
64,65,72,80,88,96,104],[8,64,80,96],[8,16,32,64,66,70,72,96,
104],[1,2,4,8,16,18,20,24,32,40,64,68,72,96,104],[1,2,8,16,
24,32,40,64,96],[8,32,64,72],[1,2,8,16,32,40,64],[64,65,66,
72,80,96],[1,2,8,16,32,64,72,80,96],[2,4,32,64,72,-80,96],[
2,8,16,32,64,-80,96],[2,16,32,64,-66,-72,96],[1,2,3,6,8,16,
18,24,32,96],[32,64],[96,112,120],[32,64,65,68,72,80,84,88],[
1,2,4,8,16,32,34,36,40,48,64,66,68,72,80,84,88],[1,4,8,16,
32,40,48,64,65,72,80,88],[1,4,8,16,32,48,64,80],[1,4,8,16,
32,48,64,68,72],[1,3,4,5,8,16,20,24,32,33,36,40,48,56,64,
72],[1,3,4,5,8,16,20,24,32,33,36,40,48,56,64],[64,96,112,
120],[1,2,4,8,16,32,96,120],[4,8,16,32,96,120],[8,16,32,64,
96,112,120],[16,32,64,96,112],[32,64,96,100,104],[32,64,66,68,
72,80,84,88],[1,2,4,8,16,32,36,40,48,64,68,72,80,84,88],[1,
2,4,8,16,32,40,48,64,66,72,80,88],[1,2,4,8,16,32,48,64,80]
,[1,2,4,8,16,32,48,64,68,72],[1,2,3,4,5,6,8,16,20,24,32,
34,36,40,48,56,64,72],[1,2,3,4,5,6,8,16,20,24,32,34,36,40,
48,56,64],[64,65,68,72,80,112,120],[1,2,4,8,16,64,66,68,72,
80,120],[1,3,4,5,8,16,20,24,48,120],[4,8,16,64,65,72,80,112
,120],[1,2,4,5,6,8,16,20,24,48,64,66,72,80,112,120],[8,16,
64,80,112],[16,32,64,68,72,96,100,104],[1,4,8,16,24,32,36,40
,48,64,72,96,104],[1,4,8,16,32,40,48,64,96],[1,4,8,16,48,
64,68,72],[1,3,4,5,8,16,20,24,48,56,64,72],[1,3,4,5,8,16,
20,24,48,56,64],[64,96,112,120],[1,4,8,16,32,96,112,120],[16,
32,64,96,112],[32,64,96,104],[32,64,65,72,80,88],[1,2,4,8,16
,32,34,40,48,64,66,72,80,88],[1,4,8,16,32,48,64,80],[1,4,8
,16,32,48,64,72],[1,3,4,5,8,16,20,24,32,33,40,48,56,64],[
64,65,66,72,80,112,120],[1,2,8,16,64,66,72,80,112,120],[2,4,
8,16,32,64,65,68,72,80,96,112,120],[1,8,16,20,24,48,112,120]
,[8,16,64,80,112],[16,32,64,68,72,96,104],[1,2,4,8,16,24,32
,34,40,48,64,72,96,104],[1,2,4,8,16,32,40,48,64,96],[1,2,8
,16,48,64,72],[1,2,3,6,8,16,20,24,48,56,64],[64,96,112],[1,
4,8,16,32,96,112],[32,64,96],[32,64,80],[1,4,8,16,32,48,64],
[64,96,100,104],[1,4,8,16,32,96,100,104],[32,64,68,72],[1,4,
8,16,32,36,40,64,72],[1,4,8,16,32,40,64],[64,65,68,72,80,96
,104],[1,2,4,8,16,32,64,66,68,72,80,96,104],[4,8,16,32,64,
65,72,80,96,104],[8,32,64,80,96],[8,16,32,64,68,72,96,104],[
1,3,4,5,8,16,20,24,32,40,96,104],[1,4,8,16,32,40,64,96],[
32,64,72],[1,4,8,16,32,40,64],[64,65,68,72,80,96],[1,2,4,8,
16,32,64,66,68,72,80,96],[4,32,64,65,72,80,96],[4,8,16,32,
64,80,96],[4,16,32,64,68,72,96],[1,3,4,5,8,16,20,24,32,96],
[32,64],[96,97,104,120],[32,64,65,67,72,88],[1,2,8,32,33,34,
40,64,66,70,72,88],[1,3,4,5,8,24,32,33,35,36,37,40,56,64,
68,72,88],[1,8,16,32,40,48,64,80],[1,3,8,24,32,33,40,56,64]
,[64,96,98,104,120],[1,2,8,32,96,98,104,120],[4,8,32,96,100,
104,120],[16,32,64,96,112],[32,64,66,70,72,88],[1,2,4,8,32,
34,36,40,64,68,72,88],[1,2,3,6,8,24,32,34,38,40,56,64,72,
88],[1,2,8,16,32,40,48,64,80],[1,2,3,6,8,24,32,34,40,56,64
],[64,65,68,72,96,100,104,120],[1,2,4,8,32,64,66,68,72,96,
100,104,120],[1,3,4,5,8,24,32,36,40,96,100,104,120],[4,8,32,
64,65,72,96,104,120],[1,2,6,8,24,32,36,40,96,104,120],[8,16,
32,64,80,96,112],[1,4,8,32,36,40,64,96],[32,64,68,72,88],[1,
4,8,32,36,40,64,72,88],[1,4,8,16,32,40,48,64,80],[1,3,4,5,
8,24,32,36,40,56,64],[64,65,67,72,88,120],[1,2,8,64,66,70,
72,88,120],[1,3,4,5,8,24,64,68,72,88,120],[1,3,7,8,24,56,
120],[8,16,64,80,112],[1,8,24,32,40,64,96],[1,3,8,24,56,64],
[64,96,112],[1,8,16,32,96,112],[32,96],[32,64,80],[1,8,16,32,
48,64],[64,65,72,96],[1,2,8,32,64,66,72,96],[8,16,32,64,80,
96],[1,3,8,24,32,96],[32,64],[112],[64,80],[1,8,16,32,-48,64]
,[64,112],[2,16,64,112],[1,8,16,112],[32,64,96],[1,8,16,-48,
64],[64,96],[1,8,16,32,96],[32,64],[124],[1,-3,4,8,-9,-11,-12
,-24,-25,-28,-56,-60,64],[64,100],[1,2,4,8,32,64,100],[4,32,
64,96],[1,4,-36,64],[64,65,68,72,-76,-88,96],[1,2,8,32,64,-\
66,68,-72,-88,96],[1,3,4,8,9,24,32,64,68,72,88,96],[1,4,8,
32,64,-72,-88,96],[8,16,32,64,-65,-68,-80,-81,-84,96],[1,2,4,
8,9,10,16,17,18,24,32,64,66,68,80,82,84,96],[1,3,4,8,9,12,
16,17,20,24,32,64,80,96],[1,4,8,24,32,64,65,67,68,96],[1,3,
4,8,9,11,12,24,25,28,32,96],[32,64],[116],[84],[1,-3,4,8,-9,
-12,16,-17,-20,32,-33,-36,-40,-48,-52,64],[64,116],[2,4,16,64,
116],[16,64,112],[1,4,8,16,116],[32,64,100],[1,-3,4,8,-9,-12,
16,-17,-20,-48,-52,64],[64,100],[1,4,8,16,32,100],[32,64,68],
[1,4,8,16,32,-36,64],[64,65,68,72,80,96],[1,2,8,32,64,68,-\
80,96],[1,4,8,16,32,64,-72,-80,96],[8,32,64,-68,80,96],[1,8,
16,32,64,-65,-68,96],[1,3,4,8,9,12,16,17,20,32,96],[32,64],
[96,116],[32,64,84],[1,2,4,84],[1,4,8,16,40,48,-80,84],[1,2,
4,8,16,32,-48,64,-72,80],[1,2,-3,4,-10,-12,-20,32,-33,-34,-\
36,-52,64],[64,96,116],[1,2,4,32,116],[4,8,16,32,64,116],[16,
32,64,112],[32,64,84],[1,2,-3,4,-10,-12,-20,32,-34,-36,-52,64
],[64,96,116],[1,2,4,8,16,32,116],[32,64,112],[4,32,96,116],
[4,32,64,-96,100],[32,64,72,-80,84],[1,2,4,8,16,32,36,-48,64
,-65,-68,-80,84],[1,2,4,8,16,32,36,64,68],[1,2,-3,4,8,-9,-\
10,-12,16,-18,-20,32,-33,-36,-40,-48,-52,64],[64,96,112],[1,2,
4,8,16,32,112],[32,96],[32,64,-72,80],[1,2,4,8,16,32,48,64,
80],[1,2,4,8,16,32,-48,64],[64,65,68,116],[1,2,4,32,64,-66,
68,-96,116],[4,16,64,-72,-80,112],[1,4,8,16,18,20,48,64,80,
112],[1,2,4,32,36,64,96],[1,-3,4,-12,-20,-52,64],[64,65,66,
68,72,80,96,112],[1,2,4,8,16,32,64,66,68,72,80,96,112],[2,
16,32,64,65,68,72,80,96,112],[2,4,16,32,64,72,80,96,112],[2,
4,8,16,32,64,65,66,68,80,96,112],[16,64,66,68,96],[1,2,4,32
,48,96],[1,2,4,8,16,18,32,48,64,96],[16,32,64,80],[1,2,4,8
,16,32,48,64],[64,65,66,68,96],[1,2,4,32,64,-66,68,96],[2,8
,32,64,-65,68,-72,-80,96],[2,4,8,16,32,64,-72,-80,96],[1,2,
3,4,10,12,20,32,96],[32,64],[96,112],[32,64,72,80],[1,4,8,16
,40,-48,80],[1,4,8,16,32,-48,64,-65,-68,80],[1,4,8,16,32,-\
48,64],[64,96,112],[1,2,4,8,16,32,112],[8,16,32,112],[16,32,
64,-96,112],[32,64,96],[32,64,-72,80],[1,2,4,8,16,32,48,64,
68,80],[1,2,4,8,16,32,-48,64],[64,96,112],[2,8,16,32,64,112]
,[1,4,8,16,32,112],[16,32,64,-96,112],[32,64,96],[32,64,-72,
80],[1,4,8,16,32,48,64,80],[1,4,8,16,32,-48,64],[64,96,112],
[1,4,8,16,32,96,112],[32,64,96],[32,64,-65,-68,80],[1,2,4,8,
16,32,48,64,68,80],[1,4,8,16,32,33,48,64,80],[1,4,8,16,32,
-48,64],[64,65,68,72,80,112],[1,2,16,64,66,68,72,80,112],[1,
4,8,16,48,64,68,72,80,112],[1,4,8,16,64,72,80,112],[1,8,16,
64,65,68,80,112],[1,2,3,4,8,10,16,48,64,66,68,80,112],[1,3,
4,8,9,12,16,48,112],[16,32,64,96],[1,4,8,16,48,64],[64,96],
[1,4,8,16,32,96],[32,64],[124],[1,2,-3,4,8,-10,-12,16,-17,-\
18,-19,-20,-24,-26,-28,-48,-49,-50,-52,-56,-60,64],[64,108],[8,
64,76],[1,2,-3,4,8,-10,-12,16,-17,-18,-20,-24,32,-33,-34,-36,
-40,-44,64],[64,96,100],[1,2,4,8,16,32,64,100],[2,4,32,64,80
,-96,100],[4,64,96],[2,4,8,16,32,64,100],[2,4,16,32,64,-68,
100],[4,32,64,-66,68],[1,2,4,8,16,20,32,36,64,68],[1,2,4,8,
16,32,-36,64],[64,65,66,68,72,-76,80,-81,-82,-84,-88,96],[1,2
,4,8,16,32,64,-66,68,72,-80,-84,-88,96],[2,16,32,64,-65,68,
-72,-80,-84,-88,96],[1,2,3,4,8,10,16,17,18,20,24,32,64,68,
72,80,88,96],[2,4,8,16,32,64,-72,-80,-88,96],[2,8,16,32,64,
-66,-68,-80,-82,-84,96],[1,2,4,8,10,16,18,24,32,64,68,80,84,
96],[1,2,3,4,8,10,12,16,17,18,20,24,32,64,80,96],[16,32,64,
-65,-66,-68,-72,-74,-76,96],[1,2,4,8,10,16,17,18,20,24,32,64
,66,68,72,74,76,96],[1,2,4,8,16,18,32,64,65,68,72,76,96],[
1,2,4,8,10,16,18,20,24,32,64,72,96],[1,2,4,8,16,18,24,32,
64,66,68,96],[1,2,3,4,8,10,12,16,17,18,19,20,24,26,28,32,
96],[32,64],[124],[32,64,92],[1,2,-3,4,8,-10,-12,-24,-26,-28,
32,-33,-34,-35,-36,-40,-42,-44,-56,-60,64],[64,124],[1,2,4,8,
124],[2,4,8,64,124],[4,8,64,120],[8,16,64,116],[1,2,-3,4,8,
-10,-12,-24,-26,-28,-56,-60,64],[64,124],[4,8,124],[8,32,64,
120],[16,64,116],[8,32,64,92],[1,2,-3,4,8,-10,-12,-24,-26,-28
,32,-33,-36,-40,-44,-56,-60,64],[64,120],[2,8,32,120],[16,64,
112],[8,32,64,88],[1,2,-3,4,8,-10,-12,-24,32,-40,-56,64],[64,
116],[100],[16,64,84],[1,2,-3,4,8,-10,-12,16,-18,-20,-24,32,-\
34,-36,-48,-52,64],[64,65,66,-67,68,72,-74,-76,-88,96],[1,2,4
,8,32,64,-66,68,72,-76,-88,96],[2,32,64,-65,68,-72,-88,96],[
1,2,3,4,8,10,32,64,68,72,88,96],[2,4,8,32,64,-72,-88,96],[
2,8,16,32,64,-66,-68,-80,-82,-84,96],[1,2,4,8,10,16,18,32,
64,68,80,84,96],[1,2,3,4,8,10,12,16,18,20,24,32,64,80,96],
[1,2,3,4,8,10,24,32,64,66,68,96],[1,2,3,4,8,10,12,24,26,
28,32,96],[32,64],[124],[64,92],[1,-3,4,8,-10,-12,-24,-28,32,
-33,-35,-36,-40,-42,-44,-56,-60,64],[64,120],[16,64,112],[8,64,
88],[1,-3,4,8,-10,-12,-24,32,-40,-56,64],[64,116],[-96,100],[
16,64,-80,84],[1,2,4,8,16,32,64,68],[1,2,-3,4,8,-10,-12,16,
-17,-20,-24,32,-34,-36,-48,-52,64],[64,65,68,72,96,100],[1,2,
4,8,16,32,64,72,80,96,100],[4,64,96],[4,8,16,32,64,68,80,96
,100],[4,32,64,68],[1,4,8,32,36,64],[64,65,-67,68,72,-74,-76
,-88,96],[1,2,4,8,16,32,64,-66,68,72,-76,-80,-84,-88,96],[1,
3,4,8,10,12,24,32,64,68,72,88,96],[4,8,32,64,-72,-88,96],[8
,16,32,64,-66,-68,-80,-84,96],[1,2,4,8,10,12,16,17,20,24,32
,64,68,80,84,96],[1,2,4,8,12,16,20,24,32,64,80,96],[1,4,8,
24,32,64,68,96],[1,3,4,8,10,12,24,28,32,96],[32,64],[120],[
64,88],[1,2,-3,4,8,-10,-12,16,-24,32,-33,-34,-36,-40,-48,-56,
64],[64,112],[16,64,80],[1,2,4,8,16,32,-48,64],[64,104],[96],
[8,64,72],[1,2,4,8,16,32,-40,64],[64,65,66,68,72,80,96],[1,
2,4,8,16,32,64,72,80,96],[2,32,64,-72,80,96],[2,4,8,16,32,
64,-72,80,96],[2,8,32,64,-66,-80,96],[2,8,16,32,64,-72,96],[
1,2,3,4,8,10,12,16,24,32,96],[32,64],[116],[84],[1,2,4,8,16
,32,64,-66,68],[1,2,-3,4,8,-10,-12,16,-18,-20,32,-33,-34,-36
,-40,-48,-52,64],[64,116],[2,4,16,64,116],[4,16,64,116],[16,
64,112],[1,2,4,8,16,116],[32,64,100],[1,2,-3,4,8,-10,-12,16,
-18,-20,-48,-52,64],[64,96,100],[1,2,4,8,16,32,100],[32,64,-\
66,68],[1,2,4,8,16,32,36,64,68],[1,2,4,8,16,32,-36,64],[64,
65,66,68,72,80,96,100],[1,2,4,8,16,32,64,66,68,72,80,96,100
],[2,4,8,16,32,64,65,68,72,80,96,100],[4,64,80,96],[4,8,16,
32,64,66,68,80,96,100],[4,16,32,64,66,68,96,100],[1,2,4,8,
16,32,36,64,96],[4,32,64,68],[1,2,4,8,16,32,36,64],[64,65,
66,68,72,80,96],[1,2,4,8,16,32,64,68,80,96],[2,32,64,68,-80
,96],[2,4,8,16,32,64,-72,-80,96],[2,8,16,32,64,-68,80,96],[
2,16,32,64,-66,-68,96],[1,2,3,4,8,10,12,16,18,20,32,96],[32
,64],[96,116],[32,64,68,72,80,84],[1,2,4,8,16,32,40,48,64,
72,80,84],[1,2,4,8,16,32,48,64,72,80,84],[1,2,4,8,16,32,64
,72,80],[1,2,4,8,16,32,36,48,64,66,68,80,84],[1,2,4,8,16,
32,36,64,68],[1,2,3,4,8,10,12,16,20,32,33,34,36,40,48,52,
64],[64,96,116],[1,2,4,8,16,32,96,116],[4,8,16,32,64,96,116]
,[32,64,96,112],[4,16,32,64,96,116],[4,32,64,96,100],[32,64,
68,72,80,84],[1,2,4,8,16,48,80,84],[1,2,4,8,16,32,64,72,80
],[1,2,4,8,16,32,36,48,64,66,68,80,84],[1,2,4,8,16,32,36,
64,68],[1,2,3,4,8,10,12,16,20,32,34,36,40,48,52,64],[64,96,
116],[1,2,4,8,16,32,96,116],[32,64,96,112],[4,16,32,64,96,
116],[4,32,64,96,100],[32,64,68,72,80,84],[1,4,8,16,40,48,80
,84],[1,2,4,8,16,32,64,72,80],[1,2,4,8,16,32,36,48,64,68,
80,84],[1,2,4,8,16,32,36,64,68],[1,2,3,4,8,10,12,16,20,32,
33,36,40,48,52,64],[64,96,112],[1,2,4,8,16,32,96,112],[32,64
,72,80],[1,2,4,8,16,32,48,64,80],[1,2,4,8,16,32,48,64],[64
,96,116],[16,32,64,96,112],[1,2,4,8,16,32,96,116],[32,64,96,
100],[32,64,66,68,80,84],[1,2,4,8,16,32,36,48,64,68,80,84],
[1,2,4,8,16,32,48,64,80],[1,2,4,8,16,32,64,68],[1,2,3,4,8
,10,12,16,20,32,34,36,48,52,64],[64,65,66,68,72,80,96,112],
[1,2,4,16,32,64,66,68,72,80,96,112],[2,4,16,32,64,65,68,72,
80,96,112],[4,16,32,64,72,80,96,112],[1,2,4,8,16,32,64,66,
68,80,96,112],[16,64,68,96],[1,2,4,8,16,32,48,64,96],[16,32,
64,80],[1,2,4,8,16,32,48,64],[64,96,100],[32,64,96],[1,2,4,
8,16,32,96,100],[32,64,68],[1,2,4,8,16,32,36,64],[64,65,66,
68,72,80,96],[1,4,8,16,32,64,66,68,72,80,96],[1,2,4,8,16,
32,64,65,68,72,80,96],[4,8,32,64,72,80,96],[8,32,64,66,68,
80,96],[4,8,16,32,64,68,96],[1,2,3,4,8,10,12,16,20,32,96],
[32,64],[96,112],[32,64,72,80],[1,2,4,8,16,32,-48,64,72,80],
[1,2,4,8,16,32,-48,64,80],[1,2,4,8,16,32,-40,-48,64,-72,80]
,[1,2,4,8,16,32,-48,64,-66,-68,80],[1,2,4,8,16,32,-48,64],
[64,96,112],[1,2,4,8,16,32,96,112],[16,32,64,-96,112],[2,8,
16,32,64,96,112],[2,16,32,64,96,112],[32,64,96],[32,64,72,80]
,[1,2,4,8,16,40,-48,80],[1,2,4,8,16,32,-48,64,-66,-68,80],
[1,2,4,8,16,32,-48,64],[64,96,112],[1,2,4,8,16,32,96,112],[
32,64,96],[32,64,-72,80],[1,4,8,16,-40,-48,80],[1,2,4,8,16,
32,48,64,68,80],[1,2,4,8,16,32,-48,64],[64,96,112],[16,32,64
,96,112],[1,2,4,8,16,32,96,112],[2,16,32,64,-96,112],[32,64,
96],[32,64,-72,80],[1,2,4,8,16,32,48,64,80],[1,2,4,8,16,32,
-48,64],[64,96,112],[16,32,64,-96,112],[1,2,4,8,16,32,96,112]
,[32,64,96],[32,64,-66,-68,80],[1,2,4,8,16,32,48,64,68,80],
[1,2,4,8,16,32,34,48,64,80],[1,2,4,8,16,32,-48,64],[64,65,
66,68,72,80,112],[1,2,16,64,66,68,72,80,112],[2,16,64,65,68,
72,80,112],[1,2,4,8,16,48,64,68,72,80,112],[1,2,4,8,16,64,
72,80,112],[1,2,8,16,64,66,68,80,112],[1,2,3,4,8,16,48,64,
68,80,112],[1,2,3,4,8,10,12,16,48,112],[16,32,64,96],[1,2,4
,8,16,48,64],[64,96],[1,2,4,8,16,32,96],[32,64],[124],[1,4,
16,48,64,65,68,76],[1,3,4,12,16,17,19,20,28,48,49,52,60,64]
,[64,96,108],[1,4,16,32,96,108],[32,64,65,68,76],[1,2,4,16,
32,34,36,64,66,68,76],[1,4,8,16,32,40,64,72],[1,3,4,12,16,
17,20,32,33,36,44,64],[64,65,66,68,80,96,108],[1,2,4,16,32,
64,80,96,108],[2,4,16,32,64,80,96,108],[4,8,64,80,96,104],[4
,16,32,64,65,66,68,96,108],[1,2,4,12,18,20,36,108],[1,4,12,
16,20,32,34,36,96,108],[1,2,4,8,12,16,24,32,36,40,64,72,96,
104],[4,32,64,66,68,76],[1,2,4,12,16,20,32,34,36,64,68,76],
[1,2,4,8,12,16,32,40,64,72],[1,2,3,4,12,16,17,18,20,32,34,
36,44,64],[64,68,72,80,96,104],[1,2,4,8,16,32,64,80,96,104],
[4,8,16,32,64,80,96,104],[8,64,80,96],[8,16,32,64,65,68,72,
96,104],[1,4,16,32,40,96],[8,32,64,72],[1,4,8,16,32,40,64],
[64,65,68,76,80,81,84,96],[1,2,4,16,32,64,66,68,80,82,84,96
],[1,3,4,12,16,17,20,32,64,68,80,84,96],[4,8,16,32,64,72,
80,88,96],[1,4,12,16,17,20,32,64,80,96],[16,32,64,65,67,68,
76,96],[1,2,4,16,17,18,20,32,64,66,68,76,96],[1,4,8,16,20,
24,32,64,72,96],[1,3,4,12,16,17,19,20,28,32,96],[32,64],[124
],[64,80,92],[1,2,4,16,32,48,64,66,68,76],[1,2,3,4,12,16,
18,20,28,32,33,34,35,36,44,48,50,52,60,64],[64,124],[1,2,4,
16,124],[2,4,16,64,124],[4,8,16,64,120],[32,64,96,108],[1,2,
4,16,64,66,68,76],[1,2,3,4,12,16,18,20,28,48,50,52,60,64],
[64,124],[8,16,64,120],[32,64,96,108],[1,4,16,48,64,68,76],[1
,3,4,12,16,18,20,28,48,52,60,64],[64,120],[16,32,112],[64,96
,104],[16,64,80,88],[1,2,4,8,16,32,64,72],[1,2,3,4,8,12,16
,18,20,24,32,40,48,56,64],[64,96,108],[1,2,4,16,32,96,108],
[32,64,66,68,76],[1,2,4,16,32,34,36,64,68,76],[1,2,4,8,16,
32,40,64,72],[1,2,3,4,12,16,18,20,32,34,36,44,64],[64,65,66
,68,80,96,108],[1,2,4,16,32,64,66,68,80,96,108],[2,4,16,32,
64,65,68,80,96,108],[4,8,64,72,80,96,104],[4,16,32,64,66,68,
96,108],[1,2,4,12,16,20,32,36,96,108],[1,2,4,8,12,16,24,32,
36,40,64,72,96,104],[4,32,64,68,76],[1,2,4,8,12,16,32,40,64
,72],[1,2,3,4,12,16,18,20,32,36,44,64],[64,65,66,68,72,80,
96,104],[1,2,4,8,16,32,64,68,72,80,96,104],[2,4,8,16,32,64,
68,72,80,96,104],[4,8,16,32,64,72,80,96,104],[8,64,80,96],[8
,16,32,64,66,68,72,96,104],[1,2,4,16,32,40,96],[8,32,64,72]
,[1,2,4,8,16,32,40,64],[64,65,66,67,68,76,80,82,84,96],[1,
2,4,16,32,64,66,68,76,80,82,84,96],[2,4,16,32,64,65,68,76,
80,84,96],[1,2,3,4,12,16,18,20,32,64,68,80,84,96],[4,8,16,
32,64,72,80,88,96],[1,2,4,12,16,18,20,32,64,80,96],[16,32,
64,66,68,76,96],[1,2,4,16,18,20,32,64,68,76,96],[1,2,4,8,
16,20,24,32,64,72,96],[1,2,3,4,12,16,18,20,28,32,96],[32,64
],[96,124],[32,64,65,68,92],[1,2,4,32,33,34,36,64,66,68,92],
[1,4,8,32,36,40,64,72,88],[1,3,4,12,28,32,33,35,36,44,60,
64],[64,96,124],[1,2,4,32,96,124],[4,32,96,124],[8,32,64,96,
120],[32,64,66,68,92],[1,2,4,32,34,36,64,68,92],[1,2,4,8,32
,36,40,64,72,88],[1,2,3,4,12,28,32,34,36,44,60,64],[64,65,
68,124],[1,2,4,64,66,68,124],[1,3,4,12,124],[4,8,64,72,120],
[1,4,12,16,20,48,64,80,112],[1,3,4,12,28,60,64],[64,96,120],
[1,4,8,32,96,120],[16,32,96,112],[32,64,72,88],[1,4,8,16,32,
48,64,80],[1,3,4,8,12,24,32,40,56,64],[64,65,68,80,96,112],
[1,2,4,16,32,64,66,68,80,96,112],[4,8,16,32,64,72,80,96,112
],[16,64,68,96],[1,4,8,24,32,48,96],[16,32,64,80],[1,4,16,
32,48,64],[64,65,67,68,76,96],[1,2,4,32,64,66,68,76,96],[1,
3,4,12,32,64,68,76,96],[4,8,32,64,72,88,96],[1,4,12,16,20,
32,64,80,96],[1,3,4,12,28,32,96],[32,64],[120],[64,80,88],[1,
4,8,16,32,64,72],[1,3,4,8,12,16,24,32,33,36,40,48,56,64],[
64,120],[2,8,16,64,120],[1,4,8,16,120],[8,16,64,112],[32,64,
96,104],[1,4,8,16,64,72],[1,3,4,8,12,16,24,48,56,64],[64,
112],[32,64,96],[1,4,16,48,64],[64,96,104],[1,4,8,16,32,96,
104],[32,64,72],[1,4,8,16,32,40,64],[64,65,68,72,80,96],[1,2
,4,8,16,32,64,72,80,96],[4,8,16,32,64,72,80,96],[8,16,32,
64,68,80,96],[16,32,64,72,96],[1,3,4,8,12,16,24,32,96],[32,
64],[96,112],[32,64,65,68,80],[1,2,4,16,32,48,64,80],[1,4,8,
16,32,40,48,64,72,80],[1,4,16,32,48,64],[64,96,112],[1,2,4,
16,32,96,112],[4,16,32,96,112],[8,16,32,64,96,112],[32,64,96]
,[32,64,66,68,80],[1,2,4,16,32,48,64,80],[1,2,4,8,16,32,40
,48,64,72,80],[1,2,4,16,32,48,64],[64,96,112],[1,4,8,16,32,
96,112],[16,32,96,112],[32,64,96],[32,64,72,80],[1,4,8,16,32,
48,64,80],[1,4,8,16,32,48,64],[64,65,68,80,112],[1,2,16,64,
66,68,80,112],[1,4,16,48,64,68,80,112],[1,4,8,16,64,72,80,
112],[1,3,4,12,16,48,112],[16,32,64,96],[1,4,16,48,64],[64,
96],[1,4,16,32,96],[32,64],[120],[1,-3,4,8,16,-17,-20,-24,-48
,-56,64],[64,104],[8,64,72],[1,4,8,16,32,-40,64],[64,72,80,
96],[1,2,16,32,64,-80,96],[1,4,8,16,32,64,-80,96],[1,8,16,
32,64,-80,96],[16,32,64,-65,-72,96],[1,3,4,8,16,17,20,24,32,
96],[32,64],[120],[32,64,88],[1,-3,4,8,-24,32,-33,-36,-40,-56,
64],[64,120],[8,32,120],[16,64,112],[8,32,64,88],[1,2,-3,4,8,
-24,32,-34,-36,-40,-56,64],[64,120],[1,2,8,64,120],[1,4,8,120
],[8,16,64,112],[1,-3,4,8,-24,-56,64],[64,112],[96],[16,64,80
],[1,4,8,16,32,-48,64],[64,65,68,72,96],[1,2,32,64,96],[1,4
,8,32,64,72,96],[1,8,16,32,64,-80,96],[1,3,4,8,24,32,96],[
32,64],[112],[80],[1,4,8,16,32,-48,64],[64,112],[2,16,64,112],
[1,16,64,112],[1,4,8,16,112],[32,64,96],[1,4,8,16,-48,64],[
64,96],[1,4,8,16,32,96],[32,64],[126],[1,2,4,-5,-6,-12,-13,-\
14,-28,-29,-30,-60,-62,64],[64,65,66,68,-69,-70,-76,-78,-92,96
],[1,4,32,64,66,-68,-70,-76,-92,96],[1,2,4,32,64,-68,-76,-92
,96],[4,8,32,64,-65,-66,-72,-73,-74,-88,-89,-90,96],[1,2,4,5
,8,9,12,24,32,64,66,72,74,88,90,96],[1,2,4,5,6,8,9,10,12,
24,32,64,72,88,96],[1,2,4,12,16,20,32,64,65,66,80,81,82,96]
,[1,2,4,5,6,12,13,16,17,18,20,21,28,32,64,66,80,82,96],[1,
2,4,5,6,12,13,14,16,17,18,20,21,22,28,32,64,80,96],[1,2,4,
5,6,12,28,32,64,65,66,96],[1,2,4,5,6,12,13,14,28,29,30,32,
96],[32,64],[96,98,100,112],[32,64,65,66,68,-76,80],[1,2,4,16
,32,-33,36,-48,64,66,-68,80],[1,2,4,16,32,-33,-34,36,-48,64,
-68,-76,80],[1,2,4,8,16,32,-36,40,-48,64,-65,-66,-72,-74,80],
[1,2,4,5,6,8,9,10,12,16,40,41,42,44,48,80],[1,2,4,5,6,12,
16,32,33,34,36,48,64,65,66,80],[1,2,4,16,32,-48,64],[64,96,
-100,112],[1,2,4,16,32,96,112],[8,16,32,64,-96,-104,112],[32,
64,96],[32,64,66,-68,80],[1,2,4,16,32,-34,-36,-48,64,-68,-76,
80],[1,2,4,8,16,32,36,40,48,64,66,72,74,80],[1,2,4,5,6,12,
16,34,48,80],[1,2,4,16,32,-48,64],[64,96,-100,112],[4,16,32,
64,96,112],[1,2,4,16,32,96,112],[8,16,32,64,-96,-104,112],[32
,64,96],[32,64,-68,-76,80],[1,2,4,8,16,32,36,40,48,64,72,80
],[1,2,4,5,6,12,16,32,36,48,64,80],[1,2,4,16,32,-48,64],[
64,96,-97,-98,-104,112],[1,2,4,8,16,32,96,-104,112],[16,32,-\
96,-97,-98,112],[32,64,96],[32,64,-65,-66,-72,-74,80],[1,2,4,
8,16,32,33,40,48,64,66,72,74,80],[1,2,4,8,16,32,33,34,40,
48,64,72,80],[1,2,4,8,16,32,40,48,64,65,66,80],[1,2,5,6,8,
9,10,16,34,48,80],[1,2,4,5,6,8,9,10,12,16,32,33,34,40,41,
48,64,80],[1,2,4,8,16,32,-48,64],[64,65,66,68,72,80,96,98,
104,112],[1,2,4,8,16,32,64,66,68,72,80,96,104,112],[2,8,16,
32,64,68,72,80,96,104,112],[2,4,8,16,32,64,65,66,72,80,96,
104,112],[1,2,4,5,6,8,9,10,12,16,32,34,40,48,96,112],[8,16,
32,64,65,66,68,80,96,98,112],[1,2,4,12,16,32,34,40,48,96,98
,112],[1,2,4,8,16,32,34,40,48,64,65,66,80,96,98,112],[16,32
,64,96],[32,64,66,72,74,80],[1,2,4,8,16,32,34,40,48,64,72,
80],[1,2,4,8,16,32,40,48,64,66,80],[1,2,4,5,6,8,9,10,12,
16,32,34,40,48,64,80],[1,2,4,8,16,32,48,64],[64,65,66,68,72
,80,96,104,112],[1,8,16,32,64,66,68,72,80,96,104,112],[1,2,
4,8,16,32,64,68,72,80,96,104,112],[1,4,8,16,32,64,65,66,72,
80,96,104,112],[1,2,4,8,9,12,16,32,40,48,64,66,72,80,96,104
,112],[1,2,4,5,6,8,9,10,12,16,32,40,48,96,104,112],[8,16,
32,64,65,66,68,80,96,112],[1,2,4,8,16,32,40,48,64,66,68,80,
96,112],[1,2,4,5,12,16,32,40,48,96,112],[1,2,4,8,9,16,32,
40,48,64,65,66,80,96,112],[16,32,64,96],[32,64,72,80],[1,2,4
,8,16,32,40,48,64,80],[1,2,4,8,16,32,48,64],[64,65,66,68,
80,96,97,98,112],[1,16,32,64,66,68,80,96,98,112],[1,2,16,32,
64,68,80,96,112],[1,2,4,8,16,32,64,65,66,72,80,96,97,98,112
],[1,2,4,5,6,12,16,32,33,34,48,96,98,112],[16,32,64,96],[32
,64,65,66,80],[1,2,4,16,32,33,48,64,66,80],[1,2,4,16,32,33
,34,48,64,80],[1,2,4,16,32,48,64],[64,65,66,68,69,70,76,80,
112],[1,16,64,66,68,70,76,80,112],[1,2,4,16,64,68,76,80,112]
,[1,4,8,16,64,65,66,72,73,74,80,112],[1,2,4,5,8,9,16,48,
64,66,72,74,80,112],[1,2,4,5,6,8,9,10,12,16,48,64,72,80,
112],[1,2,4,5,12,16,48,64,65,66,80,112],[1,2,4,5,6,12,16,
48,64,66,80,112],[1,2,4,5,6,12,13,14,16,48,112],[16,32,64,
96],[1,2,4,16,48,64],[64,96],[1,2,4,16,32,96],[32,64],[122],
[1,2,-5,-6,-10,16,-17,-18,-21,-22,-26,-48,-49,-50,-58,64],[64,
106],[1,2,-5,-6,-10,-42,64],[64,65,66,-74,80,-81,-82,96],[1,4
,16,32,64,66,-68,-72,-80,-82,-88,96],[1,2,4,8,16,32,64,-68,
-72,-80,-84,-88,96],[1,2,5,16,17,32,64,66,80,96],[1,2,4,5,6
,8,9,16,17,18,20,24,32,64,72,80,88,96],[1,2,5,6,10,16,17,
18,32,64,80,96],[16,32,64,-65,-66,-70,-74,96],[1,2,4,8,16,17
,20,32,64,66,68,72,74,96],[1,2,4,5,8,16,17,18,20,24,32,64,
68,72,96],[1,2,5,6,10,16,17,18,21,22,26,32,96],[32,64],[96,
112],[32,64,66,80],[1,2,4,8,16,32,-48,64,80],[1,2,4,8,16,32
,40,-48,64,-72,80],[1,2,16,32,-48,64],[64,96,112],[1,2,4,8,
16,32,96,112],[16,32,-96,112],[32,64,96],[32,64,66,80],[1,2,4
,8,16,32,-48,64,-72,80],[1,2,4,8,16,34,48,80],[1,2,4,8,16,
32,-48,64],[64,96,112],[4,16,32,64,96,112],[1,2,4,8,16,32,96
,112],[16,32,64,-96,112],[1,16,32,-96,112],[32,64,96],[32,64,
-68,-72,80],[1,2,4,8,16,32,48,64,72,80],[1,2,4,8,16,32,36,
48,64,80],[1,2,4,8,16,32,-48,64],[64,65,66,80,112],[1,4,16,
64,66,68,72,80,112],[1,2,4,8,16,64,68,72,80,112],[1,2,16,48
,64,66,80,112],[1,2,4,5,8,9,16,48,64,72,80,112],[1,2,5,6,
10,16,48,112],[16,32,64,96],[1,2,16,48,64],[64,96],[1,2,16,
32,96],[32,64],[120],[1,2,4,8,16,64,72],[1,2,4,-5,-6,8,16,-\
17,-18,-20,-24,-48,-56,64],[64,96,104],[1,2,4,8,16,32,104],[
32,64,68,72],[1,2,4,8,-40,72],[1,2,4,8,16,32,-40,64],[64,65
,66,68,72,104],[1,4,8,64,104],[1,2,4,8,64,104],[4,8,16,32,
64,80,-96,104],[8,32,64,-80,96],[1,2,4,-5,8,-24,-40,64,-65,-\
66,-72,104],[1,2,4,8,16,32,36,40,64,96],[1,2,4,8,-40,64],[
64,65,68,72,80,96,104],[1,8,16,32,64,80,-96,104],[1,2,8,16,
32,64,80,-96,104],[1,2,4,8,16,32,64,-80,96,104],[8,64,-80,96
],[8,16,32,64,65,66,-68,-72,96,104],[1,2,4,8,16,32,33,40,64
,96],[8,32,64,-66,72],[1,2,4,8,16,24,32,40,64,72],[1,2,4,8
,16,32,-40,64],[64,72,80,96],[1,16,32,64,-80,96],[1,2,4,16,
32,64,-80,96],[1,4,16,32,64,-80,96],[1,2,4,8,16,32,64,-80,
96],[16,32,64,-65,-66,-68,-72,96],[1,2,4,5,6,8,16,17,18,20,
24,32,96],[32,64],[120],[64,88],[1,2,4,8,72],[1,2,4,-5,-6,8,
16,-18,-20,-24,32,-33,-34,-36,-40,-48,-56,64],[64,120],[1,2,4,
8,16,120],[4,8,16,64,120],[4,8,16,64,120],[8,16,64,112],[32,
64,104],[1,2,4,-5,-6,8,16,-18,-20,-24,-48,-56,64],[64,120],[
16,32,64,112],[64,-96,104],[16,64,-80,88],[1,2,4,8,16,32,64,
66,72],[1,2,4,-5,-6,8,16,-18,-20,-24,32,-33,-34,-40,-48,-56,
64],[64,112],[64,96],[16,64,80],[1,2,4,8,16,32,-48,64],[64,
104],[1,2,4,8,16,32,104],[32,64,72],[1,2,4,8,16,32,-40,64],
[64,65,66,68,72,104],[1,2,4,8,64,68,72,104],[2,8,16,32,64,
68,72,80,96,104],[2,4,8,64,65,66,72,104],[8,32,64,80,96],[1,
2,4,8,16,32,34,40,64,96],[1,2,4,8,40,64],[64,65,66,68,72,
80,96],[1,2,4,8,16,32,64,72,80,96],[2,4,16,32,64,72,-80,96]
,[4,32,64,72,-80,96],[2,4,8,16,32,64,-80,96],[4,16,32,64,-\
66,-68,-72,96],[1,2,4,5,6,8,16,18,20,24,32,96],[32,64],[120]
,[64,88],[1,2,4,8,16,32,64,-68,72],[1,2,4,-5,-6,8,16,-20,-\
24,32,-33,-34,-36,-40,-48,-56,64],[64,120],[8,16,32,64,120],[
16,32,64,112],[64,104],[16,64,88],[1,2,4,-5,-6,8,16,-20,-24,
32,-34,-36,-40,-48,-56,64],[64,120],[1,4,8,16,64,120],[1,2,4,
8,16,120],[4,8,16,64,120],[8,16,64,112],[32,64,104],[1,2,4,-\
5,-6,8,16,-20,-24,-48,-56,64],[64,120],[16,32,64,112],[64,-96,
104],[16,64,-80,88],[1,2,4,8,16,32,64,72],[1,2,4,-5,-6,8,16
,-20,-24,32,-33,-34,-40,-48,-56,64],[64,112],[64,96],[16,64,80
],[1,2,4,8,16,32,-48,64],[64,96,104],[1,2,4,8,16,32,104],[
32,64,-68,72],[1,2,4,8,16,32,40,64,72],[1,2,4,8,16,32,-40,
64],[64,65,66,68,72,80,96,104],[1,8,32,64,72,80,96,104],[1,2
,4,8,16,32,64,68,72,80,96,104],[1,4,8,16,32,64,65,72,80,96
,104],[8,64,80,96],[1,8,16,32,64,68,72,96,104],[1,2,4,8,16,
32,40,64,96],[8,32,64,72],[1,2,4,8,16,32,40,64],[64,65,66,
68,72,80,96],[1,4,32,64,80,96],[1,2,4,8,16,32,64,72,80,96],
[4,32,64,-80,96],[1,4,8,16,32,64,-80,96],[1,4,16,32,64,-68,
-72,96],[1,2,4,5,6,8,16,20,24,32,96],[32,64],[120],[64,80,88
],[1,2,4,8,16,32,64,-66,72],[1,2,4,-5,-6,8,16,-17,-18,-24,
32,-33,-34,-36,-40,-48,-56,64],[64,120],[8,16,64,120],[1,8,16,
64,120],[1,2,4,8,16,120],[8,16,64,112],[32,64,96,104],[1,2,4
,8,16,64,-66,72],[1,2,4,-5,-6,8,16,-17,-18,-24,-48,-56,64],
[64,112],[64,96],[16,64,80],[1,2,4,8,16,32,-48,64],[64,96,104
],[1,2,4,8,16,32,96,104],[32,64,-66,72],[1,2,4,8,16,32,40,
64,72],[1,2,4,8,16,32,-40,64],[64,65,66,72,104],[1,2,4,8,16
,32,64,72,96,104],[2,8,16,32,64,72,80,96,104],[8,32,64,80,
96],[1,2,4,8,16,32,34,40,64,96],[1,2,8,40,64],[64,65,66,68,
72,80,96,104],[1,8,32,64,72,80,96,104],[1,2,4,8,16,32,64,68
,72,80,96,104],[1,4,8,16,32,64,65,66,72,80,96,104],[8,64,80
,96],[1,8,16,32,64,65,66,72,96,104],[1,2,8,24,32,40,72,104]
,[1,2,4,8,16,32,40,64,96],[8,32,64,72],[1,2,4,8,16,32,40,
64],[64,65,66,68,72,80,96],[1,32,64,-80,96],[1,2,16,32,64,72
,-80,96],[1,2,4,8,16,32,64,72,80,96],[1,2,8,16,32,64,-80,
96],[1,16,32,64,-65,-66,-72,96],[1,2,4,5,6,8,16,17,18,24,32
,96],[32,64],[96,120],[32,64,65,66,68,72,88],[1,2,4,8,32,40,
64,66,68,72,88],[1,2,4,8,32,33,34,36,40,64,68,72,88],[1,2,
4,8,32,33,36,40,64,65,66,72,88],[1,2,4,8,16,32,48,64,80],[
1,2,4,5,6,8,24,32,33,34,36,40,56,64],[64,96,120],[1,2,4,8,
32,96,120],[16,32,64,96,112],[32,64,66,68,72,88],[1,2,4,8,32
,36,40,64,68,72,88],[1,2,4,8,32,36,40,64,66,72,88],[1,2,4,
8,16,32,48,64,80],[1,2,4,5,6,8,24,32,34,36,40,56,64],[64,
96,120],[8,32,64,96,120],[1,2,4,8,32,96,120],[1,8,32,64,96,
120],[16,32,64,96,112],[32,64,68,72,88],[1,2,4,8,32,36,40,64
,72,88],[1,2,4,8,16,32,48,64,80],[1,2,4,5,6,8,24,32,36,40
,56,64],[64,96,120],[8,32,64,96,120],[1,2,4,8,32,96,120],[16
,32,64,96,112],[32,64,65,66,72,88],[1,2,4,8,32,33,40,64,66,
72,88],[1,2,4,8,32,33,34,40,64,72,88],[1,2,4,8,16,32,48,64
,80],[1,2,4,5,6,8,24,32,33,34,40,56,64],[64,65,66,68,72,96
,120],[1,8,32,64,66,68,72,96,120],[1,2,8,32,64,68,72,96,120
],[1,2,4,8,32,64,65,66,72,96,120],[8,16,64,80,96,112],[1,2,
4,8,32,64,96],[8,32,64,66,72,88],[1,2,4,8,24,32,34,40,64,
72,88],[1,2,4,8,16,24,32,48,64,80],[1,2,4,5,6,8,24,32,34,
40,56,64],[64,65,66,68,72,120],[1,8,64,66,68,72,120],[1,2,4,
8,64,68,72,120],[1,4,8,64,65,66,72,120],[1,2,4,5,8,24,64,
66,72,120],[1,2,4,5,6,8,24,120],[8,16,64,80,112],[1,2,4,8,
32,40,64,96],[1,2,4,5,6,8,24,56,64],[64,96,112],[1,2,4,8,
16,32,96,112],[32,96],[32,64,80],[1,2,4,8,16,32,48,64],[64,
65,66,68,72,96],[1,32,64,66,68,72,96],[1,2,4,8,32,64,68,72,
96],[1,4,8,32,64,65,66,72,96],[1,8,16,32,64,80,96],[1,2,4,
5,6,8,24,32,96],[32,64],[112],[64,80],[1,2,4,8,16,32,-48,64]
,[64,112],[16,64,112],[1,4,16,64,112],[1,16,64,112],[1,2,4,8
,16,112],[32,64,96],[1,2,4,8,16,-48,64],[64,96],[1,2,4,8,16
,32,96],[32,64],[126],[1,2,-6,8,-9,-10,-14,-24,-25,-26,-30,-\
56,-57,-58,-62,64],[64,65,66,-70,72,-73,-74,-78,-88,-89,-90,96
],[1,2,8,32,64,66,-70,-72,-74,-88,-90,96],[2,4,8,32,64,-68,
-72,-76,-88,-92,96],[1,2,6,8,9,10,24,32,64,72,88,96],[8,16,
32,64,-65,-66,-70,-80,-81,-82,-86,96],[1,2,8,9,10,16,17,18,
24,32,64,66,70,80,82,86,96],[1,2,4,8,10,12,16,18,20,24,32,
64,68,80,84,96],[1,2,6,8,9,10,14,16,17,18,22,24,25,26,32,
64,80,96],[1,2,8,24,32,64,65,66,70,96],[1,2,6,8,9,10,24,25
,26,32,64,66,70,96],[1,2,4,6,8,9,10,12,24,26,28,32,64,68,
96],[1,2,6,8,9,10,14,24,25,26,30,32,96],[32,64],[118],[86],[
1,2,-6,8,-9,-10,-14,16,-17,-18,-22,32,-33,-34,-38,-40,-41,-42
,-48,-49,-50,-54,64],[64,118],[4,16,64,116],[1,2,-6,-9,-10,-\
14,-18,-22,-54,64],[64,102],[4,64,100],[2,64,70],[1,2,-6,8,-9
,-10,16,-17,-18,32,-33,-34,-38,64],[64,65,66,-70,72,-73,-74,
80,-81,-82,96],[1,2,8,16,32,64,66,-70,-72,-80,-82,96],[2,4,8
,32,64,-68,-72,-76,-80,-84,96],[1,2,6,8,9,10,16,32,64,72,80
,96],[8,32,64,-65,-66,-70,80,-82,96],[1,2,8,9,10,16,32,64,
66,80,96],[1,2,4,8,10,12,16,32,64,68,80,84,96],[2,8,16,32,
64,-65,-66,-70,96],[1,2,6,8,9,10,16,17,18,32,64,66,70,96],[
1,2,4,6,8,9,10,12,16,18,20,32,64,68,96],[1,2,6,8,9,10,14,
16,17,18,22,32,96],[32,64],[96,97,98,104,112],[32,64,65,66,72
,80],[1,2,8,16,32,-33,-34,40,-48,64,66,-72,80],[1,2,4,8,16,
32,-34,-36,40,-48,64,-68,-72,-76,80],[1,2,6,8,9,10,16,40,41,
42,48,80],[1,2,8,16,32,-40,-48,64,-65,-66,-70,80],[1,2,6,8,
9,10,16,32,33,34,40,48,64,66,70,80],[1,2,4,6,8,9,10,12,16,
32,33,34,36,40,44,48,64,68,80],[1,2,8,16,32,-48,64],[64,96,
98,-104,112],[1,2,8,16,32,96,-104,112],[4,8,16,32,64,96,-104,
112],[16,32,64,-96,-98,112],[32,64,96],[32,64,66,-72,80],[1,2,
4,8,16,32,-34,36,-40,-48,64,-68,-72,-76,80],[1,2,8,16,32,40,
48,64,66,70,80],[1,2,4,6,8,9,10,12,16,36,44,48,80],[1,2,8,
16,32,-48,64],[64,96,-100,-104,112],[1,2,4,8,16,32,96,-104,
112],[8,16,32,-96,-104,112],[16,32,64,-96,-100,112],[32,64,96],
[32,64,-68,-72,-76,80],[1,2,4,8,16,32,36,40,48,64,72,80],[1,
2,4,8,16,32,40,48,64,68,80],[1,2,4,6,8,9,10,12,16,32,36,
40,48,64,80],[1,2,4,8,16,32,-48,64],[64,65,66,72,80,96,104,
112],[1,8,16,32,64,66,72,80,96,104,112],[1,2,4,8,16,32,64,
68,72,80,96,104,112],[1,2,6,8,9,10,16,32,40,48,96,104,112],
[8,16,32,64,65,66,80,96,112],[1,2,8,16,32,40,48,64,66,80,96
,112],[1,2,4,8,12,16,32,40,48,64,68,80,96,112],[16,32,64,96
],[32,64,72,80],[1,2,8,16,32,40,48,64,80],[1,2,8,16,32,48,
64],[64,96,-97,-98,112],[1,2,8,16,32,96,-97,-98,112],[32,64,
96],[32,64,-65,-66,-70,80],[1,2,8,16,32,33,34,48,64,66,70,80
],[1,2,4,8,16,32,34,36,48,64,68,80],[1,2,6,8,9,10,16,32,
33,34,48,64,80],[1,2,8,16,32,-48,64],[64,65,66,72,80,96,98,
112],[1,2,8,16,32,64,66,72,80,96,98,112],[2,4,16,32,64,68,
72,80,96,100,112],[2,8,16,32,64,65,66,80,96,98,112],[1,2,6,
8,9,10,16,32,34,48,96,112],[1,2,4,6,8,12,16,32,34,36,48,64
,68,80,96,100,112],[16,32,64,96],[32,64,66,70,80],[1,2,4,8,
16,32,34,36,48,64,68,80],[1,2,6,8,9,10,16,32,34,48,64,80],
[1,2,8,16,32,48,64],[64,65,66,68,72,80,96,100,112],[1,4,8,
16,32,64,66,68,72,80,96,100,112],[1,2,4,8,16,32,64,68,72,80
,96,100,112],[4,16,32,64,66,72,80,96,112],[4,8,16,32,64,65,
66,68,80,96,100,112],[1,2,4,6,8,9,10,12,16,32,36,48,96,100,
112],[1,2,8,16,32,36,48,96,112],[16,32,64,96],[32,64,68,80],
[1,2,4,8,16,32,36,48,64,80],[1,2,4,8,16,32,48,64],[64,65,
66,70,72,73,74,80,112],[1,8,16,64,66,70,72,74,80,112],[1,2,
4,8,16,64,68,72,76,80,112],[1,2,6,8,9,10,16,48,64,72,80,
112],[8,16,64,65,66,70,80,112],[1,2,8,9,16,48,64,66,70,80,
112],[1,2,4,8,9,10,12,16,48,64,68,80,112],[1,2,6,8,9,10,14
,16,48,112],[16,32,64,96],[1,2,8,16,48,64],[64,96],[1,2,8,
16,32,96],[32,64],[126],[1,2,-6,-14,16,-17,-18,-22,-30,-48,-49
,-50,-54,-62,64],[64,110],[2,16,32,110],[2,32,64,78],[1,2,-6,
-14,16,-17,-18,-22,32,-33,-34,-38,-46,64],[64,65,66,-70,-78,80
,-81,-82,-86,96],[1,2,16,32,64,66,-70,-80,-82,-86,96],[2,4,
16,32,64,-68,-76,-80,-84,-92,96],[1,2,6,8,10,16,17,18,24,32,
64,72,80,88,96],[1,2,6,14,16,17,18,22,32,64,80,96],[16,32,
64,-65,-66,-70,-78,96],[1,2,16,17,18,32,64,66,70,78,96],[1,2
,4,16,18,20,32,64,68,76,96],[1,2,6,8,10,16,17,18,22,24,26,
32,64,72,96],[1,2,6,14,16,17,18,22,30,32,96],[32,64],[126],[
32,64,94],[1,2,-6,-14,-30,32,-33,-34,-38,-46,-62,64],[64,126],
[1,2,126],[2,4,64,124],[1,2,-6,-14,-30,-62,64],[64,124],[2,4,
32,124],[8,120],[4,32,64,92],[1,2,4,-6,-12,-14,-28,32,-36,-44
,-60,64],[64,65,66,-70,-78,96],[1,2,32,64,66,-70,-78,96],[2,
4,32,64,-68,-76,-92,96],[1,2,6,8,10,24,32,64,72,88,96],[1,2
,6,14,16,18,22,32,64,80,96],[1,2,6,14,30,32,96],[32,64],[
124],[92],[1,2,4,-6,-12,-14,16,-20,-28,32,-33,-34,-36,-38,-44,
-48,-52,-60,64],[64,124],[8,64,120],[4,32,64,108],[1,2,4,-6,-\
12,-14,16,-20,-28,-48,-52,-60,64],[64,120],[112],[1,2,-6,8,-10
,16,-20,-24,-48,-56,64],[64,108],[8,64,104],[2,4,32,108],[4,
32,64,76],[1,2,4,-6,-12,16,-20,32,-36,-44,64],[64,65,66,68,-\
70,-76,80,-84,96],[1,2,4,16,32,64,66,68,-76,80,-84,96],[2,4,
16,32,64,-68,-76,80,96],[4,8,32,64,-66,-72,-74,-80,-88,96],[1
,2,4,6,8,10,12,16,20,24,32,64,72,80,88,96],[1,2,4,12,16,
32,64,66,80,96],[4,16,32,64,-68,-76,96],[1,2,4,8,12,16,20,
24,32,64,72,96],[1,2,4,6,12,14,16,20,28,32,96],[32,64],[96,
97,98,112],[32,64,65,66,80],[1,2,16,32,-33,-34,-48,64,66,80],
[1,2,4,16,32,-34,-36,-48,64,-68,-76,80],[1,2,6,8,10,16,32,
33,34,40,42,48,64,72,80],[1,2,16,32,-48,64],[64,96,98,112],[
1,2,16,32,96,98,112],[4,16,32,64,96,-100,112],[32,64,96],[32,
64,66,80],[1,2,4,16,32,-34,36,-48,64,-68,-76,80],[1,2,6,8,
10,16,40,42,48,80],[1,2,16,32,-48,64],[64,96,-100,112],[1,2,
4,16,32,96,-100,112],[8,16,32,-96,-104,112],[32,64,96],[32,64,
-68,-76,80],[1,2,4,8,16,32,36,40,48,64,72,80],[1,2,4,6,12,
16,32,36,48,64,80],[1,2,4,16,32,-48,64],[64,65,66,72,80,96,
104,112],[1,2,8,16,32,64,66,72,80,96,104,112],[2,4,8,16,32,
64,68,72,80,96,104,112],[1,2,6,8,10,16,32,40,48,96,104,112],
[8,16,32,64,66,80,96,112],[1,2,4,12,16,32,40,48,96,112],[16,
32,64,96],[32,64,72,80],[1,2,8,16,32,40,48,64,80],[1,2,8,16
,32,48,64],[64,65,66,70,80,112],[1,2,16,64,66,70,80,112],[2,
4,16,64,68,76,80,112],[1,2,6,8,10,16,48,64,72,80,112],[1,2,
6,14,16,48,112],[16,32,64,96],[1,2,16,48,64],[64,96],[1,2,16
,32,96],[32,64],[124],[1,2,4,-6,8,-12,16,-17,-18,-20,-22,-24,
-28,-48,-49,-50,-52,-56,-60,64],[64,108],[1,2,4,-6,8,-12,16,-\
17,-18,-20,-24,32,-33,-34,-36,-40,-44,64],[64,65,66,68,72,-76,
80,-81,-82,-84,-88,96],[1,2,4,8,16,32,64,66,68,72,-80,-84,-\
88,96],[2,4,8,16,32,64,-68,72,-80,-84,-88,96],[4,16,32,64,-\
66,-72,-80,-82,-88,96],[1,2,4,6,8,12,16,17,18,20,24,32,64,
72,80,88,96],[4,8,16,32,64,-68,-80,-84,96],[1,2,4,8,12,16,
17,18,20,24,32,64,80,96],[16,32,64,-65,-66,-68,-72,-76,96],[1
,2,4,8,16,17,18,20,24,32,64,66,68,72,76,96],[1,2,4,8,16,
18,20,24,32,64,68,72,76,96],[1,2,4,8,16,20,32,64,66,72,96],
[1,2,4,8,16,20,24,32,64,68,96],[1,2,4,6,8,12,16,17,18,20,
22,24,28,32,96],[32,64],[120],[88],[1,2,-6,8,-12,-24,32,-33,-\
34,-40,-56,64],[64,65,66,72,96],[1,2,8,32,64,72,96],[2,4,8,
16,32,64,72,-80,96],[8,16,32,64,-68,-80,96],[1,2,6,8,12,24,
32,96],[32,64],[116],[84],[1,2,4,-6,8,-12,16,-20,32,-33,-34,-\
36,-40,-48,-52,64],[64,112],[16,80],[1,2,4,8,16,32,-48,64],[
64,100],[96],[4,64,68],[1,2,4,8,16,32,-36,64],[64,65,66,68,
72,80,96],[1,2,4,8,16,32,64,68,80,96],[2,4,8,16,32,64,-68,
80,96],[4,32,64,-66,-80,96],[4,8,16,32,64,-68,80,96],[4,16,
32,64,-68,96],[1,2,4,6,8,12,16,20,32,96],[32,64],[96,112],[
32,64,80],[1,2,4,8,16,32,-48,64,80],[1,2,4,8,16,32,-48,64,
80],[1,2,4,8,16,32,-48,64,-72,80],[1,2,4,8,16,32,-36,-48,64
,-68,80],[1,2,4,8,16,32,-48,64],[64,96,112],[1,2,4,8,16,32,
96,112],[4,8,16,32,64,96,112],[16,32,64,96,112],[4,16,32,64,
96,112],[32,64,96],[32,64,68,80],[1,2,4,8,16,32,-48,64,-72,
80],[1,2,4,8,16,36,-48,80],[1,2,4,8,16,32,-48,64],[64,96,
112],[1,2,4,8,16,32,96,112],[8,16,32,64,-96,112],[16,32,64,
96,112],[32,64,96],[32,64,80],[1,2,4,8,16,40,48,80],[1,2,4,
8,16,32,-48,64,-68,80],[1,2,4,8,16,32,-48,64],[64,96,112],[1
,2,4,8,16,32,96,112],[32,64,96],[32,64,-72,80],[1,2,8,16,48
,80],[1,2,4,8,16,32,34,48,64,80],[1,2,4,8,16,32,-48,64],[
64,96,112],[16,32,64,-96,112],[1,2,4,8,16,32,96,112],[32,64,
96],[32,64,-68,80],[1,2,4,8,16,32,48,64,80],[1,2,4,8,16,32,
-48,64],[64,65,66,68,72,80,112],[1,2,16,64,66,68,72,80,112],
[2,16,64,68,72,80,112],[1,2,4,16,64,66,72,80,112],[1,2,4,8,
16,48,64,72,80,112],[1,2,4,8,16,64,68,80,112],[1,2,4,6,8,
12,16,48,112],[16,32,64,96],[1,2,4,8,16,48,64],[64,96],[1,2,
4,8,16,32,96],[32,64],[120],[1,2,8,16,64,72],[1,2,-6,8,16,-\
17,-18,-24,-48,-56,64],[64,96,104],[1,2,8,16,32,96,104],[32,
64,72],[1,2,8,16,32,-40,64],[64,65,72,80,96,104],[1,2,8,16,
32,64,104],[2,4,8,16,32,64,96,104],[8,64,-80,96],[8,16,32,64
,-72,104],[1,2,8,16,32,40,64,96],[8,32,64,72],[1,2,8,16,32,
-40,64],[64,65,66,68,72,80,96,104],[1,4,8,16,32,64,-80,96,
104],[1,2,4,8,16,32,64,-80,96,104],[4,8,16,32,64,-80,-96,104
],[8,64,-80,96],[8,16,32,64,-65,-66,-68,-72,96,104],[1,2,8,
16,17,24,32,36,40,96,104],[1,2,4,8,16,32,40,64,96],[8,32,64
,-68,72],[1,2,4,8,16,24,32,40,64,72],[1,2,4,8,16,32,-40,64
],[64,72,80,96],[1,2,8,16,32,64,-80,96],[2,4,16,32,64,-80,
96],[2,8,16,32,64,-80,96],[16,32,64,-65,-66,-72,96],[1,2,6,8
,16,17,18,24,32,96],[32,64],[120],[64,88],[1,2,8,16,32,64,72
],[1,2,-6,8,16,-18,-24,32,-33,-34,-40,-48,-56,64],[64,120],[1
,2,8,16,120],[2,4,8,16,64,120],[8,16,64,112],[32,64,104],[1,
2,8,72],[1,2,-6,8,16,-18,-24,-48,-56,64],[64,120],[8,16,32,
120],[16,32,64,112],[64,96,104],[16,64,80,88],[1,2,4,8,16,32,
64,-68,72],[1,2,4,-6,8,16,-18,-20,-24,32,-36,-40,-48,-56,64],
[64,112],[64,96],[16,64,80],[1,2,8,16,32,-48,64],[64,96,104],
[1,2,8,16,32,104],[32,64,72],[1,2,8,16,32,-40,64],[64,65,66,
68,72,104],[1,2,4,8,64,66,68,72,104],[2,4,8,64,-68,72,104],
[4,8,16,32,64,-66,72,80,-96,104],[8,32,64,-80,96],[1,2,8,-24
,-40,104],[1,2,4,8,16,32,36,40,64,96],[1,2,4,8,-40,64],[64,
65,66,72,80,96],[1,2,8,16,32,64,72,80,96],[2,4,16,32,64,-80
,96],[2,8,16,32,64,-80,96],[16,32,64,-66,-72,96],[1,2,6,8,
16,18,24,32,96],[32,64],[120],[64,80,88],[1,2,4,8,16,32,64,-\
68,72],[1,2,4,-6,8,16,-20,-24,32,-33,-34,-36,-40,-48,-56,64],
[64,120],[4,8,16,64,120],[1,2,4,8,16,120],[4,8,16,64,120],[8
,16,64,112],[32,64,96,104],[1,2,4,8,16,64,-68,72],[1,2,4,-6
,8,16,-20,-24,-48,-56,64],[64,120],[16,64,112],[32,64,-96,104]
,[1,2,8,16,64,72],[1,2,-6,8,16,-20,-24,-48,-56,64],[64,112],
[64,96],[16,64,80],[1,2,4,8,16,32,-48,64],[64,96,104],[1,2,4
,8,16,32,96,104],[32,64,-68,72],[1,2,4,8,16,32,40,64,72],[1
,2,4,8,16,32,-40,64],[64,65,66,68,72,80,96,104],[1,8,16,32,
64,72,80,96,104],[1,2,4,8,16,32,64,68,72,80,96,104],[1,4,8,
16,32,64,66,72,80,96,104],[8,64,80,96],[8,16,32,64,68,72,96,
104],[1,2,4,8,16,32,40,64,96],[8,32,64,72],[1,2,4,8,16,32,
40,64],[64,65,66,68,72,80,96],[1,4,8,16,32,64,72,80,96],[1,
2,4,8,16,32,64,72,80,96],[4,16,32,64,72,-80,96],[4,8,16,32,
64,-80,96],[16,32,64,-68,-72,96],[1,2,4,6,8,16,20,24,32,96],
[32,64],[96,120],[32,64,65,66,72,88],[1,2,8,32,33,40,64,66,
72,88],[1,2,4,8,32,33,34,36,40,64,68,72,88],[1,2,8,16,32,
48,64,80],[1,2,6,8,24,32,33,34,40,56,64],[64,96,120],[1,2,8
,32,96,120],[16,32,64,96,112],[32,64,66,72,88],[1,2,4,8,32,
34,36,40,64,68,72,88],[1,2,8,16,32,48,64,80],[1,2,6,8,24,
32,34,40,56,64],[64,96,120],[8,32,64,96,120],[1,2,4,8,32,96,
120],[1,8,32,96,120],[16,32,64,96,112],[32,64,68,72,88],[1,2,
4,8,32,36,40,64,72,88],[1,2,4,8,16,32,48,64,80],[1,2,4,6,
8,24,32,36,40,56,64],[64,65,66,72,120],[1,8,64,66,72,120],[1
,2,4,8,64,68,72,120],[1,2,6,8,24,120],[8,16,64,80,112],[1,
2,8,32,40,64,96],[1,2,6,8,24,56,64],[64,96,112],[1,2,8,16,
32,96,112],[32,96],[32,64,80],[1,2,8,16,32,48,64],[64,65,66,
72,96],[1,8,32,64,66,72,96],[1,2,4,8,32,64,68,72,96],[8,16,
32,64,80,96],[1,2,6,8,24,32,96],[32,64],[112],[64,80],[1,2,8
,16,32,-48,64],[64,112],[2,16,64,112],[4,16,64,112],[1,2,8,
16,112],[32,64,96],[1,2,8,16,-48,64],[64,96],[1,2,8,16,32,96
],[32,64],[124],[1,2,4,8,-9,-10,-12,-24,-25,-26,-28,-56,-60,
64],[64,65,66,68,72,-76,-88,96],[1,8,32,64,66,68,-72,-88,96],
[1,2,4,8,32,64,68,-72,-88,96],[1,4,8,32,64,-72,-88,96],[8,
16,32,64,-65,-66,-68,-80,-81,-84,96],[1,2,4,8,9,16,17,24,32,
64,66,68,80,84,96],[1,2,4,8,9,10,12,16,17,18,20,24,32,64,
68,80,84,96],[1,2,4,8,9,12,16,17,20,24,32,64,80,96],[1,2,4
,8,24,32,64,65,66,68,96],[1,2,4,8,9,10,12,24,25,26,28,32,
96],[32,64],[116],[84],[1,2,4,8,-9,-10,-12,16,-17,-18,-20,32,
-33,-34,-36,-40,-48,-52,64],[64,100],[32,64,96],[1,2,4,-36,64]
,[64,65,66,68,72,80,96],[1,8,32,64,68,-80,96],[1,2,4,8,16,
32,64,68,-80,96],[1,4,8,32,64,-72,-80,96],[8,32,64,-68,80,96
],[1,4,8,16,32,64,-65,-66,-68,96],[1,2,4,8,9,10,12,16,17,
18,20,32,96],[32,64],[96,112],[32,64,80],[1,2,4,8,16,40,-48,
80],[1,2,4,8,16,32,-48,64,-68,80],[1,2,4,8,16,32,-48,64],[
64,96,112],[1,2,4,8,16,32,112],[16,32,64,-96,112],[32,64,96],
[32,64,-72,80],[1,2,4,8,16,32,48,64,68,80],[1,2,4,8,16,32,
-48,64],[64,96,112],[8,16,32,64,112],[1,2,4,8,16,32,112],[1,
8,16,32,64,112],[16,32,64,-96,112],[32,64,96],[32,64,80],[1,2
,4,8,16,48,80],[1,2,4,8,16,32,-48,64],[64,96,112],[8,16,32,
64,112],[1,2,4,8,16,32,112],[16,32,64,-96,112],[32,64,96],[32
,64,-72,80],[1,2,4,8,16,32,48,64,80],[1,2,4,8,16,32,-48,64
],[64,96,112],[1,2,4,8,16,32,96,112],[32,64,96],[32,64,-65,-\
68,80],[1,2,4,8,16,32,48,64,68,80],[1,2,4,8,16,32,33,48,64
,80],[1,2,4,8,16,32,-48,64],[64,65,66,68,72,80,112],[1,16,
64,66,68,72,80,112],[1,2,16,64,68,72,80,112],[1,2,4,8,16,64
,72,80,112],[1,2,8,16,64,65,66,68,80,112],[1,2,4,8,16,48,
64,66,68,80,112],[1,2,4,8,9,16,48,64,68,80,112],[1,2,4,8,9
,10,12,16,48,112],[16,32,64,96],[1,2,4,8,16,48,64],[64,96],
[1,2,4,8,16,32,96],[32,64],[124],[1,2,4,-12,16,-17,-18,-20,-\
28,-48,-49,-50,-52,-60,64],[64,108],[1,4,32,108],[4,32,64,76],
[1,2,4,-12,16,-17,-18,-20,32,-33,-34,-36,-44,64],[64,65,66,68
,-76,80,-81,-82,-84,96],[1,16,32,64,66,68,-80,96],[1,2,4,16,
32,64,68,-80,-84,96],[1,4,8,16,32,64,-72,-80,-88,96],[1,2,4,
12,16,17,18,20,32,64,80,96],[16,32,64,-65,-66,-68,-76,96],[1,
2,4,16,17,32,64,66,68,76,96],[1,2,4,16,17,18,20,32,64,68,
76,96],[1,2,4,8,16,17,20,24,32,64,72,96],[1,2,4,12,16,17,
18,20,28,32,96],[32,64],[124],[64,92],[1,2,4,-12,16,-18,-20,-\
28,32,-33,-34,-36,-44,-48,-50,-52,-60,64],[64,120],[112],[8,16,
64,88],[1,2,4,8,-12,16,-18,-20,-24,32,-40,-48,-56,64],[64,108
],[8,104],[1,4,108],[4,64,76],[1,2,4,-12,16,-18,-20,32,-34,-\
36,-44,64],[64,65,66,68,-76,80,-82,-84,96],[1,4,16,32,64,66,
68,-76,80,-84,96],[1,2,4,16,32,64,68,-76,-80,-84,96],[4,8,32
,64,-72,-80,-88,96],[1,2,4,12,16,32,64,80,96],[4,16,32,64,-\
66,-68,-76,96],[1,2,4,12,16,18,20,32,64,68,76,96],[1,2,4,8,
12,16,20,24,32,64,72,96],[1,2,4,12,16,18,20,28,32,96],[32,
64],[124],[32,64,92],[1,2,4,-12,-28,32,-33,-34,-36,-44,-60,64]
,[64,124],[4,32,124],[8,64,120],[4,32,64,92],[1,2,4,-12,-28,
32,-34,-36,-44,-60,64],[64,124],[1,4,64,124],[1,2,4,124],[4,8
,64,120],[1,2,4,-12,-28,-60,64],[64,120],[1,8,32,120],[16,112
],[8,32,64,88],[1,2,4,8,-12,-24,32,-40,-56,64],[64,65,66,68,
-76,96],[1,32,64,66,68,96],[1,2,4,32,64,68,-76,96],[1,4,8,
32,64,-72,-88,96],[1,2,4,12,16,20,32,64,80,96],[1,2,4,12,28
,32,96],[32,64],[120],[88],[1,2,4,8,-12,16,-24,32,-33,-34,-36
,-40,-48,-56,64],[64,112],[1,2,4,16,-48,64],[64,104],[64,96],
[8,64,72],[1,2,4,8,16,32,-40,64],[64,65,66,68,72,80,96],[1,
32,64,72,96],[1,2,4,8,16,32,64,72,80,96],[1,4,8,16,32,64,-\
72,80,96],[1,8,32,64,-68,-80,96],[1,8,16,32,64,-72,96],[1,2,
4,8,12,16,24,32,96],[32,64],[96,112],[32,64,80],[1,2,4,16,32
,-48,64,80],[1,2,4,16,32,-48,64,80],[1,2,4,8,16,32,-40,-48,
64,-72,80],[1,2,4,16,32,-48,64],[64,96,112],[1,2,4,16,32,96,
112],[32,64,96],[32,64,80],[1,2,4,16,32,-48,64],[64,96,112],[
16,32,64,112],[1,2,4,16,32,96,112],[1,8,16,32,64,96,112],[32
,64,96],[32,64,80],[1,2,4,8,16,40,-48,80],[1,2,4,16,32,-48,
64],[64,96,112],[16,32,64,96,112],[1,2,4,8,16,32,96,112],[1,
16,32,-96,112],[32,64,96],[32,64,-72,80],[1,2,4,8,16,32,48,
64,80],[1,2,4,8,16,32,-48,64],[64,65,66,68,80,112],[1,16,64,
66,68,80,112],[1,2,4,16,64,68,80,112],[1,4,8,16,64,72,80,
112],[1,2,4,12,16,48,112],[16,32,64,96],[1,2,4,16,48,64],[64
,96],[1,2,4,16,32,96],[32,64],[120],[1,2,4,8,16,-17,-18,-20,
-24,-48,-56,64],[64,104],[1,2,4,8,16,32,-40,64],[64,72,80,96]
,[1,16,32,64,-80,96],[1,2,4,8,16,32,64,-80,96],[1,4,8,16,
32,64,-80,96],[1,8,16,32,64,-80,96],[16,32,64,-65,-72,96],[1,
2,4,8,16,17,18,20,24,32,96],[32,64],[120],[32,64,88],[1,2,4,
8,-24,32,-33,-34,-36,-40,-56,64],[64,120],[16,64,112],[8,32,64
,88],[1,2,4,8,-24,32,-34,-36,-40,-56,64],[64,120],[8,32,64,
120],[16,64,112],[8,32,64,88],[1,2,4,8,-24,32,-36,-40,-56,64]
,[64,120],[1,8,64,120],[1,2,8,64,120],[1,2,4,8,120],[8,16,
64,112],[1,2,4,8,-24,-56,64],[64,112],[96],[16,64,80],[1,2,4,
8,16,32,-48,64],[64,65,66,68,72,96],[1,32,64,96],[1,2,8,32,
64,96],[1,2,4,8,32,64,72,96],[1,8,16,32,64,-80,96],[1,2,4,
8,24,32,96],[32,64],[112],[80],[1,2,4,8,16,32,-48,64],[64,112
],[16,64,112],[1,16,64,112],[1,2,16,64,112],[1,2,4,8,16,112]
,[32,64,96],[1,2,4,8,16,-48,64],[64,96],[1,2,4,8,16,32,96],
[32,64]]]):
#
map(x->assign(posets[x],cat(`posets/`,x)),
 ['('J')', '('Lattices')', '('Posets')', '('W')', '('antichains')',
  '('atomic')', '('autgroup')', '('canon')', '('chain')', '('char_poly')',
  '('closure')', '('connected')', '('covers')', '('distributive')',
  '('dual')', '('extensions')', '('filter')', '('isom')', '('lattice')',
  '('meet')', '('mobius')', '('modular')', '('omega')', '('plot_poset')',
  '('rand_poset')', '('ranked')', '('rm_isom')', '('subinterval')',
  '('subposet')', '('zeta')']):
if [op(I)]=[1] then # we are in maple6 and lprint is broken
  printf(`%0.70s\n`,
         `posets 2.2.1v loaded. Run 'withposets()' to use abbreviated names.`)
else
  lprint(`posets 2.2.1v loaded. Run 'withposets()' to use abbreviated names.`)
fi;
