public static void main ( String [ ] args ) throws IOException {
  Scanner sc = new Scanner ( new BufferedReader ( new InputStreamReader ( new FileInputStream ( "src/D-large.in" ) ) ) ) ;
  String output = "" ;
  int t = sc . nextInt ( ) ;
  for ( int i = 1 ;
  i <= t ;
  i ++ ) {
    int k = sc . nextInt ( ) ;
    int c = sc . nextInt ( ) ;
    int s = sc . nextInt ( ) ;
    if ( s * c < k ) {
      output += "Case #" + i + ": IMPOSSIBLE\n" ;
      continue ;
    }
    ArrayList < Long > nums = new ArrayList < Long > ( ) ;
    for ( int j = 0 ;
    j < s ;
    j ++ ) {
      if ( j * c >= k ) break ;
      long next = 0 ;
      long mult = 1 ;
      for ( int m = 0 ;
      m < c ;
      m ++ ) {
        if ( j * c + m >= k ) break ;
        next += ( j * c + m ) * mult ;
        mult *= k ;
      }
      next ++ ;
      nums . add ( next ) ;
    }
    String toAdd = "" ;
    for ( int j = 0 ;
    j < nums . size ( ) ;
    j ++ ) {
      toAdd += " " + nums . get ( j ) ;
    }
    output += "Case #" + i + ":" + toAdd + "\n" ;
  }
  BufferedWriter bw = new BufferedWriter ( new OutputStreamWriter ( new FileOutputStream ( "src/D-large.out" ) , "utf-8" ) ) ;
  bw . write ( output ) ;
  bw . close ( ) ;
}

public static void main ( String [ ] args ) throws IOException { Scanner sc = new Scanner ( new BufferedReader ( new InputStreamReader ( new FileInputStream ( " src / D - large . in " ) ) ) ) ; String output = " " ; int t = sc . nextInt ( ) ; for ( int i = 1 ; i <= t ; i ++ ) { int k = sc . nextInt ( ) ; int c = sc . nextInt ( ) ; int s = sc . nextInt ( ) ; if ( s * c < k ) { output += " Case ▁ # " + i + " : ▁ IMPOSSIBLE \n " ; continue ; } ArrayList < Long > nums = new ArrayList < Long > ( ) ; for ( int j = 0 ; j < s ; j ++ ) { if ( j * c >= k ) break ; long next = 0 ; long mult = 1 ; for ( int m = 0 ; m < c ; m ++ ) { if ( j * c + m >= k ) break ; next += ( j * c + m ) * mult ; mult *= k ; } next ++ ; nums . add ( next ) ; } String toAdd = " " ; for ( int j = 0 ; j < nums . size ( ) ; j ++ ) { toAdd += " ▁ " + nums . get ( j ) ; } output += " Case ▁ # " + i + " : " + toAdd + " \n " ; } BufferedWriter bw = new BufferedWriter ( new OutputStreamWriter ( new FileOutputStream ( " src / D - large . out " ) , " utf - 8" ) ) ; bw . write ( output ) ; bw . close ( ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) (throws (type_identifier)) body: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list (object_creation_expression type: (type_identifier) arguments: (argument_list (object_creation_expression type: (type_identifier) arguments: (argument_list (object_creation_expression type: (type_identifier) arguments: (argument_list (string_literal))))))))))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (string_literal))) (local_variable_declaration type: (integral_type) 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 (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: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (identifier))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (binary_expression left: (string_literal) right: (identifier)) right: (string_literal)))) (continue_statement))) (local_variable_declaration type: (generic_type (type_identifier) (type_arguments (type_identifier))) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (generic_type (type_identifier) (type_arguments (type_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: (binary_expression left: (identifier) right: (identifier)) right: (identifier))) consequence: (break_statement)) (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))) (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: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (identifier)) right: (identifier))) consequence: (break_statement)) (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: (identifier))))) (expression_statement (update_expression (identifier))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (string_literal))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) update: (update_expression (identifier)) body: (block (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (string_literal) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))))))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (binary_expression left: (binary_expression left: (binary_expression left: (string_literal) right: (identifier)) right: (string_literal)) right: (identifier)) right: (string_literal)))))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list (object_creation_expression type: (type_identifier) arguments: (argument_list (object_creation_expression type: (type_identifier) arguments: (argument_list (string_literal))) (string_literal))))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))