Akm[k_,m_]:=Piecewise[{{0, k != 3 || (m != -3 && m != -2 && m != -1 && m != 1 && m != 2 && m != 3)}, {-A[3, 3], k == 3 && m == -3}, {(-I)*B[3, 2], k == 3 && m == -2}, {-A[3, 1], k == 3 && m == -1}, {A[3, 1], k == 3 && m == 1}, {I*B[3, 2], k == 3 && m == 2}}, A[3, 3]]