Nanami is an expert at playing games. This day, Nanami's good friend Hajime invited her to watch a game of baseball. Unwilling as she was, she followed him to the stadium. But Nanami had no interest in the game, so she looked around to see if there was something that might interest her. That's when she saw the digital board at one end of the stadium.

The digital board is n pixels in height and m pixels in width, every pixel is either light or dark. The pixels are described by its coordinate. The j-th pixel of the i-th line is pixel (i, j). The board displays messages by switching a combination of pixels to light, and the rest to dark. Nanami notices that the state of the pixels on the board changes from time to time. At certain times, certain pixels on the board may switch from light to dark, or from dark to light.

Nanami wonders, what is the area of the biggest light block such that a specific pixel is on its side. A light block is a sub-rectangle of the board, in which all pixels are light. Pixel (i, j) belongs to a side of sub-rectangle with (x1, y1) and (x2, y2) as its upper-left and lower-right vertex if and only if it satisfies the logical condition: 

((i = x1 or i = x2) and (y1 ≤ j ≤ y2)) or ((j = y1 or j = y2) and (x1 ≤ i ≤ x2)).

Nanami has all the history of changing pixels, also she has some questions of the described type, can you answer them?

Input

The first line contains three space-separated integers n, m and q (1 ≤ n, m, q ≤ 1000) — the height and width of the digital board, and the number of operations.

Then follow n lines, each line containing m space-separated integers. The j-th integer of the i-th line is ai, j — the initial state of pixel (i, j).

  * If ai, j = 0, pixel (i, j) is initially dark. 
  * If ai, j = 1, pixel (i, j) is initially light. 



Then follow q lines, each line containing three space-separated integers op, x, and y (1 ≤ op ≤ 2; 1 ≤ x ≤ n; 1 ≤ y ≤ m), describing an operation.

  * If op = 1, the pixel at (x, y) changes its state (from light to dark or from dark to light). 
  * If op = 2, Nanami queries the biggest light block with pixel (x, y) on its side. 

Output

For each query, print a single line containing one integer — the answer to Nanami's query.

Examples

Input

3 4 5
0 1 1 0
1 0 0 1
0 1 1 0
2 2 2
2 1 2
1 2 2
1 2 3
2 2 2


Output

0
2
6


Input

3 3 4
1 1 1
1 1 1
1 1 1
2 2 2
1 2 2
2 1 1
2 2 1


Output

6
3
3

Note

Consider the first sample.

The first query specifies pixel (2, 2), which is dark itself, so there are no valid light blocks, thus the answer is 0.

The second query specifies pixel (1, 2). The biggest light block is the block with (1, 2) as its upper-left vertex and (1, 3) as its lower-right vertex.

The last query specifies pixel (2, 2), which became light in the third operation. The biggest light block is the block with (1, 2) as its upper-left vertex and (3, 3) as its lower-right vertex.
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Scanner;
import java.util.StringTokenizer;
import java.util.TreeSet;



public class Main {
    static int mod = (int)1e9+7;
    static int inf = (int)(2e9+1e8);
    static long INF = (long)(2e16);
    static double eps = 1e-9;
    static double PI = Math.acos(-1.0);
    static int N = (int)1e3 + 10;
    static class Pair implements Comparable<Pair>{
        int height, i;
        public Pair(int height, int i){
            this.height = height;
            this.i = i;
        }
        
        public int compareTo(Pair other){
            if (height > other.height) return -1;
            if (height < other.height) return 1;
            return 0;
        }
        
        public String toString(){
            return this.height + " " + this.i;
        }
    }
    static class DSU{
        int p[];
        int n;
        public DSU(int n){
            p = new int[n+1];
            for(int i=1;i<=n;i++) p[i] = i;
        }
        
        public int find(int x){
            if (x != p[x])
            return p[x] = find(p[x]);
            return x;
        }
        
