program sample
    implicit none
  
    integer(8) :: i,j,m,n,a,b,k
    integer(8),allocatable :: x(:),y(:)
  
    read(*,*) a,b,k
    do i=1,k/2
        b=b+a/2
        a=a/2+b/2
        b=b/2
    end do
    if(mod(k,2)==1)then
        b=b+a/2
        a=a/2
    end if
  
    write(*,*) a,b
  
    stop
end program sample
  

