

A famous advertisement slogan says, "If liver is healthy, then life is colorful. If liver is ill, then life is black and white." A healthy person and a ill person may get different feelings within the same view. In order to understand the difference, you are asked to transform a colorful image to a grayscale image. The transform formula for every pixels is:
ceil( (RED + GREEN + BLUE) / 3) = GRAY
RED, GREED, and BLUE stands for the intensity level of the colorful image. Similiarly, GRAY stands for the intensity level of the grayscale image.
Input contains several test cases. Each case begins with two integers H and W (1 <= H, W <= 256) which presents the height and width of the colorful image. In following H lines, each line contains W pixels. A pixel is composed of three integer r, g, b (0 <= r, g, b <= 255) which presents the RED, GREEN, and BLUE intensity level. All integers in the same line are seperated by single space.
Input and output format are identical. For each pixel in the output, assign the same intensity level to r, g and b with corresponding grayscale intensity level.