First worksheet at ICERM
system:sage


{{{id=1|
3 + 2
///
5
}}}

<p><span style="font-size: large;"><strong>This is my first equation:</strong></span></p>
<p><span style="font-size: large;"><strong>$$\int_a^b e^x dx$$</strong></span></p>

{{{id=6|

///
}}}

{{{id=2|
4 + 5
///
9
}}}

{{{id=5|

///
}}}

{{{id=3|
x^2 + 4 - 3*x
///
x^2 - 3*x + 4
}}}

{{{id=4|

///
}}}

{{{id=8|
search_doc("Young")
///
^CTraceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "_sage_input_14.py", line 10, in <module>
    exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("c2VhcmNoX2RvYygiWW91bmciKQ=="),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))' + '\n', '', 'single')
  File "", line 1, in <module>
    
  File "/tmp/tmpA45Zg3/___code___.py", line 2, in <module>
    exec compile(u'search_doc("Young")' + '\n', '', 'single')
  File "", line 1, in <module>
    
  File "/home/saliola/Applications/sage-5.6/local/lib/python2.7/site-packages/sage/misc/sagedoc.py", line 1048, in search_doc
    **kwds)
  File "/home/saliola/Applications/sage-5.6/local/lib/python2.7/site-packages/sage/misc/sagedoc.py", line 806, in _search_src_or_doc
    if re.search(string, line, flags)]
KeyboardInterrupt
__SAGE__
}}}

{{{id=9|
Partitions
///
<function Partitions at 0x3634488>
}}}

{{{id=10|
P = Partitions(15)
///
}}}

{{{id=11|
P
///
Partitions of the integer 15
}}}

{{{id=12|
P.cardinality()
///
176
}}}

{{{id=13|
P.an_element()
///
[14, 1]
}}}

{{{id=14|
P.random_element()
///
[6, 2, 2, 1, 1, 1, 1, 1]
}}}

