import sys,lzma
for path in sys.argv[1:]:
 op=lzma.open if path.endswith('.xz') else open; clauses=[]
 for line in op(path,'rt'):
  if line.startswith('c') or line.startswith('p'): continue
  xs=list(map(int,line.split()));
  if xs and xs[-1]==0: xs=xs[:-1]
  if xs: clauses.append(xs)
 cover=[c for c in clauses if len(c)>4 and all(x>0 for x in c)]
 p=max(max(c) for c in cover); M=len(cover)
 masks={}
 for v in range(1,p+1): masks[v]=0
 for i,c in enumerate(cover):
  for v in c: masks[v]|=1<<i
 non=[(v,m) for v,m in masks.items() if m]
 unique={}
 for v,m in non: unique.setdefault(m,v)
 arr=list(unique.items())
 maximal=[]
 for i,(m,v) in enumerate(arr):
  dominated=False
  for j,(m2,v2) in enumerate(arr):
   if i!=j and (m|m2)==m2:
    dominated=True; break
  if not dominated: maximal.append((v,m))
 print(path.split('/')[-1], 'p',p,'clauses',M,'nonzero',len(non),'unique',len(unique),'maximal',len(maximal), 'sizes', sorted(set(len(c) for c in cover))[:10], sorted(set(len(c) for c in cover))[-10:])
