How many 10-digit positive integers containing only the numbers 1,2,3 can be written such that the first and the last digits are same, and no two consecutive digits are same?<spanclass=′latex−bold′>(A)</span>768<spanclass=′latex−bold′>(B)</span>642<spanclass=′latex−bold′>(C)</span>564<spanclass=′latex−bold′>(D)</span>510<spanclass=′latex−bold′>(E)</span>456