#include <iostream>
using namespace std;

class Unko
{
private:
	static int counter;
	const int number;
	int value;
public:
	Unko() : number(Unko::counter++), value(0) { }
	Unko(const int v) : number(Unko::counter++), value(v) { }
	~Unko() { cout << "Poo! (" << number << ')' << endl; }
	operator int() const { return value * number; }
	
	Unko operator + (const Unko& u1) const {
		return Unko(u1.value + value);
	}
};

int Unko::counter = 1;

int main() {
	
	Unko u1(10);
	Unko u2(100);
	
	cout << u1 << endl;
	cout << u2 << endl;
	cout << u1 + u2 << endl;
	cout << u1 + u2 << endl;
	cout << u1 + u1 + u1 << endl;
	
	// your code goes here
	return 0;
}