stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include<set>

#include<map>

#include<stack>

#include<queue>

#include<deque>

#include<cmath>

#include<cstdio>

#include<cctype>

#include<string>

#include<vector>

#include<cstdlib>

#include<cstring>

#include<sstream>

#include<iostream>

#include<algorithm>

#define MAXN 100000

#define pii pair<int,int>



using namespace std;

int main()

{

	int a,b,c,d;

	scanf("%d%d%d%d",&a,&b,&c,&d);

	printf("%d",max(a*b,c*d));

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.176209873645565x):
#include<cstdio>

#include<algorithm>

using namespace std;



int main()

{

	int A,B,C,D;

	scanf("%d %d %d %d",&A,&B,&C,&D);

	int area1,area2;

	area1=A*B;

	area2=C*D;

	printf("%d\n",area1>=area2?area1:area2);

return 0;

}
// Slower C++ solution:
#include <iostream>

using namespace std;

#define LL long long



int main()

{

    LL a, b, c, d;

    while(cin >> a >> b >> c >> d){

        LL x = a * b;

        LL y = c * d;

        cout << max(x, y) << '\n';

    }

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.243399282037283x):
#include<cstdio>

#include<algorithm>

using namespace std;



int main()

{

	int A,B,C,D;

	scanf("%d %d %d %d",&A,&B,&C,&D);

	int area1,area2;

	area1=A*B;

	area2=C*D;

	printf("%d\n",area1>=area2?area1:area2);

return 0;

}
// Slower C++ solution:


#include<bits/stdc++.h>

typedef long long ll;

using namespace std;



int main()

{

    ll a,b,c,d;

    ll r1,r2;



    while(cin>>a>>b>>c>>d)

    {

        r1=a*b;

        r2=c*d;



        if(r1>=r2)

            cout<<r1<<endl;

        else

            cout<<r2<<endl;

    }

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.243543466691566x):
#include<cstdio>

#include<algorithm>

using namespace std;



int main()

