output_description: For each query, print the coordinates of the cross points in the following
  rules.
  
    * If there is one cross point, print two coordinates with the same values.
    * Print the coordinate with smaller $x$ first. In case of a tie, print the coordinate with smaller $y$ first.
  
  The output values should be in a decimal fraction with an error less than
  0.000001.
input_description: The input is given in the following format.
  
  $cx\; cy\; r$  
  $q$  
  $Line_1$  
  $Line_2$  
  :  
  $Line_q$  
  
  In the first line, the center coordinate of the circle and its radius are
  given by $cx$, $cy$ and $r$. In the second line, the number of queries $q$ is
  given.
  
  In the following $q$ lines, as queries, $Line_i$ are given ($1 \leq i \leq q$)
  in the following format.
  
  $x_1\; y_1\; x_2\; y_2$
  
  Each line is represented by two points $p1$ and $p2$ which the line crosses.
  The coordinate of $p1$ and $p2$ are given by ($x1$, $y1$) and ($x2$, $y2$)
  respectively. All input values are given in integers.
attempt: from sys import stdin
  import math
  
  
  class Vector:
      def __init__(self, x=None, y=None):
          self.x = x
          self.y = y
  
      def __add__(self, other):
          return Vector(self.x + other.x, self.y + other.y)
  
      def __sub__(self, other):
          return Vector(self.x - other.x, self.y - other.y)
  
      def __mul__(self, k):
          return Vector(self.x * k, self.y * k)
  
      def __truediv__(self, k):
          return Vector(self.x / k, self.y / k)
  
      def __gt__(self, other):
          return self.x > other.x and self.y > other.yb
  
      def __lt__(self, other):
          return self.x < other.x and self.y < other.yb
  
      def __eq__(self, other):
          return self.x == other.x and self.y == other.y
  
      def dot(self, other):
          return self.x * other.x + self.y * other.y
  
      # usually cross operation return Vector but it returns scalor
      def cross(self, other):
          return self.x * other.y - self.y * other.x
  
      def norm(self):
          return self.x * self.x + self.y * self.y
  
      def abs(self):
          return math.sqrt(self.norm())
  
  
  class Point(Vector):
      def __init__(self, *args, **kargs):
          return super().__init__(*args, **kargs)
  
  
  class Segment:
      def __init__(self, p1=Point(0, 0), p2=Point(1, 1)):
          self.p1 = p1
          self.p2 = p2
  
  
  class Line(Segment):
      def __init__(self, *args, **kargs):
          return super().__init__(*args, **kargs)
  
  
  class Circle:
      def __init__(self, c=Point(0, 0), r=1):
          self.c = c
          self.r = r
  
  
  def project(s, p):
      base = s.p2 - s.p1
      hypo = p - s.p1
      r = hypo.dot(base) / base.norm()
      return s.p1 + base * r
  
  
  def get_cross_point(c, l):
      pr = project(l, c.c)
      e = (l.p1 - l.p2) / (l.p2 - l.p1).abs()
      base = math.sqrt(c.r * c.r - (pr - c.c).norm())
      return pr + e * base, pr - e * base
  
  
  def read_and_print_results(n, c):
      for _ in range(n):
          line = stdin.readline().strip().split()
          p0 = Vector(int(line[0]), int(line[1]))
          p1 = Vector(int(line[2]), int(line[3]))
          l = Line(p0, p1)
          p2, p3 = get_cross_point(c, l)
          print("{0:0.8f} {1:0.8f} {2:0.8f} {3:0.8f}".format(p2.x, p2.y, p3.x, p3.y))
  
  
  x, y, r = [int(i) for i in input().split()]
  c = Circle(Point(x, y), r)
  n = int(input())
  read_and_print_results(n, c)
  
problem_description: Cross Points of a Circe and a Line
  
  For given a circle $c$ and a line $l$, print the coordinates of the cross
  points of them.
samples: [{"input": "and Output\n\n  \n\n## Sample Input\n\n    \n    \n    2 1 1\n    2\n    0 1 4 1\n    3 0 3 3", "output": ".00000000 1.00000000 3.00000000 1.00000000\n    3.00000000 1.00000000 3.00000000 1.00000000"}]