#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <utility>
#include <iomanip>
#include <algorithm>
#include <functional>
using namespace std;

#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P)
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P)
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T> ostream& operator << (ostream &s, vector<vector<T> > P)
{ for (int i = 0; i < P.size(); ++i) { s << endl << P[i]; } return s << endl; }
template<class T1, class T2> ostream& operator << (ostream &s, map<T1,T2> P)
{ EACH(it, P) { s << "<" << it->first << "->" << it->second << "> "; } return s << endl; }

const long long INF = 1LL<<60;
const int MAX_N = 110000;

typedef long long DELAY;

struct VAL {
  long long minv;
  long long maxv;
  long long minnum;
  long long maxnum;
  VAL() {
	minv = maxv = 0;
	minnum = maxnum = 1;
  }
  VAL(long long a, long long b, long long c, long long d) {
	minv = a;
	maxv = b;
	minnum = c;
	maxnum = d;
  }
  friend ostream& operator << (ostream& s, const VAL& v) {
	return s << "(<" << v.minv << "," << v.minnum << ">, <" << v.maxv << ", " << v.maxnum << ">)";
  }
};

const VAL UNITY_VAL = VAL(INF, -INF, 0, 0);
const DELAY UNITY_DELAY = 0;

static int SIZE_SEG;
struct SegTree {
  VAL val[4*MAX_N];
    DELAY delay[4*MAX_N];    // +
    
    void init(int n = MAX_N) {
        SIZE_SEG = 1;
        while (SIZE_SEG < n) SIZE_SEG *= 2;
        for (int v = 0; v < 2*SIZE_SEG-1; ++v) {
		  val[v] = VAL();
		  delay[v] = 0;
		}
    }
    
    inline void init_set(int a, VAL x) {
        a += SIZE_SEG-1; val[a] = x;
    }
    
    inline void init_tree(int k = 0, int l = 0, int r = SIZE_SEG) {
        if (r - l == 1) {}                      // leaf
        else {
            init_tree(k*2+1, l, (l+r)/2);
            init_tree(k*2+2, (l+r)/2, r);
            val[k] = merge(val[k*2+1], val[k*2+2]);
        }
    }
    
    inline VAL merge(VAL a, VAL b) {
	  //VAL res = UNITY_VAL;
        // res.f = a.f + b.f;[

	  VAL res = UNITY_VAL;
	  if (a.minv > b.minv) {
		res.minv = b.minv;
		res.minnum = b.minnum;
	  }
	  else if (a.minv == b.minv) {
		res.minv = a.minv;
		res.minnum = a.minnum + b.minnum;
	  }
	  else {
		res.minv = a.minv;
		res.minnum = a.minnum;
	  }

	  if (a.maxv < b.maxv) {
		res.maxv = b.maxv;
		res.maxnum = b.maxnum;
	  }
	  else if (a.maxv == b.maxv) {
		res.maxv = a.maxv;
		res.maxnum = a.maxnum + b.maxnum;
	  }
	  else {
		res.maxv = a.maxv;
		res.maxnum = a.maxnum;
	  }
	  
	  return res;
    }
    
    inline void add(DELAY &d, DELAY x) {
        // d.f += x.f;
	  d += x;
    }
    
    inline void reflect(VAL &a, DELAY d, int l, int r) {
        // a.f += d.f * (r-l);
	  a.minv += d;
	  a.maxv += d;
    }
    
    inline void redelay(int k, int l, int r) {
        reflect(val[k], delay[k], l, r);
        if (k < SIZE_SEG-1) {
            add(delay[k*2+1], delay[k]);
            add(delay[k*2+2], delay[k]);
        }
        delay[k] = UNITY_DELAY;
    }
    
    inline void renode(int k, int l, int r) {
        val[k] = merge(val[k*2+1], val[k*2+2]);
    }
    
    inline void set(int a, int b, DELAY x, int k = 0, int l = 0, int r = SIZE_SEG) {
        if (a <= l && r <= b) {                 // included
            add(delay[k], x);
            redelay(k, l, r);
        }
        else if (a < r && l < b) {              // intersected
            redelay(k, l, r);
            set(a, b, x, k*2+1, l, (l+r)/2);
            set(a, b, x, k*2+2, (l+r)/2, r);
            renode(k, l, r);
        }
        else {                                  // no-intersected
            redelay(k, l, r);
        }
    }
    
