Line up the Diagonals of a Grid of Text Given a rectangular grid of text, line up the diagonals that go from the upper-left to the bottom-right into columns such that the lowest-rightmost characters of all diagonals are on a level. Use spaces for indentation.

For example, if the input grid of text is

abcd
1234
WXYZ


then you'd line up the diagonals W, 1X, a2Y, b3z, c4, and d in columns giving this output:

  ab
 123c
WXYZ4d


Note that the lowest-rightmost characters of all diagonals, WXYZ4d, are at the same level.

Details


The input grid of text will be at minimum 1&times;1 in size and all lines will be the same length.
You may take the input grid as a multiline string or as a list of single line strings.
The input grid will only contains printable ASCII characters (includes space).
The output may optionally have one trailing newline but there should be no other empty lines.
The lines of the output may optionally have trailing spaces but should not have unnecessary leading spaces.


Other Examples

Empty lines separate examples. Each input is directly followed by its output.

123
456
789

  1
 452
78963

123.?!
456??!
789!!!

  123.
 456???
789!!!!!

**@
@  

 **
@  @


/\/\
\/ /
/ /\
\/\/

   /
  \/\
 / / /
\/\/\/\

12
34
56
78
90

 7531
908642

Code

Code

G
O
L
F

FLOG

~

~


Scoring

The shortest code in bytes wins.
J, 12 bytes

|./.&amp;.|:&amp;.|.


Defines an anonymous verb.
Try it online!

Explanation

|./.&amp;.|:&amp;.|.
|.            Reversed
  /.          anti-diagonals
    &amp;.        under
      |:      transpose
        &amp;.    under
          |.  reversal


In J, u &amp;. v (read: u under v) means "v, then u, then inverse of v".
Reversal and transpose are self-inverses, so the program really means "reverse, transpose, extract reversed anti-diagonals, transpose, reverse".

With example input:

abcd
1234
WXYZ


Reverse:

WXYZ
1234
abcd


Transpose:

W1a
X2b
Y3c
Z4d


Extract reversed anti-diagonals (and pad with spaces):

W  
X1 
Y2a
Z3b
4c 
d  


Transpose:

WXYZ4d
 123c 
  ab  


Reverse:

  ab  
 123c 
WXYZ4d