Problem: 

Input

The input contains a single integer a (1 ≤ a ≤ 40).

Output

Output a single string.

Examples

Input

2


Output

Adams


Input

8


Output

Van Buren


Input

29


Output

Harding

Solution (in JAVA):

Solution:
import java.io.*;
import java.util.*;

public class Template implements Runnable {

    BufferedReader in;
    PrintWriter out;
    StringTokenizer tok = new StringTokenizer("");

    void init() throws FileNotFoundException {
        try {
            in = new BufferedReader(new FileReader("input.txt"));
            out = new PrintWriter("output.txt");
        } catch (Exception e) {
            in = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
        }
    }

    class GraphBuilder {
        int n, m;
        int[] x, y;
        int index;
        int[] size;


        GraphBuilder(int n, int m) {
            this.n = n;
            this.m = m;
            x = new int[m];
            y = new int[m];
            size = new int[n];
        }

        void add(int u, int v) {
            x[index] = u;
            y[index] = v;
            size[u]++;
            size[v]++;
            index++;
        }

        int[][] build() {
            int[][] graph = new int[n][];
            for (int i = 0; i < n; i++) {
                graph[i] = new int[size[i]];
            }
            for (int i = index - 1; i >= 0; i--) {
                int u = x[i];
                int v = y[i];
                graph[u][--size[u]] = v;
                graph[v][--size[v]] = u;
            }
            return graph;
        }
    }

    String readString() throws IOException {
        while (!tok.hasMoreTokens()) {
            try {
                tok = new StringTokenizer(in.readLine());
            } catch (Exception e) {
                return null;
            }
        }
        return tok.nextToken();
    }

    int readInt() throws IOException {
        return Integer.parseInt(readString());
    }

    int[] readIntArray(int size) throws IOException {
        int[] res = new int[size];
        for (int i = 0; i < size; i++) {
            res[i] = readInt();
        }
        return res;
    }

    long[] readLongArray(int size) throws IOException {
        long[] res = new long[size];
        for (int i = 0; i < size; i++) {
            res[i] = readLong();
        }
        return res;
    }

    long readLong() throws IOException {
        return Long.parseLong(readString());
    }

    double readDouble() throws IOException {
        return Double.parseDouble(readString());
    }

    <T> List<T>[] createGraphList(int size) {
        List<T>[] list = new List[size];
        for (int i = 0; i < size; i++) {
            list[i] = new ArrayList<>();
        }
        return list;
    }

    public static void main(String[] args) {
        new Template().run();
        // new Thread(null, new Template(), "", 1l * 200 * 1024 * 1024).start();
    }

    long timeBegin, timeEnd;

    void time() {
        timeEnd = System.currentTimeMillis();
        System.err.println("Time = " + (timeEnd - timeBegin));
    }

    long memoryTotal, memoryFree;

    void memory() {
        memoryFree = Runtime.getRuntime().freeMemory();
        System.err.println("Memory = " + ((memoryTotal - memoryFree) >> 10)
                + " KB");
    }

    public void run() {
        try {
            timeBegin = System.currentTimeMillis();
            memoryTotal = Runtime.getRuntime().freeMemory();
            init();
            solve();
            out.close();
            if (System.getProperty("ONLINE_JUDGE") == null) {
                time();
                memory();
            }
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(-1);
        }
    }


    void brut(int[] a, int pos) {
        if (a.length == pos) {
            for (int i = 0; i < a.length; i++) {
                if (a[a[i]] != a.length - 1 - i) return;
            }
            System.err.println(Arrays.toString(a));
            return;
        }
        for (int i = pos; i < a.length; i++) {
            int t = a[i];
            a[i] = a[pos];
            a[pos] = t;
            brut(a, pos + 1);
            t = a[i];
            a[i] = a[pos];
            a[pos] = t;
        }
    }

    void solve() throws IOException {
        List<String> list = new ArrayList<>();
        list.add("George Washington   (1789-1797)");
        list.add("John Adams   (1797-1801)");
        list.add("Thomas Jefferson   (1801-1817)");
        list.add("James Madison   (1809-1817)");
        list.add("James Monroe   (1817-1825)");
        list.add("John Adams   (1825-1829)");
        list.add("Andrew Jackson   (1829-1837)");
        list.add("Martin Van Buren   (1837-1841)");
        list.add("William Harrison   (1841)");
        list.add("John Tyler   (1841-1845)");
        list.add("James K. Polk   (1845-1849)");
        list.add("Zachary Taylor   (1849-1850)");
        list.add("Millard Fillmore   (1850-1853)");
        list.add("Franklin Pierce   (1853-1857)");
        list.add("James Buchanan   (1857-1861)");
        list.add("Abraham Lincoln   (1861-1865)");
        list.add("Andrew Johnson (1865-1869)");
        list.add("Ulysses S. Grant   (1869-1877)");
        list.add("Rutherford B. Hayes   (1877-1881)");
        list.add("James A. Garfield   (1881)");
        list.add("Chester A. Arthur   (1881-1885)");
        list.add("Grover Cleveland   (1885-1889)");
        list.add("Benjamin Harrison   (1889-1893)");
        list.add("Grover Cleveland   (1893-1897)");
        list.add("William McKinley   (1897-1901)");
        list.add("Theodore Roosevelt   (1901-1909)");
        list.add("William H. Taft   (1909-1913)");
        list.add("Woodrow Wilson   (1913-1921)");
        list.add("Warren G. Harding   (1921-1923)");
        list.add("Calvin Coolidge   (1923-1929)");
        list.add("Herbert Hoover   (1929-1933)");
        list.add("Franklin D. Roosevelt   (1933-1945)");
        list.add("Harry S. Truman   (1945-1953)");
        list.add("Dwight D. Eisenhower   (1953-1961)");
        list.add("John F. Kennedy   (1961-1963)");
        list.add("Lyndon B. Johnson   (1963-1969)");
        list.add("Richard M. Nixon   (1969-1974)");
        list.add("Gerald R. Ford   (1974-1977)");
        list.add("Jimmy Carter   (1977-1981)");
        list.add("Ronald Reagan   (1981-1989)");
        list.add("George Bush   (1989-1993)");
        list.add("William J. Clinton   (1993-2001) ");
        list.add("George W. Bush   (2001-2009)");
        list.add("Barack Obama   (2009-2017) ");
        list.add("Donald J. Trump   (2017-)");
        int n = readInt();
        String token = list.get(n - 1);
        StringTokenizer tokenizer = new StringTokenizer(token);
        tokenizer.nextToken();
        String family = tokenizer.nextToken();
        if (family.contains(".")) family = tokenizer.nextToken();
        while (true) {
            String s = tokenizer.nextToken();
            if (s.startsWith("(")) break;
            family += " " + s;
        }
        out.println(family);
    }


}