```
class Solution(object):
def singleNumber(self, nums):
"""
:type nums: List[int]
:rtype: List[int]
"""
x=0
for n in nums:
x^=n
x&=-x
ans=[0,0]
for n in nums:
ans[int(bool(n&x))]^=n
return ans
```