def parse_claim(claim):
    """
    Parse a line of input

    Example claim:
    #1 @ 861,330: 20x10
    """

    tokens = claim.split(" ")
    claim_id = int(tokens[0][1:])
    (offset_x, offset_y) = tokens[2].split(',')
    offset_x = int(offset_x)
    offset_y = int(offset_y[:-1])
    (width, height) = tokens[3].split('x')
    width = int(width)
    height = int(height)

    return (claim_id, offset_x, offset_y, width, height)