Four terrorists tried by military courts hanged