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

int main()
{
	char *input = (char*) malloc(22 * sizeof(char*));
	strcpy(input, "01");
	strcat(input, "2345678901234567890");
	printf("input is %s\n", input);

	int input_len = strlen(input);

	char *output = (char*) malloc((input_len + ((input_len - 1) / 7) + 1) * sizeof(char));
	int j = 0;
	for (int i = 0; i < input_len; ++i) {
	    if (i > 0 && i % 7 == 0) {
        	output[j++] = '-';
    	}
    	output[j++] = input[i];
	}
	output[j] = '\0';
	printf("output is %s\n", output);

	free(output);
	free(input);
	return 0;
}