import java.math.*;
import java.util.*;
import java.io.*;

public class Main {
    public static void main(String[] args)
    {
        Scanner cin = new Scanner(new BufferedInputStream(System.in));
        BigInteger a,b,c,d;
        while ( cin.hasNext() )
        {
            a = cin.nextBigInteger();
            b = cin.nextBigInteger();
            c = cin.nextBigInteger();
            d = BigInteger.valueOf(0);
            for (int i = 3; i <= 99; i++)
            {
                if ( i % 4 == 3 )
                    d = a.add(b.add(c));
                else if ( i % 4 == 0 )
                    a = b.add(c.add(d));
                else if ( i % 4 == 1 )
                    b = c.add(d.add(a));
                else
                    c = d.add(a.add(b));
            }
            System.out.println(d);
        }
    }
}

 

posted on 2013-05-02 13:01  Sinker  阅读(117)  评论(0编辑  收藏  举报