def ser_compact_size(l):
    r = b''
    if (l < 253):
        r = struct.pack('B', l)
    elif (l < 65536):
        r = struct.pack('<BH', 253, l)
    elif (l < 4294967296):
        r = struct.pack('<BI', 254, l)
    else:
        r = struct.pack('<BQ', 255, l)
    return r
def ser_compact_size(l):
    r = b
    if (l < 253):
        r = struct.pack('B', l)
    elif (l < 65536):
        r = struct.pack('<BH', 253, l)
    elif (l < 4294967296):
        r = struct.pack('<BI', 254, l)
    else:
        r = struct.pack('<BQ', 255, l)
    return r