#include<stdio.h>

int main(){
	double n, k, x, y, i = 1, j;
	scanf("%lf%lf%lf%lf", &n, &k, &x, &y);
	if(k >= n){
		printf("%.0lf\n", n*x);
	}else{
		printf("%.0lf\n", k*x + y*(n-k));
		printf("\nThe accommodation fee is as follows:\n\n");
		for(i = 1; i <= k; i++){
			if(i==1){
				printf("·%.0lf yen for the 1-st night", x);
			}else if(i==2){
				printf("·%.0lf yen for the 2-nd night", x);
			}else if(i==3){
				printf("·%.0lf yen for the 3-rd night", x);
			}else{
				printf("·%.0lf yen for the %.0lf-th night", x, i)
			}
		}
		printf("\n\n");
		printf("Thus, the total is %.0lf yen.\n", k*x + y*(n-k));
	}
	return 0;
}