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

int main(void)
{
	char first[40], last[40];

	printf("Input your first and last name:\n");
	scanf("%s %s", first, last);

	// first phase - display the count at the end
	printf("%*d %*d\n", strlen(first), strlen(first),
		strlen(last), strlen(last));

	// second phase - display the count at the beginning
	printf("%s %s\n", first, last);
	printf("%-*d %-*d\n", strlen(first), strlen(first),
		strlen(last), strlen(last));
	return 0;
}