Press space to clear, press the right arrow to switch to stamp mode, and press the left arrow to switch to pen mode.
I have finally made it. And it is 1s1s (one sprite, one script).