Chef is playing a game with two sequences of non-negative integers A1,A2,…,AN and B1,B2,…,BM. He has an integer V, which is initially equal to 0. Chef will play for a number