#include <iostream>
int f()
{
static int n = 0;
return n++;
}
int main()
{
for (unsigned i = 0; i < 20; ++i)
std::cout << f() << '\n';
}
I2luY2x1ZGUgPGlvc3RyZWFtPgoKaW50IGYoKQp7CiAgICBzdGF0aWMgaW50IG4gPSAwOwoKICAgIHJldHVybiBuKys7Cn0KCmludCBtYWluKCkKewogICAgZm9yICh1bnNpZ25lZCBpID0gMDsgaSA8IDIwOyArK2kpCiAgICAgICAgc3RkOjpjb3V0IDw8IGYoKSA8PCAnXG4nOwp9