Ternary nanocomposites for supercapattery