// Need bignumber as we are dealing with VLNs var BigNumber = require('bignumber.js'); function processData(input) { let args = input.split(' '), a = new BigNumber(args[0]), b = new BigNumber(args[1]), time = new BigNumber(args[2]); let base = a.add(b).mul('0.5'); let mod = new BigNumber(Math.pow(10,9) + 7); let colony = power(base, time, mod); console.log(colony.toString()); } function power(base, exp, mod) { let resp = new BigNumber('1'); base = base.mod(mod); while (exp.gt('0')) { if (!exp.mod('2').eq('0')) { resp = resp.mul(base).mod(mod); } exp = exp.divToInt('2'); base = base.mul(base).mod(mod); } return resp; } process.stdin.resume(); process.stdin.setEncoding("ascii"); _input = ""; process.stdin.on("data", function (input) { _input += input; }); process.stdin.on("end", function () { processData(_input); });