#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

class SegmentTree {
public:
	vector<int>dat, mx, num, sum; int B = 350;

	void init(int size_) {
		size_ += B; size_ /= B; size_ *= B;
		dat.resize(size_, 0);
		sum.resize(size_ / B, 0);
		mx.resize(size_ / B, 0);
		num.resize(size_ / B, 0);
	}
	void naive_add(int a, int b, int x) {
		for (int i = a; i <= b; i++) {
			dat[i] += x;
		}
		int id = a / B; mx[id] = -1000000007; num[id] = 0;
		for (int i = id*B; i < (id + 1)*B; i++) mx[id] = max(mx[id], dat[i]);
		for (int i = id*B; i < (id + 1)*B; i++) { if (mx[id] == dat[i]) num[id]++; }
	}
	void add(int a, int b, int x) {
		// 閉区間でやりたい
		if (a / B == b / B) naive_add(a, b, x);
		else {
			naive_add(a, (a / B + 1)*B - 1, x);
			naive_add((b / B)*B, b, x);
			for (int i = (a / B) + 1; i < b / B; i++) {
				sum[i] += x;
			}
		}
	}
	int naive_max(int a, int b) {
		int ret1 = -(1 << 30), id = a / B;
		for (int i = a; i <= b; i++) {
			ret1 = max(ret1, dat[i] + sum[id]);
		}
		return ret1;
	}
	int naive_sum(int a, int b, int x) {
		int ret2 = 0, id = a / B;
		for (int i = a; i <= b; i++) {
			if (dat[i] + sum[id] == x) ret2++;
		}
		return ret2;
	}
	pair<int, int> query(int a, int b) {
		if (a / B == b / B) {
			int G = naive_max(a, b);
			int I = naive_sum(a, b, G);
			return make_pair(G, I);
		}
		else {
			int L1 = a / B + 1, R1 = b / B;
			int G1 = naive_max(a, L1*B - 1); int I1 = naive_sum(a, L1*B - 1, G1);
			int G2 = naive_max(R1*B, b); int I2 = naive_sum(R1*B, b, G2);

			int maxn = max(G1, G2), sum2 = 0;
			if (G1 == maxn) sum2 += I1;
			if (G2 == maxn) sum2 += I2;
			for (int i = L1; i < R1; i++) {
				if (mx[i] + sum[i] > maxn) {
					maxn = mx[i] + sum[i];
					sum2 = num[i];
				}
				else if (mx[i] + sum[i] == maxn) {
					sum2 += num[i];
				}
			}
			return make_pair(maxn, sum2);
		}
	}
};

long long H, W, Q, A[100009], B[100009];

int main() {
	cin >> H >> W >> Q;
	SegmentTree X1, X2, Y1, Y2;
	X1.init(H + 2); X2.init(W + 2);
	Y1.init(H + 2); Y2.init(W + 2);

	for (int i = 1; i <= H; i++) { cin >> A[i]; X1.add(i, i, A[i]); Y1.add(i, i, -A[i]); }
	for (int i = 1; i <= W; i++) { cin >> B[i]; X2.add(i, i, B[i]); Y2.add(i, i, -B[i]); }

	for (int i = 1; i <= Q; i++) {
		long long q, a, b, c, d;
		cin >> q;
		if (q == 1) {
			cin >> a >> b >> c;
			X1.add(a, b, c);
			Y1.add(a, b, -c);
		}
		if (q == 2) {
			cin >> a >> b >> c;
			X2.add(a, b, c);
			Y2.add(a, b, -c);
		}
		if (q == 3) {
			cin >> a >> b >> c >> d;
			pair<long long, long long> E1 = X1.query(a, b);
			pair<long long, long long> F1 = X2.query(c, d);
			pair<long long, long long> E2 = Y1.query(a, b); E2.first *= -1;
			pair<long long, long long> F2 = Y2.query(c, d); F2.first *= -1;

			long long minx = min({ E1.first*F1.first,E2.first*F1.first,E1.first*F2.first,E2.first*F2.first });
			long long sum1 = 0;
			if (E1.first*F1.first == minx) sum1 += E1.second*F1.second;
			if (E2.first*F1.first == minx && E1.first != E2.first) sum1 += E2.second*F1.second;
			if (E1.first*F2.first == minx && F1.first != F2.first) sum1 += E1.second*F2.second;
			if (E2.first*F2.first == minx && E1.first != E2.first && F1.first != F2.first) sum1 += E2.second*F2.second;

			if (minx != 0) {
				cout << minx << " " << sum1 << endl;
			}
			if (minx == 0) {
				sum1 = 0;
				long long V1 = 0, V2 = 0;
				if (E1.first == 0) V1 += E1.second;
				if (E2.first == 0 && E1.first != E2.first) V1 += E2.second;
				if (F1.first == 0) V2 += F1.second;
				if (F2.first == 0 && F1.first != F2.first) V2 += F2.second;

				sum1 += V1*(d - c + 1);
				sum1 += (b - a + 1)*V2;
				sum1 -= V1*V2;
				cout << minx << " " << sum1 << endl;
			}
		}
		if (q == 4) {
			cin >> a >> b >> c >> d;
			pair<long long, long long> E1 = X1.query(a, b);
			pair<long long, long long> F1 = X2.query(c, d);
			pair<long long, long long> E2 = Y1.query(a, b); E2.first *= -1;
			pair<long long, long long> F2 = Y2.query(c, d); F2.first *= -1;

			long long maxn = max({ E1.first*F1.first,E2.first*F1.first,E1.first*F2.first,E2.first*F2.first });
			long long sum1 = 0;
			if (E1.first*F1.first == maxn) sum1 += E1.second*F1.second;
			if (E2.first*F1.first == maxn && E1.first != E2.first) sum1 += E2.second*F1.second;
			if (E1.first*F2.first == maxn && F1.first != F2.first) sum1 += E1.second*F2.second;
			if (E2.first*F2.first == maxn && E1.first != E2.first && F1.first != F2.first) sum1 += E2.second*F2.second;

			if (maxn != 0) {
				cout << maxn << " " << sum1 << endl;
			}
			if (maxn == 0) {
				sum1 = 0;
				long long V1 = 0, V2 = 0;
				if (E1.first == 0) V1 += E1.second;
				if (E2.first == 0 && E1.first != E2.first) V1 += E2.second;
				if (F1.first == 0) V2 += F1.second;
				if (F2.first == 0 && F1.first != F2.first) V2 += F2.second;

				sum1 += V1*(d - c + 1);
				sum1 += (b - a + 1)*V2;
				sum1 -= V1*V2;
				cout << maxn << " " << sum1 << endl;
			}
		}
	}
	return 0;
}


Measured memory_bytes: 5584