from random import *

def stable(a, b, c):
    return 4 * a + 2 * b + c in [7, 6, 3] 

n = 7 #randint(2, 5)
print (n)
for i in range(n - 1):
    f = lambda : randint(0, 1)
    a, b, c = f(), f(), f()
    while not stable(a, b, c):
        a, b, c = f(), f(), f()
    print (a, b, c)

a, b, c = f(), f(), f()
while a + b + c == 0:
    a, b, c = f(), f(), f()
print (a, b, c)
