#include <iostream>
using namespace std;

struct foo {
	foo() { cout << "foo" << endl; }
	~foo() { cout << "~foo" << endl; }
};

void bar()
{
	cout << "in bar(drinking)" << endl;
	static foo barinstance;
}

void baz()
{
	cout << "in baz" << endl;
	static foo bazinstance;
}

int main() {
	int a;
	cin >> a;
	if(a % 2) bar();
	if(a % 3) baz();
	return 0;
}