Optimizing the PRINT problem solution