#define G 3
#include<map>
#define AK goto
#include<cmath>
#include<queue>
#include<bitset>
#include<cstdio>
#include<vector>
#include<cstring>
#include<iostream>
#include<algorithm>
#define ll long long
#define md ((l+r)>>1)
#define cht 1000000007
#define inf 1145141919810
#define mem(i,j)memset(i,j,sizeof(i))
#define F(i,j,n)for(int i=j;i<=n;i++)
#define D(i,j,n)for(int i=j;i>=n;i--)
using namespace std;
namespace sky_chen{
//	char buf[1<<23],*p1=buf,*p2=buf,obuf[1<<23],*O=obuf;
//	#define gc() p1==p2&&(p2=(p1=buf)+fread(buf,1,1000000,stdin),p1==p2)?EOF:*p1++
	inline ll read(){ll ans=0,f=1;char a=getchar();while(a>'9'||a<'0'){if(a=='-')f=-1;a=getchar();}while(a>='0'&&a<='9')ans=ans*10+(a^48),a=getchar();return ans*f;}
	inline char red(){char a=getchar();while(a>'z'||a<'a')a=getchar();return a;}
//	inline void print(ll x){if(x>9)print(x/10);*O++=x%10+'0';}
	inline void cadd(ll &x,ll y){x=(x+y)%cht;}
	inline void cmin(ll &x,ll y){x=min(x,y);}
	inline void cmax(ll &x,ll y){x=max(x,y);}
	ll qpow(ll n,ll base=cht-2){ll ans=1;while(base){if(base&1)ans=ans*n%cht;n=n*n%cht;base>>=1;}return ans;}
	const int maxn = 1e6+5;
	const int maxc = 3e5+5;
	ll n,x[maxn],y[maxn];
	struct node{
		ll a=0,b=0,c=0;
	}p1,p2,t,f[maxn],g[maxn];
	int yyds(){
		n=read();
		F(i,1,n)x[i]=read(),y[i]=read();
		ll m=read();
		p1.a=1;p2.b=1;
		f[0]=p1;g[0]=p2;
		F(i,1,m){
			ll opt=read();
			if(!(opt-1)){
				t=p1;p1=p2;p2.a=-t.a;p2.b=-t.b;p2.c=-t.c;
				f[i]=p1;g[i]=p2;
			}
			else if(!(opt-2)){
				t=p2;p2=p1;p1.a=-t.a;p1.b=-t.b;p1.c=-t.c;
				f[i]=p1;g[i]=p2;
			}
			else if(!(opt-3)){
				p1.c=2*read()-p1.c;p1.b=-p1.b;p1.a=-p1.a;
				f[i]=p1;g[i]=p2;
			}
			else{
				p2.c=2*read()-p2.c;p2.b=-p2.b;p2.a=-p2.a;
				f[i]=p1;g[i]=p2;
			}
		}
//		F(i,0,m)cout<<f[i].a<<' '<<f[i].b<<' '<<f[i].c<<' '<<g[i].a<<' '<<g[i].b<<' '<<g[i].c<<endl;
		ll q=read();
		F(i,1,q){
			ll sb1=read(),sb2=read();
			ll za=x[sb2],zb=y[sb2];
			ll nza=f[sb1].a*za+f[sb1].b*zb+f[sb1].c,nzb=g[sb1].a*za+g[sb1].b*zb+g[sb1].c;
			printf("%lld %lld\n",nza,nzb);
		}
	    return 0;
	}
}
int main(){return sky_chen::yyds();}
 
 
 
 
 
 
 
 
//sky_chen txdy! 
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
//#pragma GCC optimize ("-O3")
using namespace std;
void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
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; }
//---------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------
void _main(){
  double A, B, C, ans;
  cin >> A >> B;
  C = A - B;
  C *= 100;
  ans = C / A;
  cout << ans << endl;
  return;
}