import java.io.*;
import java.util.*;
class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st= new StringTokenizer(br.readLine());
int Jinwoo = Integer.parseInt(st.nextToken());
int Sunwoo = Integer.parseInt(st.nextToken());
st= new StringTokenizer(br.readLine());
int Dday = Integer.parseInt(st.nextToken());
for(int i=1; i<= Dday; i++){
//홀수 날에는 진우가 선우한테 식량을 줌
if(i%2!=0){
//가마니가 홀수일때
if(Jinwoo%2!=0){
Jinwoo/=2;
Sunwoo+=Jinwoo+1;
}else{
Jinwoo/=2;
Sunwoo+=Jinwoo;
}
}else{ //짝수날에는 선우가 진우한테 식량을 줌
//가마니가 홀수일때
if(Jinwoo%2!=0){
Sunwoo/=2;
Jinwoo+=Sunwoo+1;
}else{
Sunwoo/=2;
Jinwoo+=Sunwoo;
}
}
}
System.out.println(Jinwoo+" "+Sunwoo);
}
}