import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Random;

/**
 * @author: pashka
 */
public class Gen {
    public static void main(String[] args) throws FileNotFoundException {
        int n = 100000;
        int m = 200000;
        int[] p = new int[n];
        Random random = new Random(2412312L);
        for (int i = 0; i < n; i++) {
            p[i] = random.nextInt(1000000);
        }

        PrintWriter out = new PrintWriter("input.txt");
        out.println(n + " " + m);
        for (int i = 0; i < m; i++) {
            int x = random.nextInt(n);
            int y = random.nextInt(n);
            long d = p[x] - p[y] + random.nextInt(1000);
//            long d = random.nextInt(2001) - 1000;
            out.println((x + 1) + " " + (y + 1) + " " + d);
        }
        out.close();
    }
}