def base26(w):
    """Convert string into base26 representation where a=0 and z=25."""
    val = 0
    for ch in w.lower():
        next_digit = ord(ch) - ord('a')
        val = 26*val + next_digit
    return val