stack example for reversing word