If Give an integer N . Write a program to obtain the sum of the first and last digits of this number.

-----Input-----

The first line contains an integer T, the total number of test cases. Then follow T lines, each line contains an integer N. 

-----Output-----
For each test case, display the sum of first and last digits of N in a new line.

-----Constraints-----
- 1 ≤ T ≤ 1000
- 1 ≤ N ≤ 1000000

-----Example-----
Input
3 
1234
124894
242323

Output
5
5
5

Difficulty: interview

Starter code:

Solutions:
n = int(input())
for i in range(n):
    s = input()
    l = len(s)
    n1 = int(s[0])
    n2 = int(s[l-1])
    print(n1+n2)


try:
    # cook your dish here
    for _ in range(int(input())):
        s=str(input())
        print(int(s[0])+int(s[-1]))
except:
    pass

# cook your dish here
for _ in range(int(input())):
    num= input().strip()
    print(int(num[0])+int(num[-1]))

t=eval(input())
for i in range(t):
    n=eval(input())
    rem=[]
    while(n>0):
        r=n%10
        rem.append(r)
        n=n//10
    print(rem[-1]+rem[0])
        


# cook your dish here
def sm (b):
    v=0;
    v=b%10
    c=0
    while (b!=0):
        c=b%10
        b=b//10
    return(v+c)
n=int(input())
a=[]
for i in range (0,n):
    no=int(input())
    a.append(no)
for i in range (0,n):
    print(sm(a[i]))

# cook your dish here
for _ in range(int(input())):
    s=str(input())
    print(int(s[0])+int(s[-1]))

a=int(input(""))
A=[]
for m in range(a):
    x=int(input(""))
    A.append(x)
for m in range(a):
    b=str(A[m])
    c=int(b[0])+int(b[(len(b)-1)])
    print(c)

# cook your dish here
n = int(input())
while n>0:
    s = input()
    print(int(s[0])+int(s[(len(s)-1)]))
    n = n-1

n=int(input())
for i in range(n):
    k=list(input())
    print(int(k[0])+int(k[len(k)-1]))

# cook your dish here
for _ in range(int(input())):

 n=str(input())
 print(int(n[0])+int(n[-1]))

# cook your dish here
T=int(input())
for i in range(T):
    a=input()
    m=a[0]
    n=a[-1]

    print(int(m)+int(n))

# cook your dish here
t = int(input())
for i in range(t):
    n = input()
    print(int(n[0]) + int(n[-1]))

# cook your dish here
t = int(input())
for i in range(t):
    n = input()
    print(int(n[0]) + int(n[-1]))

n=int(input())
mylist=[]
while n>0:
    num=input()
    first=num[0]
    last=num[-1]
    first=int(first)
    last=int(last)
    sum=first+last
    mylist.append(sum)
    sum=0
    n=n-1
for i in mylist:
    print(i)

    
        



# cook your dish here
t = int(input())
for i in range(t):
    n = input()
    print(int(n[0]) + int(n[-1]))

# cook your dish here
t = int(input())
for i in range(t):
    n = input()
    print(int(n[0]) + int(n[-1]))

# cook your dish here
t= int(input())
while t:
    t-=1
    n = input()
    print(int(n[0])+int(n[-1]))

t=int(input())
for i in range(t):
    n=int(input())
    a=n%10
    while(n>=10):
        n=n/10
    b=int(n)
    print(a+b)


for _ in range (int(input())):
    s = input()
    sum1 = int(s[0]) + int(s[-1])
    print(sum1)


# cook your dish here
t = int(input())
for i in range(t):
    n = input()
    print(int(n[0]) + int(n[-1]))

# cook your dish here
t=int(input())
for i in range(0,t):
    x=input()
    a=x[0]
    b=x[-1]
    sum=int(a)+int(b)
    print(sum)