a, b, k = gets.split(" ");

a = a.to_i;
b = b.to_i;
k = k.to_i;

while k > 1
   if a > 0 && a < k
      k = k - a
      a = 0
      p "aaa"
   elsif a > 0 && a > k
      k = a - k;
      a = 0
      p "bbb"
   else
      a = 0
      k = 0
   end

   if k > 0 
      if b > 0 && a == 0 && b < k
         b = k - b ;
         k = b;
         p "ccc"
      elsif b > 0 && a == 0 && b > k
         b = b - k ;
         k = b;
         p "ddd"
      else
         b = 0
         k = 0
      end
   end
      k -= 1
end

print  "#{a}" + " " + "#{b}";
