generalized print solution