#include <iostream>
using namespace std;

int main() {
	int x = 1;
	while (x > 0) {
		x *= 3;
		cout << x << endl;
	}
	
	return 0;
}