mod = 1000000007 eps = 10**-9 def main(): import sys input = sys.stdin.readline def f1(s): return s[1:] + "0" def f2(s, t): u = [] for ss, tt in zip(s, t): if ss == tt == "1": u.append("0") else: u.append("1") return "".join(u) N, M = map(int, input().split()) X = input().rstrip('\n') #for _ in range(N): # s = input().rstrip('\n') L = 10 ** 5 NN = 10 ** 4 Y = ["0" * M] * (L + 10) ans = [] # make 1 ans.append((2, NN+1, 0, 0)) Y[NN+1] = f2(Y[0], Y[0]) ans.append((1, NN+2, NN+1)) Y[NN+2] = f1(Y[NN+1]) ans.append((2, NN+3, NN+2, NN+1)) Y[NN+3] = f2(Y[NN+2], Y[NN+1]) #ans.append((2, N+4, N+2, 0)) #Y[N+4] = f2(Y[N+2], Y[0]) for k in range(M): ans.append((1, NN + 4, NN + 4)) Y[NN+4] = f1(Y[NN+4]) if X[k] == "1": ans.append((2, L, NN+4, NN+3)) Y[L] = f2(Y[NN+4], Y[NN+3]) ans.append((2, NN+4, L, NN+1)) Y[NN+4] = f2(Y[L], Y[NN+1]) ans.append((2, L+1, NN+4, NN+1)) Y[L+1] = f2(Y[NN+4], Y[NN+1]) ans.append((2, 0, L+1, L+2)) Y[0] = f2(Y[L+1], Y[L+2]) assert len(ans) <= 1000 print(len(ans)) for line in ans: print(*line) #assert X == Y[0] if __name__ == '__main__': main()