public static void main ( String [ ] args ) throws IOException {
  BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ;
  StringTokenizer st = new StringTokenizer ( br . readLine ( ) ) ;
  PrintWriter pw = new PrintWriter ( System . out ) ;
  double a = Double . parseDouble ( st . nextToken ( ) ) ;
  double d = Double . parseDouble ( st . nextToken ( ) ) % ( a * 4.0 ) ;
  int n = Integer . parseInt ( br . readLine ( ) ) ;
  int curEdge = 1 ;
  double x = 0.0 , y = 0.0 , dRemaining ;
  for ( int i = 0 ;
  i < n ;
  i ++ ) {
    dRemaining = d ;
    while ( true ) {
      if ( curEdge == 1 ) {
        if ( x + dRemaining > a ) {
          dRemaining -= a - x ;
          curEdge ++ ;
          x = a ;
        }
        else {
          x += dRemaining ;
          break ;
        }
      }
      else if ( curEdge == 2 ) {
        if ( y + dRemaining > a ) {
          dRemaining -= a - y ;
          curEdge ++ ;
          y = a ;
        }
        else {
          y += dRemaining ;
          break ;
        }
      }
      else if ( curEdge == 3 ) {
        if ( x < dRemaining ) {
          dRemaining -= x ;
          curEdge ++ ;
          x = 0.0 ;
        }
        else {
          x -= dRemaining ;
          break ;
        }
      }
      else {
        if ( y < dRemaining ) {
          dRemaining -= y ;
          curEdge = 1 ;
          y = 0.0 ;
        }
        else {
          y -= dRemaining ;
          break ;
        }
      }
    }
    pw . println ( x + " " + y ) ;
  }
  pw . flush ( ) ;
  pw . close ( ) ;
}

public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringTokenizer st = new StringTokenizer ( br . readLine ( ) ) ; PrintWriter pw = new PrintWriter ( System . out ) ; double a = Double . parseDouble ( st . nextToken ( ) ) ; double d = Double . parseDouble ( st . nextToken ( ) ) % ( a * 4.0 ) ; int n = Integer . parseInt ( br . readLine ( ) ) ; int curEdge = 1 ; double x = 0.0 , y = 0.0 , dRemaining ; for ( int i = 0 ; i < n ; i ++ ) { dRemaining = d ; while ( true ) { if ( curEdge == 1 ) { if ( x + dRemaining > a ) { dRemaining -= a - x ; curEdge ++ ; x = a ; } else { x += dRemaining ; break ; } } else if ( curEdge == 2 ) { if ( y + dRemaining > a ) { dRemaining -= a - y ; curEdge ++ ; y = a ; } else { y += dRemaining ; break ; } } else if ( curEdge == 3 ) { if ( x < dRemaining ) { dRemaining -= x ; curEdge ++ ; x = 0.0 ; } else { x -= dRemaining ; break ; } } else { if ( y < dRemaining ) { dRemaining -= y ; curEdge = 1 ; y = 0.0 ; } else { y -= dRemaining ; break ; } } } pw . println ( x + " ▁ " + y ) ; } pw . flush ( ) ; pw . 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 (field_access object: (identifier) field: (identifier)))))))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list (field_access object: (identifier) field: (identifier)))))) (local_variable_declaration type: (floating_point_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))) (local_variable_declaration type: (floating_point_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) right: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_floating_point_literal)))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (local_variable_declaration type: (floating_point_type) declarator: (variable_declarator name: (identifier) value: (decimal_floating_point_literal)) declarator: (variable_declarator name: (identifier) value: (decimal_floating_point_literal)) declarator: (variable_declarator name: (identifier))) (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 (expression_statement (assignment_expression left: (identifier) right: (identifier))) (while_statement condition: (parenthesized_expression (true)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (block (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: (identifier) right: (identifier)))) (expression_statement (update_expression (identifier))) (expression_statement (assignment_expression left: (identifier) right: (identifier)))) alternative: (block (expression_statement (assignment_expression left: (identifier) right: (identifier))) (break_statement)))) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (block (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: (identifier) right: (identifier)))) (expression_statement (update_expression (identifier))) (expression_statement (assignment_expression left: (identifier) right: (identifier)))) alternative: (block (expression_statement (assignment_expression left: (identifier) right: (identifier))) (break_statement)))) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (identifier))) (expression_statement (update_expression (identifier))) (expression_statement (assignment_expression left: (identifier) right: (decimal_floating_point_literal)))) alternative: (block (expression_statement (assignment_expression left: (identifier) right: (identifier))) (break_statement)))) alternative: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal))) (expression_statement (assignment_expression left: (identifier) right: (decimal_floating_point_literal)))) alternative: (block (expression_statement (assignment_expression left: (identifier) right: (identifier))) (break_statement))))))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (binary_expression left: (identifier) right: (string_literal)) right: (identifier))))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))