The Fibonacci sequence $(f_i)$ is the unique sequence such that

Similarly, there is a unique function $A(m,n)$ such that

Define $S(k)=\displaystyle\sum_{i=2}^k\sum_{j=2}^k A(f_i,f_j)$. For example $$ \begin{align} S(3)&=A(1,1)+A(1,2)+A(2,1)+A(2,2)\\ &=2+5+7+16\\ &=30 \end{align} $$You are also given $S(5)=10396$.

Find $S(50)$, giving your answer modulo $1123581313$.