def Int2AP(num):
    """string = Int2AP(num)
    Return 'num' converted to a string using characters from the set 'A'..'P'
    """
    val, a2p = [], 'ABCDEFGHIJKLMNOP'
    num = int(abs(num))
    while num:
        num, mod = divmod(num, 16)
        val.insert(0, a2p[mod])
    return ''.join(val)
