nt.number theory – When this system has no integer solutions

I came across the following problem. Let us consider the two equations:
$$ax+by+cz=gcd(a,b,c)$$
$$-a-b+c=wcdot gcd(a,b,c)$$

Here all the arguments are non-zero integers, and $gcd$ is the greatest common divisor. I am asking for sufficient and necessary conditions when this system has no integer solutions (in a subset of integers) if $w>0$.