Joyce's More Generalized Exponential Notation

Joyce's More Generalized Exponential Notation is an extension on Ackermann's Generalized Exponential Notation. In addition to all the rules in the original notation, this notation is defined as:


 * $$g(a,b,c,d) = g(a - 1,b,c,g(a,b,c))$$
 * $$g(a, 1, b, c, d) = g(a - 1, 1, b, g(b, c, d), d)$$
 * $$g(a, b, c, d, e) = g(a - 1, b, c, g(c, d, e), e)$$
 * $$g(a, b, c, d, e, f)  = g(a - 1, b, c, g(d, e, f), e, f)$$
 * $$g(a, 1, 1, b, c, d) = g(a - 1, 1, 1, g(b, c, d), c, d)$$
 * $$g((a, b), c, d) = g((a - 1, b - 1), g((a, b), c - 1, d), d) = g(a -1, g(b -1, g(b, c - 1, d) - 1, d)$$