document.write script execution order

The following numbers should be 1 to 5, written in ascending order:

Browsers that output numbers in such sequence:

What's the order of "document.written" script execution?

<script>
... 1 ...
document.write('<script>...</script>');
... 5 ...                |
</script>                |
                         v
                      <script>
                      ... 2 ...
                      document.write('<script>...</script>');
                      ... 4 ...                |
                      </script>                |
                                               v
                                            <script>
                                            ... 3 ...
                                            </script>