#include <stdio.h>
int main(void) {
int a;
int i=1;
int s=0;
int sum=1;
do{
s=s+i;
i=3*i;
}
while(i==a);
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgbWFpbih2b2lkKSB7CglpbnQgYTsKCWludCBpPTE7CglpbnQgcz0wOwoJaW50IHN1bT0xOwoJCglzY2FuZigiJWQiLCZhKTsKCQoJZG97CgkJcz1zK2k7CgkJaT0zKmk7Cgl9CgkKCXdoaWxlKGk9PWEpOwoJCgkKCQoJCglwcmludGYoIiVkXG4iLHMpOwoJCglyZXR1cm4gMDsKfQo=