# 异或和或的运算性质

# a^a = 0 a^0 = a
# a&a = a a&0 = 0
#
# 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可
#
# 
# @param array int整型一维数组 
# @return int整型一维数组
#
class Solution:
    def FindNumsAppearOnce(self , array: List[int]) -> List[int]:
        # write code here
        res = 0
        for num in array:
            res^= num
        compare = 1
        while compare & res == 0:
            compare <<= 1
        a = 0
        b = 0
        for num in array:
            if compare & num == 0:
                a^= num
            else:
                b^= num
        return sorted([a,b])