import scala.io.StdIn._

import Math._
object Main extends App {
  val Seq(xp1, yp1, xp2, yp2) = readLine.split(' ').map(_.toDouble).toList
  val vx1 = xp2 - xp1
  val vy1 = yp2 - yp1


  val q = readLine.toInt
  for (i <- 0 until q) {
    val Seq(x, y) = readLine.split(' ').map(_.toDouble).toList
    val vx2 = x - xp1
    val vy2 = y - yp1

    val c = (vx1 * vx2 + vy1 * vy2) / (vx1 * vx1 + vy1 * vy1)

    val ux = c * vx1 + xp1
    val uy = c * vy1 + yp1

    println("%.10f %.10f".format(2*ux - x, 2*uy - y))
  }
}

