#include <stdio.h>
int main()
{
int a1, a2, a3;
int res;
int i;
for (i = 0; i < 1000; i++) {
a1 = (i - 1);
if (a1 % 3 == 0)
a2 = a1 - (a1 / 3);
else
continue;
a2 = (a2 - 1);
if (a2 % 3 == 0)
a3 = a2 - (a2 / 3);
else
continue;
a3 = (a3 - 1);
if (a3 % 3 == 0)
res = a3 - (a3 / 3);
else
continue;
}
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgbWFpbigpCnsKICAgIGludCBhMSwgYTIsIGEzOwogICAgaW50IHJlczsKICAgIGludCBpOwogICAgZm9yIChpID0gMDsgaSA8IDEwMDA7IGkrKykgewogICAgICAgIGExID0gKGkgLSAxKTsKICAgICAgICBpZiAoYTEgJSAzID09IDApCiAgICAgICAgICAgIGEyID0gYTEgLSAoYTEgLyAzKTsKICAgICAgICBlbHNlCiAgICAgICAgICAgIGNvbnRpbnVlOwoKICAgICAgICBhMiA9IChhMiAtIDEpOwogICAgICAgIGlmIChhMiAlIDMgPT0gMCkKICAgICAgICAgICAgYTMgPSBhMiAtIChhMiAvIDMpOwogICAgICAgIGVsc2UKICAgICAgICAgICAgY29udGludWU7CgoKICAgICAgICBhMyA9IChhMyAtIDEpOwogICAgICAgIGlmIChhMyAlIDMgPT0gMCkKICAgICAgICAgICAgcmVzID0gYTMgLSAoYTMgLyAzKTsKICAgICAgICBlbHNlCiAgICAgICAgICAgIGNvbnRpbnVlOwoKICAgICAgICBwcmludGYoIiVkXG4iLCBpKTsKICAgIH0KICAgIAogICAgcmV0dXJuIDA7Cn0K