function Main(input) {
	var a = Number(input.split(" ")[0]);
	var b = Number(input.split(" ")[1]);
	var c = Number(input.split(" ")[2]);
	var k = Number(input.split(" ")[3]);
	
	if(a == b && a == c){
		console.log(0);
		return;
	}
	
	var ret = b - a;
	if(k == 0 || k % 2 != 1){
		ret = a - b;
	}
	if(Math.abs(ret) >= Math.pow(10,18)){
		console.log('Unfair');
	} else {
		console.log(ret);
	}
	
	return ;
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));