#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int a[32];
  a[0] = 1, a[1] = 1, a[2] = 1, a[3] = 2, a[4] = 1, a[5] = 2, a[6] = 1,
  a[7] = 5, a[8] = 2, a[9] = 2, a[10] = 1, a[11] = 5, a[12] = 1, a[13] = 2,
  a[14] = 1, a[15] = 14, a[16] = 1, a[17] = 5, a[18] = 1, a[19] = 5, a[20] = 2,
  a[21] = 2, a[22] = 1, a[23] = 15, a[24] = 2, a[25] = 2, a[26] = 5, a[27] = 4,
  a[28] = 1, a[29] = 4, a[30] = 1, a[31] = 51;
  int t;
  cin >> t;
  while (t--) {
    cout << a[t - 1] << endl;
  }
  return 0;
}
