Point \(P\) is taken interior to a square with side-length \(a\) such that it is equally distant from two consecutive vertices and from the side opposite these vertices. If \(d\) represents the common distance, find the value of \(d\) in terms of \(a\). The original answer is in the form \(\frac{ka}{m}\), where the fraction is in its simplest form. Please find the value of \(k + m\).

Let's think step by step and output the final answer within \boxed{}.
user