```
class Solution(object):
def canMeasureWater(self, x, y, z):
"""
:type x: int
:type y: int
:type z: int
:rtype: bool
"""
x,y=max(x,y),min(x,y)
if z==0:
return True
elif z>x+y:
return False
elif y==0:
if x==z:
return True
else:
return False
while x%y>0:
x,y=y,x%y
if z%y==0:
return True
return False
```