Capitalization is writing a word with its first letter as a capital letter. Your task is to capitalize the given word.

Note, that during capitalization all the letters except the first one remains unchanged.
A single line contains a non-empty word. This word consists of lowercase and uppercase English letters. The length of the word will not exceed 10<sup class="upper-index">3</sup>.
t=int(input())
for _ in range(t):
    n=int(input())
    a=list(map(int,input ().split()))
    sm=sum(a)
    q=int(input())
    for _ in range(q):
        s,e,w=map(int,input().split())
        sm=sm+(e-s+1)*w
 print(sm)#df
        
			  	   		 	 	   	  	 	      	