#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
template<class T> ostream& operator<<(ostream& os, const vector<T>& vec) { for (auto &vi: vec) os << vi << " "; return os; }

int main() {
    vector<int> ab(2);
    for (auto &abi: ab) cin >> abi;
    int k; cin >> k;
    for (int i = 0; i < k; i++) {
        ab[(i & 1) ^ 1] += ab[i & 1] >>= 1;
    }
    cout << ab << endl;
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
int main()
{
    int n, a;
    cin >> n;
    vector<int> v;
    for (int i = 0; i < n; i++)
    {
        cin >> a;
        v.push_back(a);
    }
    reverse(v.begin(), v.end());
    for (int i = 0; i < n - 1; i++)
    {
        cout << v[i] << " ";
    }
    cout << v[n - 1] << endl;
}
