static void solve ( String a , String b ) {
  int n = a . length ( ) , m = b . length ( ) ;
  int g = gcd ( n , m ) ;
  if ( mul ( a , m / g ) . equalsIgnoreCase ( mul ( b , n / g ) ) ) {
    System . out . println ( mul ( a , m / g ) ) ;
  }
  else {
    System . out . println ( - 1 ) ;
  }
}

static void solve ( String a , String b ) { int n = a . length ( ) , m = b . length ( ) ; int g = gcd ( n , m ) ; if ( mul ( a , m / g ) . equalsIgnoreCase ( mul ( b , n / g ) ) ) { System . out . println ( mul ( a , m / g ) ) ; } else { System . out . println ( - 1 ) ; } }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (type_identifier) name: (identifier)) (formal_parameter type: (type_identifier) 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))) 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: (method_invocation name: (identifier) arguments: (argument_list (identifier) (identifier))))) (if_statement condition: (parenthesized_expression (method_invocation object: (method_invocation name: (identifier) arguments: (argument_list (identifier) (binary_expression left: (identifier) right: (identifier)))) name: (identifier) arguments: (argument_list (method_invocation name: (identifier) arguments: (argument_list (identifier) (binary_expression left: (identifier) right: (identifier))))))) consequence: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (method_invocation name: (identifier) arguments: (argument_list (identifier) (binary_expression left: (identifier) right: (identifier)))))))) alternative: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (unary_expression operand: (decimal_integer_literal)))))))))