From point A on the ground, the angle of elevation of the top of a 20 m tall building is 45°. A flag is hoisted at the top of the building and the angle of elevation of the top of the flagstaff from A is 60°. Find the length of the flagstaff and the distance of the building from the point A.