#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;
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 << ">)";
  }
};



template<class Monoid, class Action> struct SegTree {
    int size_seg = 1;
    vector<Monoid> val;
    vector<Action> delay;
    Monoid UNITY_MONOID = VAL(INF, -INF, 0, 0); // to be set
    Action UNITY_ACTION = 0;                    // to be set
    
    SegTree(int n = 1) { init(n); }
    SegTree(int n, const Monoid &init_monoid, const Action &init_action) { init(n, init_monoid, init_action); }
    
    void init(int n = 1) {
        size_seg = 1;
        while (size_seg < n) size_seg <<= 1;
        val.resize(size_seg * 2 - 1); delay.resize(size_seg * 2 - 1);
        for (int i = 0; i < size_seg * 2 - 1; ++i) {
            val[i] = UNITY_MONOID;
            delay[i] = UNITY_ACTION;
        }
    }
    
    void init(int n, const Monoid &init_monoid, const Action &init_action) {
        size_seg = 1;
        while (size_seg < n) size_seg <<= 1;
        val.resize(size_seg * 2 - 1); delay.resize(size_seg * 2 - 1);
        for (int i = 0; i < size_seg * 2 - 1; ++i) {
            val[i] = init_monoid;
            delay[i] = init_action;
        }
    }
    
    inline void init_set(int a, const Monoid &x) {
        a += size_seg - 1;
        val[a] = x;
    }
    
    inline void init_tree(int k = 0, int l = 0, int r = -1) {
        if (r == -1) r = size_seg;
        if (r - l > 1) {
            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 Monoid merge(const Monoid &x, const Monoid &y) {
        Monoid res = UNITY_MONOID;
        
        if (x.minv > y.minv) {
            res.minv = y.minv;
            res.minnum = y.minnum;
        }
        else if (x.minv == y.minv) {
            res.minv = x.minv;
            res.minnum = x.minnum + y.minnum;
        }
        else {
            res.minv = x.minv;
            res.minnum = x.minnum;
        }
        
        if (x.maxv < y.maxv) {
            res.maxv = y.maxv;
            res.maxnum = y.maxnum;
        }
        else if (x.maxv == y.maxv) {
            res.maxv = x.maxv;
            res.maxnum = x.maxnum + y.maxnum;
        }
        else {
            res.maxv = x.maxv;
            res.maxnum = x.maxnum;
        }
        
        return res;
    }

    inline void add(Action &d, const Action &e) {
        // d += e;
        d += e;
    }
    
    inline void reflect(Monoid &x, const Action &d, int l, int r) {
        // x += d;
        x.minv += d;
        x.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_ACTION;
    }
    
    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 = -1) {
        if (r == -1) 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 Monoid get(int a, int b, int k = 0, int l = 0, int r = -1) {
        if (r == -1) r = size_seg;
        redelay(k, l, r);
        if (a <= l && r <= b) {                 // included
            return val[k];
        }
        else if (a < r && l < b) {              // intersected
            Monoid t1 = get(a, b, k*2+1, l, (l+r)/2);
            Monoid t2 = get(a, b, k*2+2, (l+r)/2, r);
            renode(k, l, r);
            return merge(t1, t2);
        }
        else {                                  // no-intersected
            return UNITY_MONOID;
        }
    }
  
    inline Monoid operator [] (int i) {return get(i, i+1);}
  
    void print() {
        long long t = 2;
        for (int i = 0; i < size_seg*2-1; ++i) {
            cout << make_pair(val[i], delay[i]) << ",";
            if (i == t-2) {cout << endl; t *= 2;}
        }
        for (int i = 0; i < size_seg; ++i) {
            cout << get(i, i+1) << ", ";
        }
        cout << endl << endl;
    }
};

SegTree<VAL,int> xseg, yseg;



long long H, W, Q;


int main() {
  while (cin >> H >> W >> Q) {
	xseg.init((int)max(H, W)+2, VAL(0, 0, 1, 1), 0);
	yseg.init((int)max(H, W)+2, VAL(0, 0, 1, 1), 0);
	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: 21372