having unravel Berland Dictionary scientist manage read note chronicler time for example learn chief ancient Berland tribe chosenAs soon pretender pick follow test take place chief tribe take slab divide horizontal vertical stripe identical square slab consist N line M column paint square black white then pretender give slab size paint entirely white within day pretender paint sidelinke set square slab color the set call link square belong set path belong set neighboring square share the aim pretender paint slab exactly way chiefs slab paint the paint slab like new chiefscientist find slab paint ancient Berland tribe chief help determine minimal day need find new chief paint slab give way