An iterative algorithm for separation of S and ScS waves of great earthquakes