import std.algorithm;
import std.array;
import std.conv;
import std.math;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

T read(T)() { return readln.chomp.to!T; }
T[] reads(T)() { return readln.split.to!(T[]); }
alias readint = read!int;
alias readints = reads!int;

void main() {
    auto abk = readints;
    int a = abk[0], b = abk[1], k = abk[2];

    for (int i = 0; i < k; i++) {
        if (i % 2 == 0) {
            if (a % 2 == 1) a--;
            b += a / 2;
            a /= 2;
        }
        else {
            if (b % 2 == 1) b--;
            a += b / 2;
            b /= 2;
        }
    }
    writeln(a, " ", b);
}
