#include<cstdio>
#define Z int
#define V void
#define L long long
#define S(n) scanf("%lld",&n)
#define P(n) printf("%lld",(n+p)%p)
#define F(i,a,b) for(L i=a;i<=b;i++)
#define I if
#define nx 51
#define p (L)(1e9+7)
L n,fn,f[nx][nx][nx],v[nx],ans;
Z main(){
	v[0]=v[1]=1;
	F(i,2,nx-1)v[i]=-p/i*v[p%i]%p;
	F(i,2,nx-1)(v[i]*=v[i-1])%=p;
	S(n),fn=1;
	F(i,1,n)(fn*=i)%=p;
	f[1][0][1]=1;
	F(i,1,n)F(x,0,n)F(y,0,n)I(f[i][x][y])
	F(a,0,n)F(b,0,n)I(x-a+b>=0&&y+a-b>=0&&a+b>0&&i+a+b<=n)(f[i+a+b][a][b]+=f[i][x][y]*v[x-a+b]%p*v[y+a-b])%=p;
	F(x,0,n)F(y,0,n)(ans+=f[n][x][y]*v[x]%p*v[y])%=p;
	F(i,1,n)(ans*=i)%=p;
	P(ans);
}