program main implicit none integer(8) a,b,c,i,dummy read(*,*)a,b,c do i=1,c-2 dummy=a a=ieor(a,b) b=dummy enddo write(*,*)a end program main