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>
using namespace std;
int i, j, k, m, n, q, x, y;
int u[1090][1090], d[1090][1090], l[1090][1090], r[1090][1090];
int a[1090][1090];
void precacu() {
  int i, j;
  for (i = 1; i <= n; i++)
    for (j = 1; j <= m; j++)
      if (a[i][j]) {
        if (a[i - 1][j])
          u[i][j] = u[i - 1][j];
        else
          u[i][j] = i;
        if (a[i][j - 1])
          l[i][j] = l[i][j - 1];
        else
          l[i][j] = j;
      }
  for (i = n; i >= 1; i--)
    for (j = m; j >= 1; j--)
      if (a[i][j]) {
        if (a[i + 1][j])
          d[i][j] = d[i + 1][j];
        else
          d[i][j] = i;
        if (a[i][j + 1])
          r[i][j] = r[i][j + 1];
        else
          r[i][j] = j;
      }
}
void op1() {
  a[x][y] ^= 1;
  if (a[x][y]) {
    if (a[x - 1][y])
      u[x][y] = u[x - 1][y];
    else
      u[x][y] = x;
    if (a[x + 1][y])
      d[x][y] = d[x + 1][y];
    else
      d[x][y] = x;
    if (a[x][y - 1])
      l[x][y] = l[x][y - 1];
    else
      l[x][y] = y;
    if (a[x][y + 1])
      r[x][y] = r[x][y + 1];
    else
      r[x][y] = y;
    i = y - 1;
    while (i && r[x][i] == y - 1) r[x][i] = r[x][y], i--;
    i = y + 1;
    while (i <= m && l[x][i] == y + 1) l[x][i] = l[x][y], i++;
    i = x - 1;
    while (i && d[i][y] == x - 1) d[i][y] = d[x][y], i--;
    i = x + 1;
    while (i <= n && u[i][y] == x + 1) u[i][y] = u[x][y], i++;
  } else {
    u[x][y] = d[x][y] = l[x][y] = r[x][y] = 0;
    i = y - 1;
    while (i && r[x][i] >= y) r[x][i] = y - 1, i--;
    i = y + 1;
    while (i <= m && l[x][i] <= y) l[x][i] = y + 1, i++;
    i = x - 1;
    while (i && d[i][y] >= x) d[i][y] = x - 1, i--;
    i = x + 1;
    while (i <= n && u[i][y] <= x) u[i][y] = x + 1, i++;
  }
}
int op2() {
  int ans = 0;
  if (a[x][y] == 0) return ans;
  int up = u[x][y], down = d[x][y];
  ans = max(ans, down - up + 1);
  for (i = y + 1; i <= m; i++) {
    if (!a[x][i]) break;
    up = max(up, u[x][i]);
    down = min(down, d[x][i]);
    ans = max(ans, (down - up + 1) * (i - y + 1));
  }
  up = u[x][y], down = d[x][y];
  for (i = y - 1; i >= 1; i--) {
    if (!a[x][i]) break;
    up = max(up, u[x][i]);
    down = min(down, d[x][i]);
    ans = max(ans, (down - up + 1) * (-i + y + 1));
  }
  int left = l[x][y], right = r[x][y];
  ans = max(ans, (right - left + 1));
  for (i = x + 1; i <= n; i++) {
    if (!a[i][y]) break;
    left = max(left, l[i][y]);
    right = min(right, r[i][y]);
    ans = max(ans, (right - left + 1) * (i - x + 1));
  }
  left = l[x][y], right = r[x][y];
  for (i = x - 1; i >= 1; i--) {
    if (!a[i][y]) break;
    left = max(left, l[i][y]);
    right = min(right, r[i][y]);
    ans = max(ans, (right - left + 1) * (-i + x + 1));
  }
  return ans;
}
int main() {
  cin >> n >> m >> q;
  memset(a, 0, sizeof(a));
  for (i = 1; i <= n; i++)
    for (j = 1; j <= m; j++) scanf("%d", &a[i][j]);
  precacu();
  int op;
  while (q--) {
    scanf("%d%d%d", &op, &x, &y);
    if (op == 1) op1();
    if (op == 2) printf("%d\n", op2());
  }
  return 0;
}
