Grundy Transform

//Grundy Transform