#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <algorithm>

int main() {
    int least = 6;
    for (int i = 1; i < 10; i++) {
        char out[10];
        sprintf(out, "%02d", i);
        freopen(out, "w", stdout);

        int m, b;
        while (true) {
            for (m = least + 1; m <= 1000; m++) {
                for (b = m + 1; b <= 1000 && least * least >= b * b - m * m; b++) {
                    if (least * least + m * m == b * b) {
                        goto out;   
                    }
                }
            }
            least++;
        }
out:
        int data[3];
        data[0] = least;
        data[1] = m;
        data[2] = b;

        std::random_shuffle(data, data + 3);

        printf("%d %d %d %d\n", data[0], data[1], data[2], (least - 1) / 3);
        least++;
    }
    return 0;
}
