def read_box_line(line, box, dim):
    """Read box info from a line."""
    raw = line.strip().split()
    box[f'{dim}lo'] = float(raw[0])
    box[f'{dim}hi'] = float(raw[1])
    if len(raw) > 2:
        if dim == 'x':
            box['xy'] = float(raw[2])
        elif dim == 'y':
            box['xz'] = float(raw[2])
        else:
            box['yz'] = float(raw[2])
    return box