#include <stdio.h>
int main(void){
   double a, b, c, d, i1, j1, i2, j2, x1, y1, x2, y2;
   int n;
   scanf("%lf %lf %lf %lf", &a, &b, &c, &d);
   if(a != c && b != d){
       i1 = (d - b)/(c - a);
       j1 = b - i1 * a;
       i2 = -1 / i1;
       scanf("%d", &n);
       for(c = 0; c < n; c++){
           scanf("%lf %lf", &a, &b);
           j2 = b - i2 * a;
           x1 = (j1 - j2)/(i2 - i1);
           y1 = i2 * x1 + j2;
           x2 = 2*x1 - a;
           y2 = 2*y1 - b; 
           printf("%.10f %.10f\n", x2, y2);
       }
    }else if(a == c){
        scanf("%d", &n);
        for(d = 0; d < n; d++){
           scanf("%lf %lf", &a, &b);
           x2 = 2*c - a;
           printf("%.10f %.10f\n", x2, b);
       }
    }else{
        scanf("%d", &n);
        for(c = 0; c < n; c++){
           scanf("%lf %lf", &a, &b);
           y2 = 2*d - b; 
           printf("%.10f %.10f\n", a, y2);
       }
    }
    return 0;
}
