What are the coordinates of the vertices of a right triangle, with the right angle at point b, given that point a is (4,7), point b is (p, 3), and point c is (7,3)? Find the value of p.