Question 1209161
<font color=black size=3>
Answer: <font color=red>730</font>


Explanation


At first it's probably not obvious, but the trick is to realize that we can factor part of it like so
3ab-3a-3b+4
3ab-3a-3b+3+1
3(ab-a-b+1)+1
3( (ab-a)+(-b+1) )+1
3( a(b-1)-1(b-1) )+1
3(a-1)(b-1)+1


In short, 3ab-3a-3b+4 rewrites to 3(a-1)(b-1)+1
The more general template is 3(first-1)*(second-1)+1
where first,second are the randomly selected roots of z^6+2 = 0.
We do this "factorization" of sorts so that we reduce the number of times a,b show up. 
Conveniently many pairs of plus 1's and minus 1's will cancel out, which allows us to scale the formula up in a nice pattern.


Let a,b,c,d,e,f represent the 6 roots of z^6+2 = 0 in any order you like.
If we selected a,b and replaced them with 3(a-1)(b-1)+1 we get this smaller set
<font color=blue>3(a-1)(b-1)+1</font>, <font color=green>c,d,e,f</font>
The color coding is to separate the items.


Apply the operation to first = <font color=blue>3(a-1)(b-1)+1</font> and second = c to get
3(<font color=blue>first</font>-1)*(second-1)+1 = 3(<font color=blue>3(a-1)(b-1)+1</font>-1)*(c-1)+1 = 9(a-1)(b-1)(c-1)+1


We now have this set
<font color=blue>9(a-1)(b-1)(c-1)+1</font>, <font color=green>d,e,f</font>


Then apply the same idea to the first two elements to get
3(<font color=blue>first</font>-1)*(second-1)+1 = 3(<font color=blue>9(a-1)(b-1)(c-1)+1</font>-1)*(d-1)+1 = 27(a-1)(b-1)(c-1)(d-1)+1


This pattern continues where each new letter introduced to this operation will bring in a (___-1) factor. 
Then we triple the coefficient out front.
This is what I meant by "scale up nicely".


Here's the full step-by-step look where we always select the two left-most elements of the set
a,b,c,d,e,f
<font color=blue>3(a-1)(b-1)+1</font>, <font color=green>c,d,e,f</font>
<font color=blue>9(a-1)(b-1)(c-1)+1</font>, <font color=green>d,e,f</font>
<font color=blue>27(a-1)(b-1)(c-1)(d-1)+1</font>, <font color=green>e,f</font>
<font color=blue>81(a-1)(b-1)(c-1)(d-1)(e-1)+1</font>,  <font color=green>f</font>
243(a-1)(b-1)(c-1)(d-1)(e-1)(f-1)+1
which is the last number on the board.


Note that 243 = 3^(n-1) = 3^(6-1) = 3^5
where n = 6 is the number of roots.
This observation should lead directly to the last number on the board without having to compute the intermediate steps.
However I recommend writing out this scratch work so you can see how I'm getting to that expression.


Roots a through f satisfy z^6+2 = 0.
Roots (a-1) through (f-1) satisfy (w+1)^6+2 = 0, since we have z = w+1 or w = z-1.
Plug w = z-1 into (w+1)^6+2 = 0 so you get z^6+2 = 0 again.



One of Vieta's formulas says that the roots of the polynomial multiply to the constant term, when we have an even degree polynomial and the leading coefficient is 1.
(w+1)^6+2 will expand to some messy polynomial that ends with 1^6+2 = 1+2 = 3, which is the constant term of this polynomial.


The roots (a-1) through (f-1) multiply to 3 due to Vieta's formula mentioned.


Then,
243<font color=blue>(a-1)(b-1)(c-1)(d-1)(e-1)(f-1)</font>+1
= 243*<font color=blue>3</font>+1
= <font color=red>730</font>
is the final answer. 
I used the CAS tool in GeoGebra to confirm it's correct.
here's the link to the workbook
<a href="https://www.geogebra.org/calculator/mrhj6tat">https://www.geogebra.org/calculator/mrhj6tat</a>


No matter which order you pick the roots, the final value will be the same each time. Your teacher is laying a trap when asking "find the largest possible value"  to imply there could be several possible outcomes, which is not the case here.
</font>