2 stacks
TODO: modularize the subshell command