#include <stdio.h>
#include <io.h>
#include <string.h>
int main(void){
FILE *in;
FILE *out;
unsigned int BLOCK_SIZE = 3;
unsigned int block[BLOCK_SIZE];
in = fopen("input.txt", "wt");
if(in == NULL){ fputs("File error", stderr); return 1; }
out = fopen("output.txt", "wt");
if(out == NULL){ fputs("File error", stderr); return 1; }
while(!feof(in)){
memset(block, 0, sizeof(block)); //Îáíóëÿåì áëîê
int i = 0;
for(i = 0; i < BLOCK_SIZE; i++)
block[i] = fgetc(in);
//Âûâîäèì áëîê â ôàéë out
fwrite(block, sizeof(block), BLOCK_SIZE, out);
}
fclose(in);
fclose(out);
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxpby5oPgojaW5jbHVkZSA8c3RyaW5nLmg+CgoKaW50IG1haW4odm9pZCl7CiAgICBGSUxFICppbjsKICAgIEZJTEUgKm91dDsKICAgIHVuc2lnbmVkIGludCBCTE9DS19TSVpFID0gMzsKICAgIHVuc2lnbmVkIGludCBibG9ja1tCTE9DS19TSVpFXTsKICAgIAogICAgaW4gPSBmb3BlbigiaW5wdXQudHh0IiwgInd0Iik7CiAgICBpZihpbiA9PSBOVUxMKXsgZnB1dHMoIkZpbGUgZXJyb3IiLCBzdGRlcnIpOyByZXR1cm4gMTsgfQogICAgCiAgICBvdXQgPSBmb3Blbigib3V0cHV0LnR4dCIsICJ3dCIpOwogICAgaWYob3V0ID09IE5VTEwpeyBmcHV0cygiRmlsZSBlcnJvciIsIHN0ZGVycik7IHJldHVybiAxOyB9CiAgICAKICAgIHdoaWxlKCFmZW9mKGluKSl7CiAgICAgICAgICAgICAgICAgICAgbWVtc2V0KGJsb2NrLCAwLCBzaXplb2YoYmxvY2spKTsgICAgIC8vw47DocOtw7PDq8O/w6XDrCDDocOrw67DqgogICAgICAgICAgICAgICAgICAgIGludCBpID0gMDsKICAgICAgICAgICAgICAgICAgICBmb3IoaSA9IDA7IGkgPCBCTE9DS19TSVpFOyBpKyspCiAgICAgICAgICAgICAgICAgICAgICAgICAgYmxvY2tbaV0gPSBmZ2V0Yyhpbik7CiAgICAgICAgICAgICAgICAgICAgLy/DgsO7w6LDrsOkw6jDrCDDocOrw67DqiDDoiDDtMOgw6nDqyBvdXQKICAgICAgICAgICAgICAgICAgICBmd3JpdGUoYmxvY2ssIHNpemVvZihibG9jayksIEJMT0NLX1NJWkUsIG91dCk7CiAgICB9CiAgICAKICAgIGZjbG9zZShpbik7CiAgICBmY2xvc2Uob3V0KTsKfQ==