def double_middle_drop(p):
    eps1 = 0.75
    eps2 = 0.25
    if ((1 - p) < eps1):
        if ((1 - p) < eps2):
            return (eps2 * 0.5)
        return (eps1 * 0.1)
    return (1 - p)
def double_middle_drop(p):
    eps1 = 0.75
    eps2 = 0.25
    if ((1 - p) < eps1):
        if ((1 - p) < eps2):
            return (eps2 * 0.5)
        return (eps1 * 0.1)
    return (1 - p)