output_description: In the first line, print N and M, the number of the vertices and edges in your
  graph. In the i-th of the following M lines, print three integers u_i,v_i and
  w_i, representing the starting vertex, the ending vertex and the length of the
  i-th edge. If there are multiple solutions, any of them will be accepted.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      L
attempt: L = bin(int(input()))[2:]
  L = L.zfill((~-len(L) // 4 + 1) * 4)
  node = ["1"] + [L[i * 4 : i * 4 + 4] for i in range(len(L) // 4)] + ["1"]
  for i in range(len(node) - 1):
      for s, x in enumerate(node[i]):
          for t, y in enumerate(node[i + 1]):
              if x == "1" and y == "1":
                  print(s + i * 4 + 2, t + i * 4 + 6, 2 ** (si * 4 + 2))
  
problem_description: Statement
  
  You are given an integer L. Construct a directed graph that satisfies the
  conditions below. The graph may contain multiple edges between the same pair
  of vertices. It can be proved that such a graph always exists.
  
    * The number of vertices, N, is at most 20. The vertices are given ID numbers from 1 to N.
    * The number of edges, M, is at most 60. Each edge has an integer length between 0 and 10^6 (inclusive).
    * Every edge is directed from the vertex with the smaller ID to the vertex with the larger ID. That is, 1,2,...,N is one possible topological order of the vertices.
    * There are exactly L different paths from Vertex 1 to Vertex N. The lengths of these paths are all different, and they are integers between 0 and L-1.
  
  Here, the length of a path is the sum of the lengths of the edges contained in
  that path, and two paths are considered different when the sets of the edges
  contained in those paths are different.
samples: [{"input": "4", "output": "8 10\n    1 2 0\n    2 3 0\n    3 4 0\n    1 5 0\n    2 6 0\n    3 7 0\n    4 8 0\n    5 6 1\n    6 7 1\n    7 8 1\n    \n\nIn the graph represented by the sample output, there are four paths from\nVertex 1 to N=8:\n\n  * 1 \u2192 2 \u2192 3 \u2192 4 \u2192 8 with length 0\n  * 1 \u2192 2 \u2192 3 \u2192 7 \u2192 8 with length 1\n  * 1 \u2192 2 \u2192 6 \u2192 7 \u2192 8 with length 2\n  * 1 \u2192 5 \u2192 6 \u2192 7 \u2192 8 with length 3\n\nThere are other possible solutions.\n\n* * *"}, {"input": "5", "output": "5 7\n    1 2 0\n    2 3 1\n    3 4 0\n    4 5 0\n    2 4 0\n    1 3 3\n    3 5 1"}]