        public void union(int x, int y){
            x = find(x);
            y = find(y);
            p[x] = y;
        }
    }
    int [][] L, R, U, D, s;
    int[] h;
    private int query(int []h, int n, int x){
        Pair []p = new Pair[n];
        p[0] = new Pair(-1, -1);
        for(int i=1;i<n;i++) p[i] = new Pair(h[i], i);
        Arrays.sort(p);
        /*
        for(int i=0;i<n;i++){
            System.out.println(p[i]);
        }
        */
        DSU left = new DSU(n+1);
        DSU right = new DSU(n+1);
        
        int ret = 0;
        for(int i=0;i<n-1;i++){
            //System.out.println(p[i]);
            int l = left.find(p[i].i), r = right.find(p[i].i);
            if (l == 0) l++;
            if (r == n) r--;
            if (l <= x && x <= r) ret = Math.max(ret, (r - l + 1) * p[i].height);
            left.union(p[i].i+1, p[i].i);
            right.union(p[i].i-1, p[i].i);
        }
        
        return ret;
    }
    BufferedReader in;
    StringTokenizer str = null;
    PrintWriter out;
    private String next() throws Exception{
        while (str == null || !str.hasMoreElements())
            str = new StringTokenizer(in.readLine());
        return str.nextToken();
    }
    
    private int nextInt() throws Exception{
        return Integer.parseInt(next());
    }
    void work() throws Exception {
        in = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);
//      int n = cin.nextInt();
//      int m = cin.nextInt();
//      int q = cin.nextInt();
        int n = nextInt();
        int m = nextInt();
        int q = nextInt();
        s = new int[n+5][m+5];
        L = new int[n+5][m+5];
        R = new int[n+5][m+5];
        U = new int[n+5][m+5];
        D = new int[n+5][m+5];
        
        for(int i = 1; i <= n; i ++) {
            for(int j = 1; j <= m; j ++) {
                s[i][j] = nextInt();
            }
        }
        for(int i=1;i<=n;i++){
            for(int j=1;j<=m;j++){
                if (s[i][j] == 1){
                    U[i][j] = U[i-1][j] + 1;
                    L[i][j] = L[i][j-1] + 1;
                }
            }
        }
        
        for(int i=n;i>0;i--){
            for(int j=m;j>0;j--){
                if (s[i][j] == 1){
                    if (i + 1 <= n) D[i][j] = D[i+1][j] + 1;
                    else D[i][j] = 1;
                    if (j + 1 <= m) R[i][j] = R[i][j+1] + 1;
                    else R[i][j] = 1;
                }
            }
        }
        while(q-- > 0) {
            int op = nextInt();
            int x = nextInt(), y = nextInt();
            if(op == 1){
            s[x][y] ^= 1;
            for(int i=1;i<=n;i++){
                if (s[i][y] == 1){
                    U[i][y] = U[i-1][y] + 1;
                }else{
                    U[i][y] = 0;
                }
            }
            
            for(int i=n;i>=0;i--){
                if (s[i][y] == 1){
                    if (i + 1 <= n) D[i][y] = D[i+1][y] + 1;
                    else D[i][y] = 1;
                }else{
                    D[i][y] = 0;
                }
            }
            
            for(int i=1;i<=m;i++){
                if (s[x][i] == 1){
                    L[x][i] = L[x][i-1] + 1;
                }else{
                    L[x][i] = 0;
                }
            }
            
            for(int i=m;i>=0;i--){
                if (s[x][i] == 1){
                    if (i + 1 <= m) R[x][i] = R[x][i + 1] + 1;
                    else R[x][i] = 1;
                }else{
                    R[x][i] = 0;
                }
            }
            
            }else{
                int ans = 0;
                h = new int[m+1];
                for(int i=1;i<=m;i++) h[i] = U[x][i];
                ans = Math.max(ans, query(h, m+1, y));
                for(int i=1;i<=m;i++) h[i] = D[x][i];
                ans = Math.max(ans, query(h, m+1, y));
                
                h = new int[n+1];
                for(int i=1;i<=n;i++) h[i] = L[i][y];
                ans = Math.max(ans, query(h, n+1, x));
                for(int i=1;i<=n;i++) h[i] = R[i][y];
                ans = Math.max(ans, query(h, n+1, x));
                
                out.println(ans);
            }
        }

        out.close();
    }
    Main() {
//        out = new PrintWriter(System.out);
//        cin = new Scanner(System.in);
    }

    public static void main(String[] args) throws Exception{
        Main wo = new Main();
        wo.work();
    }
    int Uper_bound(long[] x, int l, int r, long val) {
        int pos = r;
        r --;
        while(l <= r) {
            int mid = (l+r)/2;
            if(x[mid] <= val) {
                l = mid+1;
            } else {
                pos = mid;
                r = mid-1;
            }
        }
        return pos;
    }
    DecimalFormat df=new DecimalFormat("0.000000");
//    public Scanner cin;
//    public PrintWriter out;
    
}