Help needed in solving a DP problem

Alice and Bob are playing a game: n cards are laid out in a row, the number Ai
is written on the i-th card. In one move, you can take one, two or three cards from the right end of the row. The game
ends when there are no more cards. The winner is the one with the maximum sum of numbers on
the cards at the end of the game. Who will win if played optimally?

Kindly someone say what are the system variables and how to proceed;
I searched for similar problems but hard luck for me;
Kindly help!

share the problem link

I hope it’s not from any ongoing contest. Try this problem, it’s an easier variation of this problem with more trivial transitions CSES - Removal Game

Its a home task problem in a DS course by pavel mavrin on Youtube.
You can refer the task below.I missed the solution discussion part on twitch.
Kindly help!
the task sheet

Just take turn variable and sum and try to maximise in one turn and minimise in other turn.