import java.util.Arrays; import java.util.Scanner; public class RGB { public static void main(String[] args) { // TODO 自動生成されたメソッド・スタブ Scanner s= new Scanner(System.in); int[] rgb = new int[3]; for(int i = 0;i < 3;i++){ rgb[i] = s.nextInt(); } s.close(); int count = 0; Arrays.sort(rgb); while(rgb[0] != 0 || rgb[2] >= 3){ count += rgb[0]; rgb[1] -= rgb[0]; rgb[2] -= rgb[0]; int k = (rgb[1]*3-rgb[2])/8; int i = (rgb[2]*3-rgb[1])/8; rgb[0] = k + i; rgb[1] -= 2*k; rgb[2] -= 2*i; Arrays.sort(rgb); System.out.println(rgb[0] + " " + rgb[1] + " " + rgb[2]); } System.out.println(count); } }