const a: array[1..40] of string=('Washington','Adams','Jefferson','Madison','Monroe','Adams','Jackson','Van Buren','Harrison',
'Tyler','Polk', 'Taylor', 'Fillmore','Pierce','Buchanan','Lincoln', 'Johnson', 'Grant','Hayes', 'Garfield',
'Arthur', 'Cleveland','Harrison', 'Cleveland', 'McKinley','Roosevelt', 'Taft','Wilson', 'Harding','Coolidge',
'Hoover','Roosevelt','Truman', 'Eisenhower','Kennedy', 'Johnson', 'Nixon', 'Ford', 'Carter','Reagan');
 var n:longint;
  begin
   readln(n);
   writeln(a[n]);
  end.

var
 a:longint;
begin
 readln(a);
 if (a=2) or (a=6) then writeln('Adams');
 if a=8 then writeln('Van Buren');
 if a=29 then writeln('Harding');
 if a=1 then writeln('Washington');
 if a=3 then writeln('Jefferson');
 if a=4 then writeln('Madison');
 if a=5 then writeln('Monroe');
 if a=7 then writeln('Jackson');
 if (a=9) or (a=23) then writeln('Harrison');
 if a=10 then writeln('Tyler');
 if a=11 then writeln('Polk');
 if a=12 then writeln('Taylor');
 if a=13 then writeln('Fillmore');
 if a=14 then writeln('Pierce');
 if a=15 then writeln('Buchanan');
 if a=16 then writeln('Lincoln');
 if (a=17) or (a=36) then writeln('Johnson');
 if a=18 then writeln('Grant');
 if a=19 then writeln('Hayes');
 if a=20 then writeln('Garfield');
 if a=21 then writeln('Arthur');
 if (a=22) or (a=24) then writeln('Cleveland');
 if a=25 then writeln('McKinley');
 if (a=26) or (a=32) then writeln('Roosevelt');
 if a=27 then writeln('Taft');
 if a=28 then writeln('Wilson');
 if a=30 then writeln('Coolidge');
 if a=31 then writeln('Hoover');
 if a=33 then writeln('Truman');
 if a=34 then writeln('Eisenhower');
 if a=35 then writeln('Kennedy');
 if a=37 then writeln('Nixon');
 if a=38 then writeln('Ford');
 if a=39 then writeln('Carter');
 if a=40 then writeln('Reagan');
end.

uses math;
type mass=array[1..42] of string;
const m:mass=('Washington',
'Adams',
'Jefferson',
'Madison',
'Monroe',
'Adams',
'Jackson',
'Van Buren',
'Harrison',
'Tyler',
'Polk',
'Taylor',
'Fillmore',
'Pierce',
'Buchanan',
'Lincoln',
'Johnson',
'Grant',
'Hayes',
'Garfield',
'Arthur',
'Cleveland',
'Harrison',
'Cleveland',
'McKinley',
'Roosevelt',
'Taft',
'Wilson',
'Harding',
'Coolidge',
'Hoover',
'Roosevelt',
'Truman',
'Eisenhower',
'Kennedy',
'Johnson',
'Nixon',
'Ford',
'Carter',
'Reagan',
'Bush',
'Clinton');
var r:int64;code,k,a,b,res,c,n,z,i:integer;s,ss:string;
Begin
//   assign(input,'input.txt');
//   assign(output,'output.txt');
   readln(n);
   writeln(m[n]);
end.

program z1;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
  a: longint;

begin
//Assign(input,'input.txt'); Reset(Input); Assign(Output,'output.txt'); Rewrite(output);

Readln(a);
if a=1 then Writeln('Washington') else
if a=2 then Writeln('Adams') else
if a=3 then Writeln('Jefferson') else
if a=4 then Writeln('Madison') else
if a=5 then Writeln('Monroe') else
if a=6 then Writeln('Adams') else
if a=7 then Writeln('Jackson') else
if a=8 then Writeln('Van Buren') else
if a=9 then Writeln('Harrison') else
if a=10 then Writeln('Tyler') else
if a=11 then Writeln('Polk') else
if a=12 then Writeln('Taylor') else
if a=13 then Writeln('Fillmore') else
if a=14 then Writeln('Pierce') else
if a=15 then Writeln('Buchanan') else
if a=16 then Writeln('Lincoln') else
if a=17 then Writeln('Johnson') else
if a=18 then Writeln('Grant') else
if a=19 then Writeln('Hayes') else
if a=20 then Writeln('Garfield') else
if a=21 then Writeln('Arthur') else
if a=22 then Writeln('Cleveland') else
if a=23 then Writeln('Harrison') else
if a=24 then Writeln('Cleveland') else
if a=25 then Writeln('McKinley') else
if a=26 then Writeln('Roosevelt') else
if a=27 then Writeln('Taft') else
if a=28 then Writeln('Wilson') else
if a=29 then Writeln('Harding') else
if a=30 then Writeln('Coolidge') else
if a=31 then Writeln('Hoover') else
if a=32 then Writeln('Roosevelt') else
if a=33 then Writeln('Truman') else
if a=34 then Writeln('Eisenhower') else
if a=35 then Writeln('Kennedy') else
if a=36 then Writeln('Johnson') else
if a=37 then Writeln('Nixon') else
if a=38 then Writeln('Ford') else
if a=39 then Writeln('Carter') else
if a=40 then Writeln('Reagan');
//close(Input);close(output);
end.

{$APPTYPE CONSOLE}

uses SysUtils, Math;

type int = integer;

var a: array[1..41] of string[20];
n: int;

begin
  //reset(input, 'input.txt'); rewrite(output, 'output.txt');

  a[1]:= 'Washington';
  a[2]:= 'Adams';
  a[3]:= 'Jefferson';
  a[4]:= 'Madison';
  a[5]:= 'Monroe';
  a[6]:= 'Adams';
  a[7]:= 'Jackson';
  a[8]:= 'Van Buren';
  a[9]:= 'Harrison';
  a[10]:= 'Tyler';
  a[11]:= 'Polk';
  a[12]:= 'Taylor';
  a[13]:= 'Fillmore';
  a[14]:= 'Pierce';
  a[15]:= 'Buchanan';
  a[16]:= 'Lincoln';
  a[17]:= 'Johnson';
  a[18]:= 'Grant';
  a[19]:= 'Hayes';
  a[20]:= 'Garfield';
  a[21]:= 'Arthur';
  a[22]:= 'Cleveland';
  a[23]:= 'Harrison';
  a[24]:= 'Cleveland';
  a[25]:= 'McKinley';
  a[26]:= 'Roosevelt';
  a[27]:= 'Taft';
  a[28]:= 'Wilson';
  a[29]:= 'Harding';
  a[30]:= 'Coolidge';
  a[31]:= 'Hoover';
  a[32]:= 'Roosevelt';
  a[33]:= 'Truman';
  a[34]:= 'Eisenhower';
  a[35]:= 'Kennedy';
  a[36]:= 'Johnson';
  a[37]:= 'Nixon';
  a[38]:= 'Ford';
  a[39]:= 'Carter';
  a[40]:= 'Reagan';

  read(n);
  write(a[n])
end.

program Project2;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
   n,i:integer;
   //:array[1..100] of integer;
   s:string;
   st:array[1..40] of string = (
'Washington',
'Adams',
'Jefferson',
'Madison',
'Monroe',
'Adams',
'Jackson',
'Van Buren',
'Harrison',
'Tyler',
'Polk',
'Taylor',
'Fillmore',
'Pierce',
'Buchanan',
'Lincoln',
'Johnson',
'Grant',
'Hayes',
'Garfield',
'Arthur',
'Cleveland',
'Harrison',
'Cleveland',
'McKinley',
'Roosevelt',
'Taft',
'Wilson',
'Harding',
'Coolidge',
'Hoover',
'Roosevelt',
'Truman',
'Eisenhower',
'Kennedy',
'Johnson',
'Nixon',
'Ford',
'Carter',
'Reagan');
   //:boolean;
