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

int score(int i) {
    return (37 * (i % 100) + 11) % 100;
}

int main(int argc, char *argv[]) {
    if (argc != 2) {
        printf("Usage: %s N (1 through 10000000)\n", argv[0]);
        return 1;
    }
    char *end;
    long value = strtol(argv[1], &end, 10);
    if (end == argv[1] || *end != '\0' || value < 1 || value > 10000000) {
        printf("N must be an integer from 1 through 10000000.\n");
        return 1;
    }
    int n = (int)value;
    int histogram[10] = {0};
    for (int i = 0; i < n; i++) histogram[score(i) / 10]++;
    int total = 0;
    for (int bin = 0; bin < 10; bin++) {
        printf("%2d-%2d: %d\n", 10 * bin, 10 * bin + 9, histogram[bin]);
        total += histogram[bin];
    }
    printf("Total: %d\n", total);
    return 0;
}
