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.
#include <bits/stdc++.h>
const int MAXN = 1005;
int dat[MAXN][MAXN];
int up[MAXN][MAXN], down[MAXN][MAXN];
int left[MAXN][MAXN], right[MAXN][MAXN];
int rows, cols;
void init() {
  memset(left, 0, sizeof(left));
  memset(right, 0, sizeof(right));
  memset(up, 0, sizeof(up));
  memset(down, 0, sizeof(down));
  for (int i = 1; i <= rows; i++) {
    for (int j = 1; j <= cols; j++) {
      left[i][j] = dat[i][j] ? (left[i][j - 1] + 1) : 0;
    }
    for (int j = cols; j >= 1; j--) {
      right[i][j] = dat[i][j] ? (right[i][j + 1] + 1) : 0;
    }
  }
  for (int j = 1; j <= cols; j++) {
    for (int i = 1; i <= rows; i++) {
      up[i][j] = dat[i][j] ? (up[i - 1][j] + 1) : 0;
    }
    for (int i = rows; i >= 1; i--) {
      down[i][j] = dat[i][j] ? (down[i + 1][j] + 1) : 0;
    }
  }
}
void modify(int x, int y) {
  dat[x][y] = !dat[x][y];
  left[x][y] = dat[x][y] ? (left[x][y - 1] + 1) : 0;
  for (int j = y + 1; j <= cols; j++) {
    if (dat[x][j] == 0) {
      break;
    }
    left[x][j] = left[x][j - 1] + 1;
  }
  right[x][y] = dat[x][y] ? (right[x][y + 1] + 1) : 0;
  for (int j = y - 1; j >= 1; j--) {
    if (dat[x][j] == 0) {
      break;
    }
    right[x][j] = right[x][j + 1] + 1;
  }
  up[x][y] = dat[x][y] ? (up[x - 1][y] + 1) : 0;
  for (int i = x + 1; i <= rows; i++) {
    if (dat[i][y] == 0) {
      break;
    }
    up[i][y] = up[i - 1][y] + 1;
  }
  down[x][y] = dat[x][y] ? (down[x + 1][y] + 1) : 0;
  for (int i = x - 1; i >= 1; i--) {
    if (dat[i][y] == 0) {
      break;
    }
    down[i][y] = down[i + 1][y] + 1;
  }
}
int query(int x, int y) {
  int r = 0;
  int top, bot;
  top = up[x][y];
  bot = down[x][y];
  for (int j = y; j >= 1; j--) {
    top = ((top) < (up[x][j]) ? (top) : (up[x][j]));
    bot = ((bot) < (down[x][j]) ? (bot) : (down[x][j]));
    if (top == 0 || bot == 0) {
      break;
    }
    r = ((r) > ((y - j + 1) * (top + bot - 1))
             ? (r)
             : ((y - j + 1) * (top + bot - 1)));
  }
  top = up[x][y];
  bot = down[x][y];
  for (int j = y; j <= cols; j++) {
    top = ((top) < (up[x][j]) ? (top) : (up[x][j]));
    bot = ((bot) < (down[x][j]) ? (bot) : (down[x][j]));
    if (top == 0 || bot == 0) {
      break;
    }
    r = ((r) > ((j - y + 1) * (top + bot - 1))
             ? (r)
             : ((j - y + 1) * (top + bot - 1)));
  }
  int lb, rb;
  lb = left[x][y];
  rb = right[x][y];
  for (int i = x; i >= 1; i--) {
    lb = ((lb) < (left[i][y]) ? (lb) : (left[i][y]));
    rb = ((rb) < (right[i][y]) ? (rb) : (right[i][y]));
    if (lb == 0 || rb == 0) {
      break;
    }
    r = ((r) > ((x - i + 1) * (lb + rb - 1)) ? (r)
                                             : ((x - i + 1) * (lb + rb - 1)));
  }
  lb = left[x][y];
  rb = right[x][y];
  for (int i = x; i <= rows; i++) {
    lb = ((lb) < (left[i][y]) ? (lb) : (left[i][y]));
    rb = ((rb) < (right[i][y]) ? (rb) : (right[i][y]));
    if (lb == 0 || rb == 0) {
      break;
    }
    r = ((r) > ((i - x + 1) * (lb + rb - 1)) ? (r)
                                             : ((i - x + 1) * (lb + rb - 1)));
  }
  return r;
}
int main() {
  int tst;
  scanf("%d %d %d", &rows, &cols, &tst);
  for (int i = 1; i <= rows; i++) {
    for (int j = 1; j <= cols; j++) {
      scanf("%d", &dat[i][j]);
    }
  }
  init();
  int opt, x, y;
  while (tst--) {
    scanf("%d %d %d", &opt, &x, &y);
    if (opt == 1) {
      modify(x, y);
    } else {
      printf("%d\n", query(x, y));
    }
  }
  return 0;
}
