import std.stdio, std.algorithm, std.array, std.string, std.conv;

void main() {
    long a,b,k;
    readf("%d %d %d\n",&a,&b,&k);

    foreach (i; 0..k) {
        if (i % 2 == 0) {
            if (a & 1) {
                a--;
            }
            b += a/2;
            a /= 2;
        }
        else {
            if (b & 1) {
                b--;
            }
            a += b/2;
            b /= 2;
        }
    }
    writeln(a, " ", b);
}