#include <bits/stdc++.h>
using namespace std;
long long int n, m, a, b, c, d;
char in[100], out[100];
int f(int x, int y){
	if(x<1 or x > n -(y+1)%2 or  y> d) return 0;
	if(x == c and y == d) return 1;
	return f(x-y%2,y+1)+f(x+1-y%2,y+1)+f(x+1,y);
}
int main(){
	for(int I=36;I<=40;I++){
		sprintf(in,".%d.in",I);
	    freopen(in,"w",stdout);
		cin >> n >> m;
		cin >> a >> b;
		cin >> c >> d;
		cout << n << " " << m<<endl;
		cout << a<<" "<< b<<" "<< c<<" "<< d<<endl;
		sprintf(out,".%d.out",I);
	    freopen(out,"w",stdout);
		cout << f(a, b);
	
	}
}
