program sample
	implicit none
    integer :: x,y
    
    read(*,*) x
    read(*,*) y
    
    if (x=1 .and. y=2) then
    	write(*,*) 3
    else if (x=1 .and. y=3) then
    	write(*,*) 2
    else if (x=2 .and. y=1) then
    	write(*,*) 3        
    else if (x=2 .and. y=3) then
    	write(*,*) 1        
    else if (x=3 .and. y=1) then
    	write(*,*) 2        
    else if (x=3 .and. y=2) then
    	write(*,*) 1        
	end if

    stop
end program sample