Spoj solution of JAVAC problem