fork download
  1. def f(x):print(*x);x[-1]==''or f(['']+[(x[i]+x[i+1])%10if''!=x[i]else''for i in range(len(x)-1)])
  2. for x in ([0],[1, 2],[8, 7],[0, 0],[1, 4, 2],[0, 1, 0],[1, 0, 0, 0],[1, 2, 3, 4],[1, 2, 3, 5, 8],[9, 2, 4, 5, 3, 2, 2]):
  3. f(x)
Success #stdin #stdout 0.02s 9936KB
stdin
Standard input is empty
stdout
0

1 2
 3
 
8 7
 5
 
0 0
 0
 
1 4 2
 5 6
  1
  
0 1 0
 1 1
  2
  
1 0 0 0
 1 0 0
  1 0
   1
   
1 2 3 4
 3 5 7
  8 2
   0
   
1 2 3 5 8
 3 5 8 3
  8 3 1
   1 4
    5
    
9 2 4 5 3 2 2
 1 6 9 8 5 4
  7 5 7 3 9
   2 2 0 2
    4 2 2
     6 4
      0