#include <iostream>
using namespace std;
int &f(int n = -1)
{
static int c;
if (n >= 0) {
c = n * 10;
}
return c;
}
int main()
{
cout << f(1) << endl;
cout << f() << endl;
f() = 2;
cout << f() << endl;
f(3);
cout << f() << endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50ICZmKGludCBuID0gLTEpCnsKICAgIHN0YXRpYyBpbnQgYzsKICAgIGlmIChuID49IDApIHsKICAgICAgICBjID0gbiAqIDEwOwogICAgfQogICAgcmV0dXJuIGM7Cn0KCmludCBtYWluKCkKewogICAgY291dCA8PCBmKDEpIDw8IGVuZGw7CiAgICBjb3V0IDw8IGYoKSA8PCBlbmRsOwogICAgZigpID0gMjsKICAgIGNvdXQgPDwgZigpIDw8IGVuZGw7CiAgICBmKDMpOwogICAgY291dCA8PCBmKCkgPDwgZW5kbDsKICAgIHJldHVybiAwOwp9Cg==