import random


def DEFAULTPOLICY(state):
    """
    random policy
    :param state: from this state, run simulation with random action
    :return: final reward after reaching the final state
    """
    while state.terminal() == False:  # simulate until terminal state
        random_action = random.randint(0, 3)
        state = state.next_state(random_action)
        # print(state)
    return state.reward()