def policy(Q):
    """Hard max over prescriptions

    Params:
    -------
        * Q: dictionary of dictionaries
        Nested dictionary representing a table

    Returns:
    -------
        * policy: dictonary of states to policies
    """
    pol = {}
    for s in Q:
        pol[s] = max(Q[s].items(), key=lambda x: x[1])[0]

    return pol