public static void main ( String [ ] args ) {
  long n = 3 ;
  long x = ( power ( 3 , n ) % p + 1 ) % p ;
  x = ( x - power ( 2 , n + 1 ) + p ) % p ;
  x = ( x * power ( 2 , p - 2 ) ) % p ;
  System . out . println ( x ) ;
}

public static void main ( String [ ] args ) { long n = 3 ; long x = ( power ( 3 , n ) % p + 1 ) % p ; x = ( x - power ( 2 , n + 1 ) + p ) % p ; x = ( x * power ( 2 , p - 2 ) ) % p ; System . out . println ( x ) ; }
(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: (decimal_integer_literal))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (parenthesized_expression (binary_expression left: (binary_expression left: (method_invocation name: (identifier) arguments: (argument_list (decimal_integer_literal) (identifier))) right: (identifier)) right: (decimal_integer_literal))) right: (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (method_invocation name: (identifier) arguments: (argument_list (decimal_integer_literal) (binary_expression left: (identifier) right: (decimal_integer_literal))))) right: (identifier))) right: (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (method_invocation name: (identifier) arguments: (argument_list (decimal_integer_literal) (binary_expression left: (identifier) right: (decimal_integer_literal)))))) right: (identifier)))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (identifier))))))