Given a matrix (H × W) which contains only 1 and 0, find the area of the largest rectangle which only contains 0s.

Constraints

* 1 ≤ H, W ≤ 1,400

Input


H W
c1,1 c1,2 ... c1,W
c2,1 c2,2 ... c2,W
:
cH,1 cH,2 ... cH,W


In the first line, two integers H and W separated by a space character are given. In the following H lines, ci,j, elements of the H × W matrix, are given.

Output

Print the area (the number of 0s) of the largest rectangle.

Example

Input

4 5
0 0 1 0 0
1 0 0 0 0
0 0 0 1 0
0 0 0 1 0


Output

6
#include <bits/stdc++.h>
using namespace std;
struct Edge {
  int to, c;
  Edge(int ti, int ci) {
    to = ti;
    c = ci;
  }
};
int N, X;
set<int> sum_list;
vector<int> list_;
void dfs(vector<vector<Edge> >& g, int corr, int pre) {
  int pre_edge_c = list_[list_.size() - 1];
  for (int i = 0; i < g[corr].size(); i++) {
    if (g[corr][i].to == pre) continue;
    g[corr][i].c ^= pre_edge_c;
    int k = 0;
    for (int j = 0; j < g[i].size(); j++)
      if (g[i][j].to == corr) k = j;
    g[i][k].c = g[corr][i].c;
    sum_list.insert(g[corr][i].c);
    list_.push_back(g[corr][i].c);
    dfs(g, g[corr][i].to, corr);
  }
}
void dump(vector<vector<Edge> >& g) {
  for (int i = 0; i < g.size(); i++)
    for (Edge e : g[i])
      cout << i + 1 << " -> " << e.to + 1 << ":" << e.c << endl;
}
int main() {
  cin >> N >> X;
  vector<vector<Edge> > g(N);
  for (int i = 0; i < N - 1; i++) {
    int x, y, c;
    cin >> x >> y >> c;
    g[x - 1].push_back(Edge(y - 1, c));
    g[y - 1].push_back(Edge(x - 1, c));
  }
  int leaf;
  for (int i = 0; i < N; i++)
    if (g[i].size() == 1) leaf = i;
  cout << leaf << endl;
  list_.push_back(0);
  dfs(g, leaf, -1);
  int ans = 0;
  for (int i = 1; i < list_.size(); i++) {
    if (sum_list.find(list_[i] ^ X) == sum_list.end()) ans++;
  }
  cout << ans << endl;
}
