//AUTHOR: RAVAN_2070
//PUNE INSTITUTE OF COMPUTER TECHNOLOGY
/*                                                    
      I ♥ CLARICE STARLING...                                                               
        EXPLAINATION BELOW->
*/
#include<bits/stdc++.h>
using namespace std;
typedef unsigned long long int ull;
typedef long long int ll;
typedef long double ld;
typedef vector<ll> vi;
typedef vector<pair<ll,ll>> vii;
typedef pair<ll,ll> pii;
typedef map<ll,ll> mii;
#define MOD7 1000000007
#define MOD9 1000000009
#define pi 3.1415926535
#define Test_cases ll TC;cin>>TC;while(TC--)
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(), x.rend()
#define sp(x) fixed<<setprecision(x)
#define sz(x) (ll)(x.size())
#define fo(i,a,b) for(i=a;i<b;i++)
#define foe(i,a,b) for(i=a;i<=b;i++)
const ll INF = (ll)2e18 + 77;
void solve()
{
   int n,i;cin>>n;
   ll x[n],y[n];
   
   fo(i,0,n)cin>>x[i]>>y[i];
   
   int m;cin>>m;
   ll op[m][2];
   fo(i,0,m)
   {
       int typ,p=-1;
       cin>>typ;
       if(typ>2)cin>>p;
       
       op[i][0]=typ;
       op[i][1]=p;
   }
   
   int q;cin>>q;
   vector<pair<ll,pii>>queries;
   fo(i,0,q)
   {
       ll a,b;cin>>a>>b;
       queries.pb(mp(a,mp(b,i)));
   }
   sort(all(queries));
   
   ll ansx[q],ansy[q];
   int idx=0;
   i=0;
   
   //cout<<"NOW DEAL QUERIES\n";
   int signx,signy;signx=signy=1;//positive
   ll psumx,psumy;psumx=psumy=0ll;
   int swp=0;
   while(i<q)
   {
      int pt=queries[i].S.F-1;
      int anspt=queries[i].S.S;
      ll cx=x[pt];
      ll cy=y[pt];
      int nextidx=queries[i].F-1;
      while(idx<=nextidx)
      {
          if(op[idx][1]==-1)//Rotation
          {
              swp=swp^1;
              swap(signx,signy);
              if(op[idx][0]==1)//clockwise 90
              {
                  //swap(cx,cy);
                  swap(psumx,psumy);
                 
                  signy=signy^1;
                  psumy=(-1ll)*psumy;
              }
              else //counter clockwise 90
              {
                  //swap(cx,cy);
                  swap(psumx,psumy);
                  signx=signx^1;
                  psumx=(-1ll)*psumx;
              }
          }
          else
          {
              ll p=op[idx][1];
              if(op[idx][0]==3)
              {
                  psumx=(-1ll)*psumx;;
                  psumx+=(p*2ll);
                  signx=signx^1;
              }
              else
              {
                  psumy=(-1ll)*psumy;;
                  psumy+=(p*2ll);
                  signy=signy^1;
              }
          }
          idx++;
      }
      //cout<<cx<<" "<<cy<<" "<<signx<<" "<<signy<<" "<<psumx<<" "<<psumy<<"\n";
      if(swp)swap(cx,cy);
      ll fx,fy;
      fx=cx;
      fy=cy;
      if(!signx)fx=(-1ll*fx);
      if(!signy)fy=(-1ll*fy);
      fx+=psumx;
      fy+=psumy;
      ansx[anspt]=fx;
      ansy[anspt]=fy;
      i++;
       
   }
   
   fo(i,0,q)cout<<ansx[i]<<" "<<ansy[i]<<"\n";
   
}
int main()
{
   fastio
   //Test_cases
   solve();
  return 0;
}

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> P;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define print(x) cout << x << endl
#define all(v) (v).begin(),(v).end()
#define YN(ok) print((ok ? "YES" : "NO"))
#define yn(ok) print((ok ? "Yes" : "No"))
#define decimal(n) setprecision(30) << n

#define Arrays_toString(v) rep(o,(v).size()){cout<<v[o]<<", ";if(o==(v).size()-1){cout<<endl;}}
template<class T> void que_toString(queue<T> q){while(q.size()){cout<<q.front()<<", ";q.pop();if(q.empty()){cout<<endl;}}}

int main(void){
    int n, m, k;
    cin >> n >> m >> k;
    vi v(k);
    rep(i, k) cin >> v[i];
    
    // ans:
    // マス0 → Nまですごろくする時、サイコロを振る回数の期待値は？
    // (サイコロの目は1～Mで等確率)
    // (「ふりだしに戻る」マスもある)
    
    // how:
    // 期待値DPする。
    // (点0から点Nに行くのに貼る辺の本数の期待値は？と同値)
    // 例えば6まで出るならiの期待値は1/6 * (i+1, i+2, ... i+6) + 1
    
    // DAGでない(ループがある)DPなので、dp[地雷] = dp[0] = xとして進める。
    // dp[i] = ax + bの形でデータを持つ。(a = dp[i][0], b = dp[i][1])
    // -> dp[0] = a * x(=dp[0]) + b
    // -> dp[0] = b / (1 - a)
    
    // dp[i]: マスiからゴールに行くまでに振る回数の期待値
    vector<vector<double>> dp(n+1+m, vector<double>(2));
    for (int vv : v) {
        dp[vv][0] = 1;
        dp[vv][1] = 0;
    }
    
    // sum: 区間長mのdpのsum
    vector<double> sum(2);
    for (int i = n+m-1; i >= n; i--) {
        sum[0] += dp[i][0];
        sum[1] += dp[i][1];
    }
    
    for (int i = n-1; i >= 0; i--) {
        if (dp[i][0] != 1) {
            dp[i][0] = sum[0] / m;
            dp[i][1] = sum[1] / m + 1;
        }
        
        // update sum
        sum[0] -= dp[i+m][0];
        sum[1] -= dp[i+m][1];
        sum[0] += dp[i][0];
        sum[1] += dp[i][1];
    }
    // for (auto dpi : dp) Arrays_toString(dpi);
    
    // x = dp[0][0] * x + dp[0][1]
    // -> dp[0][1] / (1 - dp[0][0]) = x
    double res = -1; 
    if (dp[0][0] != 1) res = dp[0][1] / (1 - dp[0][0]);
    if (res > 1e12) res = -1;
    print(decimal(res));
}