Programming Tetris Blocks (Literally) In the game Tetris, there are 7 types of bricks or Tetriminoes, which are mathematically known as tetrominoes because they are all made with 4 square segments:



The have the names I, J, L, O, S, T, and Z, that correspond to their approximate shapes. Counting 90&deg; rotations, there are 19 unique shapes in total:

I
I
I
I

IIII

 J
 J
JJ

JJJ
  J

JJ
J
J

J
JJJ

L
L
LL

  L
LLL

LL
 L
 L

LLL
L

OO
OO

 SS
SS

S
SS
 S

TTT
 T

T
TT
T

 T
TTT

 T
TT
 T

ZZ
 ZZ

 Z
ZZ
Z


Challenge

Write a rectangular block of code that acts as the base segment these 19 shapes are made from. When this code is arranged into one of the shapes, a program should be formed that outputs the single uppercase letter associated with that shape. This must work for all 19 shapes.

The leading empty areas present in some of the 19 shapes are filled in entirely with spaces (). The trailing empty areas are not filled with anything (so the programs are not always exactly rectangular).

Example

Suppose this was your code block:

ABC
123


Then either arrangement of the block into the S Tetris piece would be a program that prints S:

   ABCABC
   123123
ABCABC
123123

ABC
123
ABCABC
123123
   ABC
   123

(Notice that all leading empty space is filled with space characters, and that no lines have any trailing spaces.)

The same idea applies to all 6 other pieces and their respective rotations.

Notes


All 19 final programs are to be run in the same programming language.
If desired, you may add a single trailing newline to all programs (not just some, all or none).
Your code block may contain any characters (including spaces) that aren't line terminators.
Output the letter to stdout (or your language's closest alternative) with an optional trailing newline.


Scoring

The submission whose code block has the smallest area (width times height) wins. This essentially means the shortest code wins, which is why this is tagged code-golf. Tiebreaker goes to the highest voted answer.

The ABC\n123 example has area 3&times;2 = 6.

Snippet

Given a code block, this snippet will generate all 19 programs:



&lt;script&gt;function drawShape(X,n,v){for(var t="",e=0;e&lt;v.length;e++)for(var l=0;l&lt;n.length;l++){for(var r=0;r&lt;v[e].length;r++)t+="X"===v[e][r]?n[l]:X[l];t+="\n"}return t}function go(){var X=document.getElementById("input").value;if(0!=X.length){var n=X.replace(/./g," ").split("\n");X=X.split("\n");for(var v="I (v1):|I (v2):|J (v1):|J (v2):|J (v3):|J (v4):|L (v1):|L (v2):|L (v3):|L (v4):|O:|S (v1):|S (v2):|T (v1):|T (v2):|T (v3):|T (v4):|Z (v1):|Z (v2):".split("|"),t="X\nX\nX\nX|XXXX| X\n X\nXX|XXX\n  X|XX\nX\nX|X\nXXX|X\nX\nXX|  X\nXXX|XX\n X\n X|XXX\nX|XX\nXX| XX\nXX|X\nXX\n X|XXX\n X|X\nXX\nX| X\nXXX| X\nXX\n X|XX\n XX| X\nXX\nX".split("|"),e="",l=0;l&lt;v.length;l++)e+=v[l]+"\n\n"+drawShape(n,X,t[l].split("\n"))+"\n";e=e.substring(0,e.length-2),document.getElementById("output").value=e}}&lt;/script&gt;&lt;style&gt;html *{font-family: monospace;}&lt;/style&gt;Code Block:&lt;br&gt;&lt;textarea id='input' rows='8' cols='64'&gt;ABC&amp;#010;123&lt;/textarea&gt;&lt;br&gt;&lt;button type='button' onclick='go()'&gt;Go&lt;/button&gt;&lt;br&gt;&lt;br&gt;All 19 Programs:&lt;br&gt;&lt;textarea id='output' rows='24' cols='64'&gt;&lt;/textarea&gt;
&lt;>&lt; (Fish) - 12 * 32 = 384

I was planning to go for a more elegant solution, but I somehow ended up with this, which is pretty brute-force:

c  0  g84*%\
c2*0  g84*%\
0  84*g84*%\
c  84*g84*%\
c2*84*g84*%\
0  88*g84*%\
c  88*g84*%\
?v         \
;&gt;?v~~?vv   
"L" o;  &gt;   
"S" o; &gt;~?v 
"T" o;    &gt; 
;  &gt;~?v"L"o 
;     &gt;"J"o 
?v         \
 &gt;~?v~~?vv  
"I"  o;  &gt;  
"J"  o; &gt;   
    \~~?vv  
"T"  o;  &gt;  
"Z"  o; &gt;   
?v         \
 &gt;?v"J"o;   
   &gt;?v"Z"o; 
"L"o;&gt;?!v   
"J"o;   &gt;?v 
"T"o;     &gt; 
?v?v"I"o;  &gt;
   &gt;"L"o;   
 &gt;?v"T"o;   
   &gt;?v"O"o; 
     &gt;"S"o; 


It's pretty simple, it checks the code in a 3x3 square for text and uses the results to see which tetrimino corresponds to the code's shape. I didn't take a lot of effort to golf it yet.

Try the code here (after using the snippet to shape it like a tetrimino)

Example of code in shape Z (v1) here