import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { public static void main(String[] args) { BigDecimal probability = BigDecimal.valueOf(0.5F); Scanner s = new Scanner(System.in); BigDecimal a = s.nextBigDecimal(); BigDecimal b = s.nextBigDecimal(); BigDecimal t = s.nextBigDecimal(); BigDecimal resultPart1 = a.multiply(probability).multiply(t); BigDecimal resultPart2 = b.multiply(probability).multiply(t); BigDecimal result = resultPart1.add(resultPart2); result = result.remainder(BigDecimal.valueOf(10^9 + 3)); System.out.println(result.intValue()); } }