Print the new string
for i in range ( n ) : NEW_LINE INDENT if ( str [ i ] == str [ n - 1 ] ) : NEW_LINE INDENT print ( ' ) ' , end = " " ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( ' ( ' , end = " " ) NEW_LINE DEDENT DEDENT return NEW_LINE else : NEW_LINE for i in range ( n ) : NEW_LINE