{

	int A,B,C,D;

	scanf("%d %d %d %d",&A,&B,&C,&D);

	int area1,area2;

	area1=A*B;

	area2=C*D;

	printf("%d\n",area1>=area2?area1:area2);

return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>



using namespace std ;



#define i64 long long int



int main()

{

    ios_base::sync_with_stdio(false);

    i64 a,b,c,d;

    cin>>a>>b>>c>>d;

    if(a*b>c*d)

    {

        cout<<a*b<<endl;

    }

    else

    {

        cout<<c*d<<endl;

    }

    return 0;



}


// Faster C++ solution for the same problem (measured speedup: 5.307989381291265x):
#include<cstdio>

#include<algorithm>

using namespace std;



int main()

{

	int A,B,C,D;

	scanf("%d %d %d %d",&A,&B,&C,&D);

	int area1,area2;

	area1=A*B;

	area2=C*D;

	printf("%d\n",area1>=area2?area1:area2);

return 0;

}
// Slower C++ solution:
#include <iostream>

using namespace std;



int main() {

	

	int A,B,C,D;

	

	cin >> A;

	cin >> B;

	cin >> C;

	cin >> D;

	

	if(A*B >= C*D){

	    printf("%d",A*B);

	}

	else{

	    printf("%d",C*D);

	}

	

	return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.221300656602398x):
#include<cstdio>

#include<algorithm>

using namespace std;



int main()

{

	int A,B,C,D;

	scanf("%d %d %d %d",&A,&B,&C,&D);

	int area1,area2;

	area1=A*B;

	area2=C*D;

	printf("%d\n",area1>=area2?area1:area2);

return 0;

}
// Slower C++ solution:
#include<set>

#include<map>

#include<stack>

#include<queue>

#include<deque>

#include<cmath>

#include<cstdio>

#include<cctype>

#include<string>

#include<vector>

#include<cstdlib>

#include<cstring>

#include<sstream>

#include<iostream>

#include<algorithm>

#define MAXN 100000

#define pii pair<int,int>



using namespace std;

int main()

{

	int a,b,c,d;

	scanf("%d%d%d%d",&a,&b,&c,&d);

	printf("%d",max(a*b,c*d));

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.098269846588425x):
#include <stdio.h>

#include <stdlib.h>

int main()

{

	int a, b,c,d, q, w;

	scanf("%d%d%d%d", &a, &b, &c,&d);

	q = a * b, w = c * d;

	if (q > w)

	{

		printf("%d", q);

	}

	else printf("%d", w);

	system("pause");

	return 0;

}
// Slower C++ solution:
#include <iostream>

using namespace std;

#define LL long long



int main()

{

    LL a, b, c, d;

    while(cin >> a >> b >> c >> d){

        LL x = a * b;

        LL y = c * d;

        cout << max(x, y) << '\n';

    }

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.164447560239042x):
#include <stdio.h>

#include <stdlib.h>

int main()

{

	int a, b,c,d, q, w;

	scanf("%d%d%d%d", &a, &b, &c,&d);

	q = a * b, w = c * d;

	if (q > w)

	{

		printf("%d", q);

	}

	else printf("%d", w);

	system("pause");

	return 0;

}
// Slower C++ solution:


#include<bits/stdc++.h>

typedef long long ll;

using namespace std;



int main()

{

    ll a,b,c,d;

    ll r1,r2;



    while(cin>>a>>b>>c>>d)

    {

        r1=a*b;

        r2=c*d;



        if(r1>=r2)

            cout<<r1<<endl;

        else

            cout<<r2<<endl;

    }

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.164589573853872x):
#include <stdio.h>

#include <stdlib.h>

int main()

{

	int a, b,c,d, q, w;

	scanf("%d%d%d%d", &a, &b, &c,&d);

	q = a * b, w = c * d;

	if (q > w)

	{

		printf("%d", q);

	}

	else printf("%d", w);

	system("pause");

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>



using namespace std ;



#define i64 long long int



int main()

{

    ios_base::sync_with_stdio(false);

    i64 a,b,c,d;

    cin>>a>>b>>c>>d;

    if(a*b>c*d)

    {

        cout<<a*b<<endl;

    }

    else

    {

        cout<<c*d<<endl;

    }

    return 0;



}


// Faster C++ solution for the same problem (measured speedup: 5.228065103471078x):
#include <stdio.h>

#include <stdlib.h>

int main()

{

	int a, b,c,d, q, w;

	scanf("%d%d%d%d", &a, &b, &c,&d);

	q = a * b, w = c * d;

	if (q > w)

	{

		printf("%d", q);

	}

	else printf("%d", w);

	system("pause");

	return 0;

}
// Slower C++ solution:
#include <iostream>

using namespace std;



int main() {

	

	int A,B,C,D;

	

	cin >> A;

	cin >> B;

	cin >> C;

	cin >> D;

	

	if(A*B >= C*D){

	    printf("%d",A*B);

	}

	else{

	    printf("%d",C*D);

	}

	

	return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.142681681641393x):
#include <stdio.h>

#include <stdlib.h>

int main()

{

	int a, b,c,d, q, w;

	scanf("%d%d%d%d", &a, &b, &c,&d);

	q = a * b, w = c * d;

	if (q > w)

	{

		printf("%d", q);

	}

	else printf("%d", w);

	system("pause");

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;



int main(){

	int a,b,c,d;cin>>a>>b>>c>>d;

	cout<<max(a*b,c*d)<<endl;

}

// Faster C++ solution for the same problem (measured speedup: 5.243899081893161x):
#include<stdio.h>

int main(){

int a,b,c,d;scanf("%d%d%d%d",&a,&b,&c,&d);

int e=a*b,f=c*d;

printf("%d\n",e<f?f:e);

}
// Slower C++ solution:
#include <bits/stdc++.h>



using namespace std;



int main()

{

    int a,b,c,d;

    cin>>a>>b>>c>>d;

    if((a*b)==(c*d))

    {

        cout<<a*b<<endl;

    }

    else if((a*b)>(c*d))

    {

       cout<<a*b<<endl;

    }

    else

    {

         cout<<c*d<<endl;

    }

    return 0;

}






// Faster C++ solution for the same problem (measured speedup: 5.246738379360292x):
#include<stdio.h>

#include<cmath>

int main(){

	int A,B,C,D;

	scanf("%d%d%d%d",&A,&B,&C,&D);

	int are1,are2;

	are1=A*B;

	are2=C*D;

	if(are1>=are2){

		printf("%d\n",are1);}

		else{

			printf("%d\n",are2);}

			return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

#define rep(i,l,r) for (int i=l;i<=r;i++)

using namespace std;

typedef long long ll;

const int maxn=305;

ll f[maxn][maxn],g[maxn][maxn],c[maxn][maxn],fac[maxn],inv[maxn];

int n,k;

ll mm;

ll dfs(int i,int j);

ll getsum(int i,int j){

	if (~g[i][j]) return g[i][j];

	g[i][j]=0;

	rep(p,j,k) (g[i][j]+=dfs(i,p))%=mm;

	return g[i][j];

}

ll dfs(int i,int j){

	if (~f[i][j]) return f[i][j];

	if (i==1) return f[i][j]=1;

	f[i][j]=0;

	rep(len,1,i-1) {

		(f[i][j]+=getsum(len,j+1)*dfs(i-len,j)%mm*c[i-2][len-1]%mm)%=mm;

	}

	return f[i][j];

}

int main(){

	scanf("%d%d%lld",&n,&k,&mm);

	c[0][0]=1;

	rep(i,1,n) {

		c[i][0]=1; c[i][i]=1;

		rep(j,1,i-1) c[i][j]=(c[i-1][j]+c[i-1][j-1])%mm;

	}

	memset(f,-1,sizeof(f));

	memset(g,-1,sizeof(g));

	dfs(n+1,0);

	printf("%lld\n",f[n+1][0]);

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 2.5047173179021573x):
#include<bits/stdc++.h>

#define rep(i,a,b) for(int i=(a);i<=(b);i++)

#define per(i,a,b) for(int i=(a);i>=(b);i--)

#define REP(i,n) for(int i=(0);i<(n);i++)

#define fi first

#define se second

#define pb push_back

#define mp make_pair

using namespace std;

typedef pair<int,int> pii;

typedef vector<int> vi;

typedef long long ll;



template<class T> inline void read(T &x){

	int f=0;x=0;char ch=getchar();

	for(;!isdigit(ch);ch=getchar())f|=(ch=='-');

	for(;isdigit(ch);ch=getchar())x=x*10+ch-'0';

	if(f)x=-x;

}



/*

    for(int j=0;j<=K;j++)

        f[1][j]=1,s[1][j]=K-j+1;

    for(int i=2;i<=n+1;i++)

    {

        for(int j=0;j<=K;j++)

            for(int k=1;k<i;k++)

                f[i][j]=(f[i][j]+f[i-k][j]*s[k][j+1]%mod*C[i-2][k-1])%mod;  

        for(int j=K;j>=0;j--)

            s[i][j]=(f[i][j]+s[i][j+1])%mod;

    }

*/

const int N=305;

int C[N][N],f[N][N],g[N][N],n,K,mod;



int fix(int x){

	return x>=mod?x-mod:x;

}



int main(){

	read(n),read(K),read(mod);

	C[0][0]=1;

	rep(i,1,n){

		C[i][0]=1;

		rep(j,1,n)C[i][j]=fix(C[i-1][j-1]+C[i-1][j]);

	}

	rep(i,0,K)f[1][i]=1,g[1][i]=K-i+1;

	rep(i,2,n+1)per(j,K,0){

		rep(k,1,i-1)

			f[i][j]=(f[i][j]+(ll)f[i-k][j]*g[k][j+1]%mod*C[i-2][k-1])%mod;

		g[i][j]=fix(g[i][j+1]+f[i][j]);

	}

	cout<<f[n+1][0]<<endl;

	return 0;

}
// Slower C++ solution:
#include <iostream>

#include <cstdio>

#include <algorithm>

#include <cmath>

#include <vector>

#include <queue>

#include <set>

#include <map>

#include <string>

#include <string.h>

#include <stdlib.h>

#include <time.h>

#include <climits>



using namespace std;



const int maxN=307;



long long dp[maxN][maxN],s[maxN][maxN],c[maxN][maxN];



int main(){

	int n,m,k;

	scanf("%d%d%d",&n,&k,&m);



	for (int i=0;i<=n;i++) {

		c[i][0]=c[i][i]=1;

		for (int j=1;j<i;j++) c[i][j]=(c[i-1][j]+c[i-1][j-1])%m;

	}



	for (int i=0;i<=k;i++) dp[1][i]=1,s[1][i]=(k-i+1)%m;

	for (int i=2;i<=n+1;i++) 

		for (int j=k;j>=0;j--){

			for (int t=1;t<i;t++) dp[i][j]=(dp[i][j]+dp[i-t][j]*c[i-2][t-1]%m*s[t][j+1]%m)%m;

			s[i][j]=(s[i][j+1]+dp[i][j])%m;

		}



	printf("%lld\n",dp[n+1][0]);

	return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.126000282402398x):
#include<cstdio>

using namespace std;

#define N 305

int n,m,p,dp[N][N],su[N][N],c[N][N];

int main()

{

	scanf("%d%d%d",&n,&m,&p);n++;m++;

	for(int i=1;i<=m;i++)dp[1][i]=1,su[1][i]=i;

	for(int i=0;i<=n;i++)c[i][i]=c[i][0]=1;

	for(int i=2;i<=n;i++)for(int j=1;j<i;j++)c[i][j]=(c[i-1][j-1]+c[i-1][j])%p;

	for(int i=2;i<=n;i++)

	{

		for(int k=1;k<=m;k++)

		for(int j=1;j<i;j++)

		dp[i][k]=(dp[i][k]+1ll*dp[i-j][k]*su[j][k-1]%p*c[i-2][j-1])%p;

		for(int k=1;k<=m;k++)su[i][k]=(su[i][k-1]+dp[i][k])%p;

	}

	printf("%d\n",dp[n][m]);

}//
// Slower C++ solution:
#include <bits/stdc++.h>



using namespace std;



typedef long long LL;



int MOD;



inline int Add(int a, int b) {

    return (a + b >= MOD) ? (a + b - MOD) : (a + b);

}

inline int Mul(int a, int b) {

    return (LL)a * b % MOD;

}





const int N = 305, M = 305;



int n, m;

int c[N][N];

int f[N][M];



void Init() {

    for (int i = 0; i <= n; ++i) {

        c[i][0] = c[i][i] = 1;

        for (int j = 1; j < i; ++j)

            c[i][j] = Add(c[i - 1][j - 1], c[i - 1][j]);

    }

    return;

}



int main() {

    scanf("%d%d%d", &n, &m, &MOD);

    Init();

    for (int i = 1; i <= n; ++i)

        for (int j = 1; j <= m; ++j) {

            if (i == 1) {

                f[i][j] = j % MOD;

                continue;

            }

            if (j == 1) {

                f[i][j] = 1 % MOD;

                continue;

            }

            f[i][j] = f[i][j - 1];

            for (int k = 1; k <= i; ++k)

                f[i][j] = Add(f[i][j], Mul(c[i][k - 1], Mul(k > 1 ? f[k - 1][j - 1] : 1, k < i ? f[i - k][j] : 1)));

        }

    printf("%d\n", f[n][m]);

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.1136974600326175x):
#include<cstdio>

using namespace std;

#define N 305

int n,m,p,dp[N][N],su[N][N],c[N][N];

int main()

{

	scanf("%d%d%d",&n,&m,&p);n++;m++;

	for(int i=1;i<=m;i++)dp[1][i]=1,su[1][i]=i;

	for(int i=0;i<=n;i++)c[i][i]=c[i][0]=1;

	for(int i=2;i<=n;i++)for(int j=1;j<i;j++)c[i][j]=(c[i-1][j-1]+c[i-1][j])%p;

	for(int i=2;i<=n;i++)

	{

		for(int k=1;k<=m;k++)

		for(int j=1;j<i;j++)

		dp[i][k]=(dp[i][k]+1ll*dp[i-j][k]*su[j][k-1]%p*c[i-2][j-1])%p;

		for(int k=1;k<=m;k++)su[i][k]=(su[i][k-1]+dp[i][k])%p;

	}

	printf("%d\n",dp[n][m]);

}//
// Slower C++ solution:
#include<bits/stdc++.h>

#define rep(i,l,r) for (int i=l;i<=r;i++)

using namespace std;

typedef long long ll;

const int maxn=305;

ll f[maxn][maxn],g[maxn][maxn],c[maxn][maxn],fac[maxn],inv[maxn];

int n,k;

ll mm;

ll dfs(int i,int j);

ll getsum(int i,int j){

	if (~g[i][j]) return g[i][j];

	g[i][j]=0;

	rep(p,j,k) (g[i][j]+=dfs(i,p))%=mm;

	return g[i][j];

}

ll dfs(int i,int j){

	if (~f[i][j]) return f[i][j];

	if (i==1) return f[i][j]=1;

	f[i][j]=0;

	rep(len,1,i-1) {

		(f[i][j]+=getsum(len,j+1)*dfs(i-len,j)%mm*c[i-2][len-1]%mm)%=mm;

	}

	return f[i][j];

}

int main(){

	scanf("%d%d%lld",&n,&k,&mm);

	c[0][0]=1;

	rep(i,1,n) {

		c[i][0]=1; c[i][i]=1;

		rep(j,1,i-1) c[i][j]=(c[i-1][j]+c[i-1][j-1])%mm;

	}

	memset(f,-1,sizeof(f));

	memset(g,-1,sizeof(g));

	dfs(n+1,0);

	printf("%lld\n",f[n+1][0]);

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 12.843337262412351x):
#include<cstdio>

using namespace std;

#define N 305

int n,m,p,dp[N][N],su[N][N],c[N][N];

int main()

{

	scanf("%d%d%d",&n,&m,&p);n++;m++;

	for(int i=1;i<=m;i++)dp[1][i]=1,su[1][i]=i;

	for(int i=0;i<=n;i++)c[i][i]=c[i][0]=1;

	for(int i=2;i<=n;i++)for(int j=1;j<i;j++)c[i][j]=(c[i-1][j-1]+c[i-1][j])%p;

	for(int i=2;i<=n;i++)

	{

		for(int k=1;k<=m;k++)

		for(int j=1;j<i;j++)

		dp[i][k]=(dp[i][k]+1ll*dp[i-j][k]*su[j][k-1]%p*c[i-2][j-1])%p;

		for(int k=1;k<=m;k++)su[i][k]=(su[i][k-1]+dp[i][k])%p;

	}

	printf("%d\n",dp[n][m]);

}//
// Slower C++ solution:
#include<bits/stdc++.h>

#define rep(i,a,b) for(int i=(a);i<=(b);i++)

#define per(i,a,b) for(int i=(a);i>=(b);i--)

#define REP(i,n) for(int i=(0);i<(n);i++)

#define fi first

#define se second

#define pb push_back

#define mp make_pair

using namespace std;

typedef pair<int,int> pii;

typedef vector<int> vi;

typedef long long ll;



template<class T> inline void read(T &x){

	int f=0;x=0;char ch=getchar();

	for(;!isdigit(ch);ch=getchar())f|=(ch=='-');

	for(;isdigit(ch);ch=getchar())x=x*10+ch-'0';

	if(f)x=-x;

}



/*

    for(int j=0;j<=K;j++)

        f[1][j]=1,s[1][j]=K-j+1;

    for(int i=2;i<=n+1;i++)

    {

        for(int j=0;j<=K;j++)

            for(int k=1;k<i;k++)

                f[i][j]=(f[i][j]+f[i-k][j]*s[k][j+1]%mod*C[i-2][k-1])%mod;  

        for(int j=K;j>=0;j--)

            s[i][j]=(f[i][j]+s[i][j+1])%mod;

    }

*/

const int N=305;

int C[N][N],f[N][N],g[N][N],n,K,mod;



int fix(int x){

	return x>=mod?x-mod:x;

}



int main(){

	read(n),read(K),read(mod);

	C[0][0]=1;

	rep(i,1,n){

		C[i][0]=1;

		rep(j,1,n)C[i][j]=fix(C[i-1][j-1]+C[i-1][j]);

	}

	rep(i,0,K)f[1][i]=1,g[1][i]=K-i+1;

	rep(i,2,n+1)per(j,K,0){

		rep(k,1,i-1)

			f[i][j]=(f[i][j]+(ll)f[i-k][j]*g[k][j+1]%mod*C[i-2][k-1])%mod;

		g[i][j]=fix(g[i][j+1]+f[i][j]);

	}

	cout<<f[n+1][0]<<endl;

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.127659385199354x):
#include<cstdio>

using namespace std;

#define N 305

int n,m,p,dp[N][N],su[N][N],c[N][N];

int main()

{

	scanf("%d%d%d",&n,&m,&p);n++;m++;

	for(int i=1;i<=m;i++)dp[1][i]=1,su[1][i]=i;

	for(int i=0;i<=n;i++)c[i][i]=c[i][0]=1;

	for(int i=2;i<=n;i++)for(int j=1;j<i;j++)c[i][j]=(c[i-1][j-1]+c[i-1][j])%p;

	for(int i=2;i<=n;i++)

	{

		for(int k=1;k<=m;k++)

		for(int j=1;j<i;j++)

		dp[i][k]=(dp[i][k]+1ll*dp[i-j][k]*su[j][k-1]%p*c[i-2][j-1])%p;

		for(int k=1;k<=m;k++)su[i][k]=(su[i][k-1]+dp[i][k])%p;

	}

	printf("%d\n",dp[n][m]);

}//
// Slower C++ solution:
#include<bits/stdc++.h>

#define rep(i,l,r) for (int i=l;i<=r;i++)

using namespace std;

typedef long long ll;

const int maxn=305;

ll f[maxn][maxn],g[maxn][maxn],c[maxn][maxn],fac[maxn],inv[maxn];

int n,k;

ll mm;

ll dfs(int i,int j);

ll getsum(int i,int j){

	if (~g[i][j]) return g[i][j];

	g[i][j]=0;

	rep(p,j,k) (g[i][j]+=dfs(i,p))%=mm;

	return g[i][j];

}

ll dfs(int i,int j){

	if (~f[i][j]) return f[i][j];

	if (i==1) return f[i][j]=1;

	f[i][j]=0;

	rep(len,1,i-1) {

		(f[i][j]+=getsum(len,j+1)*dfs(i-len,j)%mm*c[i-2][len-1]%mm)%=mm;

	}

	return f[i][j];

}

int main(){

	scanf("%d%d%lld",&n,&k,&mm);

	c[0][0]=1;

	rep(i,1,n) {

		c[i][0]=1; c[i][i]=1;

		rep(j,1,i-1) c[i][j]=(c[i-1][j]+c[i-1][j-1])%mm;

	}

	memset(f,-1,sizeof(f));

	memset(g,-1,sizeof(g));

	dfs(n+1,0);

	printf("%lld\n",f[n+1][0]);

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.6294709969289647x):
#include<bits/stdc++.h>

using namespace std;



typedef long long ll;

typedef pair<int,int> pii;



const int maxn=307;



int n,k,m,f[maxn][maxn],g[maxn][maxn],C[maxn][maxn];



int main(){

	scanf("%d%d%d",&n,&k,&m);

	C[0][0]=1;

	for(int i=1;i<maxn;++i){

		for(int j=1;j<maxn;++j)

			C[i][j]=(C[i-1][j-1]+C[i-1][j])%m;

		C[i][0]=1;

	}

	for(int i=0;i<=k;++i)f[1][i]=1,g[1][i]=k-i+1;

	for(int i=2;i<=n+1;++i){

		for(int j=0;j<=k;++j){

			for(int t=1;t<i;++t)

				f[i][j]=(f[i][j]+1ll*f[t][j]*g[i-t][j+1]%m*C[i-2][t-1])%m;

//			printf("f[%d][%d]=%d\n",i,j,f[i][j]);

		}

		for(int j=k;j>=0;--j)g[i][j]=(g[i][j+1]+f[i][j])%m; 

	}

	printf("%d\n",f[n+1][0]);

	return 0;

}

/*

4 3 999999999



150 150 998244353

*/
// Slower C++ solution:
#include <bits/stdc++.h>



#define int long long



using namespace std;



const int N = 305;

int dp[N][N], pref[N][N], C[N][N], n, k, m;



signed main(){

    scanf("%lld %lld %lld", &n, &k, &m);



    for (int i = 0; i < N; i++) {

        for (int j = 0; j <= i; j++) {

            if (i == 0 || j == 0 || i == j) C[i][j] = 1;

            else C[i][j] = (C[i - 1][j] + C[i - 1][j - 1]) % m;

        }

    }



    memset(dp, 0, sizeof(dp));



    for (int i = 1; i <= k + 1; i++) {

        dp[1][i] = 1;

        if (i == 1) pref[1][i] = dp[1][i];

        else pref[1][i] = (pref[1][i - 1] + dp[1][i]) % m;

    }



    for (int i = 2; i <= n + 1; i++) {

        for (int j = 1; j <= k + 1; j++) {

            for (int p = 1; p <= i - 1; p++) {

                int res = C[i - 2][p - 1];

                res *= dp[p][j]; res %= m;

                res *= pref[i - p][j - 1]; res %= m;



                dp[i][j] = (dp[i][j] + res) % m;

            }



            if (j == 1) pref[i][j] = dp[i][j];

            else pref[i][j] = (pref[i][j - 1] + dp[i][j]) % m;

        }

    }



    printf("%lld", dp[n + 1][k + 1]);

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 2.1008957429432837x):
#include <bits/stdc++.h>

using namespace std;



const int N = 305;



int n, K, mod;

int f[N][N], c[N][N], prf[N][N];



int main() {

	ios_base::sync_with_stdio(false);

	cin >> n >> K >> mod; n++, K++;

	for (int i = 0;i <= n;++i){

		c[i][0] = 1;

		for (int j = 1;j <= i;++j) c[i][j] = (c[i - 1][j - 1] + c[i - 1][j]) % mod;

	}

	for (int i = 1;i <= n;++i) {

		for (int j = 1;j <= K;++j) {

			if (i == 1) f[i][j] = 1;

			else for (int k = 1;k < i;++k) {

				int cur = 1LL * c[i - 2][k - 1] * f[k][j] % mod;

				cur = 1LL * cur * prf[i - k][j - 1] % mod;

				f[i][j] = (f[i][j] + cur) % mod;

			} 

			prf[i][j] = (prf[i][j - 1] + f[i][j]) % mod;

		}

	}

	cout << f[n][K] << '\n';

}
// Slower C++ solution:
#include<bits/stdc++.h>



using namespace std;



#define fi first

#define se second

#define pb push_back

#define mp make_pair



typedef pair<int,int> ii;



long long n,k,mod,c[305][305],f[305][305],g[305][305],h[305][305];



int main(){

    cin.tie(0),cout.tie(0),ios::sync_with_stdio(0);

    cin >> n >> k >> mod;

    c[0][0] = 1;

    for(int i = 1;i<=300;i++){

        c[i][0] = 1;

        for(int j = 1;j<=i;j++){

            c[i][j] = c[i-1][j-1] + c[i-1][j];

            c[i][j]%=mod;

        }

    }

    for(int i = 0;i<=302;i++)

        h[0][i] = 1;

    for(int i = 1;i<=n;i++){

        for(int j = k;j>=0;j--){

            f[i][j] = h[i-1][j+1]%mod;

            g[i][j] = g[i][j+1]+f[i][j];

            g[i][j]%=mod;

        }

        for(int j = 0;j<=k;j++){

            for(int l =1;l<=i;l++){

                h[i][j] += ((h[i-l][j]*g[l][j]%mod)*c[i-1][l-1])%mod;

                h[i][j]%=mod;

            }

        }

    }

    cout<<h[n][1]%mod;

}


// Faster C++ solution for the same problem (measured speedup: 1.1191150357088893x):
#include <bits/stdc++.h>



using namespace std;



int n,k,m;

int dp[305][305];

int sum[305][305];

int C[305][305];



int main()

{

	scanf("%d%d%d",&n,&k,&m);

	for(int i = 0;i <= k; ++ i) dp[1][i] = 1,sum[1][i] = k - i + 1;

	C[0][0] = 1;

	for(int i = 1;i <= 300; ++ i)

	{

		C[i][0] = 1;

		for(int j = 1;j <= i; ++ j)

			C[i][j] = (C[i - 1][j - 1] + C[i - 1][j]) % m;

	}

	for(int i = 2;i <= n + 1; ++ i)

		for(int j = k - 1;j >= 0; -- j)

		{

			for(int l = 1;l < i; ++ l)

				dp[i][j] = (dp[i][j] + dp[l][j] * 1ll * sum[i - l][j + 1] % m * C[i - 2][l - 1] % m) % m;

			sum[i][j] = sum[i][j + 1] + dp[i][j],sum[i][j] %= m;

		}

	printf("%d\n",dp[n + 1][0]);

}
// Slower C++ solution:
#include<bits/stdc++.h>



using namespace std;



#define fi first

#define se second

#define pb push_back

#define mp make_pair



typedef pair<int,int> ii;



long long n,k,mod,c[305][305],f[305][305],g[305][305],h[305][305];



int main(){

    cin.tie(0),cout.tie(0),ios::sync_with_stdio(0);

    cin >> n >> k >> mod;

    c[0][0] = 1;

    for(int i = 1;i<=300;i++){

        c[i][0] = 1;

        for(int j = 1;j<=i;j++){

            c[i][j] = c[i-1][j-1] + c[i-1][j];

            c[i][j]%=mod;

        }

    }

    for(int i = 0;i<=302;i++)

        h[0][i] = 1;

    for(int i = 1;i<=n;i++){

        for(int j = k;j>=0;j--){

            f[i][j] = h[i-1][j+1]%mod;

            g[i][j] = g[i][j+1]+f[i][j];

            g[i][j]%=mod;

        }

        for(int j = 0;j<=k;j++){

            for(int l =1;l<=i;l++){

                h[i][j] += ((h[i-l][j]*g[l][j]%mod)*c[i-1][l-1])%mod;

                h[i][j]%=mod;

            }

        }

    }

    cout<<h[n][1]%mod;

}


// Faster C++ solution for the same problem (measured speedup: 1.411456177288581x):
//I love Nnanami Chiaki

#include<bits/stdc++.h>

using namespace std;

const int maxn=307;

int n,k,m;

int dp[maxn][maxn],sum[maxn][maxn],c[maxn][maxn];

void init(){

	c[0][0]=1;

	for (int i=1;i<=n;i++){

		c[i][0]=1;

		for (int j=1;j<=i;j++) c[i][j]=(c[i-1][j-1]+c[i-1][j])%m;

	}

}

int main(){

	scanf("%d%d%d",&n,&k,&m);

	init();

	for (int i=k;i>=0;i--) dp[1][i]=1;

	for (int i=k;i>=0;i--) sum[1][i]=(sum[1][i+1]+dp[1][i])%m;

	for (int i=2;i<=n+1;i++){

		for (int j=0;j<=k;j++){

			for (int sz=1;sz<i;sz++) dp[i][j]=(dp[i][j]+1ll*dp[i-sz][j]*c[i-2][sz-1]%m*sum[sz][j+1]%m)%m;

		}

		for (int j=k;j>=0;j--) sum[i][j]=(sum[i][j+1]+dp[i][j])%m;

	}

	printf("%d\n",dp[n+1][0]);

	return 0;

}