fork(2) download
  1. from random import*
  2. L=[[1,0],[1,1]];C=choice
  3. exec"A=C(L);B=C(L);L=[L+[map(int.__xor__,A,B)],[x+[C([1,0])]for x in L]][A==B];"*input()
  4. print L
Success #stdin #stdout 0.02s 10040KB
stdin
5
stdout
[[1, 0, 0], [1, 1, 1], [0, 1, 0], [1, 0, 0], [1, 0, 1], [0, 0, 1]]