program answer
  implicit none

  integer(8) :: N, i, a, b, c, d, e
  character(len=26) :: p
  character, allocatable :: s(:)

  read(*,*) N
  p(1:1)='a'
  p(2:2)='b'
  p(3:3)='c'
  p(4:4)='d'
  p(5:5)='e'
  p(6:6)='f'
  p(7:7)='g'
  p(8:8)='h'
  p(9:9)='i'
  p(10:10)='j'
  p(11:11)='k'
  p(12:12)='l'
  p(13:13)='m'
  p(14:14)='n'
  p(15:15)='o'
  p(16:16)='p'
  p(17:17)='q'
  p(18:18)='r'
  p(19:19)='s'
  p(20:20)='t'
  p(21:21)='u'
  p(22:22)='v'
  p(23:23)='w'
  p(24:24)='x'
  p(25:25)='y'
  p(26:26)='z'

  if(N<=26) then
     write(*,*) p(i:i)
  end if

  do i =1, 10
     if(N>26**i.and.N<26**(i+1)) then
        allocate(s(i+1))
        b=i
        exit
     end if
  end do

  do i = b, 0, -1
  c= mod(N,26**i)
  d=(N-c)/26
  s((i+1):(i+1))=p(d+1:d+1)
  N=c
  if(i==1) then
     s(1:1)=p(c:c)
     exit
  end if
  end do

  write(*,*) s
 stop
end program answer
