public static void main ( String [ ] args ) {
  long n = sc . nextLong ( ) ;
  long a = sc . nextLong ( ) % mod ;
  long b = sc . nextLong ( ) % mod ;
  int k = sc . nextInt ( ) ;
  sc . nextLine ( ) ;
  long ar = quickPow ( a , mod - 2 ) ;
  long ans = 0 ;
  long ab = ar * b % mod ;
  long cycle = 0 ;
  long tmp = 1 ;
  long start = quickPow ( a , n ) ;
  String flag = sc . next ( ) ;
  for ( int i = 0 ;
  i < k ;
  i ++ ) {
    if ( flag . charAt ( i ) == '+' ) cycle = ( cycle + tmp + mod ) % mod ;
    else cycle = ( cycle - tmp + mod ) % mod ;
    tmp = tmp * ab % mod ;
  }
  long cx = quickPow ( ab , k ) ;
  ;
}

public static void main ( String [ ] args ) { long n = sc . nextLong ( ) ; long a = sc . nextLong ( ) % mod ; long b = sc . nextLong ( ) % mod ; int k = sc . nextInt ( ) ; sc . nextLine ( ) ; long ar = quickPow ( a , mod - 2 ) ; long ans = 0 ; long ab = ar * b % mod ; long cycle = 0 ; long tmp = 1 ; long start = quickPow ( a , n ) ; String flag = sc . next ( ) ; for ( int i = 0 ; i < k ; i ++ ) { if ( flag . charAt ( i ) == ' + ' ) cycle = ( cycle + tmp + mod ) % mod ; else cycle = ( cycle - tmp + mod ) % mod ; tmp = tmp * ab % mod ; } long cx = quickPow ( ab , k ) ; ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) right: (identifier)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) right: (identifier)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation name: (identifier) arguments: (argument_list (identifier) (binary_expression left: (identifier) right: (decimal_integer_literal)))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (identifier)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation name: (identifier) arguments: (argument_list (identifier) (identifier))))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) right: (character_literal))) consequence: (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (identifier))) right: (identifier)))) alternative: (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (identifier))) right: (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (identifier)))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation name: (identifier) arguments: (argument_list (identifier) (identifier)))))))