#include<bits/stdc++.h>

using namespace std;

typedef complex<double> P;

P reflection(P a,P b,P c)
{
    b-=a;c-=a;
    return a+2.0*b*real(c/b)-c;
}

int main()
{
    double x1,y1,x2,y2;
    cin>>x1>>y1>>x2>>y2;

    int q;
    cin>>q;
    while(q--)
    {
        double x,y;
        cin>>x>>y;
        P p=reflection(P(x1,y1),P(x2,y2),P(x,y));
        cout<<fixed<<setprecision(10)<<p.real()<<" "<<p.imag()<<endl;
    }

    return 0;
}


