[ None for r in [ [ i [ - 1 ] for a in [ [ [ None , [ int ( i ) % 0xff for i in input ( ) . split ( ) ] , input ( ) + ' ' , { '0' : 0 } , '0' , 0 , '' , ] ] ] for i in a if ( i [ 5 ] < len ( i [ 2 ] ) ) and not a. append ( [ [ [ i [ 3 ] . update ( { i [ 4 ] : 0 } ) for _ in [ None ] if i [ 4 ] not in i [ 3 ] ] , [ [ i [ 1 ] [ 1 : ] for _ in [ None ] if i [ 2 ] [ i [ 5 ] ] is ',' ] + [ i [ 1 ] ] ] [ 0 ] [ 0 ] , i [ 2 ] , ( [ [ dict ( [ ( o , i [ 3 ] [ o ] ) for o in i [ 3 ] if o is not i [ 4 ] ] + [ ( i [ 4 ] , ( i [ 3 ] [ i [ 4 ] ] + 1 ) % 0xff ) ] ) for _ in [ None ] if i [ 2 ] [ i [ 5 ] ] is '+' ] + [ dict ( [ ( o , i [ 3 ] [ o ] ) for o in i [ 3 ] if o is not i [ 4 ] ] + [ ( i [ 4 ] , ( i [ 3 ] [ i [ 4 ] ] - 1 ) % 256 ) ] ) for _ in [ None ] if i [ 2 ] [ i [ 5 ] ] is '-' ] + [ dict ( [ ( o , i [ 3 ] [ o ] ) for o in i [ 3 ] if o is not i [ 4 ] ] + [ ( i [ 4 ] , i [ 1 ] [ 0 ] ) ] ) for _ in [ None ] if i [ 2 ] [ i [ 5 ] ] is ',' ] + [ i [ 3 ] ] ] [ 0 ] [ 0 ] ) , ( [ [ str ( int ( i [ 4 ] ) + 1 ) for _ in [ None ] if i [ 2 ] [ i [ 5 ] ] is '>' ] + [ str ( int ( i [ 4 ] ) - 1 ) for _ in [ None ] if i [ 2 ] [ i [ 5 ] ] is '<' ] + [ i [ 4 ] ] ] [ 0 ] [ 0 ] ) , ( [ [ i [ 5 ] + ( [ l for l in range ( 2 , len ( i [ 2 ] ) + 1 ) if ( i [ 2 ] [ i [ 5 ] : ] [ :l ] . count ( '[' ) is i [ 2 ] [ i [ 5 ] : ] [ :l ] . count ( ']' ) ) ] [ 0 ] ) for _ in [ None ] if i [ 2 ] [ i [ 5 ] ] is '[' and not i [ 3 ] [ i [ 4 ] ] ] + [ i [ 5 ] + ( - [ l for l in range ( 2 , len ( i [ 2 ] ) + 1 ) if ( i [ 2 ] [ :i [ 5 ] + 1 ] [ ::- 1 ] [ :l ] . count ( '[' ) is i [ 2 ] [ :i [ 5 ] + 1 ] [ ::- 1 ] [ :l ] . count ( ']' ) ) ] [ 0 ] + 1 ) for _ in [ None ] if i [ 2 ] [ i [ 5 ] ] is ']' and i [ 3 ] [ i [ 4 ] ] ] + [ i [ 5 ] + 1 ] ] [ 0 ] [ 0 ] ) , [ [ i [ 6 ] + chr ( i [ 3 ] [ i [ 4 ] ] ) for _ in [ None ] if i [ 2 ] [ i [ 5 ] ] is '.' ] + [ i [ 6 ] ] ] [ 0 ] [ 0 ] , ] ] [ 0 ] ) ] ] if print ( r [ - 1 ] ) ]

W05vbmUgZm9yIHIgaW5bW2lbLTFdZm9yIGEgaW5bW1tOb25lLFtpbnQoaSklMHhmZiBmb3IgaSBpbiBpbnB1dCgpLnNwbGl0KCldLGlucHV0KCkrJyAnLHsnMCc6MH0sJzAnLDAsJycsXV1dZm9yIGkgaW4gYSBpZihpWzVdPGxlbihpWzJdKSlhbmQgbm90IGEuYXBwZW5kKFtbW2lbM10udXBkYXRlKHtpWzRdOjB9KWZvciBfIGluW05vbmVdaWYgaVs0XW5vdCBpbiBpWzNdXSxbW2lbMV1bMTpdZm9yIF8gaW5bTm9uZV1pZiBpWzJdW2lbNV1daXMnLCddK1tpWzFdXV1bMF1bMF0saVsyXSwoW1tkaWN0KFsobyxpWzNdW29dKWZvciBvIGluIGlbM11pZiBvIGlzIG5vdCBpWzRdXStbKGlbNF0sKGlbM11baVs0XV0rMSklMHhmZildKWZvciBfIGluW05vbmVdaWYgaVsyXVtpWzVdXWlzJysnXStbZGljdChbKG8saVszXVtvXSlmb3IgbyBpbiBpWzNdaWYgbyBpcyBub3QgaVs0XV0rWyhpWzRdLCh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