1 import java.lang.*; 2 import java.util.*; 3 import java.text.*; 4 import java.math.*; 5 import java.io.*; 6 class Main 7 { 8 public static void main(String []args) 9 { 10 int n; 11 BigInteger a1,a2; 12 Scanner cin=new Scanner(System.in); 13 while(cin.hasNext()) 14 { 15 n=cin.nextInt(); 16 while(n--!=0) 17 { 18 a2=BigInteger.valueOf(0); 19 a1=cin.nextBigInteger(); 20 while(a1.compareTo(BigInteger.valueOf(0))!=0) 21 { 22 a2=a2.add(a1); 23 a1=cin.nextBigInteger(); 24 } 25 System.out.println(a2); 26 if(n!=0)System.out.println(); 27 } 28 } 29 } 30 }