def get_skel(s):
    """Get a tuple representing an instrution skeleton.
    
    Args:
        s: String of chars in {0, 1, x} of the skeleton
    Returns:
        Tuple (before, length, after), where 
        - before is the number before the mask
        - length is the length of x's in the mask
        - after is the number after the mask
    """
    i = 0
    # get number before x's
    before = 0
    while i < len(s):
        if s[i] != 'x':
            assert s[i] == '0' or s[i] == '1'
            before += before
            before += int(s[i])
        else:
            break
        i += 1
    # get number of x's
    xlen = 0
    while i < len(s):
        if s[i] == 'x':
            xlen += 1
        else:
            break
        i += 1
    # get number of 0s after x's
    zerolen = 0
    while i < len(s):
        if s[i] == '0':
            zerolen += 1
        else: 
            break
        i += 1
    # get number afer x's
    after = 0
    while i < len(s):
        assert s[i] == '0' or s[i] == '1'
        after += after
        after += int(s[i])
        i += 1

    return (before, xlen, zerolen, after)