#include <stdio.h>

int main() {
    double xp1, yp1, xp2, yp2, xp, yp;
    int q;
    scanf("%lf%lf%lf%lf", &xp1, &yp1, &xp2, &yp2);
    scanf("%d", &q);
    while(q--) {
        scanf("%lf%lf", &xp, &yp);
        double a = ((xp2-xp1)*(xp-xp1)+(yp2-yp1)*(yp-yp1))/((xp2-xp1)*(xp2-xp1)+(yp2-yp1)*(yp2-yp1));
        printf("%.10lf %.10lf\n", 2*a*xp2+(2-2*a)*xp1-xp, 2*a*yp2+(2-2*a)*yp1-yp);
    }
}

