#include<bits/stdc++.h>
using namespace std;
#define ALL(x) x.begin(),x.end()
#define rep(i,n) for(int i=0;i<n;i++)
#define debug(v) cout<<#v<<":";for(auto x:v){cout<<x<<' ';}cout<<endl;
#define INF 1000000000
#define mod 1000000007
typedef long long ll;
const ll LINF = 1001002003004005006ll;
int dx[]={1,0,-1,0};
int dy[]={0,1,0,-1};
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
 
//幾何だいっきらい
 
using Real=long double;
using Point=complex<Real>;
const Real EPS=1e-10;
const Real pi=acosl(-1);
 
inline bool eq(Real a,Real b){
   return fabs(a-b)<EPS;
}
 
Point operator*(const Point &p,const Real &d){
   return Point(real(p)*d,imag(p)*d);
}

// 点 p を反時計回りに theta 回転
Point rotate(Real theta, const Point &p) {
 return Point(cos(theta)*p.real()-sin(theta)*p.imag(),sin(theta)*p.real()+cos(theta)*p.imag());
}


Real radian_to_degree(Real r){
   return r*180.0/pi;
}

Real degree_to_radian(Real d){
   return d*pi/180.0;
}

//三角形の面積，サラスの公式
Real area_triangle(Point a,Point b,Point c){
   Point x=b-a,y=c-a;
   return fabs(x.real()*y.imag()-x.imag()*y.real())/2;
}
struct Circle{
   Point center;
   Real r;
   Circle(Point center,Real r):center(center),r(r){}
};
 
 
struct Line{
    Point p1,p2;
    Line(Point p1,Point p2):p1(p1),p2(p2){}

    //Ax + By = C
    Line(Real A,Real B,Real C){
       if(eq(A,0))     p1=Point(0,C/B),p2=Point(1,C/B);
       else if(eq(B,0))p1=Point(C/A,0),p2=Point(C/A,1);
       else            p1=Point(0,C/B),p2=Point(C/A,0);
    }
};
 
struct Segment:Line{
   Segment()=default;
   Segment(Point p1,Point p2):Line(p1,p2){}
};
 
//v
//外積
Real cross(const Point &a, const Point &b) {
 return real(a)*imag(b)-imag(a)*real(b);
}

//v
//内積
Real dot(const Point &a, const Point &b) {
 return real(a)*real(b)+imag(a)*imag(b);
}
 
//v
//平行判定，外積0かをみる
bool parallel(Line &a,Line &b){
   return eq(cross(a.p1-a.p2,b.p1-b.p2),0.0);
}
 
//v
//垂直判定，内積0かをみる
bool orthogonal(Line &a,Line &b){
   return eq(dot(a.p1-a.p2,b.p1-b.p2),0.0);
}

//v
//正射影，pからlに下した推薦の足を求める
Point projection(const Line &l, const Point &p){
    //ベクトルl上のどの位置に垂線の足が来るか求める
    Real k=dot(l.p1-l.p2,p-l.p1)/norm(l.p1-l.p2);
    return l.p1+(l.p1-l.p2)*k;
}
Point projection(const Segment &l, const Point &p){
    Real k=dot(l.p1-l.p2,p-l.p1)/norm(l.p1-l.p2);
    return l.p1+(l.p1-l.p2)*k;
}

//反射
Point reflection(const Line &l, const Point &p){
    Point h=projection(l,p);
    return (p+(h-p)+(h-p));
}

Real dis(Point a,Point b){
   return abs(a-b);
}

//点と直線の距離
Real dis(const Line &l,const Point &p){
    return abs(p-projection(l,p));
}

//v
//COUNTER CLOCKWISE，返す値は↓を参照
//https://onlinejudge.u-aizu.ac.jp/courses/library/4/CGL/all/CGL_1_C
int clockwise(Point p0,Point p1,Point p2){
    Real c=cross(p1-p0,p2-p0);
    Real d=dot(p1-p0,p2-p0);
    if(c>EPS)           return 1;//反時計回り       COUNTER CLOCKWISE
    else if(c<-EPS)     return 2;//時計回り         CLOCKWISE
    else if(d<0)        return 3;//p1の反対側にp2   ONLINE BACK
    else if(dis(p0,p1)<dis(p0,p2))  return 4;//     ONLINE FRONT
    else                            return 5;//     ON SEGMENT
}

//v
//3点が作る三角形の外心
//面積0の三角形を渡すと分母に面積があるので壊れるかも
Point circumcenter(const Point &A,const Point &B,const Point &C){
    Real S=area_triangle(A,B,C);
    Real a=dis(B,C),b=dis(A,C),c=dis(A,B);
    return A*(a*a*(b*b+c*c-a*a)/(16*S*S))+B*(b*b*(c*c+a*a-b*b)/(16*S*S))+C*(c*c*(a*a+b*b-c*c)/(16*S*S));
}



//v
//最小包含円を返す　計算量は期待値O(n)
Circle MinimumBoundingCircle(vector<Point> v){
   int n=v.size();
  
   //ランダムシャッフル．いぢわるされたくないもんだ
   mt19937 mt(time(0));
   shuffle(v.begin(),v.end(),mt);
 
   Circle ret(0,0);
   //2点で円を作る
   auto make_circle2=[&](Point a,Point b){
       return Circle((a+b)*0.5,dis(a,b)/2);
   };
   //3点で円を作る
   auto make_circle3=[&](Point A,Point B,Point C){
       Point cent=circumcenter(A,B,C);
       return Circle(cent,dis(cent,A));
   };
   auto isIn=[&](Point a){
       return dis(ret.center,a)<ret.r+EPS;
   };
 
   ret=make_circle2(v[0],v[1]);
   for(int i=2;i<n;i++){
       //v[i]が円に入っていないなら
       if(!isIn(v[i])){
           //円内にないなら点v[i]は必ず円周上に来る
           ret=make_circle2(v[0],v[i]);
           for(int j=1;j<i;j++){
               if(!isIn(v[j])){
                   //この時iとjが円周上を考える
                   ret=make_circle2(v[i],v[j]);
                   //最後の1点の決定
                   for(int k=0;k<j;k++){
                       if(!isIn(v[k])){
                           ret=make_circle3(v[i],v[j],v[k]);
                       }
                   }
               }
           }
       }
   }
   return ret;
}
 
signed main(){
   cin.tie(0);
   ios::sync_with_stdio(0);
   cout<<fixed<<setprecision(12);
 
    Real xp0,yp0,xp1,yp1;
    cin>>xp0>>yp0>>xp1>>yp1;
    Line l(Point(xp0,yp0),Point(xp1,yp1));
    int q;cin>>q;
    while(q--){
        Real x,y;cin>>x>>y;
        auto ans=reflection(l,Point(x,y));
        cout<<ans.real()<<' '<<ans.imag()<<endl;
    }
    return 0;
}
 
 




Measured memory_bytes: 3396