ABCD is a square with side length a. Quarter circles are drawn, as shown below. A circle of radius x is tangent to the quarter circles and to side AB. Find x in terms of a.