#include <iostream>
using namespace std;
class Foo
{
public:
	int a,b,c;
    double d,e,f;
    string text;
    Foo ()
    {
    	cout << "Sup" << endl;
    }
    ~Foo()
    {
    	cout << "R.I.P." << endl;
    }
	
	static Foo& getInstanceRef()
	{
		Foo o;
		o.a = 42;
		o.text = "42";
		return o;
	}
};

int main() {
	cout << "Creating \"a\"" << endl;
	Foo a;
	
	cout << "Assigning a new value to \"a\"" << endl;
	a = Foo::getInstanceRef();
	cout << a.a << " " << a.text << endl;

	cout << "Cleaning up and finishing work" << endl;
	return 0;
}