Given a list of integers , and a string of length and with characters ’+’ and ’-’, we need to print the result of summing or subtracting each depending on whether the ’th character of is ’+’ or ’-’.
The input begins with a positive natural number on a first line. On a second line there are integers . Afterwards, there’s a sequence of lines, each with a string of length and characters ’+’ or ’-’.
For each string , the program has to print
Input
8 -15 16 -20 3 -13 -1 -14 12 ++-+-++- ----+-++ ---++++- --+++-+- ++++-+-- +-+-+--+ ---+++-+ -+-+++-+ -+-+--+- +-----++ -+----+- ---++--- +++-+--- +--+++-+ -+++++++ +++-++-+ -++--+-+ ++---+-+ -+-+-+++ +---+-+-
Output
10 2 -18 -56 -2 -40 34 66 42 -2 36 12 -32 4 -2 -10 46 56 64 -52