#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cassert>
#include <algorithm>
#include <numeric>
#include <random>
#include <vector>
#include <array>
#include <bitset>
#include <queue>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>

using namespace std;
using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
constexpr ll TEN(int n) { return (n==0) ? 1 : 10*TEN(n-1); }
template<class T> using V = vector<T>;
template<class T> using VV = V<V<T>>;

using P = pair<ll, ll>;

P mergema(P a, P b) {
    if (a.first > b.first) return a;
    if (a.first < b.first) return b;
    a.second += b.second;
    return a;
}

P mergemi(P a, P b) {
    if (a.first < b.first) return a;
    if (a.first > b.first) return b;
    a.second += b.second;
    return a;
}

struct Node {
    using NP = Node*;
    int sz;
    NP l, r;

    P mi, ma;
    ll lz;
    void update() {
        mi = mergemi(l->mi, r->mi);
        ma = mergema(l->ma, r->ma);
    }
    void push() {
        if (lz == 0) return;
        l->lzdata(lz);
        r->lzdata(lz);
        lz = 0;
    }
    void lzdata(ll x) {
        lz += x;
        mi.first += x;
        ma.first += x;
    }
    
    Node(int sz, ll fi[]) : sz(sz) {
        lz = 0;
        if (sz == 1) {
            mi = ma = P(fi[0], 1);
            return;
        }
        l = new Node(sz/2, fi);
        r = new Node(sz-sz/2, fi+sz/2);
        update();
    }

    void add(int a, int b, ll x) {
        if (b <= 0 || sz <= a) return;
        if (a <= 0 && sz <= b) {
            lzdata(x);
            return;
        }
        push();
        l->add(a, b, x);
        r->add(a-sz/2, b-sz/2, x);
        update();
    }

    P getma(int a, int b) {
        if (b <= 0 || sz <= a) return P(-TEN(18), 0);
        if (a <= 0 && sz <= b) {
            return ma;
        }
        push();
        P pl = l->getma(a, b);
        P pr = r->getma(a-sz/2, b-sz/2);
        return mergema(pl, pr);
    }


    P getmi(int a, int b) {
        if (b <= 0 || sz <= a) return P(TEN(18), 0);
        if (a <= 0 && sz <= b) {
            return mi;
        }
        push();
        P pl = l->getmi(a, b);
        P pr = r->getmi(a-sz/2, b-sz/2);
        return mergemi(pl, pr);
    }
};

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << setprecision(20);

    int h, w, q;
    cin >> h >> w >> q;
    V<ll> a(h), b(w);
    for (int i = 0; i < h; i++) {
        cin >> a[i];
    }
    for (int i = 0; i < w; i++) {
        cin >> b[i];
    }

    auto tra = new Node(h, a.data());
    auto trb = new Node(w, b.data());

    for (int ph = 0; ph < q; ph++) {
        int ty;
        cin >> ty;
        if (ty == 1) {
            int a, b; ll v;
            cin >> a >> b >> v; a--;
            tra->add(a, b, v);
        } else if (ty == 2) {
            int a, b; ll v;
            cin >> a >> b >> v; a--;
            trb->add(a, b, v);
        } else if (ty == 3) {
            int a, b, c, d;
            cin >> a >> b >> c >> d; a--; c--;
            P pami = tra->getmi(a, b);
            P pbmi = trb->getmi(c, d);
            P pama = tra->getma(a, b);
            P pbma = trb->getma(c, d);


            P ans = P(TEN(18), 0);

            for (int f = 0; f <= 1; f++) {
                if (f && pami.first == pama.first) continue;
                P pa = (!f) ? pami : pama;
                for (int g = 0; g <= 1; g++) {
                    if (g && pbmi.first == pbma.first) continue;
                    P pb = (!g) ? pbmi : pbma;
                    ans = mergemi(ans, P(pa.first * pb.first, pa.second * pb.second));
                }
            }
            
            if (ans.first == 0) {
                ll za = 0, zb = 0;
                if (pami.first == 0) za = pami.second;
                else if (pama.first == 0) za = pama.second;
                if (pbmi.first == 0) zb = pbmi.second;
                else if (pbma.first == 0) zb = pbma.second;

                ans.second = za * (d-c) + zb * (b-a) - za * zb;
            }
            cout << ans.first << " " << ans.second << endl;
        } else {
            int a, b, c, d;
            cin >> a >> b >> c >> d; a--; c--;
            P pami = tra->getmi(a, b);
            P pbmi = trb->getmi(c, d);
            P pama = tra->getma(a, b);
            P pbma = trb->getma(c, d);

            P ans = P(-TEN(18), 0);

            for (int f = 0; f <= 1; f++) {
                if (f && pami.first == pama.first) continue;
                P pa = (!f) ? pami : pama;
                for (int g = 0; g <= 1; g++) {
                    if (g && pbmi.first == pbma.first) continue;
                    P pb = (!g) ? pbmi : pbma;
                    ans = mergema(ans, P(pa.first * pb.first, pa.second * pb.second));
                }
            }

            if (ans.first == 0) {
                ll za = 0, zb = 0;
                if (pami.first == 0) za = pami.second;
                else if (pama.first == 0) za = pama.second;
                if (pbmi.first == 0) zb = pbmi.second;
                else if (pbma.first == 0) zb = pbma.second;

                ans.second = za * (d-c) + zb * (b-a) - za * zb;
            }

            cout << ans.first << " " << ans.second << endl;
        }
    }
    return 0;
}



Measured memory_bytes: 31800