import java.io._
import scala.io.StdIn.{readLine, readInt}

object Main {
  val out:BufferedWriter =
    new BufferedWriter(new OutputStreamWriter(new FileOutputStream(java.io.FileDescriptor.out), "ASCII"), \
512)
  var count = 0

  def toZero(x:Double) = if(x == -0.0) 0.0 else x
  def main(args:Array[String]) = {
   val p = readLine.split(" ").map(_.toDouble)
   val n = readInt
   val (x0,y0,x1,y1) = (p(0),p(1),p(2),p(3))

   val (x,y) = (x1-x0, y1-y0)
   val sqrt = Math.pow(x,2) + Math.pow(y,2)
   val a = 2*x*x/sqrt
   val b = 2*x*y/sqrt
   val c = 2*y*y/sqrt

   for(i<-0 until n) {
     val p1 = readLine.split(" ").map(_.toDouble)
     val (x2,y2) = (p1(0),p1(1))
     val (w,z) = (p1(0)-x0, p1(1)-y0)
     val (xt,yt) = ( a*w+b*z+2*x0-x2, b*w+c*z+2*y0-y2 )

     out.write(toZero(xt).toString)
     out.write(" ")
     out.write(toZero(yt).toString)
     out.write("\n")
     if(count<100) count += 1
     else {
      out.flush
      count = 0
     }
   }
   out.flush
   out.close
  }
}