#!/usr/bin/ruby
# encoding: utf-8

A,B,$K = gets.split.map(&:to_i)

$taka = A
$aoki = B

def taka_ope
  if $taka.odd? then
    $taka -= 1
  end
  $aoki += $taka/2
  $taka = $taka/2
end

def aoki_ope 
  if $aoki.odd? then
    $aoki -= 1
  end
  $taka += $aoki/2
  $aoki = $aoki/2
end

if $K.even? then
  $K = $K/2
  $K.times do 
    taka_ope
    aoki_ope
  end
else
  $K = $K/2
  $K.times do 
    taka_ope
    aoki_ope
  end
  taka_ope
end

puts "#{$taka} #{$aoki}"
