Van der Waerden function and colorings of hypergraphs with large girth