base = 2 print ("0 0"); a = vector(base^logint(10 000, base)-1) u = 1 { for (v=1, oo, d = digits(v, base); w = v; for (f=1, #d, if (d[f], for (t=f, oo, if (t>#d, d=concat(d, digits(w++, base)); ); m=fromdigits(d[f..t], base); if (m>#a, break, !a[m], a[m]=v; ); ); ); ); while (a[u], print (u " " a[u]); if (u++>#a, break (2); ); ); ); } quit