program example
	implicit none

	integer(8) A,B,K
    
    read(*,*) A,B,K

 	if(A+B>=K) then
    	if(A>=K) then
        	A=A-K
        else
        	B=A+B-K
        	A=0
        end if
    else
    	A=0
        B=0
    end if
    
    write(*,*) A,B

end program example