{{{id=15|
P.list()
///
[[15], [14, 1], [13, 2], [13, 1, 1], [12, 3], [12, 2, 1], [12, 1, 1, 1], [11, 4], [11, 3, 1], [11, 2, 2], [11, 2, 1, 1], [11, 1, 1, 1, 1], [10, 5], [10, 4, 1], [10, 3, 2], [10, 3, 1, 1], [10, 2, 2, 1], [10, 2, 1, 1, 1], [10, 1, 1, 1, 1, 1], [9, 6], [9, 5, 1], [9, 4, 2], [9, 4, 1, 1], [9, 3, 3], [9, 3, 2, 1], [9, 3, 1, 1, 1], [9, 2, 2, 2], [9, 2, 2, 1, 1], [9, 2, 1, 1, 1, 1], [9, 1, 1, 1, 1, 1, 1], [8, 7], [8, 6, 1], [8, 5, 2], [8, 5, 1, 1], [8, 4, 3], [8, 4, 2, 1], [8, 4, 1, 1, 1], [8, 3, 3, 1], [8, 3, 2, 2], [8, 3, 2, 1, 1], [8, 3, 1, 1, 1, 1], [8, 2, 2, 2, 1], [8, 2, 2, 1, 1, 1], [8, 2, 1, 1, 1, 1, 1], [8, 1, 1, 1, 1, 1, 1, 1], [7, 7, 1], [7, 6, 2], [7, 6, 1, 1], [7, 5, 3], [7, 5, 2, 1], [7, 5, 1, 1, 1], [7, 4, 4], [7, 4, 3, 1], [7, 4, 2, 2], [7, 4, 2, 1, 1], [7, 4, 1, 1, 1, 1], [7, 3, 3, 2], [7, 3, 3, 1, 1], [7, 3, 2, 2, 1], [7, 3, 2, 1, 1, 1], [7, 3, 1, 1, 1, 1, 1], [7, 2, 2, 2, 2], [7, 2, 2, 2, 1, 1], [7, 2, 2, 1, 1, 1, 1], [7, 2, 1, 1, 1, 1, 1, 1], [7, 1, 1, 1, 1, 1, 1, 1, 1], [6, 6, 3], [6, 6, 2, 1], [6, 6, 1, 1, 1], [6, 5, 4], [6, 5, 3, 1], [6, 5, 2, 2], [6, 5, 2, 1, 1], [6, 5, 1, 1, 1, 1], [6, 4, 4, 1], [6, 4, 3, 2], [6, 4, 3, 1, 1], [6, 4, 2, 2, 1], [6, 4, 2, 1, 1, 1], [6, 4, 1, 1, 1, 1, 1], [6, 3, 3, 3], [6, 3, 3, 2, 1], [6, 3, 3, 1, 1, 1], [6, 3, 2, 2, 2], [6, 3, 2, 2, 1, 1], [6, 3, 2, 1, 1, 1, 1], [6, 3, 1, 1, 1, 1, 1, 1], [6, 2, 2, 2, 2, 1], [6, 2, 2, 2, 1, 1, 1], [6, 2, 2, 1, 1, 1, 1, 1], [6, 2, 1, 1, 1, 1, 1, 1, 1], [6, 1, 1, 1, 1, 1, 1, 1, 1, 1], [5, 5, 5], [5, 5, 4, 1], [5, 5, 3, 2], [5, 5, 3, 1, 1], [5, 5, 2, 2, 1], [5, 5, 2, 1, 1, 1], [5, 5, 1, 1, 1, 1, 1], [5, 4, 4, 2], [5, 4, 4, 1, 1], [5, 4, 3, 3], [5, 4, 3, 2, 1], [5, 4, 3, 1, 1, 1], [5, 4, 2, 2, 2], [5, 4, 2, 2, 1, 1], [5, 4, 2, 1, 1, 1, 1], [5, 4, 1, 1, 1, 1, 1, 1], [5, 3, 3, 3, 1], [5, 3, 3, 2, 2], [5, 3, 3, 2, 1, 1], [5, 3, 3, 1, 1, 1, 1], [5, 3, 2, 2, 2, 1], [5, 3, 2, 2, 1, 1, 1], [5, 3, 2, 1, 1, 1, 1, 1], [5, 3, 1, 1, 1, 1, 1, 1, 1], [5, 2, 2, 2, 2, 2], [5, 2, 2, 2, 2, 1, 1], [5, 2, 2, 2, 1, 1, 1, 1], [5, 2, 2, 1, 1, 1, 1, 1, 1], [5, 2, 1, 1, 1, 1, 1, 1, 1, 1], [5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [4, 4, 4, 3], [4, 4, 4, 2, 1], [4, 4, 4, 1, 1, 1], [4, 4, 3, 3, 1], [4, 4, 3, 2, 2], [4, 4, 3, 2, 1, 1], [4, 4, 3, 1, 1, 1, 1], [4, 4, 2, 2, 2, 1], [4, 4, 2, 2, 1, 1, 1], [4, 4, 2, 1, 1, 1, 1, 1], [4, 4, 1, 1, 1, 1, 1, 1, 1], [4, 3, 3, 3, 2], [4, 3, 3, 3, 1, 1], [4, 3, 3, 2, 2, 1], [4, 3, 3, 2, 1, 1, 1], [4, 3, 3, 1, 1, 1, 1, 1], [4, 3, 2, 2, 2, 2], [4, 3, 2, 2, 2, 1, 1], [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{id=16|
P = Partitions(429)
///
}}}

{{{id=17|
P.cardinality()
///
39020148000237259665
}}}

{{{id=18|
P.first()
///
[429]
}}}

{{{id=19|
for p in P:
    print p
///
WARNING: Output truncated!  
<html><a target='_new' href='/home/admin/32/cells/19/full_output.txt' class='file_link'>full_output.txt</a></html>



[429]
[428, 1]
[427, 2]
[427, 1, 1]
[426, 3]
[426, 2, 1]
[426, 1, 1, 1]
[425, 4]
[425, 3, 1]
[425, 2, 2]
[425, 2, 1, 1]
[425, 1, 1, 1, 1]
[424, 5]
[424, 4, 1]
[424, 3, 2]
[424, 3, 1, 1]
[424, 2, 2, 1]
[424, 2, 1, 1, 1]
[424, 1, 1, 1, 1, 1]
[423, 6]
[423, 5, 1]
[423, 4, 2]
[423, 4, 1, 1]
[423, 3, 3]
[423, 3, 2, 1]
[423, 3, 1, 1, 1]
[423, 2, 2, 2]
[423, 2, 2, 1, 1]
[423, 2, 1, 1, 1, 1]
[423, 1, 1, 1, 1, 1, 1]
[422, 7]
[422, 6, 1]
[422, 5, 2]
[422, 5, 1, 1]
[422, 4, 3]
[422, 4, 2, 1]
[422, 4, 1, 1, 1]
[422, 3, 3, 1]
[422, 3, 2, 2]
[422, 3, 2, 1, 1]
[422, 3, 1, 1, 1, 1]
[422, 2, 2, 2, 1]
[422, 2, 2, 1, 1, 1]
[422, 2, 1, 1, 1, 1, 1]
[422, 1, 1, 1, 1, 1, 1, 1]
[421, 8]
[421, 7, 1]
[421, 6, 2]
[421, 6, 1, 1]
[421, 5, 3]
[421, 5, 2, 1]
[421, 5, 1, 1, 1]
[421, 4, 4]
[421, 4, 3, 1]
[421, 4, 2, 2]
[421, 4, 2, 1, 1]
[421, 4, 1, 1, 1, 1]
[421, 3, 3, 2]
[421, 3, 3, 1, 1]

...

[395, 14, 5, 5, 4, 2, 2, 2]
[395, 14, 5, 5, 4, 2, 2, 1, 1]
[395, 14, 5, 5, 4, 2, 1, 1, 1, 1]
[395, 14, 5, 5, 4, 1, 1, 1, 1, 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3, 2, 1, 1, 1, 1, 1, 1]
[395, 14, 5, 4, 3, 1, 1, 1, 1, 1, 1, 1, 1]
[395, 14, 5, 4, 2, 2, 2, 2, 2, 1]
[395, 14, 5, 4, 2, 2, 2, 2, 1, 1, 1]
[395, 14, 5, 4, 2, 2, 2, 1, 1, 1, 1, 1]
[395, 14, 5, 4, 2, 2, 1, 1, 1, 1, 1, 1, 1]
[395, 14, 5, 4, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1]
[395, 14, 5, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
[395, 14, 5, 3, 3, 3, 3, 3]
[395, 14, 5, 3, 3, 3, 3, 2, 1]
^C
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "_sage_input_62.py", line 10, in <module>
    exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("Zm9yIHAgaW4gUDoKICAgIHByaW50IHA="),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))' + '\n', '', 'single')
  File "", line 1, in <module>
    
  File "/tmp/tmpMUqX_r/___code___.py", line 2, in <module>
    exec compile(u'for p in P:\n    print p' + '\n', '', 'single')
  File "", line 2, in <module>
    
KeyboardInterrupt
__SAGE__
}}}

{{{id=20|
p
///
[395, 14, 5, 3, 3, 3, 3, 2, 1]
}}}

{{{id=21|
p = Partition([5,3,1,1])
///
}}}

{{{id=22|
p
///
[5, 3, 1, 1]
}}}

{{{id=23|
print p.ferrers_diagram()
///
*****
***
*
*
}}}

{{{id=24|
S = p.standard_tableaux()
///
}}}

{{{id=25|
S
///
Standard tableaux of shape [5, 3, 1, 1]
}}}

{{{id=26|
t = S.first()
///
}}}

{{{id=27|
t.pp()
///
  1  5  7  9 10
  2  6  8
  3
  4
}}}

{{{id=28|
latex(t)
///
{\def\lr#1{\multicolumn{1}{|@{\hspace{.6ex}}c@{\hspace{.6ex}}|}{\raisebox{-.3ex}{$#1$}}}
\raisebox{-.6ex}{$\begin{array}[b]{ccccc}
\cline{1-1}\cline{2-2}\cline{3-3}\cline{4-4}\cline{5-5}
\lr{1}&\lr{5}&\lr{7}&\lr{9}&\lr{10}\\
\cline{1-1}\cline{2-2}\cline{3-3}\cline{4-4}\cline{5-5}
\lr{2}&\lr{6}&\lr{8}\\
\cline{1-1}\cline{2-2}\cline{3-3}
\lr{3}\\
\cline{1-1}
\lr{4}\\
\cline{1-1}
\end{array}$}
}
}}}

{{{id=29|
view(t, pdflatex=True, viewer='pdf')
///
}}}

{{{id=30|

///
}}}

{{{id=31|
f(x) = x^2 + sin(4*x)
///
}}}

{{{id=32|
f(x)
///
x^2 + sin(4*x)
}}}

{{{id=33|
show(f(x))
///
<html><script type="math/tex; mode=display">\newcommand{\Bold}[1]{\mathbf{#1}}x^{2} + \sin\left(4 \, x\right)</script></html>
}}}

{{{id=34|
f(-3)
///
-sin(12) + 9
}}}

{{{id=35|
plot(f(x), -2, 2)
///
<html><font color='black'><img src='cell://sage0.png'></font></html>
}}}

{{{id=36|
type(f(x))
///
<type 'sage.symbolic.expression.Expression'>
}}}

{{{id=37|
f(t)
///
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "_sage_input_92.py", line 10, in <module>
    exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("Zih0KQ=="),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))' + '\n', '', 'single')
  File "", line 1, in <module>
    
  File "/tmp/tmpnAvEmf/___code___.py", line 2, in <module>
    exec compile(u'f(t)' + '\n', '', 'single')
  File "", line 1, in <module>
    
  File "expression.pyx", line 3946, in sage.symbolic.expression.Expression.__call__ (sage/symbolic/expression.cpp:19109)
  File "/home/saliola/Applications/sage-5.6/local/lib/python2.7/site-packages/sage/symbolic/callable.py", line 477, in _call_element_
    return SR(_the_element.substitute(**d))
  File "expression.pyx", line 3795, in sage.symbolic.expression.Expression.substitute (sage/symbolic/expression.cpp:18366)
  File "expression.pyx", line 2300, in sage.symbolic.expression.Expression.coerce_in (sage/symbolic/expression.cpp:13237)
  File "parent_old.pyx", line 235, in sage.structure.parent_old.Parent._coerce_ (sage/structure/parent_old.c:3628)
  File "parent.pyx", line 1000, in sage.structure.parent.Parent.coerce (sage/structure/parent.c:8302)
TypeError: no canonical coercion from Standard tableaux of shape [5, 3, 1, 1] to Callable function ring with arguments (x,)
}}}

{{{id=38|
t
///
[[1, 5, 7, 9, 10], [2, 6, 8], [3], [4]]
}}}

{{{id=39|
var('t')
///
t
}}}

{{{id=40|
plot(f(t), -2, 2)
///
<html><font color='black'><img src='cell://sage0.png'></font></html>
}}}

{{{id=41|
plot(f, -2, 2)
///
<html><font color='black'><img src='cell://sage0.png'></font></html>
}}}

{{{id=42|
type(f)
///
<type 'sage.symbolic.expression.Expression'>
}}}

{{{id=43|
f.taylor()
///
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "_sage_input_100.py", line 10, in <module>
    exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("Zi50YXlsb3IoKQ=="),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))' + '\n', '', 'single')
  File "", line 1, in <module>
    
  File "/tmp/tmp7Vz3VY/___code___.py", line 2, in <module>
    exec compile(u'f.taylor()' + '\n', '', 'single')
  File "", line 1, in <module>
    
  File "expression.pyx", line 3269, in sage.symbolic.expression.Expression.taylor (sage/symbolic/expression.cpp:16597)
NotImplementedError: Wrong arguments passed to taylor. See taylor? for more details.
}}}

{{{id=44|
f.taylor(x, 0, 2)
///
x |--> x^2 + 4*x
}}}

{{{id=45|
show(f.taylor(x, 0, 2))
///
<html><script type="math/tex; mode=display">\newcommand{\Bold}[1]{\mathbf{#1}}x \ {\mapsto}\ x^{2} + 4 \, x</script></html>
}}}

{{{id=46|
plot(f.taylor(x, 0, 2), -2, 2)
///
<html><font color='black'><img src='cell://sage0.png'></font></html>
}}}

{{{id=47|
P1 = plot(f, -2, 2)
P2 = plot(f.taylor(x, 0, 5), -2, 2, color='red', ymin=-5, ymax=5)
///
}}}

{{{id=48|
P1 + P2
///
<html><font color='black'><img src='cell://sage0.png'></font></html>
}}}

{{{id=49|
P2 + P1
///
<html><font color='black'><img src='cell://sage0.png'></font></html>
}}}

{{{id=50|
@interact
def taylor_play(f=x^2+sin(4*x), order=slider(0, 20, 1, 2)):
    P1 = plot(f, -5, 5)
    P2 = plot(f.taylor(x, 0, order), -5, 5, color='red', ymin=-5, ymax=5)
    show(P1 + P2)
///
<html><!--notruncate-->
        <div padding=6 id="div-interact-50">
          <table width=800px height=20px bgcolor="#c5c5c5" cellpadding=15>
            <tr>
              <td bgcolor="#f9f9f9" valign=top align=left>
            <table>
              <tr><td colspan=3><table><tr><td align=right><font color="black">f&nbsp;</font></td><td><input type="text" value="x^2 + sin(4*x)" size=80 onchange="interact(50, {variable: 'f', adapt_number: 5, value: encode64(this.value)}, 1)"></input></td>
</tr><tr><td align=right><font color="black">order&nbsp;</font></td><td>
        <table>
          <tr>
            <td>
              <div id="slider-order-50" style="margin:0px; margin-left: 1.0em; margin-right: 1.0em; width: 15.0em;"></div>
            </td>
            
            <td>
              <font color="black" id="slider-order-50-lbl"></font>
            </td>
          </tr>
        </table><script>
    (function() {
        var values = ["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20"];
        setTimeout(function() {
            $('#slider-order-50').slider({
                step: 1,
                min: 0,
                max: 20,
                value: 2,
                change: function (e, ui) {
                    var position = ui.value;
                    if (values != null) {
                        $('#slider-order-50-lbl').text(values[position]);
                        interact(50, {variable: 'order', adapt_number: 6, value: encode64(position)}, 1);
                    }
                },
                slide: function (e, ui) {
                    if (values != null) {
                        $('#slider-order-50-lbl').text(values[ui.value]);
                    }
                }
            });
            if (values != null) {
                $('#slider-order-50-lbl').text(values[$('#slider-order-50').slider('value')]);
            }
        }, 1);
    })();
    </script></td>
</tr></table></td></tr>
              <tr><td></td><td style='width: 100%;'>
        <div id="cell-interact-50"><?__SAGE__START>
          <table border=0 bgcolor="white" width=100%>
            <tr>
              <td bgcolor="white" align=left valign=top>
                <pre><?__SAGE__TEXT></pre>
              </td>
            </tr>
            <tr>
              <td align=left valign=top><?__SAGE__HTML></td>
            </tr>
          </table><?__SAGE__END>
        </div></td><td></td></tr>
              <tr><td colspan=3></td></tr>
            </table></td>
            </tr>
          </table>
        </div></html>
}}}

{{{id=51|
taylor_play(5)
///
<html><font color='black'><img src='cell://sage0.png'></font></html>
}}}

{{{id=52|
@interact
def taylor_play(f=x^2+sin(4*x),order=slider(0,20,1,2),x0=slider(-2,2,.25,0)):
    p1 = plot(f, -2, 2, ymin=-5,ymax=5)
    p2 = plot(f.taylor(x, x0, order),-2,2,color='red',ymin=-5,ymax=5)
    show(p1 + p2)
///
<html><!--notruncate-->
        <div padding=6 id="div-interact-52">
          <table width=800px height=20px bgcolor="#c5c5c5" cellpadding=15>
            <tr>
              <td bgcolor="#f9f9f9" valign=top align=left>
            <table>
              <tr><td colspan=3><table><tr><td align=right><font color="black">f&nbsp;</font></td><td><input type="text" value="x^2 + sin(4*x)" size=80 onchange="interact(52, {variable: 'f', adapt_number: 7, value: encode64(this.value)}, 1)"></input></td>
</tr><tr><td align=right><font color="black">order&nbsp;</font></td><td>
        <table>
          <tr>
            <td>
              <div id="slider-order-52" style="margin:0px; margin-left: 1.0em; margin-right: 1.0em; width: 15.0em;"></div>
            </td>
            
            <td>
              <font color="black" id="slider-order-52-lbl"></font>
            </td>
          </tr>
        </table><script>
    (function() {
        var values = ["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20"];
        setTimeout(function() {
            $('#slider-order-52').slider({
                step: 1,
                min: 0,
                max: 20,
                value: 2,
                change: function (e, ui) {
                    var position = ui.value;
                    if (values != null) {
                        $('#slider-order-52-lbl').text(values[position]);
                        interact(52, {variable: 'order', adapt_number: 8, value: encode64(position)}, 1);
                    }
                },
                slide: function (e, ui) {
                    if (values != null) {
                        $('#slider-order-52-lbl').text(values[ui.value]);
                    }
                }
            });
            if (values != null) {
                $('#slider-order-52-lbl').text(values[$('#slider-order-52').slider('value')]);
            }
        }, 1);
    })();
    </script></td>
</tr><tr><td align=right><font color="black">x0&nbsp;</font></td><td>
        <table>
          <tr>
            <td>
              <div id="slider-x0-52" style="margin:0px; margin-left: 1.0em; margin-right: 1.0em; width: 15.0em;"></div>
            </td>
            
            <td>
              <font color="black" id="slider-x0-52-lbl"></font>
            </td>
          </tr>
        </table><script>
    (function() {
        var values = ["-2.00000000000000","-1.75000000000000","-1.50000000000000","-1.25000000000000","-1.00000000000000","-0.750000000000000","-0.500000000000000","-0.250000000000000","0.000000000000000","0.250000000000000","0.500000000000000","0.750000000000000","1.00000000000000","1.25000000000000","1.50000000000000","1.75000000000000","2.00000000000000"];
        setTimeout(function() {
            $('#slider-x0-52').slider({
                step: 1,
                min: 0,
                max: 16,
                value: 8,
                change: function (e, ui) {
                    var position = ui.value;
                    if (values != null) {
                        $('#slider-x0-52-lbl').text(values[position]);
                        interact(52, {variable: 'x0', adapt_number: 9, value: encode64(position)}, 1);
                    }
                },
                slide: function (e, ui) {
                    if (values != null) {
                        $('#slider-x0-52-lbl').text(values[ui.value]);
                    }
                }
            });
            if (values != null) {
                $('#slider-x0-52-lbl').text(values[$('#slider-x0-52').slider('value')]);
            }
        }, 1);
    })();
    </script></td>
</tr></table></td></tr>
              <tr><td></td><td style='width: 100%;'>
        <div id="cell-interact-52"><?__SAGE__START>
          <table border=0 bgcolor="white" width=100%>
            <tr>
              <td bgcolor="white" align=left valign=top>
                <pre><?__SAGE__TEXT></pre>
              </td>
            </tr>
            <tr>
              <td align=left valign=top><?__SAGE__HTML></td>
            </tr>
          </table><?__SAGE__END>
        </div></td><td></td></tr>
              <tr><td colspan=3></td></tr>
            </table></td>
            </tr>
          </table>
        </div></html>
}}}

{{{id=53|

///
}}}