#include<iostream>
#include<stdlib.h>
using namespace std;
int n = 0,randseed = 0;
int canmoveto(int m,int dire);
int evaluation();
int dfs(int m,int mark);
int main()
{
cin>> n >> randseed;
srand(randseed);
cout<<dfs(n,1)<<endl;
return 0;
}
int canmoveto(int m,int dire)
{
return (rand() % 2);
}
int evaluation()
{
return(rand() % 21 - 10);
}
int dfs(int m,int mark)
{
int i;
int value;
int maxvalue = -10;
if(m == 0)
{
return (evaluation());
}
else
{
for(i=0;i<4;i++)
{
if(canmoveto(m , i))
{
value = dfs(m - 1,mark * -1);
if(mark * value > maxvalue)
{
maxvalue = mark * value;
}
}
}
}
return (mark * maxvalue);
}