    inline VAL get(int a, int b, int k = 0, int l = 0, int r = SIZE_SEG) {
        redelay(k, l, r);
        if (a <= l && r <= b) {                 // included
            return val[k];
        }
        else if (a < r && l < b) {              // intersected
            VAL t1 = get(a, b, k*2+1, l, (l+r)/2);
            VAL t2 = get(a, b, k*2+2, (l+r)/2, r);
            renode(k, l, r);
            
            return merge(t1, t2);
        }
        else {                                  // no-intersected
            return UNITY_VAL;
        }
    }
    
    inline VAL operator [] (int i) {return get(i, i+1);}
    
    void print(long long r = SIZE_SEG) {
        long long t = 2;
		/*
        for (int i = 0; i < r*2-1; ++i) {
            cout << make_pair(val[i], delay[i]) << ",";
            if (i == t-2) {cout << endl; t *= 2;}
        }
		*/
        for (int i = 0; i < r; ++i) {
            cout << get(i, i+1) << ", ";
        }
        cout << endl << endl;
    }
} xseg, yseg;



long long H, W, Q;


int main() {
  while (cin >> H >> W >> Q) {
	xseg.init(max(H, W)+2);
	yseg.init(max(H, W)+2);
	for (int i = 0; i < H; ++i) {
	  int x;
	  cin >> x;
	  xseg.set(i, i+1, x);
	}
	for (int i = 0; i < W; ++i) {
	  int y;
	  cin >> y;
	  yseg.set(i, i+1, y);
	}

	

	for (int q = 0; q < Q; ++q) {
	  int t;
	  cin >> t;
	  if (t == 1) {
		int a, b;
		long long v;
		cin >> a >> b >> v;
		--a, --b;
		xseg.set(a, b+1, v);
	  }
	  else if (t == 2) {
		int c, d;
		long long v;
		cin >> c >> d >> v;
		--c, --d;
		yseg.set(c, d+1, v);
	  }
	  else if (t == 3 || t == 4) {
		int a, b, c, d;
		cin >> a >> b >> c >> d;
		--a, --b, --c, --d;
	    VAL x = xseg.get(a, b+1);
		VAL y = yseg.get(c, d+1);

		long long res = INF;
		if (t == 4) res = -INF;
		long long resnum = 0;
		if (t == 3) {
		  chmin(res, x.minv * y.minv);
		  chmin(res, x.minv * y.maxv);
		  chmin(res, x.maxv * y.minv);
		  chmin(res, x.maxv * y.maxv);
		}
		else {
		  chmax(res, x.minv * y.minv);
		  chmax(res, x.minv * y.maxv);
		  chmax(res, x.maxv * y.minv);
		  chmax(res, x.maxv * y.maxv);
		}
		if (res == 0) {
		  long long xnonzero = b - a + 1;
		  if (x.minv == 0) xnonzero -= x.minnum;
		  else if (x.maxv == 0) xnonzero -= x.maxnum;
		  long long ynonzero = d - c + 1;
		  if (y.minv == 0) ynonzero -= y.minnum;
		  else if (y.maxv == 0) ynonzero -= y.maxnum;
		  resnum = (b-a+1) * (d-c+1) - xnonzero * ynonzero;
		}
		else {
		  if (res == x.minv * y.minv) resnum += x.minnum * y.minnum;
		  if (res == x.maxv * y.minv && x.maxv != x.minv)
			resnum += x.maxnum * y.minnum;
		  if (res == x.minv * y.maxv && y.maxv != y.minv)
			resnum += x.minnum * y.maxnum;
		  if (res == x.maxv * y.maxv && x.maxv != x.minv && y.maxv != y.minv)
			resnum += x.maxnum * y.maxnum;
		}

		cout << res << " " << resnum << endl;
	  }

	  /*
	  COUT("----------");
	  COUT(q);
	  xseg.print();
	  yseg.print();
	  */
	  
	}
  }
}
	




Measured memory_bytes: 34720