#include <iostream>
using namespace std;
long akkerman(long m , long n)
{
if (m==0) return n+1;
if (m>0 && n==0) return akkerman(m-1, 1);
return akkerman(m-1, akkerman(m, n-1));
}
int main() {
// your code goes here
std::cout<<akkerman(0,0)<<std::endl;
std::cout<<akkerman(2,1)<<std::endl;
std::cout<<akkerman(2,3)<<std::endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKbG9uZyBha2tlcm1hbihsb25nIG0gLCBsb25nIG4pCnsKCWlmIChtPT0wKSByZXR1cm4gbisxOwoJaWYgKG0+MCAmJiBuPT0wKSByZXR1cm4gYWtrZXJtYW4obS0xLCAxKTsKCXJldHVybiBha2tlcm1hbihtLTEsIGFra2VybWFuKG0sIG4tMSkpOwp9CmludCBtYWluKCkgewoJLy8geW91ciBjb2RlIGdvZXMgaGVyZQoJc3RkOjpjb3V0PDxha2tlcm1hbigwLDApPDxzdGQ6OmVuZGw7CglzdGQ6OmNvdXQ8PGFra2VybWFuKDIsMSk8PHN0ZDo6ZW5kbDsKCXN0ZDo6Y291dDw8YWtrZXJtYW4oMiwzKTw8c3RkOjplbmRsOwoJCglyZXR1cm4gMDsKfQ==