Is Dinic quartic?

Print a fixed 4-vertex, 5-edge flow network with the exact edges and capacities given in the statement.

Easy1GraphImplementationSimulationNo attempts yetTime limit2sMemory limit512 MB

Problem

Jigoo always solves maximum-flow problems with the Edmonds-Karp algorithm. One day Jigoo saw a flow problem with 500500 vertices and 100000100000 edges. Jigoo built a flow graph, wrote about 20002000 bytes of code, and submitted it, but the cheerful green "Accepted!!" text did not appear. Tired of optimizing the code, Jigoo found Dinic's algorithm, whose worst-case time complexity is O(V2E)O(V^2 E).

Dinic's algorithm is simpler than it first seems.

  1. Treat every residual edge as an edge of length 11, and compute the shortest distance dvd_v from the source to every vertex.
  2. Find an augmenting path by DFS and send flow. Use an edge uvu \rightarrow v only when du+1=dvd_u + 1 = d_v.
  3. Repeat steps 1 and 2 until no more flow can be sent.

The time complexity of Dinic is O(V2E)O(V^2 E). The proof is as follows.

  1. Steps 1 and 2 repeat at most O(V)O(V) times.
    • Reason: each round increases the distance to the sink dNd_{N} by at least 11, and dNd_{N} cannot exceed VV.
  2. Step 1 is O(E)O(E).
    • Reason: it can be computed by BFS.
  3. Step 2 is O(VE)O(VE).
    • Reason: each time flow is sent, at least one edge becomes saturated, so at most O(E)O(E) augmenting paths are created. The length of an augmenting path is at most VV.

There was still a problem. Jigoo implemented the algorithm carefully and still did not see the green text. In the end Jigoo gave up on that problem together with Dinic.

A few days later, Dotori happened to look at Jigoo's Dinic code and pointed out a small mistake that caused many useless operations and made the program slow. Jigoo fixed the code and finally saw the beautiful green text.

Jigoo still found something odd. The number of edges is at most V2V^2, so Dinic is O(V4)O(V^4), and 500500 vertices should time out. Jigoo could not construct a slow test.

Originally any flow graph that makes Dinic slow would be accepted. To fix a unique answer, print the following graph.

There are 44 vertices and 55 edges. Flow is sent from vertex 11 to vertex 44. Print the edges in this order with these capacities.

  • 121 \rightarrow 2, capacity 33
  • 131 \rightarrow 3, capacity 44
  • 141 \rightarrow 4, capacity 55
  • 242 \rightarrow 4, capacity 22
  • 343 \rightarrow 4, capacity 22

Input

There is no input. If standard input is present, ignore it.

Output

Print the number of vertices NN and the number of edges MM on the first line, separated by a space.

On each of the next MM lines, print the start vertex ss, the end vertex ee, and the capacity ff, separated by spaces.

The output must be exactly N=4N = 4, M=5M = 5, with the edges in the order and capacities fixed in the statement.