#include <stdio.h>

void writeHeader(int rows, int cols){
        fprintf(stdout,"P6\n %d %d 255\n",cols,rows);
}

void writePixel(unsigned char r, unsigned char g, unsigned char b){
        fprintf(stdout,"%c%c%c",r,g,b);
}

int main(void){
	writeHeader(100,100);

	//for each row
	int r, c;
	for (r = 0; r < 100; r++){
		//for each column in that row
		for (c = 0; c < 100; c++){
			if (c % 2 == 0){
				//write a pixel that's blue
				writePixel(0,0,255);
			}

			else{
				writePixel(0,255,0);
			}
		}
	}
}
