Please solve the programming task below using a self-contained code snippet in a markdown code block.

You are given a string s and a robot that currently holds an empty string t. Apply one of the following operations until s and t are both empty:

Remove the first character of a string s and give it to the robot. The robot will append this character to the string t.
Remove the last character of a string t and give it to the robot. The robot will write this character on paper.

Return the lexicographically smallest string that can be written on the paper.
 
Please complete the following python code precisely:
```python
class Solution:
    def robotWithString(self, s: str) -> str:
```