Problem:
Score : 100 points

Problem Statement

Print the K-th element of the following sequence of length 32:

1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51

Constraints

1 \leq K \leq 32

All values in input are integers.

Input

Input is given from Standard Input in the following format:

K

Output

Print the K-th element.

Sample Input 1

6

Sample Output 1

2

The 6-th element is 2.

Sample Input 2

27

Sample Output 2

5

The 27-th element is 5.

Solution in C++14 (GCC 5.4.1) (judge verdict: Accepted)

#include<bits/stdc++.h>
using namespace std;
#define ll long long int 
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define ff(i,n) for(i=0;i<n;i++)
ll bg=1000000007;
ll gcd(ll a,ll b)
{
if(b==0)
   return a;
else
   return gcd(b,a%b);   
}
ll power(ll x,ll y)
{
	if(y==0)
		return 1;
	ll h=power(x,y/2);	
	h=(h*h)%bg;
	if(y%2==1)
	  return (x*h)%bg;
	else
	  return h%bg;  
}
ll isp(string str) 
{ 
    // Start from leftmost and rightmost corners of str 
    int l = 0; 
    int h = str.length() - 1;
    // Keep comparing characters while they are same 
    while (h > l) 
    { 
        if (str[l++] != str[h--]) 
        {  
            return -1; 
        } 
    } 
    return 1; 
} 
vector<vector<ll> >adj(300000);
void bfs(ll s,ll n,ll d[])
{
	queue<ll> q;
    ll used[n+1]={0};
    vector<ll> p(n+1);
    q.push(s);
    used[s] = 1;
    p[s] = -1;
    d[s]=0;
    while (!q.empty()) {
    ll v = q.front();
    q.pop();
    ll j;
    for (j=0;j<adj[v].size();j++) {
    	ll u=adj[v][j];
        if (used[u]==0) {
            used[u] = 1;
            q.push(u);
            d[u] = d[v] + 1;
            p[u] = v;
        }
    }
   }
}
int main()
{
	ll t;
	t=1;
	while(t--)
	{	
	   ll i,j,n,m,x,k;
	   cin>>n;
	   ll arr[32]={1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
	   cout<<arr[n-1];
	}
return 0;
}