begin
   //reset(input,'input.txt');
   //rewrite(output,'output.txt');
   {for i:=1 to 40 do
    begin
     readln(s);
     if pos(' ',s)<>0 then s:=copy(s,pos(' ',s)+1,length(s)-pos(' ',s));
     writeln(s);
    end;
   writeln(chr(27));
   //}readln(i);
   writeln(st[i]);
end.

program hui;

{$APPTYPE CONSOLE}

var
 x: integer;
 a: array[1..40] of string;

begin
 read(x);
 a[1] := 'Washington';
 a[2] := 'Adams';
 a[3] := 'Jefferson';
 a[4] := 'Madison';
 a[5] := 'Monroe';
 a[6] := 'Adams';
 a[7] := 'Jackson';
 a[8] := 'Van Buren';
 a[9] := 'Harrison';
 a[10] := 'Tyler';
 a[11] := 'Polk';
 a[12] := 'Taylor';
 a[13] := 'Fillmore';
 a[14] := 'Pierce';
 a[15] := 'Buchanan';
 a[16] := 'Lincoln';
 a[17] := 'Johnson';
 a[18] := 'Grant';
 a[19] := 'Hayes';
 a[20] := 'Garfield';
 a[21] := 'Arthur';
 a[22] := 'Cleveland';
 a[23] := 'Harrison';
 a[24] := 'Cleveland';
 a[25] := 'McKinley';
 a[26] := 'Roosevelt';
 a[27] := 'Taft';
 a[28] := 'Wilson';
 a[29] := 'Harding';
 a[30] := 'Coolidge';
 a[31] := 'Hoover';
 a[32] := 'Roosevelt';
 a[33] := 'Truman';
 a[34] := 'Eisenhower';
 a[35] := 'Kennedy';
 a[36] := 'Johnson';
 a[37] := 'Nixon';
 a[38] := 'Ford';
 a[39] := 'Carter';
 a[40] := 'Reagan';
 writeln(a[x]);
end.

program Project2;

{$APPTYPE CONSOLE}
{$O-}

uses
  SysUtils;

var
  b, a: array[1..1000001] of string;
  i, n, cnt1, cnt2, cnt3, k: integer;
  cnt: Int64;
  ch: Char;
  s: string;

begin
  read(n);

  a[1] := 'Washington';
  a[2] := 'Adams';
  a[3] := 'Jefferson';
  a[4] := 'Madison';
  a[5] := ('Monroe');
  a[6] := ('Adams');
  a[7] := ('Jackson');
  a[8] := ('Van Buren');
  a[9] := ('Harrison');
  a[10] := ('Tyler');
  a[11] := ('Polk');
  a[12] := 'Taylor';
  a[13] := 'Fillmore';
  a[14] := 'Pierce';
  a[15] := 'Buchanan';
  a[16] := 'Lincoln';
  a[17] := 'Johnson';
  a[18] := 'Grant';
  a[19] := 'Hayes';
  a[20] := 'Garfield';
  a[21] := 'Arthur';
  a[22] := 'Cleveland';
  a[23] := 'Harrison';
  a[24] := 'Cleveland';
  a[25] := 'McKinley';
  a[26] := 'Roosevelt';
  a[27] := 'Taft';
  a[28] := 'Wilson';
  a[29] := 'Harding';
  a[30] := 'Coolidge';
  a[31] := 'Hoover';
  a[32] := 'Roosevelt';
  a[33] := 'Truman';
  a[34] := 'Eisenhower';
  a[35] := 'Kennedy';
  a[36] := 'Johnson';
  a[37] := 'Nixon';
  a[38] := 'Ford';
  a[39] := 'Carter';
  a[40] := 'Reagan';
  a[41] := 'Bush';

  write(a[n]);

end.

var n: byte;
    data: array [1..45] of string;
begin
      data[1]:='Washington';
      data[2]:='Adams';
      data[3]:='Jefferson';
      data[4]:='Madison';
      data[5]:='Monroe';
      data[6]:='Adams';
      data[7]:='Jackson';
      data[8]:='Van Buren';
      data[9]:='Harrison';
      data[10]:='Tyler';
      data[11]:='Polk';
      data[12]:='Taylor';
      data[13]:='Fillmore';
      data[14]:='Pierce';
      data[15]:='Buchanan';
      data[16]:='Lincoln';
      data[17]:='Johnson';
      data[18]:='Grant';
      data[19]:='Hayes';
      data[20]:='Garfield';
      data[21]:='Arthur';
      data[22]:='Cleveland';
      data[23]:='Harrison';
      data[24]:='Cleveland';
      data[25]:='McKinley';
      data[26]:='Roosevelt';
      data[27]:='Taft';
      data[28]:='Wilson';
      data[29]:='Harding';
      data[30]:='Coolidge';
      data[31]:='Hoover';
      data[32]:='Roosevelt';
      data[33]:='Truman';
      data[34]:='Eisenhower';
      data[35]:='Kennedy';
      data[36]:='Johnson';
      data[37]:='Nixon';
      data[38]:='Ford';
      data[39]:='Carter';
      data[40]:='Reagan';
      data[41]:='Bush';
      data[42]:='Clinton';
      data[43]:='Bush';
      data[44]:='Obama';
    readln(n);
    writeln(data[n]);
end.

Const a:array[1..40]of string=(
'Washington',
'Adams',
'Jefferson',
'Madison',
'Monroe',
'Adams',
'Jackson',
'Van Buren',
'Harrison',
'Tyler',
'Polk',
'Taylor',
'Fillmore',
'Pierce',
'Buchanan',
'Lincoln',
'Johnson',
'Grant',
'Hayes',
'Garfield',
'Arthur',
'Cleveland',
'Harrison',
'Cleveland',
'McKinley',
'Roosevelt',
'Taft',
'Wilson',
'Harding',
'Coolidge',
'Hoover',
'Roosevelt',
'Truman',
'Eisenhower',
'Kennedy',
'Johnson',
'Nixon',
'Ford',
'Carter',
'Reagan');
var n:longint;
 begin
  read(n);
  writeln(a[n]);
 end.

program Project1;

{$APPTYPE CONSOLE}
{$DEFINE SUBMIT}

uses
  SysUtils;

var
  N: integer;
//  const a: array [1..40] of string = ('Washington', 'Adams', 'Jefferson', 'Madison', 'Monroe', 'Quincy Adams', 'Jackson', 'Van Buren', 'H. Harrison', 'Tyler', 'K. Polk', 'Taylor', 'Fillmore', 'Pierce', 'Buchanan', 'Lincoln', 'Johnson', 'S. Grant', 'B. Hayes', 'A. Garfield', 'A. Arthur', 'Cleveland', 'Harrison', 'Cleveland', 'McKinley', 'Roosevelt', 'Howard Taft', 'Wilson', 'G. Harding', 'Coolidge', 'Hoover', 'D. Roosevelt', 'S. Truman', 'D. Eisenhower', 'F. Kennedy', 'B. Johnson', 'Nixon', 'Ford', 'Carter', 'Reagan');
const a: array [1..40] of string = ('Washington',
'Adams',
'Jefferson',
'Madison',
'Monroe',
'Adams',
'Jackson',
'Van Buren',
'Harrison',
'Tyler',
'Polk',
'Taylor',
'Fillmore',
'Pierce',
'Buchanan',
'Lincoln',
'Johnson',
'Grant',
'Hayes',
'Garfield',
'Arthur',
'Cleveland',
'Harrison',
'Cleveland',
'McKinley',
'Roosevelt',
'Taft',
'Wilson',
'Harding',
'Coolidge',
'Hoover',
'Roosevelt',
'Truman',
'Eisenhower',
'Kennedy',
'Johnson',
'Nixon',
'Ford',
'Carter',
'Reagan')
;
begin
{$IFNDEF SUBMIT}
  Assign(input, 'input.txt');
  Assign(output, 'output.txt');
{$ENDIF}
  ReadLn(N);
  WriteLn(a[n]);
end.

var a: longint;
begin
  readln(a);
  case a of
    1: writeln('Washington');
    2,6: writeln('Adams');
    3: writeln('Jefferson');
    4: writeln('Madison');
    5: writeln('Monroe');
    7: writeln('Jackson');
    8: writeln('Van Buren');
    9,23: writeln('Harrison');
    10: writeln('Tyler');
    11: writeln('Polk');
    12: writeln('Taylor');
    13: writeln('Fillmore');
    14: writeln('Pierce');
    15: writeln('Buchanan');
    16: writeln('Lincoln');
    17,36: writeln('Johnson');
    18: writeln('Grant');
    19: writeln('Hayes');
    20: writeln('Garfield');
    21: writeln('Arthur');
    22,24: writeln('Cleveland');
    25: writeln('McKinley');
    26,32: writeln('Roosevelt');
    27: writeln('Taft');
    28: writeln('Wilson');
    29: writeln('Harding');
    30: writeln('Coolidge');
    31: writeln('Hoover');
    33: writeln('Truman');
    34: writeln('Eisenhower');
    35: writeln('Kennedy');
    37: writeln('Nixon');
    38: writeln('Ford');
    39: writeln('Carter');
    40: writeln('Reagan')
  end
end.

const
  a:array[1..40]of string=(
  'Washington','Adams','Jefferson','Madison','Monroe','Adams','Jackson','Van Buren','Harrison','Tyler','Polk','Taylor','Fillmore','Pierce','Buchanan','Lincoln','Johnson','Grant','Hayes','Garfield','Arthur','Cleveland','Harrison','Cleveland','McKinley','Roosevelt','Taft','Wilson','Harding','Coolidge','Hoover','Roosevelt','Truman','Eisenhower','Kennedy','Johnson','Nixon','Ford','Carter','Reagan');
var
  x:longint;
begin
  read(x);
  writeln(a[x]);
end.

Var n:Byte;
Begin
Read(n);
If n=1 then writeLn('Washington');
If n=2 then writeLn('Adams');
If n=3 then writeLN('Jefferson');
If n=4 then writeLn('Madison');
If n=5 then writeLn('Monroe');
If n=6 then writeLN('Adams');
If n=7 then writeLn('Jackson');
If n=8 then writeLn('Van Buren');
If n=9 then writeLn('Harrison');
If n=10 then writeLn('Tyler');
If n=11 then writeLn('Polk');
If n=12 then writeLn('Taylor');
If n=13 then writeLn('Fillmore');
If n=14 then writeLn('Pierce');
If n=15 then writeLn('Buchanan');
If n=16 then writeLn('Lincoln');
If n=17 then writeLn('Johnson');
If n=18 then writeLn('Grant');
IF n=19 then writeLn('Hayes');
If n=20 then writeLn('Garfield');
If n=21 then writeLN('Arthur');
IF n=22 then writeln('Cleveland');
IF n=23 then writeLn('Harrison');
If n=24 then writeLn('Cleveland');
If n=25 then writeln('McKinley');
If n=26 then writeLn('Roosevelt');
If n=27 then writeLn('Taft');
IF n=28 then writeLn('Wilson');
If n=29 then writeLn('Harding');
If n=30 then writeLn('Coolidge');
If n=31 then writeLN('Hoover');
If n=32 then writeLn('Roosevelt');
if n=33 then writeLN('Truman');
If n=34 then writeLN('Eisenhower');
If n=35 then writeLn('Kennedy');
If n=36 then writeLn('Johnson');
If n=37 then writeLn('Nixon');
If n=38 then writeLn('Ford');
If n=39 then writeLn('Carter');
If n=40 then writeLN('Reagan');
End.

program A1;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var a:integer;
begin
  readln(a);
  if a=1 then write('Washington');
  if a=2 then write('Adams');
  if a=3 then write('Jefferson');
  if a=4 then write('Madison');
  if a=5 then write('Monroe');
  if a=6 then write('Adams');
  if a=7 then write('Jackson');
  if a=8 then write('Van Buren');
  if a=9 then write('Harrison');
  if a=10 then write('Tyler');
  if a=11 then write('Polk');
  if a=12 then write('Taylor');
  if a=13 then write('Fillmore');
  if a=14 then write('Pierce');
  if a=15 then write('Buchanan');
  if a=16 then write('Lincoln');
  if a=17 then write('Johnson');
  if a=18 then write('Grant');
  if a=19 then write('Hayes');
  if a=20 then write('Garfield');
  if a=21 then write('Arthur');
  if a=22 then write('Cleveland');
  if a=23 then write('Harrison');
  if a=24 then write('Cleveland');
  if a=25 then write('McKinley');
  if a=26 then write('Roosevelt');
  if a=27 then write('Taft');
  if a=28 then write('Wilson');
  if a=29 then write('Harding');
  if a=30 then write('Coolidge');
  if a=31 then write('Hoover');
  if a=32 then write('Roosevelt');
  if a=33 then write('Truman');
  if a=34 then write('Eisenhower');
  if a=35 then write('Kennedy');
  if a=36 then write('Johnson');
  if a=37 then write('Nixon');
  if a=38 then write('Ford');
  if a=39 then write('Carter');
  if a=40 then write('Reagan')
end.

Var a:longint;
begin
 Read(a);
 if a=1 then begin Write('Washington'); halt(0); end;
 if (a=2) or (a=6) then begin Write('Adams'); halt(0); end;
 if a=3 then begin Write('Jefferson'); halt(0); end;
 if a=4 then begin Write('Madison'); halt(0); end;
 if a=5 then begin Write('Monroe'); halt(0); end;
 if a=7 then begin Write('Jackson'); halt(0); end;
 if a=8 then begin Write('Van Buren'); halt(0); end;
 if a=9 then begin Write('Harrison'); halt(0); end;
 if a=10 then begin Write('Tyler'); halt(0); end;
 if a=11 then begin Write('Polk'); halt(0); end;
 if a=12 then begin Write('Taylor'); halt(0); end;
 if a=13 then begin Write('Fillmore'); halt(0); end;
 if a=14 then begin Write('Pierce'); halt(0); end;
 if a=15 then begin Write('Buchanan'); halt(0); end;
 if a=16 then begin Write('Lincoln'); halt(0); end;
 if a=17 then begin Write('Johnson'); halt(0); end;
 if a=18 then begin Write('Grant'); halt(0); end;
 if a=19 then begin Write('Hayes'); halt(0); end;
 if a=20 then begin Write('Garfield'); halt(0); end;
 if a=21 then begin Write('Arthur'); halt(0); end;
 if a=22 then begin Write('Cleveland'); halt(0); end;
 if a=23 then begin Write('Harrison'); halt(0); end;
 if a=24 then begin Write('Cleveland'); halt(0); end;
 if a=25 then begin Write('McKinley'); halt(0); end;
 if a=26 then begin Write('Roosevelt'); halt(0); end;
 if a=27 then begin Write('Taft'); halt(0); end;
 if a=28 then begin Write('Wilson'); halt(0); end;
 if a=29 then begin Write('Harding'); halt(0); end;
 if a=30 then begin Write('Coolidge'); halt(0); end;
 if a=31 then begin Write('Hoover'); halt(0); end;
 if a=32 then begin Write('Roosevelt'); halt(0); end;
 if a=33 then begin Write('Truman'); halt(0); end;
 if a=34 then begin Write('Eisenhower'); halt(0); end;
 if a=35 then begin Write('Kennedy'); halt(0); end;
 if a=36 then begin Write('Johnson'); halt(0); end;
 if a=37 then begin Write('Nixon'); halt(0); end;
 if a=38 then begin Write('Ford'); halt(0); end;
 if a=39 then begin Write('Carter'); halt(0); end;
 if a=40 then begin Write('Reagan'); halt(0); end;
end.

{$MODE OBJFPC}
const

a: array[1..40] of string = (
'Washington ','Adams ','Jefferson ','Madison ','Monroe ','Adams ','Jackson ','Van Buren ','Harrison ','Tyler ','Polk ','Taylor ','Fillmore ','Pierce ','Buchanan ','Lincoln ','Johnson ',
'Grant ','Hayes ','Garfield ','Arthur ','Cleveland ','Harrison ','Cleveland ','McKinley ','Roosevelt ','Taft ','Wilson ','Harding ','Coolidge ','Hoover ','Roosevelt ','Truman ','Eisenhower ',
'Kennedy ','Johnson ','Nixon ','Ford ','Carter ','Reagan ');//x,'Bush ','Clinton');

var
  i: longint;
begin
  read(i);
  writeln(a[i]);
end.

program USA;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
   n:integer;
begin
   readln(n);
   if(n=1)then write('Washington')
   else
   if(n=2)then write('Adams')
   else
   if(n=3)then write('Jefferson')
   else
   if(n=4)then write('Madison')
   else
   if(n=5)then write('Monroe')
   else
   if(n=6)then write('Adams')
   else
   if(n=7)then write('Jackson')
   else
   if(n=8)then write('Van Buren')
   else
   if(n=9)then write('Harrison')
   else
   if(n=10)then write('Tyler')
   else
   if(n=11)then write('Polk')
   else
   if(n=12)then write('Taylor')
   else
   if(n=13)then write('Fillmore')
   else
   if(n=14)then write('Pierce')
   else
   if(n=15)then write('Buchanan')
   else
   if(n=16)then write('Lincoln')
   else
   if(n=17)then write('Johnson')
   else
   if(n=18)then write('Grant')
   else
   if(n=19)then write('Hayes')
   else
   if(n=20)then write('Garfield')
   else
   if(n=21)then write('Arthur')
   else
   if(n=22)then write('Cleveland')
   else
   if(n=23)then write('Harrison')
   else
   if(n=24)then write('Cleveland')
   else
   if(n=25)then write('McKinley')
   else
   if(n=26)then write('Roosevelt')
   else
   if(n=27)then write('Taft')
   else
   if(n=28)then write('Wilson')
   else
   if(n=29)then write('Harding')
   else
   if(n=30)then write('Coolidge')
   else
   if(n=31)then write('Hoover')
   else
   if(n=32)then write('Roosevelt')
   else
   if(n=33)then write('Truman')
   else
   if(n=34)then write('Eisenhower')
   else
   if(n=35)then write('Kennedy')
   else
   if(n=36)then write('Johnson')
   else
   if(n=37)then write('Nixon')
   else
   if(n=38)then write('Ford')
   else
   if(n=39)then write('Carter')
   else
   if(n=40)then write('Reagan');
   readln;readln;
end.

var
  list:array[1..40]of string=(
  'Washington','Adams','Jefferson','Madison','Monroe','Adams','Jackson','Van Buren','Harrison','Tyler','Polk','Taylor','Fillmore','Pierce','Buchanan','Lincoln','Johnson','Grant','Hayes','Garfield','Arthur','Cleveland','Harrison','Cleveland','McKinley','Roosevelt','Taft','Wilson','Harding','Coolidge','Hoover','Roosevelt','Truman','Eisenhower','Kennedy','Johnson','Nixon','Ford','Carter','Reagan');
  x:longint;
begin
  read(x);
  writeln(list[x]);
end.

const a:array[1..40]of string=('Washington','Adams','Jefferson','Madison','Monroe','Adams','Jackson','Van Buren','Harrison','Tyler','Polk','Taylor','Fillmore','Pierce','Buchanan','Lincoln','Johnson','Grant','Hayes','Garfield','Arthur','Cleveland','Harrison','Cleveland','McKinley','Roosevelt','Taft','Wilson','Harding','Coolidge','Hoover','Roosevelt','Truman','Eisenhower','Kennedy','Johnson','Nixon','Ford','Carter','Reagan');
var x:word;
begin
  read(x);
  write(a[x])
end.

var s: ansistring;
n: longint;
begin
  readln(n);

  if n=1 then writeln('Washington')
  else if n=2 then writeln('Adams')
  else if n=3 then writeln('Jefferson')
  else if n=4 then writeln('Madison')
  else if n=5 then writeln('Monroe')
  else if n=6 then writeln('Adams')
  else if n=7 then writeln('Jackson')
  else if n=8 then writeln('Van Buren')
  else if n=9 then writeln('Harrison')
  else if n=10 then writeln('Tyler')
  else if n=11 then writeln('Polk')
  else if n=12 then writeln('Taylor')
  else if n=13 then writeln('Fillmore')
  else if n=14 then writeln('Pierce')
  else if n=15 then writeln('Buchanan')
  else if n=16 then writeln('Lincoln')
  else if n=17 then writeln('Johnson')
  else if n=18 then writeln('Grant')
  else if n=19  then writeln('Hayes')
  else if n=20 then writeln('Garfield')
  else if n=21 then writeln('Arthur')
  else if n=22 then writeln('Cleveland')
  else if n=23 then writeln('Harrison')
  else if n=24 then writeln('Cleveland')
  else if n=25 then writeln('McKinley')
  else if n=26 then writeln('Roosevelt')
  else if n=27 then writeln('Taft')
  else if n=28 then writeln('Wilson')
  else if n=29 then writeln('Harding')
  else if n=30 then writeln('Coolidge')
  else if n=31 then writeln('Hoover')
  else if n=32 then writeln('Roosevelt')
  else if n=33 then writeln('Truman')
  else if n=34 then writeln('Eisenhower')
  else if n=35 then writeln('Kennedy')
  else if n=36 then writeln('Johnson')
  else if n=37 then writeln('Nixon')
  else if n=38 then writeln('Ford')
  else if n=39 then writeln('Carter')
  else if n=40 then writeln('Reagan');
end.

const
	a:array[1..40] of string[30]=('Washington','Adams','Jefferson','Madison','Monroe','Adams','Jackson','Van Buren','Harrison','Tyler','Polk','Taylor','Fillmore','Pierce','Buchanan','Lincoln','Johnson','Grant','Hayes','Garfield','Arthur','Cleveland','Harrison','Cleveland','McKinley','Roosevelt','Taft','Wilson','Harding','Coolidge','Hoover','Roosevelt','Truman','Eisenhower','Kennedy','Johnson','Nixon','Ford','Carter','Reagan');
var
	n:longint;
begin
	read(n);
	write(a[n]);
end.

var
n:integer;
begin
read(n);
case n of
1:writeln('Washington');
2:writeln('Adams');
3:writeln('Jefferson');
4:writeln('Madison');
5:writeln('Monroe');
6:writeln('Adams');
7:writeln('Jackson');
8:writeln('Van Buren');
9:writeln('Harrison');
10:writeln('Tyler');
11:writeln('Polk');
12:writeln('Taylor');
13:writeln('Fillmore');
14:writeln('Pierce');
15:writeln('Buchanan');
16:writeln('Lincoln');
17:writeln('Johnson');
18:writeln('Grant');
19:writeln('Hayes');
20:writeln('Garfield');
21:writeln('Arthur');
22:writeln('Cleveland');
23:writeln('Harrison');
24:writeln('Cleveland');
25:writeln('McKinley');
26:writeln('Roosevelt');
27:writeln('Taft');
28:writeln('Wilson');
29:writeln('Harding');
30:writeln('Coolidge');
31:writeln('Hoover');
32:writeln('Roosevelt');
33:writeln('Truman');
34:writeln('Eisenhower');
35:writeln('Kennedy');
36:writeln('Johnson');
37:writeln('Nixon');
38:writeln('Ford');
39:writeln('Carter');
40:writeln('Reagan');
41:writeln('Bush');
42:writeln('Clinton');
43:writeln('Bush');
44:writeln('Obama');
end;
end.

program ProjectA;

{$APPTYPE CONSOLE}

const
  a : array[1..40] of string =
('Washington',
'Adams',
'Jefferson',
'Madison',
'Monroe',
'Adams',
'Jackson',
'Van Buren',
'Harrison',
'Tyler',
'Polk',
'Taylor',
'Fillmore',
'Pierce',
'Buchanan',
'Lincoln',
'Johnson',
'Grant',
'Hayes',
'Garfield',
'Arthur',
'Cleveland',
'Harrison',
'Cleveland',
'McKinley',
'Roosevelt',
'Taft',
'Wilson',
'Harding',
'Coolidge',
'Hoover',
'Roosevelt',
'Truman',
'Eisenhower',
'Kennedy',
'Johnson',
'Nixon',
'Ford',
'Carter',
'Reagan');
var
  x : integer;
begin
  readln(x);
  writeln(a[x]);
  readln;
  readln;
end.

{$APPTYPE CONSOLE}
{$R+,Q+,S+}
uses
  SysUtils,Math;
const
  Pi = 3.1415926535897932384626;
procedure SWAP(var a,b:integer);
var
  q:Integer;
begin
  q:=a;
  a:=b;
  b:=q;
end;
var
  a:Integer;
  //a:array[1..10] of Integer;
  s:string;
  c:char ;
begin
  read(a);
  if a = 1 then write('Washington');
  if a = 2 then write('Adams');
  if a = 3 then write('Jefferson');
  if a = 4 then write('Madison');
  if a = 5 then write('Monroe');
  if a = 6 then write('Adams');   //
  if a = 7 then write('Jackson');
  if a = 8 then write('Van Buren');
  if a = 9 then write('Harrison');  //
  if a = 10 then write('Tyler');

  if a = 11 then write('Polk');   //
  if a = 12 then write('Taylor');
  if a = 13 then write('Fillmore');
  if a = 14 then write('Pierce');
  if a = 15 then write('Buchanan');
  if a = 16 then write('Lincoln');
  if a = 17 then write('Johnson');
  if a = 18 then write('Grant');    //
  if a = 19 then write('Hayes');      //
  if a = 20 then write('Garfield');  //

  if a = 21 then write('Arthur');   //
  if a = 22 then write('Cleveland');
  if a = 23 then write('Harrison');
  if a = 24 then write('Cleveland');
  if a = 25 then write('McKinley');
  if a = 26 then write('Roosevelt');
  if a = 27 then write('Taft');   //
  if a = 28 then write('Wilson');
  if a = 29 then write('Harding');   //
  if a = 30 then write('Coolidge');

  if a = 31 then write('Hoover');
  if a = 32 then write('Roosevelt');   //
  if a = 33 then write('Truman');     //
  if a = 34 then write('Eisenhower');  //
  if a = 35 then write('Kennedy');      //
  if a = 36 then write('Johnson');      //
  if a = 37 then write('Nixon');
  if a = 38 then write('Ford');
  if a = 39 then write('Carter');
  if a = 40 then write('Reagan');

end.

program Project2;

{$APPTYPE CONSOLE}

uses
  SysUtils, Math;

var i, n,k,m,x,y,z,cur,l,v1 : integer;
    s:string;

begin
  {assign(input,'input.txt');
  assign(output,'output.txt');
  reset(input);
  rewrite(output); }
  read(n);
  s:=' Washington Adams Jefferson Madison Monroe Adams Jackson VanBuren Harrison Tyler Polk Taylor';
  s:=s+' Fillmore Pierce Buchanan Lincoln Johnson Grant Hayes Garfield Arthur Cleveland Harrison Cleveland McKinley Roosevelt Taft Wilson Harding Coolidge Hoover Roosevelt Truman Eisenhower Kennedy Johnson Nixon Ford Carter Reagan Bush Clinton Bush Obama';
  if n=8 then write('Van Buren') else begin
    k:=0;
    i:=1;
    while k<>n do begin
      if s[i]=' ' then inc(k);
      inc(i);
    end;
    while s[i]<>' ' do begin
      write(s[i]);
      inc(i);
    end;

  end;
end.

program Project2;

{$APPTYPE CONSOLE}

uses
  SysUtils;
 var
  sum,n,i,j,code,c,max,min,z,x:integer;
  s,y,s1,k,r:string;
  u:char;
  a,b:array[1..4] of integer;
begin
readln(n);
if n=1 then writeln('Washington');
if n=2 then writeln('Adams');
if n=3 then writeln('Jefferson');
if n=4 then writeln('Madison');
if n=5 then writeln('Monroe');
if n=6 then writeln('Adams');
if n=7 then writeln('Jackson');
if n=8 then writeln('Van Buren');
if n=9 then writeln('Harrison');
if n=10 then writeln('Tyler');
if n=11 then writeln('Polk');
if n=12 then writeln('Taylor');
if n=13 then writeln('Fillmore');
if n=14 then writeln('Pierce');
if n=15 then writeln('Buchanan');
if n=16 then writeln('Lincoln');
if n=17 then writeln('Johnson');
if n=18 then writeln('Grant');
if n=19 then writeln('Hayes');
if n=20 then writeln('Garfield');
if n=21 then writeln('Arthur');
if n=22 then writeln('Cleveland');
if n=23 then writeln('Harrison');
if n=24 then writeln('Cleveland');
if n=25 then writeln('McKinley');
if n=26 then writeln('Roosevelt');
if n=27 then writeln('Taft');
if n=28 then writeln('Wilson');
if n=29 then writeln('Harding');
if n=30 then writeln('Coolidge');
if n=31 then writeln('Hoover');
if n=32 then writeln('Roosevelt');
if n=33 then writeln('Truman');
if n=34 then writeln('Eisenhower');
if n=35 then writeln('Kennedy');
if n=36 then writeln('Johnson');
if n=37 then writeln('Nixon');
if n=38 then writeln('Ford');
if n=39 then writeln('Carter');
if n=40 then writeln('Reagan');

end.

var
  ans : array [0..40] of ansistring;
  n : longint;
begin
  ans[1]:='Washington';
  ans[2]:='Adams';
  ans[3]:='Jefferson';
  ans[4]:='Madison';
  ans[5]:='Monroe';
  ans[6]:='Adams';
  ans[7]:='Jackson';
  ans[8]:='Van Buren';
  ans[9]:='Harrison';
  ans[10]:='Tyler';
  ans[11]:='Polk';
  ans[12]:='Taylor';
  ans[13]:='Fillmore';
  ans[14]:='Pierce';
  ans[15]:='Buchanan';
  ans[16]:='Lincoln';
  ans[17]:='Johnson';
  ans[18]:='Grant';
  ans[19]:='Hayes';
  ans[20]:='Garfield';
  ans[21]:='Arthur';
  ans[22]:='Cleveland';
  ans[23]:='Harrison';
  ans[24]:='Cleveland';
  ans[25]:='McKinley';
  ans[26]:='Roosevelt';
  ans[27]:='Taft';
  ans[28]:='Wilson';
  ans[29]:='Harding';
  ans[30]:='Coolidge';
  ans[31]:='Hoover';
  ans[32]:='Roosevelt';
  ans[33]:='Truman';
  ans[34]:='Eisenhower';
  ans[35]:='Kennedy';
  ans[36]:='Johnson';
  ans[37]:='Nixon';
  ans[38]:='Ford';
  ans[39]:='Carter';
  ans[40]:='Reagan';
  readln(n);
  writeln(ans[n]);
end.

Const
        p:array[1..40]of Shortstring=('Washington'       //1
                                      ,'Adams'//
                                      ,'Jefferson'//
                                      ,'Madison'
                                      ,'Monroe'
                                      ,'Adams'
                                      ,'Jackson'
                                      ,'Van Buren'
                                      ,'Harrison'
                                      ,'Tyler'          //10
                                      ,'Polk'
                                      ,'Taylor'
                                      ,'Fillmore'
                                      ,'Pierce'
				      ,'Buchanan'
				      ,'Lincoln'
				      ,'Johnson'
				      ,'Grant'
				      ,'Hayes'
				      ,'Garfield'       //20
				      ,'Arthur'
				      ,'Cleveland'
				      ,'Harrison'
				      ,'Cleveland'
				      ,'McKinley'
				      ,'Roosevelt'
                                      ,'Taft'
				      ,'Wilson'
                                      ,'Harding'
                                      ,'Coolidge'            //30
                                      ,'Hoover'
				      ,'Roosevelt'
				      ,'Truman'
				      ,'Eisenhower'
				      ,'Kennedy'
				      ,'Johnson'
				      ,'Nixon'
				      ,'Ford'
				      ,'Carter'
				      ,'Reagan');

var
        a:longint;
begin
readln(a);
writeln(p[a]);
end.

{$APPTYPE CONSOLE}
const a:array[1..40]of string = ('Washington','Adams','Jefferson','Madison','Monroe','Adams','Jackson','Van Buren','Harrison','Tyler','Polk','Taylor','Fillmore','Pierce','Buchanan','Lincoln','Johnson','Grant','Hayes','Garfield','Arthur','Cleveland','Harrison','Cleveland','McKinley','Roosevelt','Taft','Wilson','Harding','Coolidge','Hoover','Roosevelt','Truman','Eisenhower','Kennedy','Johnson','Nixon','Ford','Carter','Reagan');
var x:longint;
begin
  read(x);
  write(a[x])
end.

program Project13;

{$APPTYPE CONSOLE}

uses
  SysUtils;

const
  pr: array [1 .. 40] of string =
  ('Washington', 'Adams', 'Jefferson', 'Madison', 'Monroe', 'Adams', 'Jackson',
'Van Buren', 'Harrison', 'Tyler', 'Polk', 'Taylor', 'Fillmore', 'Pierce', 'Buchanan', 'Lincoln',
'Johnson', 'Grant','Hayes', 'Garfield', 'Arthur', 'Cleveland', 'Harrison', 'Cleveland',
'McKinley', 'Roosevelt', 'Taft', 'Wilson', 'Harding', 'Coolidge', 'Hoover',
'Roosevelt', 'Truman', 'Eisenhower', 'Kennedy', 'Johnson', 'Nixon', 'Ford', 'Carter',
'Reagan');

var
  a: integer;
begin
  readln(a);
  writeln(pr[a]);
  readln;
end.

const massiv:array[1..40] of string =('Washington', 'Adams', 'Jefferson', 'Madison', 'Monroe', 'Adams', 'Jackson', 'Van Buren', 'Harrison', 'Tyler', 'Polk', 'Taylor',
 'Fillmore', 'Pierce', 'Buchanan','Lincoln', 'Johnson', 'Grant', 'Hayes', 'Garfield', 'Arthur', 'Cleveland', 'Harrison', 'Cleveland', 'McKinley', 'Roosevelt', 'Taft',
  'Wilson', 'Harding', 'Coolidge', 'Hoover', 'Roosevelt', 'Truman', 'Eisenhower', 'Kennedy', 'Johnson', 'Nixon', 'Ford', 'Carter', 'Reagan');
var n:longint;

begin

  readln(n);
  writeln(massiv[n]);

end.

var
n:longint;
begin
readln(n);
If n=1 then writeln('Washington');
If n=2 then writeln('Adams');
If n=3 then writeln('Jefferson');
If n=4 then writeln('Madison');
IF n=5 then writeln('Monroe');
If n=6 then writeln('Adams');
If n=7 then writeln('Jackson');
If n=8 then writeln('Van Buren');
If n=9 then writeln('Harrison');
If n=10 then writeln('Tyler');
If n=11 then writeln('Polk');
If n=12 then writeln('Taylor');
If n=13 then writeln('Fillmore');
If n=14 then writeln('Pierce');
If n=15 then writeln('Buchanan');
If n=16 then writeln('Lincoln');
If n=17 then writeln('Johnson');
If n=18 then writeln('Grant');
If n=19 then writeln('Hayes');
If n=20 then writeln('Garfield');
If n=21 then writeln('Arthur');
If n=22 then writeln('Cleveland');
If n=23 then writeln('Harrison');
If n=24 then writeln('Cleveland');
If n=25 then writeln('McKinley');
If n=26 then writeln('Roosevelt');
If n=27 then writeln('Taft');
If n=28 then writeln('Wilson');
if n=29 then writeln('Harding');
if n=30 then writeln('Coolidge');
If n=31 then writeln('Hoover');
if n=32 then writeln('Roosevelt');
if n=33 then writeln('Truman');
if n=34 then writeln('Eisenhower');
if n=35 then writeln('Kennedy');
if n=36 then writeln('Johnson');
if n=37 then writeln('Nixon');
if n=38 then writeln('Ford');
if n=39 then writeln('Carter');
if n=40 then writeln('Reagan');
end.

var
  n: integer;
const
  s : array[1..44] of string = ('Washington', 'Adams', 'Jefferson', 'Madison', 'Monroe', 'Adams', 'Jackson', 'Van Buren', 'Harrison', 'Tyler', 'Polk', 'Taylor', 'Fillmore', 'Pierce',
  'Buchanan', 'Lincoln', 'Johnson', 'Grant', 'Hayes', 'Garfield', 'Arthur', 'Cleveland', 'Harrison', 'Cleveland', 'McKinley', 'Roosevelt', 'Taft', 'Wilson', 'Harding', 'Coolidge',
  'Hoover', 'Roosevelt', 'Truman', 'Eisenhower', 'Kennedy', 'Johnson', 'Nixon', 'Ford', 'Carter', 'Reagan', 'Bush', 'Clinton', 'Bush', 'Obama');
begin
  read(n);
  writeln(s[n]);
end.

program Project1;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
  n,k,i:integer;
begin
  read(n);
  if (n=1) then write('Washington');
  if (n=2) then write('Adams');
  if (n=3) then write('Jefferson');
  if (n=4) then write('Madison');
  if (n=5) then write('Monroe');
  if (n=6) then write('Adams');
  if (n=7) then write('Jackson');
  if (n=8) then write('Van Buren');
  if (n=9) then write('Harrison');
  if (n=10) then write('Tyler');
  if (n=11) then write('Polk');
  if (n=12) then write('Taylor');
  if (n=13) then write('Fillmore');
  if (n=14) then write('Pierce');
  if (n=15) then write('Buchanan');
  if (n=16) then write('Lincoln');
  if (n=17) then write('Johnson');
  if (n=18) then write('Grant');
  if (n=19) then write('Hayes');
  if (n=20) then write('Garfield');
  if (n=21) then write('Arthur');
  if (n=22) then write('Cleveland');
  if (n=23) then write('Harrison');
  if (n=24) then write('Cleveland');
  if (n=25) then write('McKinley');
  if (n=26) then write('Roosevelt');
  if (n=27) then write('Taft');
  if (n=28) then write('Wilson');
  if (n=29) then write('Harding');
  if (n=30) then write('Coolidge');
  if (n=31) then write('Hoover');
  if (n=32) then write('Roosevelt');
  if (n=33) then write('Truman');
  if (n=34) then write('Eisenhower');
  if (n=35) then write('Kennedy');
  if (n=36) then write('Johnson');
  if (n=37) then write('Nixon');
  if (n=38) then write('Ford');
  if (n=39) then write('Carter');
  if (n=40) then write('Reagan');
end.

program AA;

{$APPTYPE CONSOLE}

uses
  SysUtils;
var a:integer;
begin
readln(a);
case a of
1:writeln('Washington')  ;
2:writeln('Adams')  ;
3:writeln('Jefferson')  ;
4:writeln('Madison')  ;
5:writeln('Monroe')  ;
6:writeln('Adams')  ;
7:writeln('Jackson')  ;
8:writeln('Van Buren')  ;
9:writeln('Harrison')  ;
10:writeln('Tyler')  ;
11:writeln('Polk')  ;
12:writeln('Taylor')  ;
13:writeln('Fillmore')  ;
14:writeln('Pierce')  ;
15:writeln('Buchanan')  ;
16:writeln('Lincoln')  ;
17:writeln('Johnson')  ;
18:writeln('Grant')  ;
19:writeln('Hayes')  ;
20:writeln('Garfield')  ;
21:writeln('Arthur')  ;
22:writeln('Cleveland')  ;
23:writeln('Harrison')  ;
24:writeln('Cleveland')  ;
25:writeln('McKinley')  ;
26:writeln('Roosevelt')  ;
27:writeln('Taft')  ;
28:writeln('Wilson')  ;
29:writeln('Harding')  ;
30:writeln('Coolidge')  ;
31:writeln('Hoover')  ;
32:writeln('Roosevelt')  ;
33:writeln('Truman')  ;
34:writeln('Eisenhower')  ;
35:writeln('Kennedy')  ;
36:writeln('Johnson')  ;
37:writeln('Nixon')  ;
38:writeln('Ford')  ;
39:writeln('Carter')  ;
40:writeln('Reagan')  ;

end;

end.

{$APPTYPE CONSOLE}
uses
  SysUtils;
var
  mv:array[1..40] of string;
  n:integer;
begin
  mv[1]:='Washington';
  mv[2]:='Adams';
  mv[3]:='Jefferson';
  mv[4]:='Madison';
  mv[5]:='Monroe';
  mv[6]:='Adams';
  mv[7]:='Jackson';
  mv[8]:='Van Buren';
  mv[9]:='Harrison';
  mv[10]:='Tyler';
  mv[11]:='Polk';
  mv[12]:='Taylor';
  mv[13]:='Fillmore';
  mv[14]:='Pierce';
  mv[15]:='Buchanan';
  mv[16]:='Lincoln';
  mv[17]:='Johnson';
  mv[18]:='Grant';
  mv[19]:='Hayes';
  mv[20]:='Garfield';
  mv[21]:='Arthur';
  mv[22]:='Cleveland';
  mv[23]:='Harrison';
  mv[24]:='Cleveland';
  mv[25]:='McKinley';
  mv[26]:='Roosevelt';
  mv[27]:='Taft';
  mv[28]:='Wilson';
  mv[29]:='Harding';
  mv[30]:='Coolidge';
  mv[31]:='Hoover';
  mv[32]:='Roosevelt';
  mv[33]:='Truman';
  mv[34]:='Eisenhower';
  mv[35]:='Kennedy';
  mv[36]:='Johnson';
  mv[37]:='Nixon';
  mv[38]:='Ford';
  mv[39]:='Carter';
  mv[40]:='Reagan';
  Readln(n);
  Writeln(mv[n]);
end.

const a:array[1..40] of string=('Washington', 'Adams', 'Jefferson', 'Madison', 'Monroe', 'Adams', 'Jackson', 'Van Buren', 'Harrison', 'Tyler', 'Polk', 'Taylor', 'Fillmore', 'Pierce', 'Buchanan', 'Lincoln', 'Johnson', 'Grant', 'Hayes', 'Garfield', 'Arthur', 'Cleveland', 'Harrison', 'Cleveland', 'McKinley', 'Roosevelt', 'Taft', 'Wilson', 'Harding', 'Coolidge', 'Hoover', 'Roosevelt', 'Truman', 'Eisenhower', 'Kennedy', 'Johnson', 'Nixon', 'Ford', 'Carter', 'Reagan');
var n:longint;
begin
 readln(n);
 writeln(a[n]);
end.

var
  a:array[1..40] of string=('Washington', 'Adams', 'Jefferson','Madison','Monroe','Adams', 'Jackson',
   'Van Buren','Harrison', 'Tyler', 'Polk','Taylor','Fillmore','Pierce','Buchanan','Lincoln','Johnson','Grant','Hayes','Garfield','Arthur', 'Cleveland',
   'Harrison','Cleveland','McKinley','Roosevelt','Taft','Wilson','Harding','Coolidge','Hoover','Roosevelt','Truman','Eisenhower','Kennedy','Johnson','Nixon','Ford','Carter','Reagan');
   n:longint;
begin
  readln(n);
  writeln(a[n]);
end.

program shablon;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
  n:integer;
begin
  read(n);
  case n of
    1:write('Washington');
    2:write('Adams');
    3:write('Jefferson');
    4:write('Madison');
    5:write('Monroe');
    6:write('Adams');
    7 :write('Jackson');
    8:write('Van Buren');
    9:write('Harrison');
    10:write('Tyler');
    11:write('Polk');
    12:write('Taylor');
    13:write('Fillmore');
    14:write('Pierce');
    15:write('Buchanan');
    16:write('Lincoln');
    17 :write('Johnson');
    18 :write('Grant');
    19:write('Hayes');
    20:write('Garfield');
    21:write('Arthur');
    22:write('Cleveland');
    23:write('Harrison');
    24:write('Cleveland');
    25:write('McKinley');
    26:write('Roosevelt');
    27:write('Taft');
    28:write('Wilson');
    29 :write('Harding');
    30:write('Coolidge');
    31:write('Hoover');
    32:write('Roosevelt');
    33:write('Truman');
    34:write('Eisenhower');
    35:write('Kennedy');
    36:write('Johnson');
    37:write('Nixon');
    38:write('Ford');
    39:write('Carter');
    40:write('Reagan');
  end;
readln;readln;
end.

const a:array[1..40]of string=('Washington','Adams','Jefferson','Madison','Monroe','Adams','Jackson','Van Buren','Harrison','Tyler','Polk','Taylor','Fillmore','Pierce','Buchanan','Lincoln','Johnson','Grant','Hayes','Garfield','Arthur','Cleveland','Harrison','Cleveland','McKinley','Roosevelt','Taft','Wilson','Harding','Coolidge','Hoover','Roosevelt','Truman','Eisenhower','Kennedy','Johnson','Nixon','Ford','Carter','Reagan');
var x:word;
begin
  read(x);
  write(a[x])
end.

var
 a:byte;
begin
 read(a);
 case a of
 1:write('Washington');
 2:write('Adams');
 3:write('Jefferson');
 4:write('Madison');
 5:write('Monroe');
 6:write('Adams');
 7:write('Jackson');
 8:write('Van Buren');
 9:write('Harrison');
  10:write('Tyler');
 11:write('Polk');
 12:write('Taylor');
 13:write('Fillmore');
 14:write('Pierce');
 15:write('Buchanan');
 16:write('Lincoln');
 17:write('Johnson');
 18:write('Grant');
 19:write('Hayes');
 20:write('Garfield');
 21:write('Arthur');
 22:write('Cleveland');
 23:write('Harrison');
 24:write('Cleveland');
 25:write('McKinley');
 26:write('Roosevelt');
 27:write('Taft');
 28:write('Wilson');
 29:write('Harding');
 30:write('Coolidge');
 31:write('Hoover');
 32:write('Roosevelt');
 33:write('Truman');
 34:write('Eisenhower');
 35:write('Kennedy');
 36:write('Johnson');
 37:write('Nixon');
 38:write('Ford');
 39:write('Carter');
 40:write('Reagan');
 end;
End.

var
  toread:text;
  i:shortint;
  families:array[1..40] of string[20];
begin
families[1]:='Washington';
families[2]:='Adams';
families[3]:='Jefferson';
families[4]:='Madison';
families[5]:='Monroe';
families[6]:='Adams';
families[7]:='Jackson';
families[8]:='Van Buren';
families[9]:='Harrison';
families[10]:='Tyler';
families[11]:='Polk';
families[12]:='Taylor';
families[13]:='Fillmore';
families[14]:='Pierce';
families[15]:='Buchanan';
families[16]:='Lincoln';
families[17]:='Johnson';
families[18]:='Grant';
families[19]:='Hayes';
families[20]:='Garfield';
families[21]:='Arthur';
families[22]:='Cleveland';
families[23]:='Harrison';
families[24]:='Cleveland';
families[25]:='McKinley';
families[26]:='Roosevelt';
families[27]:='Taft';
families[28]:='Wilson';
families[29]:='Harding';
families[30]:='Coolidge';
families[31]:='Hoover';
families[32]:='Roosevelt';
families[33]:='Truman';
families[34]:='Eisenhower';
families[35]:='Kennedy';
families[36]:='Johnson';
families[37]:='Nixon';
families[38]:='Ford';
families[39]:='Carter';
families[40]:='Reagan';
readln(i);
writeln(families[i]);
end.

var n:integer;
begin
readln(n);
case n of
  1: writeln('Washington');
  2: writeln('Adams');
  3: writeln('Jefferson');
  4: writeln('Madison');
  5: writeln('Monroe');
  6: writeln('Adams');
  7: writeln('Jackson');
  8: writeln('Van Buren');
  9: writeln('Harrison');
  10: writeln('Tyler');
  11: writeln('Polk');
  12: writeln('Taylor');
  13: writeln('Fillmore');
  14: writeln('Pierce');
  15: writeln('Buchanan');
  16: writeln('Lincoln');
  17: writeln('Johnson');
  18: writeln('Grant');
  19: writeln('Hayes');
  20: writeln('Garfield');
  21: writeln('Arthur');
  22: writeln('Cleveland');
  23: writeln('Harrison');
  24: writeln('Cleveland');
  25: writeln('McKinley');
  26: writeln('Roosevelt');
  27: writeln('Taft');
  28: writeln('Wilson');
  29: writeln('Harding');
  30: writeln('Coolidge');
  31: writeln('Hoover');
  32: writeln('Roosevelt');
  33: writeln('Truman');
  34: writeln('Eisenhower');
  35: writeln('Kennedy');
  36: writeln('Johnson');
  37: writeln('Nixon');
  38: writeln('Ford');
  39: writeln('Carter');
  40: writeln('Reagan');
end;
end.

var  arr:array[1..40]of string =('Washington','Adams','Jefferson','Madison','Monroe','Adams','Jackson','Van Buren','Harrison','Tyler','Polk','Taylor','Fillmore','Pierce','Buchanan','Lincoln','Johnson'
,'Grant','Hayes','Garfield','Arthur','Cleveland','Harrison','Cleveland','McKinley','Roosevelt','Taft','Wilson','Harding','Coolidge','Hoover','Roosevelt','Truman','Eisenhower','Kennedy','Johnson','Nixon','Ford','Carter','Reagan');
    t:integer;
begin
    readln(t);
    writeln(arr[t]);
end.

var
	name:array[1..40] of string;
	n:byte;
begin
	name[1]:='Washington';
	name[2]:='Adams';
	name[3]:='Jefferson';
	name[4]:='Madison';
	name[5]:='Monroe';
	name[6]:='Adams';
	name[7]:='Jackson';
	name[8]:='Van Buren';
	name[9]:='Harrison';
	name[10]:='Tyler';
	name[11]:='Polk';
	name[12]:='Taylor';
	name[13]:='Fillmore';
	name[14]:='Pierce';
	name[15]:='Buchanan';
	name[16]:='Lincoln';
	name[17]:='Johnson';
	name[18]:='Grant';
	name[19]:='Hayes';
	name[20]:='Garfield';
	name[21]:='Arthur';
	name[22]:='Cleveland';
	name[23]:='Harrison';
	name[24]:='Cleveland';
	name[25]:='McKinley';
	name[26]:='Roosevelt';
	name[27]:='Taft';
	name[28]:='Wilson';
	name[29]:='Harding';
	name[30]:='Coolidge';
	name[31]:='Hoover';
	name[32]:='Roosevelt';
	name[33]:='Truman';
	name[34]:='Eisenhower';
	name[35]:='Kennedy';
	name[36]:='Johnson';
	name[37]:='Nixon';
	name[38]:='Ford';
	name[39]:='Carter';
	name[40]:='Reagan';

	readln(n);
	writeln(name[n]);
end.

var
  ans : array [0..40] of ansistring;
  n : longint;
begin
  ans[1]:='Washington';
  ans[2]:='Adams';
  ans[3]:='Jefferson';
  ans[4]:='Madison';
  ans[5]:='Monroe';
  ans[6]:='Adams';
  ans[7]:='Jackson';
  ans[8]:='Van Buren';
  ans[9]:='Harrison';
  ans[10]:='Tyler';
  ans[11]:='Polk';
  ans[12]:='Taylor';
  ans[13]:='Fillmore';
  ans[14]:='Pierce';
  ans[15]:='Buchanan';
  ans[16]:='Lincoln';
  ans[17]:='Johnson';
  ans[18]:='Grant';
  ans[19]:='Hayes';
  ans[20]:='Garfield';
  ans[21]:='Arthur';
  ans[22]:='Cleveland';
  ans[23]:='Harrison';
  ans[24]:='Cleveland';
  ans[25]:='McKinley';
  ans[26]:='Roosevelt';
  ans[27]:='Taft';
  ans[28]:='Wilson';
  ans[29]:='Harding';
  ans[30]:='Coolidge';
  ans[31]:='Hoover';
  ans[32]:='Roosevelt';
  ans[33]:='Truman';
  ans[34]:='Eisenhower';
  ans[35]:='Kennedy';
  ans[36]:='Johnson';
  ans[37]:='Nixon';
  ans[38]:='Ford';
  ans[39]:='Carter';
  ans[40]:='Reagan';
  readln(n);
  writeln(ans[n]);
end.

program Project1;

{$APPTYPE CONSOLE}

{$R *.res}

uses
  SysUtils;

var
  n : byte;
begin
  Readln(n);
  case n of
    1: writeln('Washington');
    2: writeln('Adams');
    3: writeln('Jefferson');
    4: writeln('Madison');
    5: writeln('Monroe');
    6: writeln('Adams');
    7: writeln('Jackson');
    8: writeln('Van Buren');
    9: writeln('Harrison');
    10: writeln('Tyler');
    11: writeln('Polk');
    12: writeln('Taylor');
    13: writeln('Fillmore');
    14: writeln('Pierce');
    15: writeln('Buchanan');
    16: writeln('Lincoln');
    17: writeln('Johnson');
    18: writeln('Grant');
    19: writeln('Hayes');
    20: writeln('Garfield');
    21: writeln('Arthur');
    22: writeln('Cleveland');
    23: writeln('Harrison');
    24: writeln('Cleveland');
    25: writeln('McKinley');
    26: writeln('Roosevelt');
    27: writeln('Taft');
    28: writeln('Wilson');
    29: writeln('Harding');
    30: writeln('Coolidge');
    31: writeln('Hoover');
    32: writeln('Roosevelt');
    33: writeln('Truman');
    34: writeln('Eisenhower');
    35: writeln('Kennedy');
    36: writeln('Johnson');
    37: writeln('Nixon');
    38: writeln('Ford');
    39: writeln('Carter');
    40: writeln('Reagan');
  end;
end.

program Project2;

{$APPTYPE CONSOLE}

uses
  SysUtils;

const
  a : array[1..40] of string = ('Washington', 'Adams', 'Jefferson', 'Madison', 'Monroe', 'Adams', 'Jackson', 'Van Buren', 'Harrison', 'Tyler', 'Polk', 'Taylor', 'Fillmore', 'Pierce', 'Buchanan', 'Lincoln', 'Johnson', 'Grant', 'Hayes', 'Garfield', 'Arthur', 'Cleveland', 'Harrison', 'Cleveland', 'McKinley', 'Roosevelt', 'Taft', 'Wilson', 'Harding', 'Coolidge', 'Hoover', 'Roosevelt', 'Truman', 'Eisenhower', 'Kennedy', 'Johnson', 'Nixon', 'Ford', 'Carter', 'Reagan');

var
  v : integer;

begin
    {$IFNDEF ONLINE_JUDGE}
      reset(input, 'input.txt');
      rewrite(output, 'output.txt');
    {$ENDIF}
    read(v);
    write(a[v]);
end.

var
  a:array[1..40] of string=('Washington','Adams','Jefferson','Madison','Monroe','Adams','Jackson','Van Buren','Harrison','Tyler','Polk','Taylor','Fillmore','Pierce','Buchanan','Lincoln','Johnson','Grant','Hayes','Garfield','Arthur','Cleveland','Harrison','Cleveland','McKinley','Roosevelt','Taft','Wilson','Harding','Coolidge','Hoover','Roosevelt','Truman','Eisenhower','Kennedy','Johnson','Nixon','Ford','Carter','Reagan');
  n,ans,i:longint;
begin
  readln(n);
  ans:=length(a[n]);
  for i:= 1 to ans do write(a[n][i]);
end.//1

var a:integer;
begin
read(a);
if a=1 then writeln('Washington');
if a=2 then writeln('Adams');
if a=3 then writeln('Jefferson');
if a=4 then writeln('Madison');
if a=5 then writeln('Monroe');
if a=15 then writeln('Buchanan');
if a=16 then writeln('Lincoln');
if a=17 then writeln('Johnson');
if a=6 then writeln('Adams');
if a=18 then writeln('Grant');
if a=7 then writeln('Jackson');
if a=19 then writeln('Hayes');
if a=8 then writeln('Van Buren');
if a=20 then writeln('Garfield');
if a=9 then writeln('Harrison');
if a=21 then writeln('Arthur');
if a=10 then writeln('Tyler');
if a=22 then writeln('Cleveland');
if a=11 then writeln('Polk');
if a=23 then writeln('Harrison');
if a=12 then writeln('Taylor');
if a=24 then writeln('Cleveland');
if a=13 then writeln('Fillmore');
if a=25 then writeln('McKinley');
if a=14 then writeln('Pierce');
if a=26 then writeln('Roosevelt');
if a=35 then writeln('Kennedy');
if a=27 then writeln('Taft');
if a=36 then writeln('Johnson');
if a=28 then writeln('Wilson');
if a=37 then writeln('Nixon');
if a=29 then writeln('Harding');
if a=38 then writeln('Ford');
if a=30 then writeln('Coolidge');
if a=39 then writeln('Carter');
if a=31 then writeln('Hoover');
if a=40 then writeln('Reagan');
if a=32 then writeln('Roosevelt');
if a=41 then writeln('Bush');
if a=33 then writeln('Truman');
if a=42 then writeln('Clinton');
if a=34 then writeln('Eisenhower');
if a=43 then writeln('Bush');
if a=44 then writeln('Obama');
end.

Var a:longint;
  Begin
    Read(a);
    if a=1 then Write('Washington');
    if a=2 then Write('Adams');
    if a=3 then Write('Jefferson');
    if a=4 then Write('Madison');
    if a=5 then Write('Monroe')  ;
    if a=6 then Write('Adams') ;
    if a=7 then Write('Jackson')      ;
    if a=8 then Write('Van Buren')    ;
    if a=9 then Write('Harrison');
    if a=10 then Write('Tyler')       ;
    if a=11 then Write('Polk')      ;
    if a=12 then Write('Taylor')      ;
    if a=13 then Write('Fillmore')    ;
    if a=14 then Write('Pierce')       ;
    if a=15 then Write('Buchanan')      ;
    if a=16 then Write('Lincoln')        ;
    if a=17 then Write('Johnson')         ;
    if a=18 then Write('Grant')          ;
    if a=19 then Write('Hayes')           ;
    if a=20 then Write('Garfield')         ;
    if a=21 then Write('Arthur')            ;
    if a=22 then Write('Cleveland')            ;
    if a=23 then Write('Harrison')              ;
    if a=24 then Write('Cleveland')              ;
    if a=25 then Write('McKinley')                ;
    if a=26 then Write('Roosevelt')                ;
    if a=27 then Write('Taft')               ;
    if a=28 then Write('Wilson')                     ;
    if a=29 then Write('Harding')                   ;
    if a=30 then Write('Coolidge')                     ;
    if a=31 then Write('Hoover')                        ;
    if a=32 then Write('Roosevelt')                    ;
    if a=33 then Write('Truman')                        ;
    if a=34 then Write('Eisenhower')                     ;
    if a=35 then Write('Kennedy')                           ;
    if a=36 then Write('Johnson')                           ;
    if a=37 then Write('Nixon')                             ;
    if a=38 then Write('Ford')                              ;
    if a=39 then Write('Carter')                            ;
    if a=40 then Write('Reagan');
  End.

program a290;

{$mode objfpc}{$H+}
const a:array[1..40]of string=('Washington','Adams','Jefferson','Madison','Monroe','Adams','Jackson','Van Buren','Harrison','Tyler','Polk','Taylor','Fillmore','Pierce','Buchanan','Lincoln','Johnson','Grant','Hayes','Garfield','Arthur','Cleveland','Harrison','Cleveland','McKinley','Roosevelt','Taft','Wilson','Harding','Coolidge','Hoover','Roosevelt','Truman','Eisenhower','Kennedy','Johnson','Nixon','Ford','Carter','Reagan');
 var
    x, xx: longint;
begin
  readln(x);
  write(a[x]);
  readln(xx);
end.

const mas:Array[1..40] of string = (
'Washington',
'Adams',
'Jefferson',
'Madison',
'Monroe',
'Adams',
'Jackson',
'Van Buren',
'Harrison',
'Tyler',
'Polk',
'Taylor',
'Fillmore',
'Pierce',
'Buchanan',
'Lincoln',
'Johnson',
'Grant',
'Hayes',
'Garfield',
'Arthur',
'Cleveland',
'Harrison',
'Cleveland',
'McKinley',
'Roosevelt',
'Taft',
'Wilson',
'Harding',
'Coolidge',
'Hoover',
'Roosevelt',
'Truman',
'Eisenhower',
'Kennedy',
'Johnson',
'Nixon',
'Ford',
'Carter',
'Reagan');

var n:longint;
begin
 readln(n);
 writeln(mas[n]);
end.

const maxn=100000;
var
n:byte;
BEGIN
readln(n);
if n=1 then write('Washington');
if n=2 then write('Adams');
if n=3 then write('Jefferson');
if n=4 then write('Madison');
if n=5 then write('Monroe');
if n=6 then write('Adams');
if n=7 then write('Jackson');
if n=8 then write('Van Buren');
if n=9 then write('Harrison');
if n=10 then write('Tyler');
if n=11 then write('Polk');
if n=12 then write('Taylor');
if n=13 then write('Fillmore');
if n=14 then write('Pierce');
if n=15 then write('Buchanan');
if n=16 then write('Lincoln');
if n=17 then write('Johnson');
if n=18 then write('Grant');
if n=19 then write('Hayes');
if n=20 then write('Garfield');
if n=21 then write('Arthur');
if n=22 then write('Cleveland');
if n=23 then write('Harrison');
if n=24 then write('Cleveland');
if n=25 then write('McKinley');
if n=26 then write('Roosevelt');
if n=27 then write('Taft');
if n=28 then write('Wilson');
if n=29 then write('Harding');
if n=30 then write('Coolidge');
if n=31 then write('Hoover');
if n=32 then write('Roosevelt');
if n=33 then write('Truman');
if n=34 then write('Eisenhower');
if n=35 then write('Kennedy');
if n=36 then write('Johnson');
if n=37 then write('Nixon');
if n=38 then write('Ford');
if n=39 then write('Carter');
if n=40 then write('Reagan');
END.

var
  a:array[1..40] of string=('Washington','Adams','Jefferson','Madison','Monroe','Adams','Jackson','Van Buren','Harrison','Tyler','Polk','Taylor','Fillmore','Pierce','Buchanan','Lincoln','Johnson','Grant','Hayes','Garfield','Arthur','Cleveland','Harrison','Cleveland','McKinley','Roosevelt','Taft','Wilson','Harding','Coolidge','Hoover','Roosevelt','Truman','Eisenhower','Kennedy','Johnson','Nixon','Ford','Carter','Reagan');
  n,ans,i:longint;
begin
  readln(n);
  ans:=length(a[n]);
  for i:= 1 to ans do write(a[n][i]);
end.

var
  a:array[1..40] of string=('Washington','Adams','Jefferson','Madison','Monroe','Adams','Jackson','Van Buren','Harrison','Tyler','Polk','Taylor','Fillmore','Pierce','Buchanan','Lincoln','Johnson','Grant','Hayes','Garfield','Arthur','Cleveland','Harrison','Cleveland','McKinley','Roosevelt','Taft','Wilson','Harding','Coolidge','Hoover','Roosevelt','Truman','Eisenhower','Kennedy','Johnson','Nixon','Ford','Carter','Reagan');
  n,ans,i:longint;
begin
  readln(n);
  ans:=length(a[n]);//题面改了，之前是要n-1
  for i:= 1 to ans do write(a[n][i]);
end.

var s:array[1..40] of string=('Washington', 'Adams', 'Jefferson', 'Madison', 'Monroe', 'Adams', 'Jackson', 'Van Buren', 'Harrison', 'Tyler', 'Polk', 'Taylor', 'Fillmore', 'Pierce', 'Buchanan', 'Lincoln', 'Johnson', 'Grant', 'Hayes', 'Garfield', 'Arthur', 'Cleveland', 'Harrison', 'Cleveland', 'McKinley', 'Roosevelt', 'Taft', 'Wilson', 'Harding', 'Coolidge', 'Hoover', 'Roosevelt', 'Truman', 'Eisenhower', 'Kennedy', 'Johnson', 'Nixon', 'Ford', 'Carter', 'Reagan');
    i:longint;
begin
  readln(i);
  writeln(s[i]);
end.

{$MODE OBJFPC}
Program onlylove;
const a:array[1..44]of string = ('Washington','Adams','Jefferson','Madison','Monroe','Adams','Jackson','Van Buren','Harrison','Tyler','Polk','Taylor','Fillmore','Pierce','Buchanan','Lincoln','Johnson'
,'Grant','Hayes','Garfield','Arthur','Cleveland','Harrison','Cleveland','McKinley','Roosevelt','Taft','Wilson','Harding','Coolidge','Hoover','Roosevelt','Truman','Eisenhower','Kennedy','Johnson','Nixon','Ford','Carter','Reagan','Bush','Clinton','Bush'
,'Obama');
var i : longint;
begin
    Readln(i);
    Writeln(a[i]);
end.

Var n:longint;
begin
readln(n);
case n of
1:writeln('Washington');
2:writeln('Adams');
3:writeln('Jefferson');
4:writeln('Madison');
5:writeln('Monroe');
6:writeln('Adams');
7:writeln('Jackson');
8:writeln('Van Buren');
9:writeln('Harrison');
10:writeln('Tyler');
11:writeln('Polk');
12:writeln('Taylor');
13:writeln('Fillmore');
14:writeln('Pierce');
15:writeln('Buchanan');
16:writeln('Lincoln');
17:writeln('Johnson');
18:writeln('Grant');
19:writeln('Hayes');
20:writeln('Garfield');
21:writeln('Arthur');
22:writeln('Cleveland');
23:writeln('Harrison');
24:writeln('Cleveland');
25:writeln('McKinley');
26:writeln('Roosevelt');
27:writeln('Taft');
28:writeln('Wilson');
29:writeln('Harding');
30:writeln('Coolidge');
31:writeln('Hoover');
32:writeln('Roosevelt');
33:writeln('Truman');
34:writeln('Eisenhower');
35:writeln('Kennedy');
36:writeln('Johnson');
37:writeln('Nixon');
38:writeln('Ford');
39:writeln('Carter');
40:writeln('Reagan');
end;
end.

Var st:array [1..40] of string;
    n:longint;
Begin
    st[1]:='Washington';
    st[2]:='Adams';
    st[3]:='Jefferson';
    st[4]:='Madison';
    st[5]:='Monroe';
    st[6]:='Adams';
    st[7]:='Jackson';
    st[8]:='Van Buren';
    st[9]:='Harrison';
    st[10]:='Tyler';
    st[11]:='Polk';
    st[12]:='Taylor';
    st[13]:='Fillmore';
    st[14]:='Pierce';
    st[15]:='Buchanan';
    st[16]:='Lincoln';
    st[17]:='Johnson';
    st[18]:='Grant';
    st[19]:='Hayes';
    st[20]:='Garfield';
    st[21]:='Arthur';
    st[22]:='Cleveland';
    st[23]:='Harrison';
    st[24]:=st[22];
    st[25]:='McKinley';
    st[26]:='Roosevelt';
    st[27]:='Taft';
    st[28]:='Wilson';
    st[29]:='Harding';
    st[30]:='Coolidge';
    st[31]:='Hoover';
    st[32]:='Roosevelt';
    st[33]:='Truman';
    st[34]:='Eisenhower';
    st[35]:='Kennedy';
    st[36]:='Johnson';
    st[37]:='Nixon';
    st[38]:='Ford';
    st[39]:='Carter';
    st[40]:='Reagan';
    readln(n); write(st[n]);
End.

var
 a:longint;
begin
read(a);
 case a of
  1:writeln('Washington');
  2:writeln('Adams');
  3:writeln('Jefferson');
  4:writeln('Madison');
  5:writeln('Monroe');
  6:writeln('Adams');
  7:writeln('Jackson');
  8:writeln('Van Buren');
  9:writeln('Harrison');
  10:writeln('Tyler');
  11:writeln('Polk');
  12:writeln('Taylor');
  13:writeln('Fillmore');
  14:writeln('Pierce');
  15:writeln('Buchanan');
  16:writeln('Lincoln');
  17:writeln('Johnson');
  18:writeln('Grant');
  19:writeln('Hayes');
  20:writeln('Garfield');
  21:writeln('Arthur');
  22:writeln('Cleveland');
  23:writeln('Harrison');
  24:writeln('Cleveland');
  25:writeln('McKinley');
  26:writeln('Roosevelt');
  27:writeln('Taft');
  28:writeln('Wilson');
  29:writeln('Harding');
  30:writeln('Coolidge');
  31:writeln('Hoover');
  32:writeln('Roosevelt');
  33:writeln('Truman');
  34:writeln('Eisenhower');
  35:writeln('Kennedy');
  36:writeln('Johnson');
  37:writeln('Nixon');
  38:writeln('Ford');
  39:writeln('Carter');
  40:writeln('Reagan');
 end;
 end.

const ans:array[1..40]of string=('Washington','Adams','Jefferson','Madison',
'Monroe','Adams','Jackson','Van Buren','Harrison','Tyler','Polk','Taylor',
'Fillmore','Pierce','Buchanan','Lincoln','Johnson','Grant','Hayes','Garfield',
'Arthur','Cleveland','Harrison','Cleveland','McKinley','Roosevelt','Taft',
'Wilson','Harding','Coolidge','Hoover','Roosevelt','Truman','Eisenhower',
'Kennedy','Johnson','Nixon','Ford','Carter','Reagan');
var n:longint;
begin
  read(n);
  writeln(ans[n]);
end.

program Project1;

{$APPTYPE CONSOLE}
{$DEFINE SUBMIT}

uses
  SysUtils;

var
  N: integer;
  const a: array [1..40] of string = ('Washington', 'Adams', 'Jefferson', 'Madison', 'Monroe', 'Quincy Adams', 'Jackson', 'Van Buren', 'H. Harrison', 'Tyler', 'K. Polk', 'Taylor', 'Fillmore', 'Pierce', 'Buchanan', 'Lincoln', 'Johnson', 'S. Grant', 'B. Hayes', 'A. Garfield', 'A. Arthur', 'Cleveland', 'Harrison', 'Cleveland', 'McKinley', 'Roosevelt', 'Howard Taft', 'Wilson', 'G. Harding', 'Coolidge', 'Hoover', 'D. Roosevelt', 'S. Truman', 'D. Eisenhower', 'F. Kennedy', 'B. Johnson', 'Nixon', 'Ford', 'Carter', 'Reagan');

begin
{$IFNDEF SUBMIT}
  Assign(input, 'input.txt');
  Assign(output, 'output.txt');
{$ENDIF}
  ReadLn(N);
  WriteLn(a[n]);
end.

const
  a:array[1..40]of string=(
  'Washington','Adams','Jefferson','Madison','Monroe','Adams','Jackson','Van Buren','Harrison','Tyler','Polk','Taylor','Fillmore','Pierce','Buchanan','Lincoln','Johnson','Grant','Hayes','Garfield','Arthur','Cleveland','Harrison','Cleveland','McKinley','Roosevelt','Howard Taft','Wilson','Harding','Coolidge','Hoover','Roosevelt','Truman','Truman','Kennedy','Johnson','Nixon','Ford','Earl Carter','Reagan');
var
  x:longint;
begin
  read(x);
  writeln(a[x]);
end.

var
n:integer;
begin
read(n);
case n of
1:writeln('Washington');
2:writeln('Adams');
3:writeln('Jefferson');
4:writeln('Madison');
5:writeln('Monroe');
6:writeln('Quincy Adams');
7:writeln('Jackson');
8:writeln('Van Buren');
9:writeln('Henry Harrison');
10:writeln('Tyler');
11:writeln('Polk');
12:writeln('Taylor');
13:writeln('Fillmore');
14:writeln('Pierce');
15:writeln('Buchanan');
16:writeln('Lincoln');
17:writeln('Johnson');
18:writeln('Grant');
19:writeln('Hayes');
20:writeln('Garfield');
21:writeln('Arthur');
22:writeln('Cleveland');
23:writeln('Harrison');
24:writeln('Cleveland');
25:writeln('McKinley');
26:writeln('Roosevelt');
27:writeln('Howard Taft');
28:writeln('Wilson');
29:writeln('Harding');
30:writeln('Coolidge');
31:writeln('Hoover');
32:writeln('Roosevelt');
33:writeln('Truman');
34:writeln('Eisenhower');
35:writeln('Kennedy');
36:writeln('Johnson');
37:writeln('Nixon');
38:writeln('Ford');
39:writeln('Carter');
40:writeln('Reagan');
41:writeln('Bush');
42:writeln('Clinton');
43:writeln('Bush');
44:writeln('Obama');
end;
end.

var
  a:longint;
begin
  readln(a);
  if a = 1 then writeln('Washington') else
  if a = 2 then writeln('Adams') else
  if a = 3 then writeln('Jefferson') else
  if a = 4 then writeln('Madison') else
  if a = 5 then writeln('Monroe') else
  if a = 6 then writeln('Adams') else
  if a = 7 then writeln('Jackson') else
  if a = 8 then writeln('Van Buren') else
  if a = 9 then writeln('Harrison') else
  if a = 10 then writeln('Tyler') else
  if a = 11 then writeln('Polk') else
  if a = 12 then writeln('Taylor') else
  if a = 13 then writeln('Fillmore') else
  if a = 14 then writeln('Pierce') else
  if a = 15 then writeln('Buchanan') else
  if a = 16 then writeln('Lincoln') else
  if a = 17 then writeln('Johnson') else
  if a = 18 then writeln('Grant') else
  if a = 19 then writeln('Hayes') else
  if a = 20 then writeln('Garfield') else
  if a = 21 then writeln('Arthur') else
  if a = 22 then writeln('Cleveland') else
  if a = 23 then writeln('Harrison') else
  if a = 24 then writeln('Cleveland') else
  if a = 25 then writeln('McKinley') else
  if a = 26 then writeln('Roosevelt') else
  if a = 27 then writeln('Taft') else
  if a = 28 then writeln('Wilson') else
  if a = 29 then writeln('Harding') else
  if a = 30 then writeln('Coolidge') else
  if a = 31 then writeln('Hoover') else
  if a = 32 then writeln('Roosevelet') else
  if a = 33 then writeln('Truman') else
  if a = 34 then writeln('Eisenhower') else
  if a = 35 then writeln('Kennedy') else
  if a = 36 then writeln('Johnson') else
  if a = 37 then writeln('Nixon') else
  if a = 38 then writeln('Ford') else
  if a = 39 then writeln('Carter') else
  if a = 40 then writeln('Reagan');
end.

program progaA;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
  a: array[1..40] of string;
  x: integer;

begin
//  reset(input, 'input.txt');
//  rewrite(output, 'output.txt');
  a[16] := 'Abraham Lincoln';
  a[36] := 'Lyndon B. Johnson';
  a[1] := 'George Washington';
  a[3] := 'Thomas Jefferson';
  a[32] := 'Franklin D. Roosevelt';
  a[7] := 'Andrew Jackson';
  a[40] := 'Ronald Reagan';
  a[5] := 'James Monroe';
  a[10] := 'John Tyler';
  a[15] := 'James Buchanan';
  a[20] := 'James A. Garfield';
  a[21] := 'Chester A. Arthur';
  a[29] := 'Warren G. Harding';
  a[35] := 'John F. Kennedy';
  a[38] := 'Gerald Ford';
  a[27] := 'William Howard Taft';
  a[31] := 'Herbert Hoover';
  a[37] := 'Richard Nixon';
  a[22] := 'Grover Cleveland';
  a[24] := 'Grover Cleveland';
  a[28] := 'Woodrow Wilson';
  a[34] := 'Dwight D. Eisenhower';
  a[14] := 'Franklin Pierce';
  a[17] := 'Andrew Johnson';
  a[26] := 'Theodore Roosevelt';
  a[30] := 'Calvin Coolidge';
  a[39] := 'Jimmy Carter';
  a[13] := 'Millard Fillmore';
  a[33] := 'Harry S Truman';
  a[19] := 'Rutherford B. Hayes';
  a[9] := 'William Henry Harrison';
  a[11] := 'James K. Polk';
  a[12] := 'Zachary Taylor';
  a[18] := 'Ulysses S. Grant';
  a[6] := 'John Quincy Adams';
  a[2] := 'John Adams';
  a[25] := 'William McKinley';
  a[23] := 'Benjamin Harrison';
  a[8] := 'Martin Van Buren';
  a[4] := 'James Madison';
  readln(x);
  writeln(a[x]);
end.

var n:integer;
const a:array [1..40] of string =('Washington', 'Adams', 'Jefferson', 'Madison', 'Monroe', 'Adams', 'Jackson', 'Van Buren', 'Harrison', 'Tyler', 'Polk', 'Taylor', 'Fillmore', 'Pierce', 'Buchanan', 'Lincoln', 'Johnson', 'Grant', 'Hayes', 'Garfield', 'Arthur', 'Cleveland', 'Harrison', 'Cleveland', 'McKinley', 'Roosevelt', 'Taft', 'Wilson', 'Harding', 'Coolidge', 'Hoover', 'Roosevelt', 'Truman', 'Eisenhower', 'Kennedy', 'Johnson', 'Nixon', 'Ford', 'Carter', 'Regan');
begin
readln(n);
writeln(a[n]);
end.

var
 a:longint;
begin
 readln(a);
 if (a=2) or (a=6) then writeln('Adams');
 if a=8 then writeln('Van Buren');
 if a=29 then writeln('Harding');
 if a=1 then writeln('Washington');
 if a=3 then writeln('Jefferson');
 if a=4 then writeln('Madison');
 if a=5 then writeln('Monroe');
 if a=7 then writeln('Jackson');
 if (a=9) or (a=23) then writeln('Harrison');
 if a=10 then writeln('Tyler');
 if a=11 then writeln('Polk');
 if a=12 then writeln('Taylor');
 if a=13 then writeln('Fillmore');
 if a=14 then writeln('Pierce');
 if a=15 then writeln('Buchanan');
 if a=16 then writeln('Lincoln');
 if (a=17) or (a=36) then writeln('Johnson');
 if a=18 then writeln('Grant');
 if a=19 then writeln('Hayes');
 if a=20 then writeln('Garfield');
 if a=21 then writeln('Arthur');
 if (a=22) or (a=24) then writeln('Cleveland');
 if a=25 then writeln('McKinley');
 if (a=26) or (a=32) then writeln('Roosevelt');
 if a=27 then writeln('Taft');
 if a=28 then writeln('Wilson');
 if a=30 then writeln('Coolidge');
 if a=31 then writeln('Hoover');
 if a=33 then writeln('Truman');
 if a=34 then writeln('Eisenhower');
 if a=35 then writeln('Kennedy');
 if a=37 then writeln('Nixon');
end.

var
 a:longint;
begin
 readln(a);
 if a=2 then writeln('Adams');
 if a=8 then writeln('Van Buren');
 if a=29 then writeln('Harding');
 if a=1 then writeln('Washington');
end.

var s: ansistring;
n: longint;
begin
  readln(n);

  if n=1 then writeln('Washington')
  else if n=2 then writeln('Adams')
  else if n=3 then writeln('Jefferson')
  else if n=4 then writeln('Madison')
  else if n=5 then writeln('Monroe')
  else if n=6 then writeln('Quincy Adams')
  else if n=7 then writeln('Jackson')
  else if n=8 then writeln('Van Buren')
  else if n=9 then writeln('Harrison')
  else if n=10 then writeln('Tyler')
  else if n=11 then writeln('Polk')
  else if n=12 then writeln('Taylor')
  else if n=13 then writeln('Fillmore')
  else if n=14 then writeln('Pierce')
  else if n=15 then writeln('Buchanan')
  else if n=16 then writeln('Lincoln')
  else if n=17 then writeln('Johnson')
  else if n=18 then writeln('Grant')
  else if n=19  then writeln('Hayes')
  else if n=20 then writeln('Garfield')
  else if n=21 then writeln('Arthur')
  else if n=22 then writeln('Cleveland')
  else if n=23 then writeln('Harrison')
  else if n=24 then writeln('Cleveland')
  else if n=25 then writeln('McKinley')
  else if n=26 then writeln('Roosevelt')
  else if n=27 then writeln('Howard Taft')
  else if n=28 then writeln('Wilson')
  else if n=29 then writeln('Harding')
  else if n=30 then writeln('Coolidge')
  else if n=31 then writeln('Hoover')
  else if n=32 then writeln('Roosevelt')
  else if n=33 then writeln('Truman')
  else if n=34 then writeln('Eisenhower')
  else if n=35 then writeln('Kennedy')
  else if n=36 then writeln('Johnson')
  else if n=37 then writeln('Nixon')
  else if n=38 then writeln('Ford')
  else if n=39 then writeln('Carter')
  else if n=40 then writeln('Regan');
end.

program Project2;

{$APPTYPE CONSOLE}

uses
  SysUtils;

const
  a : array[1..40] of string = ('Washington', 'Adams', 'Jefferson', 'Madison', 'Monroe', 'Quincy Adams', 'Jackson', 'Van Buren', 'Henry Harrison', 'Tyler', 'Knox Polk', 'Taylor', 'Fillmore', 'Pierce', 'Buchanan', 'Lincoln', 'Johnson', 'Simpson Grant', 'Hayes', 'Garfield', 'Arthur', 'Grover Cleveland', 'Harrison', 'Grover Cleveland', 'McKinley', 'Roosevelt', 'Howard Taft', 'Woodrow Wilson', 'Harding', 'Coolidge', 'Clark Hoover', 'Roosevelt', 'Truman', 'Eisenhower', 'Kennedy', 'Johnson', 'Nixon', 'Ford', 'Carter', 'Reagan');

var
  v : integer;

begin
    {$IFNDEF ONLINE_JUDGE}
      reset(input, 'input.txt');
      rewrite(output, 'output.txt');
    {$ENDIF}
    read(v);
    write(a[v]);
end.

program Project2;

{$APPTYPE CONSOLE}

uses
  SysUtils;

const
  a : array[1..40] of string = ('Washington', 'Adams', 'Jefferson', 'Madison', 'Monroe', 'Quincy Adams', 'Jackson', 'Van Buren', 'Henry Harrison', 'Tyler', 'Knox Polk', 'Taylor', 'Fillmore', 'Pierce', 'Buchanan', 'Lincoln', 'Johnson', 'Grant', 'Hayes', 'Garfield', 'Arthur', 'Grover Cleveland', 'Harrison', 'Grover Cleveland', 'McKinley', 'Roosevelt', 'Howard Taft', 'Wilson', 'Harding', 'Coolidge', 'Hoover', 'Roosevelt', 'Truman', 'Eisenhower', 'Kennedy', 'Johnson', 'Nixon', 'Ford', 'Carter', 'Reagan');

var
  v : integer;

begin
    {$IFNDEF ONLINE_JUDGE}
      reset(input, 'input.txt');
      rewrite(output, 'output.txt');
    {$ENDIF}
    read(v);
    write(a[v]);
end.

var
	name:array[1..40] of string;
	n:byte;
begin
	name[1]:='Washington';
	name[2]:='Adams';
	name[3]:='Jefferson';
	name[4]:='Madison';
	name[5]:='Monroe';
	name[6]:='Adams';
	name[7]:='Jackson';
	name[8]:='Van Buren';
	name[9]:='Harrison';
	name[10]:='Tyler';
	name[11]:='Polk';
	name[12]:='Taylor';
	name[13]:='Fillmore';
	name[14]:='Pierce';
	name[15]:='Buchanan';
	name[16]:='Lincoln';
	name[17]:='Johnson';
	name[18]:='Grant';
	name[19]:='Hayes';
	name[20]:='Garfield';
	name[21]:='Arthur';
	name[22]:='Cleveland';
	name[23]:='Harrison';
	name[24]:='Cleveland';
	name[25]:='McKinley';
	name[26]:='Roosevelt';
	name[27]:='Taft';
	name[28]:='Wilson';
	name[29]:='Harding';
	name[30]:='Coolidge';
	name[31]:='Hoover';
	name[32]:='Roosevelt';
	name[33]:='Truman';
	name[34]:='Eisenhower';
	name[35]:='Kennedy';
	name[36]:='Johnson';
	name[37]:='Nixon';
	name[38]:='Ford';
	name[39]:='Carter';
	name[40]:='Raegan';

	readln(n);
	writeln(name[n]);
end.

Const a:array[1..40]of string=(
'Washington',
'Adams',
'Jefferson',
'Madison',
'Monroe',
'Adams',
'Jackson',
'Van Buren',
'Harrison',
'Tyler',
'Polk',
'Taylor',
'Fillmore',
'Pierce',
'Buchanan',
'Lincoln',
'Johnson',
'Grant',
'Hayes',
'Garfield',
'Arthur',
'Cleveland',
'Harrison',
'Cleveland',
'McKinley',
'Roosevelt',
'Howard Taft',
'Wilson',
'Harding',
'Coolidge',
'Hoover',
'Roosevelt',
'Truman',
'Eisenhower',
'Kennedy',
'Johnson',
'Nixon',
'Ford',
'Carter',
'Reagan');
var n:longint;
 begin
  read(n);
  writeln(a[n]);
 end.

var n:integer;
begin
read (n);
if n=1 then write ('Washington');
if n=2 then write ('Adams');
if n=3 then write ('Jefferson');
if n=4 then write ('Madison');
if n=5 then write ('Monroe');
if n=6 then write ('Quincy Adams');
if n=7 then write ('Jackson');
if n=8 then write ('Van Buren');
if n=9 then write ('Henry Harrison');
if n=10 then write ('Tyler');
if n=11 then write ('Polk');
if n=12 then write ('Taylor');
if n=13 then write ('Fillmore');
if n=14 then write ('Pierce');
if n=15 then write ('Buchanan');
if n=16 then write ('Lincoln');
if n=17 then write ('Johnson');
if n=18 then write ('Grant');
if n=19 then write ('Hayes');
if n=20 then write ('Garfield');
if n=21 then write ('Arthur');
if n=22 then write ('Cleveland');
if n=23 then write ('Harrison');
if n=24 then write ('McKinley');
if n=25 then write ('Roosevelt');
if n=26 then write ('Howard Taft');
if n=27 then write ('Wilson');
if n=28 then write ('Harding');
if n=29 then write ('Coolidge');
if n=30 then write ('Hoover');
if n=31 then write ('Roosevelt');
if n=32 then write ('Truman');
if n=33 then write ('Eisenhower');
if n=34 then write ('Kennedy');
if n=35 then write ('Johnson');
if n=36 then write ('Nixon');
if n=37 then write ('Ford');
if n=38 then write ('Carter');
if n=39 then write ('Reagan');
if n=40 then write ('H. W. Bush');
end.

Const
        p:array[1..40]of Shortstring=('Washington'       //1
                                      ,'Adams'
                                      ,'Jefferson'
                                      ,'Madison'
                                      ,'Monroe'
                                      ,'Adams'
                                      ,'Jackson'
                                      ,'Van Buren'
                                      ,'Harison'
                                      ,'Tyler'          //10
                                      ,'Polk'
                                      ,'Taylor'
                                      ,'FillMore'
                                      ,'Pierce'
				      ,'Buchanan'
				      ,'Lincoln'
				      ,'Johnson'
				      ,'Grant'
				      ,'Hayes'
				      ,'Garfield'       //20
				      ,'Arthur'
				      ,'Cleveland'
				      ,'Harrison'
				      ,'Cleveland'
				      ,'Mckinley'
				      ,'Roosevelt'
                                      ,'Taft'
				      ,'Wilson'
                                      ,'Harding'
                                      ,'Coolidge'            //30
                                      ,'Hoover'
				      ,'Roosevelt'
				      ,'Truman'
				      ,'Eisenhower'
				      ,'Kennedy'
				      ,'Johnson'
				      ,'Nixon'
				      ,'Ford'
				      ,'Carter'
				      ,'Reagan');

var
        a:longint;
begin
readln(a);
writeln(p[a]);
end.

program Project2;

{$APPTYPE CONSOLE}
uses
  SysUtils;
var
  n:integer;
begin
  read(n);
  if n=1 then  write('Washington');
  if n=2 then  write('Adams');
  if n=3 then  write('Jefferson');
  if n=4 then  write('Madison');
  if n=5 then  write('Monroe');
  if n=6 then  write('Adams');
  if n=7 then  write('Jackson');
  if n=8 then  write('Van Buren');
  if n=9 then  write('Henry Harrison');
  if n=10 then  write('Tyler');
  if n=11 then  write('Polk');
  if n=12 then  write('Taylor');
  if n=13 then  write('Fillmore');
  if n=14 then  write('Pierce');
  if n=15 then  write('Buchanan');
  if n=16 then  write('Lincoln');
  if n=17 then  write('Johnson');
  if n=18 then  write('Grant');
  if n=19 then  write('Hayes');
  if n=20 then  write('Garfield');
  if n=21 then  write('Arthur');
  if n=22 then  write('Cleveland');
  if n=23 then  write('Harrison');
  if n=24 then  write('Cleveland');
  if n=25 then  write('McKinley');
  if n=26 then  write('Roosevelt');
  if n=27 then  write('Taft');
  if n=28 then  write('Wilson');
  if n=29 then  write('Harding');
  if n=30 then  write('Coolidge');
  if n=31 then  write('Hoover');
  if n=32 then  write('Roosevelt');
  if n=33 then  write('Truman');
  if n=34 then  write('Eisenhower');
  if n=35 then  write('Kennedy');
  if n=36 then  write('Johnson');
  if n=37 then  write('Nixon');
  if n=38 then  write('Ford');
  if n=39 then  write('Carter');
  if n=40 then  write('Reagan');
end.

var
 a:longint;
begin
 readln(a);
 if (a=2) or (a=6) then writeln('Adams');
 if a=8 then writeln('Van Buren');
 if a=29 then writeln('Harding');
 if a=1 then writeln('Washington');
 if a=3 then writeln('Jefferson');
 if a=4 then writeln('Madison');
 if a=5 then writeln('Monroe');
 if a=7 then writeln('Jackson');
 if (a=9) or (a=23) then writeln('Harrison');
 if a=10 then writeln('Tyler');
 if a=11 then writeln('Polk');
 if a=12 then writeln('Taylor');
 if a=13 then writeln('Fillmore');
 if a=14 then writeln('Pierce');
 if a=15 then writeln('Buchanan');
 if a=16 then writeln('Lincoln');
 if a=17 then writeln('Johnson');
 if a=18 then writeln('Grant');
 if a=19 then writeln('Hayes');
 if a=20 then writeln('Garfield');
 if a=21 then writeln('Arthur');
 if a=22 then writeln('Cleveland');
end.

Var st:array [1..40] of string;
    n:longint;
Begin
    st[1]:='Washington';
    st[2]:='Adams';
    st[3]:='Jefferson';
    st[4]:='Madison';
    st[5]:='Monroe';
    st[6]:='Quincy Adams';
    st[7]:='Jackson';
    st[8]:='Van Buren';
    st[9]:='Henry Harrison';
    st[10]:='Tyler';
    st[11]:='Polk';
    st[12]:='Taylor';
    st[13]:='Fillmore';
    st[14]:='Pierce';
    st[15]:='Buchanan';
    st[16]:='Lincoln';
    st[17]:='Johnson';
    st[18]:='Grant';
    st[19]:='Hayes';
    st[20]:='Garfield';
    st[21]:='Arthur';
    st[22]:='Cleveland';
    st[23]:='Harrison';
    st[24]:=st[22];
    st[25]:='McKinley';
    st[26]:='Roosevelt';
    st[27]:='Howard Taft';
    st[28]:='Wilson';
    st[29]:='Harding';
    st[30]:='Coolidge';
    st[31]:='Hoover';
    st[32]:='Roosevelt';
    st[33]:='Truman';
    st[34]:='Eisenhower';
    st[35]:='Kennedy';
    st[36]:='Johnson';
    st[37]:='Nixon';
    st[38]:='Ford';
    st[39]:='Carter';
    st[40]:='Reagan';
    readln(n); write(st[n]);
End.

Const a:array[1..40]of string=(
'Washington',
'Adams',
'Jefferson',
'Madison',
'Monroe',
'Quincy Adams',
'Jackson',
'Van Buren',
'Harrison',
'Tyler',
'Polk',
'Taylor',
'Fillmore',
'Pierce',
'Buchanan',
'Lincoln',
'Johnson',
'Grant',
'Hayes',
'Garfield',
'Arthur',
'Cleveland',
'Harrison',
'Cleveland',
'McKinley',
'Roosevelt',
'Taft',
'Wilson',
'Harding',
'Coolidge',
'Hoover',
'Roosevelt',
'Truman',
'Eisenhower',
'Kennedy',
'Johnson',
'Nixon',
'Ford',
'Carter',
'Reagan');

var n:longint;
 begin
  read(n);
  writeln(a[n]);
 end.

var
	name:array[1..40] of string;
	n:byte;
begin
	name[1]:='Washington';
	name[2]:='Adams';
	name[3]:='Jefferson';
	name[4]:='Madison';
	name[5]:='Monroe';
	name[6]:='Quincy Adams';
	name[7]:='Jackson';
	name[8]:='Van Buren';
	name[9]:='Henry Harrison';
	name[10]:='Tyler';
	name[11]:='Polk';
	name[12]:='Taylor';
	name[13]:='Fillmore';
	name[14]:='Pierce';
	name[15]:='Buchanan';
	name[16]:='Lincoln';
	name[17]:='Johnson';
	name[18]:='Grant';
	name[19]:='Hayes';
	name[20]:='Garfield';
	name[21]:='Arthur';
	name[22]:='Cleveland';
	name[23]:='Harrison';
	name[24]:='Cleveland';
	name[25]:='McKinley';
	name[26]:='Roosevelt';
	name[27]:='Howard Taft';
	name[28]:='Wilson';
	name[29]:='Harding';
	name[30]:='Coolidge';
	name[31]:='Hoover';
	name[32]:='Roosevelt';
	name[33]:='Truman';
	name[34]:='Eisenhower';
	name[35]:='Kennedy';
	name[36]:='Johnson';
	name[37]:='Nixon';
	name[38]:='Ford';
	name[39]:='Carter';
	name[40]:='Raegan';

	readln(n);
	writeln(name[n]);
end.

var
n:longint;
begin
readln(n);
If n=1 then writeln('Washington');
If n=2 then writeln('Adams');
If n=3 then writeln('Jefferson');
If n=4 then writeln('Madison');
IF n=5 then writeln('Monroe');
If n=6 then writeln('Quincy Adams');
If n=7 then writeln('Jackson');
If n=8 then writeln('Van Buren');
If n=9 then writeln('Henry Harrison');
If n=10 then writeln('Tyler');
If n=11 then writeln('Knox Polk');
If n=12 then writeln('Taylor');
If n=13 then writeln('Fillmore');
If n=14 then writeln('Pierce');
If n=15 then writeln('Buchanan');
If n=16 then writeln('Lincoln');
If n=17 then writeln('Johnson');
If n=18 then writeln('Simpson Grant');
If n=19 then writeln('Birchard Hayes');
If n=20 then writeln('Abram Garfield');
If n=21 then writeln('Alan Arthur');
If n=22 then writeln('Grover Cleveland');
If n=23 then writeln('Harrison');
If n=24 then writeln('Grover Cleveland');
If n=25 then writeln('McKinley');
If n=26 then writeln('Roosevelt');
If n=27 then writeln('Howard Taft');
If n=28 then writeln('Woodrow Wilson');
if n=29 then writeln('Gamaliel Harding');
if n=30 then writeln('Calvin Coolidge');
If n=31 then writeln('Clark Hoover');
if n=32 then writeln('Delano Roosevelt');
if n=33 then writeln('Truman');
if n=34 then writeln('David Eisenhower');
if n=35 then writeln('Fitzgerald Kennedy');
if n=36 then writeln('Baines Johnson');
if n=37 then writeln('Milhous Nixon');
if n=38 then writeln('Rudolph Ford');
if n=39 then writeln('Earl Carter');
if n=40 then writeln('Wilson Reagan');
end.

Var a:Array[0..1000] of String;
    n:LongiNt;
begin
Read(n);
a[1]:='Washington';
a[2]:='Adams';
a[3]:='Jefferson';
a[4]:='Medison';
a[5]:='Monroe';
a[6]:='Quincy Adams';
a[7]:='Jackson';
a[8]:='Van Buren';
a[9]:='Henry Harrison';
a[10]:='Tyler';
a[11]:='K.Polk';
a[12]:='Taylor';
a[13]:='Fillmore';
a[14]:='Pierce';
a[15]:='Buchanan';
a[16]:='Lincoln';
a[17]:='Johnson';
a[18]:='S.Grant';
a[19]:='B.Hayes';
a[20]:='Garfield';
a[21]:='A.Arthur';
a[22]:='Cleveland';
a[23]:='Harrison';
a[24]:='Cleveland';
a[25]:='McKinley';
a[26]:='Roosevelt';
a[27]:='Howard Taft';
a[28]:='Wilson';
a[29]:='Harding';
a[30]:='Coolidge';
a[31]:='Hoover';
a[32]:='D.Roosevelt';
a[33]:='S Truman';
a[34]:='D.Eisenhower';
a[35]:='F.Kennedy';
a[36]:='B.Johnson';
a[37]:='M.Nixon';
a[38]:='R.Ford';
a[39]:='Carter';
a[40]:='Reagan';
WriteLn(a[n]);
end.

const  P:array [1..44] of string  =  ('Washington','Adams', 'Jefferson' , 'Madison','Monroe', 'Quincy Adams', 'Jackson', 'Van Buren','H. Harrison','Tyler','K. Polk','Taylor','Fillmore','Pierce','Buchanan','Lincoln','Johnson','S. Grant','B. Hayes','A. Garfield','A. Arthur','Cleveland' ,'Harrison'   ,'Cleveland'     ,'McKinley'             ,'Roosevelt'     ,'H. Taft','Wilson'  ,'G. Harding' ,'Coolidge'  ,'Hoover','D. Roosevelt','S. Truman','D. Eisenhower','F. Kennedy','B. Johnson' ,'M. Nixon','R. Ford' ,'Carter','Reagan' ,'H. W. Bush'  ,'Clinton' ,'W. Bush','Hussein Obama');
Var n:integer;
Begin

  Readln( n );

  Writeln( P[n] );

end.

var
 a:longint;
begin
 readln(a);
 if (a=2) or (a=6) then writeln('Adams');
 if a=8 then writeln('Van Buren');
 if a=29 then writeln('Harding');
 if a=1 then writeln('Washington');
 if a=3 then writeln('Jefferson');
 if a=4 then writeln('Madison');
 if a=5 then writeln('Monroe');
end.

var
n:longint;
begin
readln(n);
If n=1 then writeln('Washington');
If n=2 then writeln('Adams');
If n=3 then writeln('Jefferson');
If n=4 then writeln('Madison');
IF n=5 then writeln('Monroe');
If n=6 then writeln('Quincy Adams');
If n=7 then writeln('Jackson');
If n=8 then writeln('Van Buren');
If n=9 then writeln('Henry Harrison');
If n=10 then writeln('Tyler');
If n=11 then writeln('Knox Polk');
If n=12 then writeln('Taylor');
If n=13 then writeln('Fillmore');
If n=14 then writeln('Pierce');
If n=15 then writeln('Buchanan ');
If n=16 then writeln('Lincoln ');
If n=17 then writeln('Johnson');
If n=18 then writeln('Simpson Grant');
If n=19 then writeln('Birchard Hayes');
If n=20 then writeln('Abram Garfield');
If n=21 then writeln('Alan Arthur');
If n=22 then writeln('Grover Cleveland');
If n=23 then writeln('Harrison');
If n=24 then writeln('Grover Cleveland');
If n=25 then writeln('McKinley');
If n=26 then writeln('Roosevelt');
If n=27 then writeln('Howard Taft');
If n=28 then writeln('Woodrow Wilson');
if n=29 then writeln('Gamaliel Harding');
if n=30 then writeln('Calvin Coolidge');
end.

var
  n:longint;
begin
  readln(n);
  if n=1 then writeln('Washington')
  else if n=2 then writeln('Adams')
  else if n=3 then writeln('Jefferson')
  else if n=4 then writeln('Madison')
  else if n=5 then writeln('Monroe')
  else if n=6 then writeln('Adams')
  else if n=7 then writeln('Jackson')
  else if n=8 then writeln('Van Buren')
  else if n=9 then writeln('Garrison')
  else if n=10 then writeln('Tyler')
  else if n=11 then writeln('Knox Polk')
  else if n=12 then writeln('Taylor')
  else if n=13 then writeln('Fillmore')
  else if n=14 then writeln('Pearce')
  else if n=15 then writeln('Buchanan')
  else if n=16 then writeln('Lincoln')
  else if n=17 then writeln('Johnson')
  else if n=18 then writeln('Grant')
  else if n=19 then writeln('Hayes')
  else if n=20 then writeln('Garfield')
  else if n=21 then writeln('Arthur')
  else if n=22 then writeln('Cleveland')
  else if n=23 then writeln('Garrison')
  else if n=24 then writeln('Cleveland')
  else if n=25 then writeln('McKinley')
  else if n=26 then writeln('Roosevelt')
  else if n=27 then writeln('Taft')
  else if n=28 then writeln('Wilson')
  else if n=29 then writeln('Harding')
  else if n=30 then writeln('Coolidge')
  else if n=31 then writeln('Hoover')
  else if n=32 then writeln('Roosevelt')
  else if n=33 then writeln('Truman')
  else if n=34 then writeln('Eisenhower')
  else if n=35 then writeln('Kennedy')
  else if n=36 then writeln('Johnson')
  else if n=37 then writeln('Nixon')
  else if n=38 then writeln('Ford')
  else if n=39 then writeln('Crankcase')
  else if n=40 then writeln('Reagan');
end.

var
presiden:array[1..44] of string;
a:integer;
begin
readln(a);
presiden[1]:='Washington';
presiden[2]:='Adams';
presiden[3]:='Jefferson';
presiden[4]:='Madison';
presiden[5]:='Monroe';
presiden[6]:='Quincy Adams';
presiden[7]:='Jackson';
presiden[8]:='Van Buren';
presiden[9]:='Harrison';
presiden[10]:='Tyler';
presiden[11]:='Polk';
presiden[12]:='Taylor';
presiden[13]:='Fillmore';
presiden[14]:='Pierce';
presiden[15]:='Buchanan';
presiden[16]:='Lincoln';
presiden[17]:='Johnson';
presiden[18]:='Grant';
presiden[19]:='Hayes';
presiden[20]:='Garfield';
presiden[21]:='Arthur';
presiden[22]:='Cleveland';
presiden[23]:='Harrison';
presiden[24]:='Cleveland';
presiden[25]:='McKinley';
presiden[26]:='Roosevelt';
presiden[27]:='Taft';
presiden[28]:='Wilson';
presiden[29]:='Harding';
presiden[30]:='Coolidge';
presiden[31]:='Hoover';
presiden[32]:='D. Roosevelt';
presiden[33]:='Truman';
presiden[34]:='Eisenhower';
presiden[35]:='Kennedy';
presiden[36]:='Johnson';
presiden[37]:='Nixon';
presiden[38]:='Ford';
presiden[39]:='Carter';
presiden[40]:='Reagan';
presiden[41]:='Bush';
presiden[42]:='Clinton';
presiden[43]:='Bush';
presiden[44]:='Obama';
writeln(presiden[a]);
end.

var
n:longint;
begin
readln(n);
If n=1 then writeln('Washington');
If n=2 then writeln('Adams');
If n=3 then writeln('Jefferson');
If n=4 then writeln('Madison');
IF n=5 then writeln('Monroe');
If n=6 then writeln('Quincy Adams');
If n=7 then writeln('Jackson');
If n=8 then writeln('Van Buren');
If n=9 then writeln('Henry Harrison');
If n=10 then writeln('Tyler');
If n=11 then writeln('Knox Polk');
If n=12 then writeln('Taylor');
If n=13 then writeln('Fillmore');
If n=14 then writeln('Pierce');
If n=15 then writeln('Buchanan');
If n=16 then writeln('Lincoln');
If n=17 then writeln('Johnson');
If n=18 then writeln('Simpson Grant');
If n=19 then writeln('Birchard Hayes');
If n=20 then writeln('Abram Garfield');
If n=21 then writeln('Alan Arthur');
If n=22 then writeln('Grover Cleveland');
If n=23 then writeln('Harrison');
If n=24 then writeln('Grover Cleveland');
If n=25 then writeln('McKinley');
If n=26 then writeln('Roosevelt');
If n=27 then writeln('Howard Taft');
If n=28 then writeln('Woodrow Wilson');
if n=29 then writeln('Gamaliel Harding');
if n=30 then writeln('Calvin Coolidge');
If n=31 then writeln('Clark Hoover');
if n=32 then writeln('Delano Roosevelt');
if n=33 then writeln('S. Truman');
if n=34 then writeln('David Eisenhower');
if n=35 then writeln('Fitzgerald Kennedy');
if n=36 then writeln('Baines Johnson');
if n=37 then writeln('Milhous Nixon');
if n=38 then writeln('Rudolph Ford');
if n=39 then writeln('Earl Carter');
if n=40 then writeln('Wilson Reagan');
end.

var
 a:longint;
begin
 readln(a);
 if (a=2) or (a=6) then writeln('Adams');
 if a=8 then writeln('Van Buren');
 if a=29 then writeln('Harding');
 if a=1 then writeln('Washington');
 if a=3 then writeln('Jefferson');
 if a=4 then writeln('Madison');
 if a=5 then writeln('Monroe');
 if a=7 then writeln('Jackson');
 if (a=9) or (a=23) then writeln('Harrison');
 if a=10 then writeln('Tyler');
 if a=11 then writeln('Polk');
 if a=12 then writeln('Taylor');
 if a=13 then writeln('Fillmore');
 if a=14 then writeln('Pierce');
 if a=15 then writeln('Buchanan');
 if a=16 then writeln('Lincoln');
 if a=17 then writeln('Johnson');
 if a=18 then writeln('Grant');
 if a=19 then writeln('Hayes');
 if a=20 then writeln('Garfield');
 if a=21 then writeln('Arthur');
 if (a=22) or (a=24) then writeln('Cleveland');
 if a=25 then writeln('McKinley');
 if (a=26) or (a=32) then writeln('Roosevelt');
 if a=27 then writeln('Taft');
 if a=28 then writeln('Wilson');
 if a=30 then writeln('Coolidge');
 if a=31 then writeln('Hoover');
end.

var
 a:longint;
begin
 readln(a);
 if (a=2) or (a=6) then writeln('Adams');
 if a=8 then writeln('Van Buren');
 if a=29 then writeln('Harding');
 if a=1 then writeln('Washington');
 if a=3 then writeln('Jefferson');
 if a=4 then writeln('Madison');
 if a=5 then writeln('Monroe');
 if a=7 then writeln('Jackson');
 if (a=9) or (a=23) then writeln('Harrison');
 if a=10 then writeln('Tyler');
 if a=11 then writeln('Polk');
 if a=12 then writeln('Taylor');
 if a=13 then writeln('Fillmore');
 if a=14 then writeln('Pierce');
 if a=15 then writeln('Buchanan');
 if a=16 then writeln('Lincoln');
 if a=17 then writeln('Johnson');
 if a=18 then writeln('Grant');
 if a=19 then writeln('Hayes');
 if a=20 then writeln('Garfield');
 if a=21 then writeln('Arthur');
 if (a=22) or (a=24) then writeln('Cleveland');
 if a=25 then writeln('McKinley');
 if (a=26) or (a=32) then writeln('Roosevelt');
 if a=27 then writeln('Taft');
 if a=28 then writeln('Wilson');
 if a=30 then writeln('Coolidge');
 if a=31 then writeln('Hoover');
 if a=33 then writeln('Truman');
 if a=34 then writeln('Eisenhower');
end.

var s: ansistring;
n: longint;
begin
  readln(n);

  if n=1 then writeln('Washington')
  else if n=2 then writeln('Adams')
  else if n=3 then writeln('Jefferson')
  else if n=4 then writeln('Madison')
  else if n=5 then writeln('Monroe')
  else if n=6 then writeln('Adams')
  else if n=7 then writeln('Jackson')
  else if n=8 then writeln('Van Buren')
  else if n=9 then writeln('Harrison')
  else if n=10 then writeln('Tyler')
  else if n=11 then writeln('Polk')
  else if n=12 then writeln('Taylor')
  else if n=13 then writeln('Fillmore')
  else if n=14 then writeln('Pierce')
  else if n=15 then writeln('Buchanan')
  else if n=16 then writeln('Lincoln')
  else if n=17 then writeln('Johnson')
  else if n=18 then writeln('Grant')
  else if n=19  then writeln('Hayes')
  else if n=20 then writeln('Garfield')
  else if n=21 then writeln('Arthur')
  else if n=22 then writeln('Cleveland')
  else if n=23 then writeln('Harrison')
  else if n=24 then writeln('Cleveland')
  else if n=25 then writeln('McKinley')
  else if n=26 then writeln('Roosevelt')
  else if n=27 then writeln('Taft')
  else if n=28 then writeln('Wilson')
  else if n=29 then writeln('Harding')
  else if n=30 then writeln('Coolidge')
  else if n=31 then writeln('Hoover')
  else if n=32 then writeln('Roosevelt')
  else if n=33 then writeln('Truman')
  else if n=34 then writeln('Eisenhower')
  else if n=35 then writeln('Kennedy')
  else if n=36 then writeln('Johnson')
  else if n=37 then writeln('Nixon')
  else if n=38 then writeln('Ford')
  else if n=39 then writeln('Carter')
  else if n=40 then writeln('Regan');
end.

var
 a:longint;
begin
 readln(a);
 if (a=2) or (a=6) then writeln('Adams');
 if a=8 then writeln('Van Buren');
 if a=29 then writeln('Harding');
 if a=1 then writeln('Washington');
 if a=3 then writeln('Jefferson');
 if a=4 then writeln('Madison');
 if a=5 then writeln('Monroe');
 if a=7 then writeln('Jackson');
 if a=9 then writeln('Harrison');
 if a=10 then writeln('Tyler');
 if a=11 then writeln('Polk');
 if a=12 then writeln('Taylor');
 if a=13 then writeln('Fillmore');
 if a=14 then writeln('Pierce');
 if a=15 then writeln('Buchanan');
end.

program hui;

{$APPTYPE CONSOLE}

var
 x: integer;
 a: array[1..40] of string;

begin
 read(x);
 a[1] := 'Washington';
 a[2] := 'Adams';
 a[3] := 'Jefferson';
 a[4] := 'Madison';
 a[5] := 'Monroe';
 a[6] := 'Adams';
 a[7] := 'Jackson';
 a[8] := 'Van Buren';
 a[9] := 'Harrison';
 a[10] := 'Tyler';
 a[11] := 'Polk';
 a[12] := 'Taylor';
 a[13] := 'Fillmore';
 a[14] := 'Pierce';
 a[15] := 'Buchanan';
 a[16] := 'Lincoln';
 a[17] := 'Johnson';
 a[18] := 'Grant';
 a[19] := 'Hayes';
 a[20] := 'Arthur';
 a[21] := 'Cleveland';
 a[22] := 'Harrison';
 a[23] := 'Cleveland';
 a[24] := 'McKinley';
 a[25] := 'Roosevelt';
 a[26] := 'Taft';
 a[27] := 'Wilson';
 a[28] := 'Harding';
 a[29] := 'Coolidge';
 a[30] := 'Hoover';
 a[31] := 'Roosevelt';
 a[32] := 'Truman';
 a[33] := 'Eisenhower';
 a[34] := 'Kennedy';
 a[35] := 'Johnson';
 a[36] := 'Nixon';
 a[37] := 'Ford';
 a[38] := 'Carter';
 a[39] := 'Reagan';
 a[40] := 'Bush';
 writeln(a[x]);
end.

const x:array[1..15]of
string=('George Washington','John Adams','Thomas Jefferson','James Madison','James Monroe',
'John Quincy Adams','Andrew Jackson','Martin Van Buren','William Henry Harrison',
'John Tyler','James Knox Polk','Zachary Taylor','Millard Fillmore','Franklin Pierce',
'James Buchanan');
var a:longint;

 begin
 // assign(input,'input.txt'); reset(input);
   readln(a);
  writeln(x[a]);

 end.

Const
        p:array[1..40]of Shortstring=('Washington'       //1
                                      ,'Adams'
                                      ,'Jefferson'
                                      ,'Madison'
                                      ,'Monroe'
                                      ,'Adams'
                                      ,'Jackson'
                                      ,'Van Buren'
                                      ,'Harison'
                                      ,'Tyler'          //10
                                      ,'Polk'
                                      ,'Taylor'
                                      ,'FillMore'
                                      ,'Pierce'
				      ,'Buchanan'
				      ,'Lincoln'
				      ,'Johnson'
				      ,'Grant'
				      ,'Hayes'
				      ,'Garfield'       //20
				      ,'Arthur'
				      ,'Cleveland'
				      ,'Harrison'
				      ,'Cleveland'
				      ,'McKinley'
				      ,'Roosevelt'
                                      ,'Taft'
				      ,'Wilson'
                                      ,'Harding'
                                      ,'Coolidge'            //30
                                      ,'Hoover'
				      ,'Roosevelt'
				      ,'Truman'
				      ,'Eisenhower'
				      ,'Kennedy'
				      ,'Johnson'
				      ,'Nixon'
				      ,'Ford'
				      ,'Carter'
				      ,'Reagan');

var
        a:longint;
begin
readln(a);
writeln(p[a]);
end.

var
 a:byte;
begin
 read(a);
 case a of
 1:write('Washington');
 2:write('Adams');
 3:write('Jefferson');
 4:write('Madison');
 5:write('Monroe');
 6:write('Quincy Adams');
 7:write('Jackson');
 8:write('Van Buren');
 9:write('Henry Harrison');
  10:write('Tyler');
 11:write('Knox Polk');
 12:write('Taylor');
 13:write('Fillmore');
 14:write('Pierce');
 15:write('Buchanan');
 16:write('Lincoln');
 17:write('Johnson');
 18:write('Simpson Grant');
 19:write('Hayes');
 20:write('Garfield');
 21:write('Arthur');
 22:write('Grover Cleveland');
 23:write('Harrison');
 24:write('Grover Cleveland');
 25:write('McKinley');
 26:write('Roosevelt');
 27:write('Howard Taft');
 28:write('Wilson');
 29:write('Harding');
 30:write('Coolidge');
 31:write('Clark Hoover');
 32:write('Roosevelt');
 33:write('Truman');
 34:write('Eisenhower');
 35:write('Kennedy');
 36:write('Johnson');
 37:write('Nixon');
 38:write('Ford');
 39:write('Carter');
 40:write('Reagan');
 end;
End.

program Project2;

{$APPTYPE CONSOLE}
{$O-}

uses
  SysUtils;

var
  b, a: array[1..1000001] of string;
  i, n, cnt1, cnt2, cnt3, k: integer;
  cnt: Int64;
  ch: Char;
  s: string;

begin
  read(n);

  a[1] := 'Washington';
  a[2] := 'Adams';
  a[3] := 'Jefferson';
  a[4] := 'Madison';
  a[5] := ('Monroe');
  a[6] := ('Adams');
  a[7] := ('Jackson');
  a[8] := ('Van Buren');
  a[9] := ('Harrison');
  a[10] := ('Tyler');
  a[11] := ('Polk');
  a[12] := 'Taylor';
  a[13] := 'Fillmore';
  a[14] := 'Pierce';
  a[15] := 'Buchanan';
  a[16] := 'Lincoln';
  a[17] := 'Johnson';
  a[18] := 'Grant';
  a[19] := 'Hayes';
  a[20] := 'Garfield';
  a[21] := 'Chester';
  a[22] := 'Cleveland';
  a[23] := 'Harrison';
  a[24] := 'Cleveland';
  a[25] := 'MCKinley';
  a[26] := 'Roosevelt';
  a[27] := 'Taft';
  a[28] := 'Wilson';
  a[29] := 'Harding';
  a[30] := 'Coolidge';
  a[31] := 'Hoover';
  a[32] := 'Roosevelt';
  a[33] := 'Truman';
  a[34] := 'Eisenhower';
  a[35] := 'Kennedy';
  a[36] := 'Lyndon';
  a[37] := 'Nixon';
  a[38] := 'Ford';
  a[39] := 'Carter';
  a[40] := 'Reagan';
  a[41] := 'Bush';

  write(a[n]);

end.

var
n:longint;
begin
readln(n);
If n=1 then writeln('Washington');
If n=2 then writeln('Adams');
If n=3 then writeln('Jefferson');
If n=4 then writeln('Madison');
IF n=5 then writeln('Monroe');
If n=6 then writeln('Quincy Adams');
If n=7 then writeln('Jackson');
If n=8 then writeln('Van Buren');
If n=9 then writeln('Harrison');
If n=10 then writeln('Tyler');
If n=11 then writeln('Knox Polk');
If n=12 then writeln('Taylor');
If n=13 then writeln('Fillmore');
If n=14 then writeln('Pierce');
If n=15 then writeln('Buchanan');
If n=16 then writeln('Lincoln');
If n=17 then writeln('Johnson');
If n=18 then writeln('Grant');
If n=19 then writeln('Hayes');
If n=20 then writeln('Garfield');
If n=21 then writeln('Arthur');
If n=22 then writeln('Cleveland');
If n=23 then writeln('Harrison VI');
If n=24 then writeln('Cleveland');
If n=25 then writeln('McKinley');
If n=26 then writeln('Roosevelt');
If n=27 then writeln('Taft');
If n=28 then writeln('Wilson');
if n=29 then writeln('Harding');
if n=30 then writeln('Coolidge');
If n=31 then writeln('Hoover');
if n=32 then writeln('Roosevelt');
if n=33 then writeln('Truman');
if n=34 then writeln('Eisenhower');
if n=35 then writeln('Kennedy');
if n=36 then writeln('Johnson');
if n=37 then writeln('Nixon');
if n=38 then writeln('Ford');
if n=39 then writeln('Carter');
if n=40 then writeln('Reagan');
end.

var
n:longint;
begin
readln(n);
If n=1 then writeln('Washington');
If n=2 then writeln('Adams');
If n=3 then writeln('Jefferson');
If n=4 then writeln('Madison');
IF n=5 then writeln('Monroe');
If n=6 then writeln('Quincy Adams');
If n=7 then writeln('Jackson');
If n=8 then writeln('Van Buren');
If n=9 then writeln('Henry Harrison');
If n=10 then writeln('Tyler, Jr');
If n=11 then writeln('Knox Polk');
If n=12 then writeln('Taylor');
If n=13 then writeln('Fillmore');
If n=14 then writeln('Pierce');
If n=15 then writeln('Buchanan');
If n=16 then writeln('Lincoln');
If n=17 then writeln('Johnson');
If n=18 then writeln('Simpson Grant');
If n=19 then writeln('Birchard Hayes');
If n=20 then writeln('Abram Garfield');
If n=21 then writeln('Alan Arthur');
If n=22 then writeln('Grover Cleveland');
If n=23 then writeln('Harrison');
If n=24 then writeln('Grover Cleveland');
If n=25 then writeln('McKinley');
If n=26 then writeln('Roosevelt');
If n=27 then writeln('Howard Taft');
If n=28 then writeln('Woodrow Wilson');
if n=29 then writeln('Gamaliel Harding');
if n=30 then writeln('Calvin Coolidge');
end.

var
n:longint;
begin
readln(n);
If n=1 then writeln('Washington');
If n=2 then writeln('Adams');
If n=3 then writeln('Jefferson');
If n=4 then writeln('Madison');
IF n=5 then writeln('Monroe');
If n=6 then writeln('Quincy Adams');
If n=7 then writeln('Jackson');
If n=8 then writeln('Van Buren');
If n=9 then writeln('Henry Harrison');
If n=10 then writeln('Tyler');
If n=11 then writeln('Knox Polk');
If n=12 then writeln('Taylor');
If n=13 then writeln('Fillmore');
If n=14 then writeln('Pierce');
If n=15 then writeln('Buchanan');
If n=16 then writeln('Lincoln');
If n=17 then writeln('Johnson');
If n=18 then writeln('Simpson Grant');
If n=19 then writeln('Birchard Hayes');
If n=20 then writeln('Abram Garfield');
If n=21 then writeln('Alan Arthur');
If n=22 then writeln('Grover Cleveland');
If n=23 then writeln('Harrison VI');
If n=24 then writeln('Grover Cleveland');
If n=25 then writeln('McKinley');
If n=26 then writeln('Roosevelt');
If n=27 then writeln('Howard Taft');
If n=28 then writeln('Woodrow Wilson');
if n=29 then writeln('Gamaliel Harding');
if n=30 then writeln('Calvin Coolidge');
If n=31 then writeln('Clark Hoover');
if n=32 then writeln('Delano Roosevelt');
if n=33 then writeln('Truman');
if n=34 then writeln('David Eisenhower');
if n=35 then writeln('Fitzgerald Kennedy');
if n=36 then writeln('Baines Johnson');
if n=37 then writeln('Milhous Nixon');
if n=38 then writeln('Rudolph Ford');
if n=39 then writeln('Earl Carter');
if n=40 then writeln('Wilson Reagan');
end.

// By JeeJee
Var n:longint;
    a:array[1..40] of string;
Begin
Readln(n);

   a[1]:= 'Washington';
   a[2]:= 'Adams';
   a[3]:= 'Jefferson';
   a[4]:='Madison';
   a[5]:='Monroe';
   a[6]:='Adams';
     a[7]:='Jackson';
   a[8]:='Van Buren';
    a[9]:='Henry Harrison';
   a[10]:='Tyler';
     a[11]:='K. Polk';
    a[12]:='Taylor';
     a[13]:='Fillmore';
   a[14]:='Pierce';
      a[15]:='Buchanan';
    a[16]:='Lincoln';
     a[17]:='Johnson';
     a[18]:='S. Grant';
 a[19]:='B. Hayes';
    a[20]:='Garfield';
    a[21]:='A. Arthur';
     a[22]:='Cleveland';
  a[23]:='Harrison';
     a[24]:='Cleveland';
     a[25]:='McKinley';
a[26]:='Roosevelt';
     a[27]:='Howard Taft';
     a[28]:='Wilson';
    a[29]:='G. Harding';
     a[30]:='Coolidge';
     a[31]:='Hoover';
    a[32]:='D. Roosevelt';
    a[33]:='S. Truman';
     a[34]:='D. Eisenhower';
     a[35]:='F. Kennedy';
     a[36]:='B. Johnson';
     a[37]:='M. Nixon';
     a[38]:='R. Ford';
     a[39]:='Carter';
    a[40]:='Reagan';

Writeln(a[n]);
End.

var
 a:longint;
begin
 readln(a);
 if (a=2) or (a=6) then writeln('Adams');
 if a=8 then writeln('Van Buren');
 if a=29 then writeln('Harding');
 if a=1 then writeln('Washington');
 if a=3 then writeln('Jefferson');
 if a=4 then writeln('Madison');
 if a=5 then writeln('Monroe');
 if a=7 then writeln('Jackson');
 if a=9 then writeln('Harrison');
 if a=10 then writeln('Tyler');
 if a=11 then writeln('Polk');
 if a=12 then writeln('Taylor');
 if a=13 then writeln('Fillmore');
end.

Var n:longint;
begin
readln(n);
case n of
1:writeln('Washington');
2:writeln('Adams');
3:writeln('Jefferson');
4:writeln('Madison');
5:writeln('Monroe');
6:writeln('Adams');
7:writeln('Jackson');
8:writeln('Van Buren');
9:writeln('Harrison');
10:writeln('Tyler');
11:writeln('Knox Polk');
12:writeln('Taylor');
13:writeln('Fillmore');
14:writeln('Pierce');
15:writeln('Buchanan');
16:writeln('Lincoln');
17:writeln('Johnson');
18:writeln('Grant');
19:writeln('Hayes');
20:writeln('Garfield');
21:writeln('Alan Arthur');
22:writeln('Cleveland');
23:writeln('Harrison');
24:writeln('Cleveland');
25:writeln('McKinley');
26:writeln('Roosevelt');
27:writeln('Taft');
28:writeln('Wilson');
29:writeln('Harding');
30:writeln('Coolidge');
31:writeln('Hoover');
32:writeln('Roosevelt');
33:writeln('Truman');
34:writeln('Eisenhower');
35:writeln('Kennedy');
36:writeln('Johnson');
37:writeln('Nixon');
38:writeln('Ford');
39:writeln('Carter');
40:writeln('Reagan');
end;
end.

program progaA;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
  a: array[1..40] of string;
  x: integer;

begin
//  reset(input, 'input.txt');
//  rewrite(output, 'output.txt');
  a[16] := 'Lincoln';
  a[36] := 'Johnson';
  a[1] := 'Washington';
  a[3] := 'Jefferson';
  a[32] := 'Roosevelt';
  a[7] := 'Jackson';
  a[40] := 'Reagan';
  a[5] := 'Monroe';
  a[10] := 'Tyler';
  a[15] := 'Buchanan';
  a[20] := 'Garfield';
  a[21] := 'Arthur';
  a[29] := 'Harding';
  a[35] := 'Kennedy';
  a[38] := 'Ford';
  a[27] := 'Taft';
  a[31] := 'Hoover';
  a[37] := 'Nixon';
  a[22] := 'Cleveland';
  a[24] := 'Cleveland';
  a[28] := 'Wilson';
  a[34] := 'Eisenhower';
  a[14] := 'Pierce';
  a[17] := 'Johnson';
  a[26] := 'Roosevelt';
  a[30] := 'Coolidge';
  a[39] := 'Carter';
  a[13] := 'Fillmore';
  a[33] := 'Truman';
  a[19] := 'Hayes';
  a[9] := 'Harrison';
  a[11] := 'Polk';
  a[12] := 'Taylor';
  a[18] := 'Grant';
  a[6] := 'Adams';
  a[2] := 'Adams';
  a[25] := 'MacKinley';
  a[23] := 'Harrison';
  a[8] := 'Van Buren';
  a[4] := 'Madison';
  readln(x);
  writeln(a[x]);
end.

program p1;
var i:integer;
begin
read(i);
case i of
1: write('Washington');
2: write('Adams');
3: write('Jefferson');
4: write('Madison');
5: write('Monroe');
6: write('Adams');
7: write('Jackson');
8: write('Van Buren');
9: write('Harrison');
10: write('Tyler');
11: write('K.Polk');
12: write('Taylor');
13: write('Fillmore');
14: write('Pierce');
15: write('Buchanan');
16: write('Lincoln');
17: write('Johnson');
18: write('Grant');
19: write('Hayes');
20: write('Garfield');
21: write('Arthur');
22: write('Cleveland');
23: write('Harrison');
24: write('Cleveland');
25: write('McKinley');
26: write('Roosevelt');
27: write('Howard Taft');
28: write('Wilson');
29: write('Harding');
30: write('Coolidge');
31: write('Hoover');
32: write('Roosevelt');
33: write('Truman');
34: write('Eisenhower');
35: write('Kennedy');
36: write('Johnson');
37: write('Nixon');
38: write('Ford');
39: write('Carter');
40: write('Reagan');
end;
end.

var
 a:longint;
begin
 readln(a);
 if (a=2) or (a=6) then writeln('Adams');
 if a=8 then writeln('Van Buren');
 if a=29 then writeln('Harding');
 if a=1 then writeln('Washington');
 if a=3 then writeln('Jefferson');
 if a=4 then writeln('Madison');
 if a=5 then writeln('Monroe');
 if a=7 then writeln('Jackson');
 if (a=9) or (a=23) then writeln('Harrison');
 if a=10 then writeln('Tyler');
 if a=11 then writeln('Polk');
 if a=12 then writeln('Taylor');
 if a=13 then writeln('Fillmore');
 if a=14 then writeln('Pierce');
 if a=15 then writeln('Buchanan');
 if a=16 then writeln('Lincoln');
 if a=17 then writeln('Johnson');
 if a=18 then writeln('Grant');
 if a=19 then writeln('Hayes');
 if a=20 then writeln('Garfield');
 if a=21 then writeln('Arthur');
 if (a=22) or (a=24) then writeln('Cleveland');
 if a=25 then writeln('McKinley');
 if a=26 then writeln('Roosevelt');
 if a=27 then writeln('Taft');
 if a=28 then writeln('Wilson');
 if a=30 then writeln('Coolidge');
 if a=31 then writeln('Hoover');
end.

const
  a:array[1..40]of string=(
  'Washington','Adams','Jefferson','Madison','Monroe','Adams','Jackson','Van Buren','Harrison','Tyler','Polk','Taylor','Fillmore','Pierce','Buchanan','Lincoln','Johnson','Grant','Hayes','Garfield','Arthur','Cleveland','Harrison','Cleveland','McKinley','Roosevelt','Taft','Wilson','Harding','Coolidge','Hoover','Roosevelt','Truman','Truman','Kennedy','Johnson','Nixon','Ford','Carter','Reagan');
var
  x:longint;
begin
  read(x);
  writeln(a[x]);
end.

var n:integer;
const a:array [1..40] of string =('Washington', 'Adams', 'Jefferson', 'Madison', 'Monroe', 'Adams', 'Jackson', 'Van Buren', 'Harrison', 'Tyler', 'Polk', 'Taylor', 'Fillmore', 'Pierce', 'Buchanan', 'Lincoln', 'Johnson', 'Grant', 'Hayes', 'Garfield', 'Arthur', 'Cleveland', 'Harrison', 'Cleveland', 'McKinley', 'Roosevelt', 'Taft', 'Wilson', 'Harding', 'Coolidge', 'Hoover', 'Roosevelt', 'Truman', 'Eisenhower', 'Kennedy', 'Johnson', 'Nixon', 'Ford', 'Carter', 'Regan');
begin
readln(n);
writeln(a[n]);
end.

var
  a:longint;
begin
  readln(a);
  if a = 1 then writeln('Washington') else
  if a = 2 then writeln('Adams') else
  if a = 3 then writeln('Jefferson') else
  if a = 4 then writeln('Madison') else
  if a = 5 then writeln('Monroe') else
  if a = 6 then writeln('Adams') else
  if a = 7 then writeln('Jackson') else
  if a = 8 then writeln('Van Buren') else
  if a = 9 then writeln('Harrison') else
  if a = 10 then writeln('Tyler') else
  if a = 11 then writeln('Polk') else
  if a = 12 then writeln('Taylor') else
  if a = 13 then writeln('Fillmore') else
  if a = 14 then writeln('Pierce') else
  if a = 15 then writeln('Buchanan') else
  if a = 16 then writeln('Lincoln') else
  if a = 17 then writeln('Johnson') else
  if a = 18 then writeln('Grant') else
  if a = 19 then writeln('Hayes') else
  if a = 20 then writeln('Garfield') else
  if a = 21 then writeln('Arthur') else
  if a = 22 then writeln('Cleveland') else
  if a = 23 then writeln('Harrison') else
  if a = 24 then writeln('Cleveland') else
  if a = 25 then writeln('McKinley') else
  if a = 26 then writeln('Roosevelt') else
  if a = 27 then writeln('Howard Taft') else
  if a = 28 then writeln('Wilson') else
  if a = 29 then writeln('Harding') else
  if a = 30 then writeln('Coolidge') else
  if a = 31 then writeln('Hoover') else
  if a = 32 then writeln('Roosevelet') else
  if a = 33 then writeln('Truman') else
  if a = 34 then writeln('Eisenhower') else
  if a = 35 then writeln('Kennedy') else
  if a = 36 then writeln('Johnson') else
  if a = 37 then writeln('Nixon') else
  if a = 38 then writeln('Ford') else
  if a = 39 then writeln('Carter') else
  if a = 40 then writeln('Reagan');
end.

{$mode delphi}
const a:array[1..44]of string = ('Washington','Adams','Jefferson','Madison','Monroe','Adams','Jackson','Van Buren','Harrison','Tyler','Polk','Taylor','Fillmore','Pierce','Buchanan','Lincoln','Johnson','Grant','Hayes','Garfield','Arthur','Cleveland','Harrison','Cleveland','McKinley','Roosevelt','Howard Taft','Wilson','Harding','Coolidge','Hoover','Roosevelt','Truman','Eisenhower','Kennedy','Johnson','Nixon','Ford','Carter','Reagan','Bush','Clinton','Bush','Obama');
var x:integer;
begin
  read (x);
  writeln (a[x]);
end.

Var st:array [1..40] of string;
    n:longint;
Begin
    st[1]:='Washington';
    st[2]:='Adams';
    st[3]:='Jefferson';
    st[4]:='Madison';
    st[5]:='Monroe';
    st[6]:='Quincy Adams';
    st[7]:='Jackson';
    st[8]:='Van Buren';
    st[9]:='Henry Harrison';
    st[10]:='Tyler';
    st[11]:='Knox Polk';
    st[12]:='Taylor';
    st[13]:='Fillmore';
    st[14]:='Pierce';
    st[15]:='Buchanan';
    st[16]:='Lincoln';
    st[17]:='Johnson';
    st[18]:='Simpson Grant';
    st[19]:='Birchard Hayes';
    st[20]:='Garfield';
    st[21]:='Alan Arthur';
    st[22]:='Cleveland';
    st[23]:='Harrison';
    st[24]:=st[22];
    st[25]:='McKinley';
    st[26]:='Roosevelt';
    st[27]:='Howard Taft';
    st[28]:='Wilson';
    st[29]:='Harding';
    st[30]:='Coolidge';
    st[31]:='Hoover';
    st[32]:='Delano Roosevelt';
    st[33]:='Truman';
    st[34]:='Eisenhower';
    st[35]:='Kennedy';
    st[36]:='Johnson';
    st[37]:='Nixon';
    st[38]:='Ford';
    st[39]:='Carter';
    st[40]:='Reagan';
    readln(n); write(st[n]);
End.

var
        a:longint;
begin
readln(a);
if a=2 then writeln('Adams')
else
if a=8 then writeln('Van Buren')
else
if a=29 then writeln('Harding')
else
writeln('Adams');

end.

var
        a:longint;
begin
readln(a);
if a=2 then writeln('Adams');
if a=8 then writeln('Van Buren');
if a=29 then writeln('Harding');
end.

var
 a:longint;
begin
 readln(a);
 if (a=2) or (a=6) then writeln('Adams');
 if a=8 then writeln('Van Buren');
 if a=29 then writeln('Harding');
 if a=1 then writeln('Washington');
 if a=3 then writeln('Jefferson');
 if a=4 then writeln('Madison');
 if a=5 then writeln('Monroe');
 if a=7 then writeln('Jackson');
 if a=9 then writeln('Harrison');
 if a=10 then writeln('Tyler');
 if a=11 then writeln('Polk');
 if a=12 then writeln('Taylor');
 if a=13 then writeln('Fillmore');
 if a=14 then writeln('Pierce');
 if a=15 then writeln('Buchanan');
 if a=16 then writeln('Lincoln');
 if a=17 then writeln('Johnson');
 if a=18 then writeln('Grant');
 if a=19 then writeln('Hayes');
 if a=20 then writeln('Garfield');
end.

var a,b:longint;s:array[0..99]of ansistring;
Begin
s[1]:='Washington';
s[2]:='Adams';
s[3]:='Jefferson';
s[4]:='Madison';
s[5]:='Monroe';
s[6]:='Quincy Adams';
s[7]:='Jackson';
s[8]:='Van Buren';
s[9]:='Henry Harrison';
s[10]:='Tyler';
s[11]:='Polk';
s[12]:='Taylor';
s[13]:='Fillmore';
s[14]:='Pierce';
s[15]:='Buchanan';
s[16]:='Lincoln';
s[17]:='Johnson';
s[18]:='Grant';
s[19]:='Hayes';
s[20]:='Garfield';
s[21]:='Arthur';
s[22]:='Cleveland';
s[23]:='Harrison';
s[24]:='Cleveland';
s[25]:='McKinley';
s[26]:='Roosevelt';
s[27]:='Taft';
s[28]:='Wilson';
s[29]:='Harding';
s[30]:='Coolidge';
s[31]:='Hoover';
s[32]:='Roosevelt';
s[33]:='Truman';
s[34]:='Eisenhower';
s[35]:='Kennedy';
s[36]:='Johnson';
s[37]:='Nixon';
s[38]:='Ford';
s[39]:='Carter, Jr.';
s[40]:='Reagan';
        read(a);
        writeln(s[a]);
End.

program mystery;

{$APPTYPE CONSOLE}

 var
 a:integer;
begin
readln(a);
case a of
1: writeln('Washington');
2: writeln('Adams');
3: writeln('Jefferson');
4: writeln('Madison');
5: writeln('Monroe');
6: writeln('Quincy Adams');
7: writeln('Jackson');
8: writeln('Van Buren');
9: writeln('Henry Harrison');
10: writeln('Tyler');
11: writeln('K. Polk');
12: writeln('Taylor');
13: writeln('Fillmore');
14: writeln('Pierce');
15: writeln('Buchanan');
16: writeln('Lincoln');
17: writeln('Johnson');
18: writeln('S. Grant');
19: writeln('B. Hayes');
20: writeln('A. Garfield');
21: writeln('A. Arthur');
22: writeln('Cleveland');
23: writeln('Harrison');
24: writeln('Cleveland');
25: writeln('McKinley');
26: writeln('Roosevelt');
27: writeln('Howard Taft');
28: writeln('Wilson');
29: writeln('G. Harding');
30: writeln('Coolidge');
31: writeln('Hoover');
32: writeln('D. Roosevelt');
33: writeln('S. Truman');
34: writeln('D. Eisenhower');
35: writeln('F. Kennedy');
36: writeln('B. Johnson');
37: writeln('Nixon');
38: writeln('Ford');
39: writeln('Carter');
40: writeln('Reagan');
end;
end.

program progaA;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
  a: array[1..40] of string;
  x: integer;

begin
//  reset(input, 'input.txt');
//  rewrite(output, 'output.txt');
  a[16] := 'Lincoln';
  a[36] := 'Johnson';
  a[1] := 'Washington';
  a[3] := 'Jefferson';
  a[32] := 'Roosevelt';
  a[7] := 'Jackson';
  a[40] := 'Reagan';
  a[5] := 'Monroe';
  a[10] := 'Tyler';
  a[15] := 'Buchanan';
  a[20] := 'Garfield';
  a[21] := 'Arthur';
  a[29] := 'Harding';
  a[35] := 'Kennedy';
  a[38] := 'Ford';
  a[27] := 'Taft';
  a[31] := 'Hoover';
  a[37] := 'Nixon';
  a[22] := 'Kleveland';
  a[24] := 'Cleveland';
  a[28] := 'Wilson';
  a[34] := 'Eisenhower';
  a[14] := 'Pierce';
  a[17] := 'Johnson';
  a[26] := 'Roosevelt';
  a[30] := 'Coolidge';
  a[39] := 'Carter';
  a[13] := 'Fillmore';
  a[33] := 'Truman';
  a[19] := 'Hayes';
  a[9] := 'Harrison';
  a[11] := 'Polk';
  a[12] := 'Taylor';
  a[18] := 'Grant';
  a[6] := 'Adams';
  a[2] := 'Adams';
  a[25] := 'McKinley';
  a[23] := 'Harrison';
  a[8] := 'Van Buren';
  a[4] := 'Madison';
  readln(x);
  writeln(a[x]);
end.

const
  a:array[1..40]of string=(
  'Washington','Adams','Jefferson','Madison','Monroe','Adams','Jackson','Van Buren','Harrison','Tyler','Polk','Taylor','Fillmore','Pierce','Buchanan','Lincoln','Johnson','Grant','Hayes','Garfield','Arthur','Cleveland','Harrison','Cleveland','McKinley','Roosevelt','Howard Taft','Wilson','Harding','Coolidge','Hoover','Roosevelt','Truman','Truman','Kennedy','Johnson','Nixon','Ford','Earl Carter','Reagan');
var
  x:longint;
begin
  read(x);
  writeln(a[x]);
end.

var
 a:longint;
begin
 readln(a);
 if (a=2) or (a=6) then writeln('Adams');
 if a=8 then writeln('Van Buren');
 if a=29 then writeln('Harding');
 if a=1 then writeln('Washington');
 if a=3 then writeln('Jefferson');
 if a=4 then writeln('Madison');
 if a=5 then writeln('Monroe');
 if a=7 then writeln('Jackson');
 if (a=9) or (a=23) then writeln('Harrison');
 if a=10 then writeln('Tyler');
 if a=11 then writeln('Polk');
 if a=12 then writeln('Taylor');
 if a=13 then writeln('Fillmore');
 if a=14 then writeln('Pierce');
 if a=15 then writeln('Buchanan');
 if a=16 then writeln('Lincoln');
 if a=17 then writeln('Johnson');
 if a=18 then writeln('Grant');
 if a=19 then writeln('Hayes');
 if a=20 then writeln('Garfield');
 if a=21 then writeln('Arthur');
 if (a=22) or (a=24) then writeln('Cleveland');
 if a=25 then writeln('McKinley');
 if a=26 then writeln('Roosevelt');
 if a=27 then writeln('Taft');
 if a=28 then writeln('Wilson');
end.

var
  a:array[1..40] of string=('Washington','Adams','Jefferson','Madison','Monroe','Adams','Jackson','Van Buren','Harrison','Tyler','Polk','Taylor','Fillmore','Pierce','Buchanan','Lincoln','Johnson','Grant','Hayes','Garfield','Arthur','Cleveland','Harrison','Cleveland','McKinley','Roosevelt','Taft','Wilson','Harding','Coolidge','Hoover','Roosevelt','Truman','Eisenhower','Kennedy','Johnson','Nixon','Ford','Carter','Reagan');
  n,ans,i:longint;
begin
  readln(n);
  ans:=length(a[n-1]);
  for i:= 1 to ans do write(a[n-1][i]);
end.//1

var i,j,n:longint;
    a:array[1..40]of string;
begin
  readln(n);
  for i:=1 to 40 do a[i]:='Adams';
  a[2]:='Adams';
  a[8]:='Van Buren';
  A[29]:='Harding';
  writeln(a[n]);
end.

var     A:      array[1..40]    of      string;
        N:      byte;
begin
        A[1]    := 'Washington';
        A[2]    := 'Adams';
        A[3]    := 'Jefferson';
        A[4]    := 'Madison';
        A[5]    := 'Monroe';
        A[6]    := 'Quincy Adams';
        A[7]    := 'Jackson';
        A[8]    := 'Van Buren';
        A[9]    := 'Henry Harrison';
        A[10]   := 'Tyler';
        A[11]   := 'Knox Polk';
        A[12]   := 'Taylor';
        A[13]   := 'Fillmore';
        A[14]   := 'Pierce';
        A[15]   := 'Buchanan';
        A[16]   := 'Lincoln';
        A[17]   := 'Johnson';
        A[18]   := 'Simpson Grant';
        A[19]   := 'Birchard Hayes';
        A[20]   := 'Garfield';
        A[21]   := 'Alan Arthur';
        A[22]   := 'Cleveland';
        A[23]   := 'Harrison';
        A[24]   := 'Cleveland';
        A[25]   := 'McKinley';
        A[26]   := 'Roosevelt';
        A[27]   := 'Howard Taft';
        A[28]   := 'Wilson';
        A[29]   := 'Gamaliel Harding';
        A[30]   := 'Coolidge';
        A[31]   := 'Hoover';
        A[32]   := 'Delano Roosevelt';
        A[33]   := 'Truman';
        A[34]   := 'Eisenhower';
        A[35]   := 'Kennedy';
        A[36]   := 'Johnson';
        A[37]   := 'Nixon';
        A[38]   := 'Ford';
        A[39]   := 'Carter';
        A[40]   := 'Reagan';
        readln(N);
        writeln(A[N]);
end.

Var st:array [1..40] of string;
    n:longint;
Begin
    st[1]:='Washington';
    st[2]:='Adams';
    st[3]:='Jefferson';
    st[4]:='Madison';
    st[5]:='Monroe';
    st[6]:='Quincy Adams';
    st[7]:='Jackson';
    st[8]:='Van Buren';
    st[9]:='Henry Harrison';
    st[10]:='Tyler';
    st[11]:='Knox Polk';
    st[12]:='Taylor';
    st[13]:='Fillmore';
    st[14]:='Pierce';
    st[15]:='Buchanan';
    st[16]:='Lincoln';
    st[17]:='Johnson';
    st[18]:='Ulysses Grant';
    st[19]:='Birchard Hayes';
    st[20]:='Garfield';
    st[21]:='Alan Arthur';
    st[22]:='Cleveland';
    st[23]:='Harrison';
    st[24]:=st[22];
    st[25]:='McKinley';
    st[26]:='Roosevelt';
    st[27]:='Howard Taft';
    st[28]:='Wilson';
    st[29]:='Harding';
    st[30]:='Coolidge';
    st[31]:='Hoover';
    st[32]:='Delano Roosevelt';
    st[33]:='Truman';
    st[34]:='Eisenhower';
    st[35]:='Kennedy';
    st[36]:='Johnson';
    st[37]:='Nixon';
    st[38]:='Ford';
    st[39]:='Carter';
    st[40]:='Reagan';
    readln(n); write(st[n]);
End.

Const s:array[1..40]of String=('Washington','Adams','Jefferson','Madison','Monroe',
                               'Quincy Adams','Jackson','Van Buren','Harrison','Tyler',
                               'Polk','Taylor','Fillmore','Pierce','Buchanan',
                               'Lincoln','Johnson','Grant','Hayes','Garfield',
                               'Arthur','Cleveland','Harrison','Cleveland','McKinley',
                               'Roosevelt','Taft','Wilson','Harding','Coolidge',
                               'Hoover','Roosevelt','Truman','Eisenhower','Kennedy',
                               'Johnson','Nixon','Ford','Carter','Reagan');
Var a:Integer;
 begin
  ReadLn(a);
  WriteLn(s[a]);
 end.

program Project1;

{$APPTYPE CONSOLE}
{$DEFINE SUBMIT}

uses
  SysUtils;

var
  N: integer;
//  const a: array [1..40] of string = ('Washington', 'Adams', 'Jefferson', 'Madison', 'Monroe', 'Quincy Adams', 'Jackson', 'Van Buren', 'H. Harrison', 'Tyler', 'K. Polk', 'Taylor', 'Fillmore', 'Pierce', 'Buchanan', 'Lincoln', 'Johnson', 'S. Grant', 'B. Hayes', 'A. Garfield', 'A. Arthur', 'Cleveland', 'Harrison', 'Cleveland', 'McKinley', 'Roosevelt', 'Howard Taft', 'Wilson', 'G. Harding', 'Coolidge', 'Hoover', 'D. Roosevelt', 'S. Truman', 'D. Eisenhower', 'F. Kennedy', 'B. Johnson', 'Nixon', 'Ford', 'Carter', 'Reagan');
const a: array [1..40] of string = ('Washington',
'Adams',
'Jefferson',
'Madison',
'Monroe',
'Quincy Adams',
'Jackson',
'Van Buren',
'Henry Harrison',
'Tyler',
'Knox Polk',
'Taylor',
'Fillmore',
'Pierce',
'Buchanan',
'Lincoln',
'Johnson',
'Simpson Grant',
'Birchard Hayes',
'Abram Garfield',
'Alan Arthur',
'Grover Cleveland',
'Harrison',
'Grover Cleveland',
'McKinley',
'Roosevelt, Jr.',
'Howard Taft',
'Woodrow Wilson',
'Gamaliel Harding',
'Calvin Coolidge, Jr.',
'Clark Hoover',
'Delano Roosevelt',
'S. Truman',
'David Eisenhower',
'Fitzgerald Kennedy',
'Baines Johnson',
'Milhous Nixon',
'Rudolph Ford, Jr.',
'Earl "Jimmy" Carter, Jr.',
'Wilson Reagan');
begin
{$IFNDEF SUBMIT}
  Assign(input, 'input.txt');
  Assign(output, 'output.txt');
{$ENDIF}
  ReadLn(N);
  WriteLn(a[n]);
end.

var
 a:longint;
begin
 readln(a);
 if (a=2) or (a=6) then writeln('Adams');
 if a=8 then writeln('Van Buren');
 if a=29 then writeln('Harding');
 if a=1 then writeln('Washington');
 if a=3 then writeln('Jefferson');
 if a=4 then writeln('Madison');
 if a=5 then writeln('Monroe');
 if a=7 then writeln('Jackson');
 if (a=9) or (a=23) then writeln('Harrison');
 if a=10 then writeln('Tyler');
 if a=11 then writeln('Polk');
 if a=12 then writeln('Taylor');
 if a=13 then writeln('Fillmore');
 if a=14 then writeln('Pierce');
 if a=15 then writeln('Buchanan');
 if a=16 then writeln('Lincoln');
 if a=17 then writeln('Johnson');
 if a=18 then writeln('Grant');
 if a=19 then writeln('Hayes');
 if a=20 then writeln('Garfield');
 if a=21 then writeln('Arthur');
 if (a=22) or (a=24) then writeln('Cleveland');
 if a=25 then writeln('McKinley');
 if a=26 then writeln('Roosevelt');
 if a=27 then writeln('Taft');
end.

var c:longint;
    a:array[1..41] of string;
begin
 read(c);
 a[1]:='Washington';
 a[2]:='Adams';
 a[3]:='Jefferson';
 a[4]:='Madison';
 a[5]:='Monroe';
 a[6]:='Quincy Adams';
 a[7]:='Jackson';
 a[8]:='Van Buren';
 a[9]:='Henry Harrison';
 a[10]:='Tyler';

 a[11]:='Knox Polk';
 a[12]:='Taylor';
 a[13]:='Fillmore';
 a[14]:='Pierce';
 a[15]:='Buchanan';
 a[16]:='Lincoln';
 a[17]:='Johnson';
 a[18]:='Grant';
 a[19]:='Birchard Hayes';
 a[20]:='Abram Garfield';

 a[21]:='Alan Arthur';
 a[22]:='Cleveland';
 a[23]:='Harrison';
 a[24]:='Cleveland';
 a[25]:='McKinley';
 a[26]:='Roosevelt';
 a[27]:='Howard Taft';
 a[28]:='Wilson';
 a[29]:='Harding';
 a[30]:='Coolidge';

 a[31]:='Hoover';
 a[32]:='Delano Roosevelt';
 a[33]:='S. Truman';
 a[34]:='D. Eisenhower';
 a[35]:='F. Kennedy';
 a[36]:='Baines Johnson';
 a[37]:='Nixon';
 a[38]:='Ford';
 a[39]:='Carter';
 a[40]:='Reagan';

 write(a[c]);
end.

var
 a:byte;
begin
 read(a);
 case a of
 1:write('Washington');
 2:write('Adams');
 3:write('Jefferson');
 4:write('Madison');
 5:write('Monroe');
 6:write('Quincy Adams');
 7:write('Jackson');
 8:write('Van Buren');
 9:write('Harrison');
  10:write('Tyler');
 11:write('Knox Polk');
 12:write('Taylor');
 13:write('Fillmore');
 14:write('Pierce');
 15:write('Buchanan');
 16:write('Lincoln');
 17:write('Johnson');
 18:write('Grant');
 19:write('Hayes');
 20:write('Garfield');
 21:write('Arthur');
 22:write('Cleveland');
 23:write('Harrison');
 24:write('Cleveland');
 25:write('McKinley');
 26:write('Roosevelt');
 27:write('Howard Taft');
 28:write('Wilson');
 29:write('Harding');
 30:write('Coolidge');
 31:write('Hoover');
 32:write('Roosevelt');
 33:write('Truman');
 34:write('Eisenhower');
 35:write('Kennedy');
 36:write('Johnson');
 37:write('Nixon');
 38:write('Ford');
 39:write('Carter');
 40:write('Reagan');
 end;
End.

Const
        p:array[1..40]of Shortstring=('Washington'       //1
                                      ,'Adams'
                                      ,'Jefferson'
                                      ,'Madison'
                                      ,'Monroe'
                                      ,'Adams'
                                      ,'Jackson'
                                      ,'Van Buren'
                                      ,'Harison'
                                      ,'Tyler'          //10
                                      ,'Polk'
                                      ,'Taylor'
                                      ,'FillMore'
                                      ,'Pierce'
				      ,'Buchanan'
				      ,'Lincoln'
				      ,'Johnson'
				      ,'Grant'
				      ,'Hayes'
				      ,'Garfield'       //20
				      ,'Arthur'
				      ,'Cleveland'
				      ,'Harrison'
				      ,'Cleveland'
				      ,'Mckinley'
				      ,'Roosevelt'
                                      ,'Taft'
				      ,'Wilson'
                                      ,'Harding'
                                      ,'Coolidge'            //30
                                      ,'Hoover'
				      ,'Roosevelt'
				      ,'Truman'
				      ,'Eisenhower'
				      ,'Kennedy'
				      ,'Johnson'
				      ,'Nixon'
				      ,'Ford'
				      ,'Carter'
				      ,'Reagan');

var
        a:longint;
begin
readln(a);
writeln(p[a]);
end.

var
  a:longint;
begin
  readln(a);
  if a = 1 then writeln('Washington') else
  if a = 2 then writeln('Adams') else
  if a = 3 then writeln('Jefferson') else
  if a = 4 then writeln('Madison') else
  if a = 5 then writeln('Monroe') else
  if a = 6 then writeln('Adams') else
  if a = 7 then writeln('Jackson') else
  if a = 8 then writeln('Van Buren') else
  if a = 9 then writeln('Harrison') else
  if a = 10 then writeln('Tyler') else
  if a = 11 then writeln('Polk') else
  if a = 12 then writeln('Taylor') else
  if a = 13 then writeln('Fillmore') else
  if a = 14 then writeln('Pierce') else
  if a = 15 then writeln('Buchanan') else
  if a = 16 then writeln('Lincoln') else
  if a = 17 then writeln('Johnson') else
  if a = 18 then writeln('Grant') else
  if a = 19 then writeln('Hayes') else
  if a = 20 then writeln('Garfield') else
  if a = 21 then writeln('Arthur') else
  if a = 22 then writeln('Cleveland') else
  if a = 23 then writeln('Harrison') else
  if a = 24 then writeln('Cleveland') else
  if a = 25 then writeln('McKinley') else
  if a = 26 then writeln('Roosevelt') else
  if a = 27 then writeln('Taft') else
  if a = 28 then writeln('Wilson') else
  if a = 29 then writeln('Harding') else
  if a = 30 then writeln('Coolidge') else
  if a = 31 then writeln('Hoover') else
  if a = 32 then writeln('Roosevelet') else
  if a = 33 then writeln('S Truman') else
  if a = 34 then writeln('Eisenhower') else
  if a = 35 then writeln('Kennedy') else
  if a = 36 then writeln('Johnson') else
  if a = 37 then writeln('Nixon') else
  if a = 38 then writeln('Ford') else
  if a = 39 then writeln('Carter') else
  if a = 40 then writeln('Reagan');
end.

var
 a:longint;
begin
 readln(a);
 if (a=2) or (a=6) then writeln('Adams');
 if a=8 then writeln('Van Buren');
 if a=29 then writeln('Harding');
 if a=1 then writeln('Washington');
 if a=3 then writeln('Jefferson');
 if a=4 then writeln('Madison');
 if a=5 then writeln('Monroe');
 if a=7 then writeln('Jackson');
 if a=9 then writeln('Harrison');
 if a=10 then writeln('Tyler');
 if a=11 then writeln('Polk');
 if a=12 then writeln('Taylor');
 if a=13 then writeln('Fillmore');
 if a=14 then writeln('Pierce');
end.

program USA;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
   n:integer;
begin
   readln(n);
   if(n=1)then write('Washington')
   else
   if(n=2)then write('Adams')
   else
   if(n=3)then write('Jefferson')
   else
   if(n=4)then write('Madison')
   else
   if(n=5)then write('Monroe')
   else
   if(n=6)then write('Quincy Adams')
   else
   if(n=7)then write('Jackson')
   else
   if(n=8)then write('Van Buren')
   else
   if(n=9)then write('Henry Harrison')
   else
   if(n=10)then write('Tyler')
   else
   if(n=11)then write('Polk')
   else
   if(n=12)then write('Taylor')
   else
   if(n=13)then write('Fillmore')
   else
   if(n=14)then write('Pierce')
   else
   if(n=15)then write('Buchanan')
   else
   if(n=16)then write('Lincoln')
   else
   if(n=17)then write('Johnson')
   else
   if(n=18)then write('Grant')
   else
   if(n=19)then write('Hayes')
   else
   if(n=20)then write('Garfield')
   else
   if(n=21)then write('Arthur')
   else
   if(n=22)then write('Cleveland')
   else
   if(n=23)then write('Harrison')
   else
   if(n=24)then write('Cleveland')
   else
   if(n=25)then write('McKinley')
   else
   if(n=26)then write('Roosevelt')
   else
   if(n=27)then write('Howard Taft')
   else
   if(n=28)then write('Wilson')
   else
   if(n=29)then write('Harding')
   else
   if(n=30)then write('Coolidge')
   else
   if(n=31)then write('Hoover')
   else
   if(n=32)then write('Roosevelt')
   else
   if(n=33)then write('Truman')
   else
   if(n=34)then write('Eisenhower')
   else
   if(n=35)then write('Kennedy')
   else
   if(n=36)then write('Johnson')
   else
   if(n=37)then write('Nixon')
   else
   if(n=38)then write('Ford')
   else
   if(n=39)then write('Carter')
   else
   if(n=40)then write('Reagan');
   readln;readln;
end.

var i,j,n:longint;
    a:array[1..40]of string;
begin
  readln(n);
  a[1]:='Washington';
  a[2]:='Adams';
  A[3]:='Jefferson';
  a[4]:='Madison';
  a[5]:='Monroe';
  a[6]:='Quincy Adams';
  A[7]:='Jackson';
  a[8]:='Van Buren';
  a[9]:='Henry Harrison';
  a[10]:='Tyler';
  a[11]:='Knox Polk';
  a[12]:='Taylor';
  a[13]:='Fillmore';
  a[14]:='Pierce';
  a[15]:='Buchanan';
  a[16]:='Lincoln';
  a[17]:='Johnson';
  a[18]:='Simpson Grant';
  a[19]:='Birchard Hayes';
  a[20]:='Garfield';
  a[21]:='Alan Arthur';
  a[22]:='Cleveland';
  a[23]:='Harrison';
  a[24]:='Cleveland';
  a[25]:='McKinley';
  a[26]:='Roosevelt';
  a[27]:='Howard Taft';
  a[28]:='Wilson';
  a[29]:='Harding';
  a[30]:='Coolidge';
  a[31]:='Hoover';
  a[32]:='Delano Roosevelt';
  a[33]:='Truman';
  a[34]:='David Eisenhower';
  a[35]:='Fitzgerald Kennedy';
  a[36]:='Baines Johnson';
  a[37]:='Nixon';
  a[38]:='Ford';
  a[39]:='Carter';
  a[40]:='Reagan';
  writeln(a[n]);
end.

const
  a:array[1..40]of string=(
  'Washington','Adams','Jefferson','Madison','Monroe','Adams','Jackson','Van Buren','Harrison','Tyler','Polk','Taylor','Fillmore','Pierce','Buchanan','Lincoln','Johnson','Grant','Hayes','Garfield','Arthur','Cleveland','Harrison','Cleveland','McKinley','Roosevelt','Taft','Wilson','Harding','Coolidge','Hoover','Roosevelt','Truman','Truman','Kennedy','Johnson','Nixon','Ford','Carter','Reagan');
var
  x:longint;
begin
  read(x);
  writeln(a[x]);
end.

// By JeeJee
Var n:longint;
    a:array[1..40] of string;
Begin
Readln(n);

   a[1]:= 'Washington';
   a[2]:= 'Adams';
   a[3]:= 'Jefferson';
   a[4]:='Madison';
   a[5]:='Monroe';
   a[6]:='Quincy Adams';
     a[7]:='Jackson';
   a[8]:='Van Buren';
    a[9]:='Henry Harrison';
   a[10]:='Tyler';
     a[11]:='Polk';
    a[12]:='Taylor';
     a[13]:='Fillmore';
   a[14]:='Pierce';
      a[15]:='Buchanan';
    a[16]:='Lincoln';
     a[17]:='Johnson';
     a[18]:='Grant';
 a[19]:='Hayes';
    a[20]:='Garfield';
    a[21]:='Arthur';
     a[22]:='Cleveland';
  a[23]:='Harrison';
     a[24]:='Cleveland';
     a[25]:='Kinley';
a[26]:='Roosevelt';
     a[27]:='Howard Taft';
     a[28]:='Wilson';
    a[29]:='Harding';
     a[30]:='Coolidge';
     a[31]:='Hoover';
    a[32]:='Roosevelt';
    a[33]:='Truman';
     a[34]:='Eisenhower';
     a[35]:='Kennedy';
     a[36]:='Johnson';
     a[37]:='Nixon';
     a[38]:='Ford';
     a[39]:='Carter';
    a[40]:='Reagan';

Writeln(a[n]);
End.

var
        a:longint;
begin
readln(a);
if a=2 then writeln('Adams')
else
if a=8 then writeln('Van Buren')
else
if a=29 then writeln('Harding')
else
writeln('Adams');

end.

var n:integer;
begin
        read(n);
        case (n) of
                1:write('Washington');
                2:write('Adams');
                3:write('Jefferson');
                4:write('Madison');
                5:write('Monroe');
                6:write('Adams');
                7:write('Jackson');
                8:write('Van Buren');
                9:write('Harrison');
                10:write('Tyler');
                11:write('Polk');
                12:write('Taylor');
                13:write('Fillmore');
                14:write('Pierce');
                15:write('Buchanan');
                16:write('Lincoln');
                17:write('Johnson');
                18:write('Grant');
                19:write('Hayes');
                20:write('Garfield');
                21:write('Arthur');
                22:write('Cleveland');
                23:write('Harrison');
                24:write('Cleveland');
                25:write('Mckinley');
                26:write('Roosevelt');
                27:write('Taft');
                28:write('Wilson');
                29:write('Harding');
                30:write('Coolidge');
                31:write('Hoover');
                32:write('Roosevelt');
                33:write('Truman');
                34:write('Eisenhower');
                35:write('Kennedy');
                36:write('Johnson');
                37:write('Nixon');
                38:write('Ford');
                39:write('Carter');
                40:write('Reagan');
                end;
end.

var
        s : array[1..40] of string;
        n : longint;

begin
        readln(n);
        s[1] := 'Washington';
        s[2] := 'Adams';
        s[3] := 'Jefferson';
        s[4] := 'Madison';
        s[5] := 'Monroe';
        s[6] := 'Quincy Adams';
        s[6] := 'Adams';
        s[7] := 'Jackson';
        s[8] := 'Van Buren';
        s[9] := 'Harrison';
        s[10] := 'Tyler';
        s[11] := 'Polk';
        s[12] := 'Taylor';
        s[13] := 'Fillmore';
        s[14] := 'Pierce';
        s[15] := 'Buchanan';
        s[16] := 'Lincoln';
        s[17] := 'Johnson';
        s[18] := 'Grant';
        s[19] := 'Hayes';
        s[20] := 'Garfield';
        s[21] := 'Arthur';
        s[22] := 'Cleveland';
        s[23] := 'Harrison';
        s[24] := 'Cleveland';
        s[25] := 'McKinley';
        s[26] := 'Roosevelt';
        s[27] := 'Howard Taft';
        s[28] := 'Wilson';
        s[29] := 'Harding';
        s[30] := 'Coolidge';
        s[31] := 'Hoover';
        s[32] := 'Roosevelt';
        s[33] := 'Truman';
        s[34] := 'Eisenhower';
        s[35] := 'Kennedy';
        s[36] := 'Johnson';
        s[37] := 'Nixon';
        s[38] := 'Ford';
        s[39] := 'Carter';
        s[40] := 'Reagan';
        writeln(s[n]);
end.

const maxn=100000;
var
n:byte;
BEGIN
readln(n);
if n=1 then write('Washington');
if n=2 then write('Adams');
if n=3 then write('Jefferson');
if n=4 then write('Madison');
if n=5 then write('Monroe');
if n=6 then write('Quincy Adams');
if n=7 then write('Jackson');
if n=8 then write('Van Buren');
if n=9 then write('Henry Harrison');
if n=10 then write('Tyler');
if n=11 then write('Polk');
if n=12 then write('Taylor');
if n=13 then write('Fillmore');
if n=14 then write('Pierce');
if n=15 then write('Buchanan');
if n=16 then write('Lincoln');
if n=17 then write('Johnson');
if n=18 then write('Grant');
if n=19 then write('Hayes');
if n=20 then write('Garfield');
if n=21 then write('Arthur');
if n=22 then write('Cleveland');
if n=23 then write('Harrison');
if n=24 then write('Cleveland');
if n=25 then write('McKinley');
if n=26 then write('Roosevelt');
if n=27 then write('Howard Taft');
if n=28 then write('Wilson');
if n=29 then write('Harding');
if n=30 then write('Coolidge');
if n=31 then write('Hoover');
if n=32 then write('Roosevelt');
if n=33 then write('Truman');
if n=34 then write('Eisenhower');
if n=35 then write('Kennedy');
if n=36 then write('Johnson');
if n=37 then write('Nixon');
if n=38 then write('Ford');
if n=39 then write('Carter');
if n=40 then write('Reagan');
END.

program Project2;

{$APPTYPE CONSOLE}

uses
  SysUtils;
 var
  sum,n,i,j,code,c,max,min,z,x:integer;
  s,y,s1,k,r:string;
  u:char;
  a,b:array[1..4] of integer;
begin
readln(n);
if n=1 then writeln('Washington');
if n=2 then writeln('Adams');
if n=3 then writeln('Jefferson');
if n=4 then writeln('Madison');
if n=5 then writeln('Monroe');
if n=6 then writeln('Adams');
if n=7 then writeln('Jackson');
if n=8 then writeln('Van Buren');
if n=9 then writeln('Harrison');
if n=10 then writeln('Tyler');
if n=11 then writeln('Polk');
if n=12 then writeln('Taylor');
if n=13 then writeln('Fillmore');
if n=14 then writeln('Pierce');
if n=15 then writeln('Buchanan');
if n=16 then writeln('Lincoln');
if n=17 then writeln('Johnson');
if n=18 then writeln('Simpson Grant');
if n=19 then writeln('Hayes');
if n=20 then writeln('Garfield');
if n=21 then writeln('Arthur');
if n=22 then writeln('Cleveland');
if n=23 then writeln('Harrison');
if n=24 then writeln('Grover Cleveland');
if n=25 then writeln('McKinley');
if n=26 then writeln('Roosevelt');
if n=27 then writeln('Howard Taft');
if n=28 then writeln('Wilson');
if n=29 then writeln('Harding');
if n=30 then writeln('Coolidge');
if n=31 then writeln('Clark Hoover');
if n=32 then writeln('Roosevelt');
if n=33 then writeln('Truman');
if n=34 then writeln('Eisenhower');
if n=35 then writeln('Kennedy');
if n=36 then writeln('Johnson');
if n=37 then writeln('Nixon');
if n=38 then writeln('Ford');
if n=39 then writeln('Carter');
if n=40 then writeln('Reagan');

end.

const
	a:array[1..40] of string[30]=('Washington','Adams','Jefferson','Madison','Monroe','Adams','Jackson','VanBuren','Harrison','Tyler','Polk','Taylor','Fillmore','Pierce','Buchanan','Lincoln','Johnson','Grant','Hayes','Garfield','Arthur','Cleveland','Harrison','Cleveland','McKinley','Roosevelt','Taft','Wilson','Harding','Coolidge','Hoover','Roosevelt','Truman','Eisenhower','Kennedy','Johnson','Nixon','Ford','Carter','Reagan');
var
	n:longint;
begin
	read(n);
	write(a[n]);
end.

var
 a:longint;
begin
 readln(a);
 if (a=2) or (a=6) then writeln('Adams');
 if a=8 then writeln('Van Buren');
 if a=29 then writeln('Harding');
 if a=1 then writeln('Washington');
 if a=3 then writeln('Jefferson');
 if a=4 then writeln('Madison');
 if a=5 then writeln('Monroe');
 if a=7 then writeln('Jackson');
 if a=9 then writeln('Harrison');
 if a=10 then writeln('Tyler');
 if a=11 then writeln('Polk');
 if a=12 then writeln('Taylor');
 if a=13 then writeln('Fillmore');
 if a=14 then writeln('Pierce');
 if a=15 then writeln('Buchanan');
 if a=16 then writeln('Lincoln');
 if a=17 then writeln('Johnson');
end.

var
  n:longint;
begin
  readln(n);
  if n=1 then writeln('Washington')
  else if n=2 then writeln('Adams')
  else if n=3 then writeln('Jefferson')
  else if n=4 then writeln('Madison')
  else if n=5 then writeln('Monroe')
  else if n=6 then writeln('Adams')
  else if n=7 then writeln('Jackson')
  else if n=8 then writeln('Van Buren')
  else if n=9 then writeln('Harrison')
  else if n=10 then writeln('Tyler')
  else if n=11 then writeln('Polk')
  else if n=12 then writeln('Taylor')
  else if n=13 then writeln('Fillmore')
  else if n=14 then writeln('Pierce')
  else if n=15 then writeln('Buchanan')
  else if n=16 then writeln('Lincoln')
  else if n=17 then writeln('Johnson')
  else if n=18 then writeln('Grant')
  else if n=19 then writeln('Hayes')
  else if n=20 then writeln('Garfield')
  else if n=21 then writeln('Arthur')
  else if n=22 then writeln('Cleveland')
  else if n=23 then writeln('Harrison')
  else if n=24 then writeln('Cleveland')
  else if n=25 then writeln('McKinley')
  else if n=26 then writeln('Roosevelt')
  else if n=27 then writeln('Taft')
  else if n=28 then writeln('Wilson')
  else if n=29 then writeln('Harding')
  else if n=30 then writeln('Coolidge')
  else if n=31 then writeln('Hoover')
  else if n=32 then writeln('Roosevelt')
  else if n=33 then writeln('Truman')
  else if n=34 then writeln('Eisenhower')
  else if n=35 then writeln('Kennedy')
  else if n=36 then writeln('Johnson')
  else if n=37 then writeln('Nixon')
  else if n=38 then writeln('Ford')
  else if n=39 then writeln('Crankcase')
  else if n=40 then writeln('Reagan');
end.

var
  a:array[1..40] of string=('Washington','Adams','Jefferson','Madison','Monroe','Adams','Jackson','Van Buren','Harrison','Tyler','Polk','Taylor','Fillmore','Pierce','Buchanan','Lincoln','Johnson','Grant','Hayes','Garfield','Arthur','Cleveland','Harrison','Cleveland','McKinley','Roosevelt','Taft','Wilson','Harding','Coolidge','Hoover','Roosevelt','Truman','Eisenhower','Kennedy','Johnson','Nixon','Ford','Carter','Reagan');
  n:longint;
begin
  readln(n);
  writeln(a[n-1]);
end.//1

var a:byte;
begin
    readln(a);
    case a of
        1 : writeln('Washington');
        2 : writeln('Adams');
        3 : writeln('Jefferson');
        4 : writeln('Madison');
        5 : writeln('Monroe');
        6 : writeln('Quincy Adams');
        7 : writeln('Jackson');
        8 : writeln('Van Buren');
        9 : writeln('Henry Harrison');
        10: writeln('Tyler');
        11: writeln('Polk');
        12: writeln('Taylor');
        13: writeln('Fillmore');
        14: writeln('Pierce');
        15: writeln('Buchanan');
        16: writeln('Lincoln');
        17: writeln('Johnson');
        18: writeln('Grant');
        19: writeln('Hayes');
        20: writeln('Garfield');
        21: writeln('Arthur');
        22: writeln('Cleveland');
        23: writeln('Harrison');
        24: writeln('Cleveland');
        25: writeln('McKinley');
        26: writeln('Roosevelt');
        27: writeln('Taft');
        28: writeln('Wilson');
        29: writeln('Harding');
        30: writeln('Coolidge');
        31: writeln('Hoover');
        32: writeln('Roosevelt');
        33: writeln('Truman');
        34: writeln('Eisenhower');
        35: writeln('Kennedy');
        36: writeln('Johnson');
        37: writeln('Nixon');
        38: writeln('Ford');
        39: writeln('Carter');
        40: writeln('Reagan');
    end;
end.

Const s:array[1..40]of String=('Washington','Adams','Jefferson','Madison','Monroe',
                               'Quincy Adams','Jackson','Van Buren','Harrison','Tyler',
                               'Polk','Taylor','Fillmore','Pierce','Buchanan',
                               'Lincoln','Johnson','Grant','Hayes','Garfield',
                               'Arthur','Cleveland','Harrison','Cleveland','McKinley',
                               'Roosevelt','Taft','Wilson','Harding','Coolidge',
                               'Hoover','Roosevelt','Truman','Eisenhower','Kennedy',
                               'Johnson','Nixon','Ford','Carter','Reagan');
Var a:Integer;
 begin
  ReadLn(a);
  WriteLn(s[a]);
 end.

{$mode delphi}
const a:array[1..44]of string = ('Washington','Adams','Jefferson','Madison','Monroe','Quincy Adams','Jackson','Van Buren','Henry Harrison','Tyler','Polk','Taylor','Fillmore','Pierce','Buchanan','Lincoln','Johnson','Grant','Hayes','Garfield','Arthur','Cleveland','Harrison','Cleveland','McKinley','Roosevelt','Taft','Wilson','Harding','Coolidge','Hoover','Roosevelt','Truman','Eisenhower','Kennedy','Johnson','Nixon','Ford','Carter','Reagan','Bush','Clinton','Bush','Obama');
var x:integer;
begin
  read (x);
  writeln (a[x]);
end.

var a:array[1..40] of string=('Washington', 'Adams', 'Jefferson', 'Madison', 'Monroe', 'Adams', 'Jackson', 'Van Buren', 'Harrison', 'Tyler', 'Polk', 'Taylor', 'Fillmore', 'Pierce', 'Buchanan', 'Lincoln', 'Johnson', 'Grant', 'Hayes', 'Garfield', 'Arthur', 'Cleveland', 'Harrison', 'Cleveland', 'McKinley', 'Roosevelt', 'Taft', 'Wilson', 'Harding', 'Coolidge', 'Hoover', 'Roosevelt', 'Truma', 'Eisenhower', 'Kennedy', 'Johnson', 'Nixon', 'Ford', 'Carter', 'Reagan');
i,j,k:longint;
begin
readln(i);
writeln(a[i])
;
end
.

var
        a:longint;
begin
readln(a);
writeln('Iman');
end.

Const
        p:array[1..40]of Shortstring=('Washington'       //1
                                      ,'Adams'
                                      ,'Jeferson'
                                      ,'Madison'
                                      ,'Monroe'
                                      ,'Adams'
                                      ,'Jackson'
                                      ,'Van Buren'
                                      ,'Henry Harison'
                                      ,'Tyler'          //10
                                      ,'Polk'
                                      ,'Taylor'
                                      ,'FillMore'
                                      ,'Pierce'
				      ,'Buchanan'
				      ,'Lincoln'
				      ,'Johnson'
				      ,'Grant'
				      ,'Hayes'
				      ,'Garfield'       //20
				      ,'Arthur'
				      ,'Cleveland'
				      ,'Harrison'
				      ,'Cleveland'
				      ,'McKinley'
				      ,'Roosevelt'
                                      ,'Howard Taft'
				      ,'Wilson'
                                      ,'Harding'
                                      ,'Coolidge'            //30
                                      ,'Hoover'
				      ,'Roosevelt'
				      ,'Truman'
				      ,'Eisenhower'
				      ,'Kennedy'
				      ,'Johnson'
				      ,'Nixon'
				      ,'Ford'
				      ,'Carter'
				      ,'Reagan');

var
        a:longint;
begin
readln(a);
writeln(p[a]);
end.

var
n:longint;
begin
readln(n);
If n=1 then writeln('Washington');
If n=2 then writeln('Adams');
If n=3 then writeln('Jefferson');
If n=4 then writeln('Madison');
IF n=5 then writeln('Monroe');
If n=6 then writeln('Quincy Adams');
If n=7 then writeln('Jackson');
If n=8 then writeln('Van Buren');
If n=9 then writeln('Harrison');
If n=10 then writeln('Tyler');
If n=11 then writeln('Knox Polk');
If n=12 then writeln('Taylor');
If n=13 then writeln('Fillmore');
If n=14 then writeln('Pierce');
If n=15 then writeln('Buchanan');
If n=16 then writeln('Lincoln');
If n=17 then writeln('Johnson');
If n=18 then writeln('Grant');
If n=19 then writeln('Hayes');
If n=20 then writeln('Garfield');
If n=21 then writeln('Arthur');
If n=22 then writeln('Cleveland');
If n=23 then writeln('Harrison');
If n=24 then writeln('Cleveland');
If n=25 then writeln('McKinley');
If n=26 then writeln('Roosevelt');
If n=27 then writeln('Taft');
If n=28 then writeln('Wilson');
if n=29 then writeln('Harding');
if n=30 then writeln('Coolidge');
If n=31 then writeln('Hoover');
if n=32 then writeln('Roosevelt');
if n=33 then writeln('Truman');
if n=34 then writeln('Eisenhower');
if n=35 then writeln('Kennedy');
if n=36 then writeln('Johnson');
if n=37 then writeln('Nixon');
if n=38 then writeln('Ford');
if n=39 then writeln('Carter');
if n=40 then writeln('Reagan');
end.