#include<bits/stdc++.h>
using namespace std;

#define CO const
#define IN inline
typedef long long int64;

template<class T> IN T read(){
	T x=0,w=1;char c=getchar();
	for(;!isdigit(c);c=getchar())if(c=='-') w=-w;
	for(;isdigit(c);c=getchar()) x=x*10+c-'0';
	return x*w;
}
template<class T> IN T read(T&x){
	return x=read<T>();
}

CO int mod=1e9+7;
IN int add(int a,int b){
	return (a+=b)>=mod?a-mod:a;
}
IN int mul(int a,int b){
	return (int64)a*b%mod;
}
IN int fpow(int a,int b){
	int ans=1;
	for(;b;b>>=1,a=mul(a,a))
		if(b&1) ans=mul(ans,a);
	return ans;
}

CO int N=51;
int fac[N],ifac[N];
int F[N][N][N];

int main(){
	int n=read<int>();
	fac[0]=1;
	for(int i=1;i<=n;++i) fac[i]=mul(fac[i-1],i);
	ifac[n]=fpow(fac[n],mod-2);
	for(int i=n-1;i>=0;--i) ifac[i]=mul(ifac[i+1],i+1);
	F[n][0][0]=1;
	for(int i=n-1;i>=0;--i)
		for(int x=0;x<=n-i;++x)for(int y=0;y<=n-i-x;++y){
			for(int a=0;a<=n-i-x-y;++a)for(int b=0;b<=n-i-x-y-a;++b)
				if(x-a+b>=0 and y+a-b>=0)
					F[i][x][y]=add(F[i][x][y],mul(F[i+x+y][a][b],mul(ifac[x-a+b],ifac[y+a-b])));
		}
	int ans=mul(fac[n],F[0][1][0]);
	printf("%d\n",ans);
	return 0;
}
