#define max(a,b)(((a) > (b)) ? (a) : (b))
#define max3(x,y,z) (max((x),max(y,z)))