-
Notifications
You must be signed in to change notification settings - Fork 0
/
cpMCDESPOT_residuals_SAH.c
981 lines (791 loc) · 241 KB
/
cpMCDESPOT_residuals_SAH.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
/***************************************************************************
* MEXFUNCTION res = cpMCDESPOT_residuals_SAH(fv, omega, phaseCycle, data, alpha, tr, model)
*
* CPU-BASED mcDESPOT OBJECTIVE FUNCTION (cpMCDESPOT)
*
* Inputs:
* fv = [T1m, T1f, T2m, T2f, MWF, Tau_m] --> [Np Matrix x 7] Parameter Vectors, where N=nParam (number of parameter trials)
*
* omega --> Off-resonance [Hz]
* phaseCycle --> SSFP RF Pulse Phase Cycling (-1 = fitting SPGR)
* data --> [Np x 1] MRI Data, # of flip angles by 1 (NOTE: Divide out PD before fitting)
* alpha --> [scalar] Flip angles (corrected /w B1err) in degrees
* tr --> [scalar] TR times, in ms
* model --> 0=Standard 2-pool w/o sqrt(exp(TR/T2)) correction, 1=Standard 2-pool /w correction, 2=(2+1) Pool Model
*
* Outputs:
* res --> SOS Residual
*
* Based on Sean Deoni's mcDESPOT C-Code, with additions from John Ollinger for matrix exponential
* Based on Deoni MRM 2012 Note on 3-Pool Model
*
* MATLAB COMPILE COMMAND (R2009b, GLNX): mex CFLAGS="\$CFLAGS -std=c99" -Dchar16_t=uint16_T -lm -lpthread cpMCDESPOT_residuals_SAH.c
*
* Samuel A. Hurley
* University of Wisconsin
* University of Oxford
* v5.1 6-Jul-2015
*
* Changelog:
* v1.0 - initial code, based on gpMCDESPOT_residual
* v1.1 - added some debugging lines (Mar-2010)
* v2.0 - convert generalMatrixInverse to jxMatrixInverse (Jordan Exchange) method
* v3.0 - fitting explicit pd term for spgr and ssfp, based on v1.0 (Jun-2010)
* v3.1 - Implemented Double capabilities (Jul-2010)
* v4.0 - Implemented John Ollinger's Exact Matrix Inverse Solution,
* significant code cleanup (Nov-2010)
* v4.1 - Added a flag to turn on/off TE correction factor (Apr-2011)
* v4.2 - Fixed parameter vectors getting loaded incorrectly
* Omega separated out into separate calibration scalar (Nov-2011)
* v4.3 - Adding multithreaded support (Dec-2011)
* v4.4 - Fixed p-threads bug if #of FV is not evenly divisible by NUM_THREADS (Feb-2012)
* v5.0 - Drastically re-structured code. Added support for 3-pool model. Now only computes
* a single residual at a time (based on ssfpPhase variable: -1 == SPGR) (Nov-2012)
* v5.1 - Fixed integer abs operation being called on floating point data. abs->fabs (Jul-2015)
***************************************************************************/
/* Includes MEX for Matlab and Lib MATH headers */
#include <mex.h>
#include <math.h>
#include <pthread.h>
// Program Header
#include "cpMCDESPOT_residuals_SAH.h"
// Debug Flag (Crashes PTHREAD Version)
// #define DEBUG_FLAG_X
// Number of multithreads
// #define NUM_THREADS 4
// Define maximum number of data points we can have,
// in order to use constant memory effectively
#define MAX_ALPHA 10
// Universal Constants
#define PI 3.14159265358979323846264338327950288419716939937510
#define DEG_TO_RAD 0.017453292519943
// Basic Math Functions
#define max(a,b) (((a) > (b)) ? (a) : (b))
#define min(a,b) (((a) < (b)) ? (a) : (b))
// ==== Structure For Multithreaded Computation ==== //
// Create Thread Structure
typedef struct {
double **fv;
double *res;
int start_idx; // Starting value of i
int end_idx; // Ending value of i
} thread_arg;
// ==== Global variables (for data shared between all fv evaluations) ====
int d_nAlpha[1];
double d_omega[1];
double d_phaseCycle[1]; // Note phase cycle is floating point
double d_data[MAX_ALPHA];
double d_alpha[MAX_ALPHA];
double d_tr[1];
double d_model[1]; // Changed from tefix to model
/* Main Function ************************************************************/
void mexFunction( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) {
/**** 0. Variable Declrations **********************************/
int i;
int nParam, nAlpha;
// Size of data vectors in memory
size_t dataSize;
// --- Host Data --- //
// Parameter vector
double **fv;
double *omega;
double *phaseCycle;
// MR Data & Control Paramters (Defined as global vars above)
double *data;
double *alpha;
double *tr;
double *model;
double *numThreads;
// Residual solutions
double *res;
/* I. Error checking ****************************************************************/
// Check for 8 inputs
if (nrhs != 8)
mexErrMsgTxt("Requires 8 inputs: [fv omega phaseCycle data alpha tr model numThreads]");
// Check for 1 output
if (nlhs != 1)
mexErrMsgTxt("Requires one output [res]");
// Check that input #1 is a [6 x N] matrix
if (mxGetM(prhs[0]) != 6) {
mexErrMsgTxt("First input (paramter vector) must be Nx6 (6 rows tall)");
}
// Check that all other inputs are Nx1 (single column)
for (i=1; i<7; i++) {
if (mxGetN(prhs[i]) > 1)
mexErrMsgTxt("All inputs must be Nx1 (one column wide)");
}
// Grab nParam -- number of different paramter guesses
nParam = mxGetN(prhs[0]);
// Grab the number of SPGR/SSFP flip angles
nAlpha = mxGetM(prhs[4]);
// Check that the number of supplied flip angles matches the data
if (mxGetM(prhs[3]) != nAlpha)
mexErrMsgTxt("Number of supplied flip angles does not match number of data points");
// Check that the TR's are scalars
if (mxGetN(prhs[5]) !=1)
mexErrMsgTxt("TR must be a scalar (in sec)");
// Check that tefix is a scalar
if (mxGetN(prhs[6]) !=1)
mexErrMsgTxt("Model must be a scalar");
// Check that num_threads is a scalar
if (mxGetN(prhs[7]) !=1)
mexErrMsgTxt("Number of threads must be a scalar");
/* II. Load In Data *******************************************************/
// Alloc Param Vector
fv = (double**) mxMalloc(sizeof(double*)*nParam);
for (i=0; i<nParam; i++) {
fv[i] = (double*) mxMalloc(sizeof(double)*6);
}
// Alloc Output Vectors as mxDoubleMatrix
plhs[0] = mxCreateDoubleMatrix(0, 0, mxREAL);
mxSetM(plhs[0], nParam);
mxSetN(plhs[0], 1);
mxSetData(plhs[0], mxMalloc(sizeof(double)*nParam));
// Grab pointers to output data
res = mxGetPr(plhs[0]);
// Size of SPGR/SSFP Data
dataSize = sizeof(double)*nAlpha;
// Load in parameter data matrix
load_mrhs(fv, 0, prhs);
// Load MRI Data and Control Parameters
omega = mxGetPr(prhs[1]);
phaseCycle = mxGetPr(prhs[2]);
data = mxGetPr(prhs[3]);
alpha = mxGetPr(prhs[4]);
tr = mxGetPr(prhs[5]);
model = mxGetPr(prhs[6]);
numThreads = mxGetPr(prhs[7]);
// Check Model
if (!(model[0] == 0.0 || model[0] == 1.0 || model[0] == 2.0)) {
mexErrMsgTxt("Error: model must be 0/1/2 (2-pool, 2-pool /w TE correction, 2+1 pool)");
}
// Check number of threads
if (numThreads[0] <= 0.0) {
mexErrMsgTxt("Error: number of threads must be 1 or greater)");
}
// Check Data Size
if (dataSize > sizeof(double)*MAX_ALPHA) {
mexErrMsgTxt("Error: This algorithm has a hard-coded limit of data points, and you used too many!\nDo not panic, the authorities are on their way...");
}
// Copy local variables into global variables (CUDA copy host->global device)
d_omega[0] = (double) omega[0];
d_phaseCycle[0] = (double) phaseCycle[0];
d_tr[0] = (double) tr[0];
d_model[0] = (double) model[0];
d_nAlpha[0] = nAlpha;
for (i=0; i<nAlpha; i++) {
d_data[i] = data[i];
d_alpha[i] = alpha[i];
}
/* III. Compute Residuals *****************************************************/
// Assign previously #defined number of threads
int NUM_THREADS = (int) numThreads[0];
// Number of threads for multithreading
pthread_t threads[NUM_THREADS];
thread_arg targ[NUM_THREADS];
// Determine the chunk size
int chunkSize = nParam / NUM_THREADS;
#ifdef DEBUG_FLAG_X
mexPrintf("Num Thread: %d \n", NUM_THREADS);
mexPrintf("Num Fevals: %d \n", nParam);
mexPrintf("Chunk Size: %d \n", chunkSize);
#endif
// Create all Threads
for (i=0; i<NUM_THREADS; i++) {
targ[i].fv = fv;
targ[i].res = res;
targ[i].start_idx = i*chunkSize;
if (i == (NUM_THREADS-1)) {
targ[i].end_idx = nParam;
} else {
targ[i].end_idx = (i+1)*chunkSize;
}
pthread_create(&threads[i], NULL, threadFunc, (void *) &targ[i]);
}
// Wait for all Threads
for (i=0; i<NUM_THREADS; i++) {
pthread_join(threads[i], NULL);
}
/* IV. Cleanup & Free Memory ************************************************/
// Parameter vectors
for (i=0; i<nParam; i++) {
mxFree(fv[i]);
}
mxFree(fv);
} // </Main mexFunction>
/* CPU Functions ***********************************************************/
/************ MultiThreading Support **************/
// Thread Function
void *threadFunc(void *arg) {
thread_arg *targ = (thread_arg *) arg;
double **fv = targ->fv;
double *res = targ->res;
for (int i=targ->start_idx; i<targ->end_idx; i++) {
// If phaseCycle is (-1), compute SPGR
if (d_phaseCycle[0] == -1) {
#ifdef DEBUG_FLAG
mexPrintf("Computing SPGR");
#endif
calcSPGR(fv[i], &res[i]);
} else {
#ifdef DEBUG_FLAG
mexPrintf("Computing SSFP");
#endif
calcSSFP(fv[i], &res[i], d_phaseCycle[0]*DEG_TO_RAD);
}
}
return NULL;
}
/************SPGR Signal Calculation**************/
void calcSPGR(double* d_fv, double* d_resSPGR) {
#ifdef DEBUG_FLAG
mexPrintf("== Entering calcSPGR ==\n");
#endif
// Grab the supplied parameters
double T1m = d_fv[0];
double T1f = d_fv[1];
double MWF = d_fv[4];
double tau = d_fv[5];
#ifdef DEBUG_FLAG
mexPrintf("SPGR | T1m: %0.3f | T1f: %0.3f | | | MWF: %0.3f | Tau: %0.3f | \n", T1m, T1f, MWF, tau);
#endif
// Compute the dependent parameters
double Kmf = 1.00/tau;
double Kfm = Kmf * MWF/(1-MWF);
// Compute 2x2 exponential of A*TR
double expATR[2][2];
matrixExponential(d_tr[0], T1m, T1f, Kmf, Kfm, MWF, expATR);
#ifdef DEBUG_FLAG
mexPrintf("exp(A*TR) \n");
debugPrint2by2(expATR);
#endif
// IminusExpATR = (I2 - exp(A*TR))
double IminusExpATR[2][2];
IminusExpATR[0][0] = 1 - expATR[0][0];
IminusExpATR[1][0] = 0 - expATR[1][0];
IminusExpATR[0][1] = 0 - expATR[0][1];
IminusExpATR[1][1] = 1 - expATR[1][1];
#ifdef DEBUG_FLAG
mexPrintf("(I2 - exp(A*TR)) \n");
debugPrint2by2(IminusExpATR);
#endif
// Product of IminusExpATR & M0
double matrixProduct[2];
matrixProduct[0] = IminusExpATR[0][0] * MWF + IminusExpATR[1][0] * (1 - MWF);
matrixProduct[1] = IminusExpATR[0][1] * MWF + IminusExpATR[1][1] * (1 - MWF);
#ifdef DEBUG_FLAG
mexPrintf("(I2 - exp(A*TR))*M0 \n");
debugPrint2by1(matrixProduct);
#endif
// The rest of the computations must be done over each flip angle
// Preallocate additional variables to be re-used in each FA loop
double sina, cosa, scalar;
int flipAngle;
double IminusExpATRcos[2][2]; // = (I2 - expm(A*TR)*cos(alpha)
double IminusExpATRcosInv[2][2]; // = inv(I2 - expm(A*TR)*cos(alpha))
double matrixProduct2[2]; // = inv(I2 - exp(A*TR)*cosa) * (I2 - exp(A*TR)) * M0 * sinalpha
// Initalize sum-of-square residuals to zero.
d_resSPGR[0] = 0.00;
/******************Loop Over Each Flip Angle & Compute SPGR Signal*************/
for (flipAngle=0; flipAngle<d_nAlpha[0]; flipAngle++) {
// Pre-compute sin & cos, & convert DEG -> RAD
sina = sin(d_alpha[flipAngle] * DEG_TO_RAD);
cosa = cos(d_alpha[flipAngle] * DEG_TO_RAD);
#ifdef DEBUG_FLAG
mexPrintf("FlipAngle: %05f degrees \n", d_alpha[flipAngle]);
#endif
// (I2 - expm(A*TR)*cos(alpha))
IminusExpATRcos[0][0] = 1 - expATR[0][0]*cosa;
IminusExpATRcos[1][0] = 0 - expATR[1][0]*cosa;
IminusExpATRcos[0][1] = 0 - expATR[0][1]*cosa;
IminusExpATRcos[1][1] = 1 - expATR[1][1]*cosa;
#ifdef DEBUG_FLAG
mexPrintf("(I2 - expm(A*TR)*cos(alpha))\n");
debugPrint2by2(IminusExpATRcos);
#endif
// inv(I2 - expm(A*TR)*cos(alpha))
scalar = (1.00/ (IminusExpATRcos[0][0]*IminusExpATRcos[1][1] - IminusExpATRcos[1][0]*IminusExpATRcos[0][1]));
IminusExpATRcosInv[0][0] = scalar * IminusExpATRcos[1][1];
IminusExpATRcosInv[1][1] = scalar * IminusExpATRcos[0][0];
IminusExpATRcosInv[1][0] = scalar * -1.00*IminusExpATRcos[1][0];
IminusExpATRcosInv[0][1] = scalar * -1.00*IminusExpATRcos[0][1];
#ifdef DEBUG_FLAG
mexPrintf("inv(I2 - expm(A*TR)*cos(alpha))\n");
debugPrint2by2(IminusExpATRcosInv);
#endif
// inv(I2 - exp(A*TR)*cosa) * (I2 - exp(A*TR)) * M0 * sinalpha
matrixProduct2[0] = IminusExpATRcosInv[0][0] * matrixProduct[0] + IminusExpATRcosInv[1][0] * matrixProduct[1];
matrixProduct2[1] = IminusExpATRcosInv[0][1] * matrixProduct[0] + IminusExpATRcosInv[1][1] * matrixProduct[1];
matrixProduct2[0] = matrixProduct2[0] * sina;
matrixProduct2[1] = matrixProduct2[1] * sina;
#ifdef DEBUG_FLAG
mexPrintf("inv(I2 - exp(A*TR)*cosa) * (I2 - exp(A*TR)) * M0 * sinalpha\n");
debugPrint2by1(matrixProduct2);
#endif
// Finally, observed signal is just sum of matrixProduct2[0] and matrixProduct2[1]
// Take difference from input MRI data, square, and add to SOS residual
d_resSPGR[0] += ((matrixProduct2[0] + matrixProduct2[1]) - d_data[flipAngle]) * ((matrixProduct2[0] + matrixProduct2[1]) - d_data[flipAngle]);
}// </LoopOverFA>
#ifdef DEBUG_FLAG
mexPrintf("SOS SPGR Residual: %05f\n", d_resSPGR[0]);
#endif
}// </calcSPGR>
/***************SSFP Signal Calculation*************/
void calcSSFP(double* fv, double* d_resSSFP, double rfPulsePhase) {
#ifdef DEBUG_FLAG
mexPrintf("== Entering calcSSFP ==\n");
#endif
int i, j;
// Grab Supplied Parameters
double T1m = fv[0];
double T1f = fv[1];
double T2m = fv[2];
double T2f = fv[3];
double MWF = fv[4];
double tau = fv[5];
double Omega = d_omega[0]; // Hz
#ifdef DEBUG_FLAG
mexPrintf("SSFP | T1m: %0.3f | T1f: %0.3f | T2m: %0.3f | T2f: %0.3f | MWF: %0.3f | Tau: %0.3f | Omega: %0.3f | Chop: %0.3f \n", T1m, T1f, T2m, T2f, MWF, tau, Omega, rfPulsePhase);
#endif
// Compute the dependent parameters
double Kmf = 1.00/ tau;
double Kfm = Kmf * MWF/(1-MWF);
// Compute Exponential of Aupper and Alower
double expAupper[2][2];
double expAlower[2][2];
matrixExponential(d_tr[0], T2m, T2f, Kmf, Kfm, MWF, expAupper);
matrixExponential(d_tr[0], T1m, T1f, Kmf, Kfm, MWF, expAlower);
// Compute the exponential of W
double expW[6][6];
double beta = Omega*2*PI*d_tr[0] + rfPulsePhase; //Units of radians, therefore convert Omega from Hz -> rad/s
double sinb = sin(beta);
double cosb = cos(beta);
// Initalize expW to all zeros
initZeros6by6(expW);
// Fill in sin & cos terms
expW[0][0] = cosb;
expW[1][1] = cosb;
expW[2][2] = cosb;
expW[3][3] = cosb;
expW[4][4] = 1.00;
expW[5][5] = 1.00;
expW[2][0] = -sinb;
expW[3][1] = -sinb;
expW[0][2] = sinb;
expW[1][3] = sinb;
#ifdef DEBUG_FLAG
mexPrintf("expm(W)\n");
debugPrint6by6(expW);
#endif
// Combine into a single exp(A*TR) matrix
double expAcombined[6][6];
initZeros6by6(expAcombined);
expAcombined[0][0] = expAupper[0][0];
expAcombined[1][0] = expAupper[1][0];
expAcombined[0][1] = expAupper[0][1];
expAcombined[1][1] = expAupper[1][1];
expAcombined[2][2] = expAupper[0][0];
expAcombined[3][2] = expAupper[1][0];
expAcombined[2][3] = expAupper[0][1];
expAcombined[3][3] = expAupper[1][1];
expAcombined[4][4] = expAlower[0][0];
expAcombined[5][4] = expAlower[1][0];
expAcombined[4][5] = expAlower[0][1];
expAcombined[5][5] = expAlower[1][1];
#ifdef DEBUG_FLAG
mexPrintf("expm(A_ssfp*tr_ssfp)\n");
debugPrint6by6(expAcombined);
#endif
// Now multiply expAcombined & expW to get full exp((A+W)*TR) = exp(A*TR)*exp(W)
double expATR[6][6];
matrixMultiply6by6(expW, expAcombined, expATR);
#ifdef DEBUG_FLAG
mexPrintf("expm(A_ssfp*tr_ssfp)*expm(W)\n");
debugPrint6by6(expATR);
#endif
// Compute (I - eATR)
double IminusExpATR[6][6];
for (i=0; i<6; i++) {
for (j=0; j<6; j++) {
if (i == j) {
// Diagonals
IminusExpATR[i][j] = 1.00 - expATR[i][j];
}
else {
// Off-Diagonals
IminusExpATR[i][j] = 0.00 - expATR[i][j];
}
}
}
#ifdef DEBUG_FLAG
mexPrintf("(I6 - expm(A*TR)\n");
debugPrint6by6(IminusExpATR);
#endif
// Generate M0 Vector. Assume input data has PD normalized to 1
double M0[6];
M0[0] = 0.00;
M0[1] = 0.00;
M0[2] = 0.00;
M0[3] = 0.00;
M0[4] = MWF;
M0[5] = (1-MWF);
// Compute (I6 - eATR)*M0
double matrixProduct[6];
for (i=0; i<6; i++) {
matrixProduct[i] = 0;
for (j=0; j<6; j++) {
matrixProduct[i] += IminusExpATR[j][i] * M0[j];
}
}
#ifdef DEBUG_FLAG
mexPrintf("(I6 - expm(A*TR))*M0 \n");
debugPrint6by1(matrixProduct);
#endif
// The rest of the computations must be done over each flip angle
// Preallocate additional variables to be re-used in each FA loop
double sina, cosa, scalar;
int flipAngle;
double R[6][6]; // = Rotation Matrix
initZeros6by6(R);
double expATRrot[6][6]; // = expm(A*TR)*Rot(Alpha)
double IminusExpATRrot[6][6]; // = I6 - expm(A*TR)*Rot(alpha)
double matrixProduct2[6]; // = inv(I6 - expm(A*TR)*Rot(alpha)) * (I6 - exp(A*TR)) * M0
double signalSSFP; // Observed MRI Signal
// Initalize sum-of-square residuals to zero.
d_resSSFP[0] = 0;
/******************Loop Over Each Flip Angle & Compute SSFP Signal*************/
for (flipAngle=0; flipAngle<d_nAlpha[0]; flipAngle++) {
// Pre-compute sin & cos, and convert DEG -> RAD
sina = sin(d_alpha[flipAngle] * DEG_TO_RAD);
cosa = cos(d_alpha[flipAngle] * DEG_TO_RAD);
#ifdef DEBUG_FLAG
mexPrintf("FlipAngle: %05f degrees \n", d_alpha[flipAngle]);
#endif
// Fill Out the R Rotation Matrix
R[0][0] = 1.00;
R[1][1] = 1.00;
R[2][2] = cosa;
R[3][3] = cosa;
R[4][4] = cosa;
R[5][5] = cosa;
R[4][2] = -sina;
R[5][3] = -sina;
R[2][4] = sina;
R[3][5] = sina;
#ifdef DEBUG_FLAG
mexPrintf("Rot(alpha) \n");
debugPrint6by6(R);
#endif
// expm(A*TR)*Rot(Alpha)
matrixMultiply6by6(expATR, R, expATRrot);
#ifdef DEBUG_FLAG
mexPrintf("expm(A*TR)*Rot(Alpha) \n");
debugPrint6by6(expATRrot);
#endif
//(I6 - expm(A*TR)*Rot(alpha))
for (i=0; i<6; i++) {
for (j=0; j<6; j++) {
if (i == j) {
// Diagonals
IminusExpATRrot[i][j] = 1.00 - expATRrot[i][j];
}
else {
// Off-Diagonals
IminusExpATRrot[i][j] = 0.00 - expATRrot[i][j];
}
}
}
#ifdef DEBUG_FLAG
mexPrintf("(I6 - expm(A*TR)*Rot(alpha)) \n");
debugPrint6by6(IminusExpATRrot);
#endif
// inv(I6 - expm(A*TR)*Rot(alpha)) * (I6 - exp(A*TR)) * M0
matrixJXleastSquares6by6(IminusExpATRrot, matrixProduct, matrixProduct2);
// matrixGeneralInverse6by6(IminusExpATRrot, matrixProduct, matrixProduct2);
// matrixAnalyticalInverse6by6(IminusExpATRrot, matrixProduct, matrixProduct2);
#ifdef DEBUG_FLAG
mexPrintf("inv(I6 - expm(A*TR)*Rot(alpha)) * (I6 - exp(A*TR)) * M0 \n");
debugPrint6by1(matrixProduct2);
#endif
if (d_model[0] == 0.0) {
// Compute Observed Signal
signalSSFP = sqrt(matrixProduct2[0]*matrixProduct2[0] + matrixProduct2[2]*matrixProduct2[2]) + sqrt(matrixProduct2[1]*matrixProduct2[1] + matrixProduct2[3]*matrixProduct2[3]);
} else {
// Multiply on an extra sqrt(E2) term to account for center-echo readout
signalSSFP = sqrt(matrixProduct2[0]*matrixProduct2[0] + matrixProduct2[2]*matrixProduct2[2]) * sqrt(exp(d_tr[0]/T2m)) + sqrt(matrixProduct2[1]*matrixProduct2[1] + matrixProduct2[3]*matrixProduct2[3]) * sqrt(exp(d_tr[0]/T2f));
}
#ifdef DEBUG_FLAG
mexPrintf("signalSSFP: %0.5f\n", signalSSFP);
#endif
// Finally, observed signal is just sum of matrixProduct2[0] and matrixProduct2[1]
// Take difference from input MRI data, square, and add to SOS residual
d_resSSFP[0] += (signalSSFP - d_data[flipAngle]) * (signalSSFP - d_data[flipAngle]);
}// </LoopOverFA>
}// </calcSSFP>
/* Host Helper Functions ****************************************************/
/* Load in data from prhs[i] matrix and convert to an matrix of doubles *******/
/* P. Mossahebi v1.0 12-Jul-2010 */
/* S. Hurley v2.0 04-Nov-2011 */
void load_mrhs(double** output_double, int argin, const mxArray *prhs[])
{
// Get a pointer to the double-floating point data
double *input_double = mxGetPr(prhs[argin]);
// Get the number of elements
int nSize = mxGetN(prhs[argin]);
int mSize = mxGetM(prhs[argin]);
int i, j;
for (i = 0; i < nSize; i++) { // 1 -> nParam
for(j = 0; j < mSize; j++) { // 1 -> 6
output_double[i][j] = input_double[(i*mSize)+j];
}
}
}
/* Custom 2x2 A matrix Exponential *********************************************
* Thanks to John Ollinger
* Outputs 2x2 solution for expm(A)
*/
void matrixExponential(double TR, double Tm, double Tf, double Kmf, double Kfm, double MWF, double A[][2])
{
// Convert T1/T2 to R1/R2
double Rm = 1/Tm;
double Rf = 1/Tf;
// Initalize the Output Matrix to All Zeros
A[0][0] = 0.00;
A[1][0] = 0.00;
A[0][1] = 0.00;
A[1][1] = 0.00;
// Compute Sinh & Cosh
double a = (-Rm-Kmf)*TR - (-Rf-Kfm)*TR;
double b = 4*Kmf*Kmf*TR*TR * MWF/(1-MWF);
double sqrt1 = sqrt(a*a + b);
double sinh1 = sinh(0.5*sqrt1);
double cosh1 = cosh(0.5*sqrt1);
double exp1 = exp( ((-Rf-Kfm)*TR + (-Rm-Kmf)*TR) / 2.0);
A[0][0] = exp1*( a*sinh1+sqrt1*cosh1) / sqrt1;
A[1][0] = (2*Kfm*TR*exp1*sinh1) / sqrt1;
A[0][1] = (2*Kmf*TR*exp1*sinh1) / sqrt1;
A[1][1] = exp1*(-a*sinh1+sqrt1*cosh1) / sqrt1;
}
/* Initalize a 6x6 Matrix to all zeros *****************************************/
void initZeros6by6(double matrix[][6])
{
int i, j;
for (i=0; i<6; i++) {
for (j=0; j<6; j++) {
matrix[i][j] = 0;
}
}
}
/* Multiply a 6x6 Matrix*******************************************************/
/* Z = X*Y Must be 6x6!! (Under Penalty of Death. Or at least Seg Fault) */
void matrixMultiply6by6(double X[][6], double Y[][6], double Z[][6])
{
int i, j, k;
for (i=0; i<6; i++) {
for (j=0; j<6; j++) {
Z[i][j] = 0.00;
for (k=0; k<6; k++) {
Z[i][j] += X[k][j] * Y[i][k];
}
}
}
}
/* Compute Solution to X = inv(A)*B /w Analytical 6x6 Inverse *******************/
void matrixAnalyticalInverse6by6(double a[][6], double B[6], double X[6])
{
double invA[6][6];
double denom;
int i,j;
denom = a[0][0]*a[1][1]*a[2][2]*a[3][3]*a[4][4]*a[5][5] - a[0][0]*a[1][1]*a[2][2]*a[3][3]*a[4][5]*a[5][4] - a[0][0]*a[1][1]*a[2][2]*a[3][4]*a[4][3]*a[5][5] + a[0][0]*a[1][1]*a[2][2]*a[3][4]*a[4][5]*a[5][3] + a[0][0]*a[1][1]*a[2][2]*a[3][5]*a[4][3]*a[5][4] - a[0][0]*a[1][1]*a[2][2]*a[3][5]*a[4][4]*a[5][3] - a[0][0]*a[1][1]*a[2][3]*a[3][2]*a[4][4]*a[5][5] + a[0][0]*a[1][1]*a[2][3]*a[3][2]*a[4][5]*a[5][4] + a[0][0]*a[1][1]*a[2][3]*a[3][4]*a[4][2]*a[5][5] - a[0][0]*a[1][1]*a[2][3]*a[3][4]*a[4][5]*a[5][2] - a[0][0]*a[1][1]*a[2][3]*a[3][5]*a[4][2]*a[5][4] + a[0][0]*a[1][1]*a[2][3]*a[3][5]*a[4][4]*a[5][2] + a[0][0]*a[1][1]*a[2][4]*a[3][2]*a[4][3]*a[5][5] - a[0][0]*a[1][1]*a[2][4]*a[3][2]*a[4][5]*a[5][3] - a[0][0]*a[1][1]*a[2][4]*a[3][3]*a[4][2]*a[5][5] + a[0][0]*a[1][1]*a[2][4]*a[3][3]*a[4][5]*a[5][2] + a[0][0]*a[1][1]*a[2][4]*a[3][5]*a[4][2]*a[5][3] - a[0][0]*a[1][1]*a[2][4]*a[3][5]*a[4][3]*a[5][2] - a[0][0]*a[1][1]*a[2][5]*a[3][2]*a[4][3]*a[5][4] + a[0][0]*a[1][1]*a[2][5]*a[3][2]*a[4][4]*a[5][3] + a[0][0]*a[1][1]*a[2][5]*a[3][3]*a[4][2]*a[5][4] - a[0][0]*a[1][1]*a[2][5]*a[3][3]*a[4][4]*a[5][2] - a[0][0]*a[1][1]*a[2][5]*a[3][4]*a[4][2]*a[5][3] + a[0][0]*a[1][1]*a[2][5]*a[3][4]*a[4][3]*a[5][2] - a[0][0]*a[1][2]*a[2][1]*a[3][3]*a[4][4]*a[5][5] + a[0][0]*a[1][2]*a[2][1]*a[3][3]*a[4][5]*a[5][4] + a[0][0]*a[1][2]*a[2][1]*a[3][4]*a[4][3]*a[5][5] - a[0][0]*a[1][2]*a[2][1]*a[3][4]*a[4][5]*a[5][3] - a[0][0]*a[1][2]*a[2][1]*a[3][5]*a[4][3]*a[5][4] + a[0][0]*a[1][2]*a[2][1]*a[3][5]*a[4][4]*a[5][3] + a[0][0]*a[1][2]*a[2][3]*a[3][1]*a[4][4]*a[5][5] - a[0][0]*a[1][2]*a[2][3]*a[3][1]*a[4][5]*a[5][4] - a[0][0]*a[1][2]*a[2][3]*a[3][4]*a[4][1]*a[5][5] + a[0][0]*a[1][2]*a[2][3]*a[3][4]*a[4][5]*a[5][1] + a[0][0]*a[1][2]*a[2][3]*a[3][5]*a[4][1]*a[5][4] - a[0][0]*a[1][2]*a[2][3]*a[3][5]*a[4][4]*a[5][1] - a[0][0]*a[1][2]*a[2][4]*a[3][1]*a[4][3]*a[5][5] + a[0][0]*a[1][2]*a[2][4]*a[3][1]*a[4][5]*a[5][3] + a[0][0]*a[1][2]*a[2][4]*a[3][3]*a[4][1]*a[5][5] - a[0][0]*a[1][2]*a[2][4]*a[3][3]*a[4][5]*a[5][1] - a[0][0]*a[1][2]*a[2][4]*a[3][5]*a[4][1]*a[5][3] + a[0][0]*a[1][2]*a[2][4]*a[3][5]*a[4][3]*a[5][1] + a[0][0]*a[1][2]*a[2][5]*a[3][1]*a[4][3]*a[5][4] - a[0][0]*a[1][2]*a[2][5]*a[3][1]*a[4][4]*a[5][3] - a[0][0]*a[1][2]*a[2][5]*a[3][3]*a[4][1]*a[5][4] + a[0][0]*a[1][2]*a[2][5]*a[3][3]*a[4][4]*a[5][1] + a[0][0]*a[1][2]*a[2][5]*a[3][4]*a[4][1]*a[5][3] - a[0][0]*a[1][2]*a[2][5]*a[3][4]*a[4][3]*a[5][1] + a[0][0]*a[1][3]*a[2][1]*a[3][2]*a[4][4]*a[5][5] - a[0][0]*a[1][3]*a[2][1]*a[3][2]*a[4][5]*a[5][4] - a[0][0]*a[1][3]*a[2][1]*a[3][4]*a[4][2]*a[5][5] + a[0][0]*a[1][3]*a[2][1]*a[3][4]*a[4][5]*a[5][2] + a[0][0]*a[1][3]*a[2][1]*a[3][5]*a[4][2]*a[5][4] - a[0][0]*a[1][3]*a[2][1]*a[3][5]*a[4][4]*a[5][2] - a[0][0]*a[1][3]*a[2][2]*a[3][1]*a[4][4]*a[5][5] + a[0][0]*a[1][3]*a[2][2]*a[3][1]*a[4][5]*a[5][4] + a[0][0]*a[1][3]*a[2][2]*a[3][4]*a[4][1]*a[5][5] - a[0][0]*a[1][3]*a[2][2]*a[3][4]*a[4][5]*a[5][1] - a[0][0]*a[1][3]*a[2][2]*a[3][5]*a[4][1]*a[5][4] + a[0][0]*a[1][3]*a[2][2]*a[3][5]*a[4][4]*a[5][1] + a[0][0]*a[1][3]*a[2][4]*a[3][1]*a[4][2]*a[5][5] - a[0][0]*a[1][3]*a[2][4]*a[3][1]*a[4][5]*a[5][2] - a[0][0]*a[1][3]*a[2][4]*a[3][2]*a[4][1]*a[5][5] + a[0][0]*a[1][3]*a[2][4]*a[3][2]*a[4][5]*a[5][1] + a[0][0]*a[1][3]*a[2][4]*a[3][5]*a[4][1]*a[5][2] - a[0][0]*a[1][3]*a[2][4]*a[3][5]*a[4][2]*a[5][1] - a[0][0]*a[1][3]*a[2][5]*a[3][1]*a[4][2]*a[5][4] + a[0][0]*a[1][3]*a[2][5]*a[3][1]*a[4][4]*a[5][2] + a[0][0]*a[1][3]*a[2][5]*a[3][2]*a[4][1]*a[5][4] - a[0][0]*a[1][3]*a[2][5]*a[3][2]*a[4][4]*a[5][1] - a[0][0]*a[1][3]*a[2][5]*a[3][4]*a[4][1]*a[5][2] + a[0][0]*a[1][3]*a[2][5]*a[3][4]*a[4][2]*a[5][1] - a[0][0]*a[1][4]*a[2][1]*a[3][2]*a[4][3]*a[5][5] + a[0][0]*a[1][4]*a[2][1]*a[3][2]*a[4][5]*a[5][3] + a[0][0]*a[1][4]*a[2][1]*a[3][3]*a[4][2]*a[5][5] - a[0][0]*a[1][4]*a[2][1]*a[3][3]*a[4][5]*a[5][2] - a[0][0]*a[1][4]*a[2][1]*a[3][5]*a[4][2]*a[5][3] + a[0][0]*a[1][4]*a[2][1]*a[3][5]*a[4][3]*a[5][2] + a[0][0]*a[1][4]*a[2][2]*a[3][1]*a[4][3]*a[5][5] - a[0][0]*a[1][4]*a[2][2]*a[3][1]*a[4][5]*a[5][3] - a[0][0]*a[1][4]*a[2][2]*a[3][3]*a[4][1]*a[5][5] + a[0][0]*a[1][4]*a[2][2]*a[3][3]*a[4][5]*a[5][1] + a[0][0]*a[1][4]*a[2][2]*a[3][5]*a[4][1]*a[5][3] - a[0][0]*a[1][4]*a[2][2]*a[3][5]*a[4][3]*a[5][1] - a[0][0]*a[1][4]*a[2][3]*a[3][1]*a[4][2]*a[5][5] + a[0][0]*a[1][4]*a[2][3]*a[3][1]*a[4][5]*a[5][2] + a[0][0]*a[1][4]*a[2][3]*a[3][2]*a[4][1]*a[5][5] - a[0][0]*a[1][4]*a[2][3]*a[3][2]*a[4][5]*a[5][1] - a[0][0]*a[1][4]*a[2][3]*a[3][5]*a[4][1]*a[5][2] + a[0][0]*a[1][4]*a[2][3]*a[3][5]*a[4][2]*a[5][1] + a[0][0]*a[1][4]*a[2][5]*a[3][1]*a[4][2]*a[5][3] - a[0][0]*a[1][4]*a[2][5]*a[3][1]*a[4][3]*a[5][2] - a[0][0]*a[1][4]*a[2][5]*a[3][2]*a[4][1]*a[5][3] + a[0][0]*a[1][4]*a[2][5]*a[3][2]*a[4][3]*a[5][1] + a[0][0]*a[1][4]*a[2][5]*a[3][3]*a[4][1]*a[5][2] - a[0][0]*a[1][4]*a[2][5]*a[3][3]*a[4][2]*a[5][1] + a[0][0]*a[1][5]*a[2][1]*a[3][2]*a[4][3]*a[5][4] - a[0][0]*a[1][5]*a[2][1]*a[3][2]*a[4][4]*a[5][3] - a[0][0]*a[1][5]*a[2][1]*a[3][3]*a[4][2]*a[5][4] + a[0][0]*a[1][5]*a[2][1]*a[3][3]*a[4][4]*a[5][2] + a[0][0]*a[1][5]*a[2][1]*a[3][4]*a[4][2]*a[5][3];
denom += -a[0][0]*a[1][5]*a[2][1]*a[3][4]*a[4][3]*a[5][2] - a[0][0]*a[1][5]*a[2][2]*a[3][1]*a[4][3]*a[5][4] + a[0][0]*a[1][5]*a[2][2]*a[3][1]*a[4][4]*a[5][3] + a[0][0]*a[1][5]*a[2][2]*a[3][3]*a[4][1]*a[5][4] - a[0][0]*a[1][5]*a[2][2]*a[3][3]*a[4][4]*a[5][1] - a[0][0]*a[1][5]*a[2][2]*a[3][4]*a[4][1]*a[5][3] + a[0][0]*a[1][5]*a[2][2]*a[3][4]*a[4][3]*a[5][1] + a[0][0]*a[1][5]*a[2][3]*a[3][1]*a[4][2]*a[5][4] - a[0][0]*a[1][5]*a[2][3]*a[3][1]*a[4][4]*a[5][2] - a[0][0]*a[1][5]*a[2][3]*a[3][2]*a[4][1]*a[5][4] + a[0][0]*a[1][5]*a[2][3]*a[3][2]*a[4][4]*a[5][1] + a[0][0]*a[1][5]*a[2][3]*a[3][4]*a[4][1]*a[5][2] - a[0][0]*a[1][5]*a[2][3]*a[3][4]*a[4][2]*a[5][1] - a[0][0]*a[1][5]*a[2][4]*a[3][1]*a[4][2]*a[5][3] + a[0][0]*a[1][5]*a[2][4]*a[3][1]*a[4][3]*a[5][2] + a[0][0]*a[1][5]*a[2][4]*a[3][2]*a[4][1]*a[5][3] - a[0][0]*a[1][5]*a[2][4]*a[3][2]*a[4][3]*a[5][1] - a[0][0]*a[1][5]*a[2][4]*a[3][3]*a[4][1]*a[5][2] + a[0][0]*a[1][5]*a[2][4]*a[3][3]*a[4][2]*a[5][1] - a[0][1]*a[1][0]*a[2][2]*a[3][3]*a[4][4]*a[5][5] + a[0][1]*a[1][0]*a[2][2]*a[3][3]*a[4][5]*a[5][4] + a[0][1]*a[1][0]*a[2][2]*a[3][4]*a[4][3]*a[5][5] - a[0][1]*a[1][0]*a[2][2]*a[3][4]*a[4][5]*a[5][3] - a[0][1]*a[1][0]*a[2][2]*a[3][5]*a[4][3]*a[5][4] + a[0][1]*a[1][0]*a[2][2]*a[3][5]*a[4][4]*a[5][3] + a[0][1]*a[1][0]*a[2][3]*a[3][2]*a[4][4]*a[5][5] - a[0][1]*a[1][0]*a[2][3]*a[3][2]*a[4][5]*a[5][4] - a[0][1]*a[1][0]*a[2][3]*a[3][4]*a[4][2]*a[5][5] + a[0][1]*a[1][0]*a[2][3]*a[3][4]*a[4][5]*a[5][2] + a[0][1]*a[1][0]*a[2][3]*a[3][5]*a[4][2]*a[5][4] - a[0][1]*a[1][0]*a[2][3]*a[3][5]*a[4][4]*a[5][2] - a[0][1]*a[1][0]*a[2][4]*a[3][2]*a[4][3]*a[5][5] + a[0][1]*a[1][0]*a[2][4]*a[3][2]*a[4][5]*a[5][3] + a[0][1]*a[1][0]*a[2][4]*a[3][3]*a[4][2]*a[5][5] - a[0][1]*a[1][0]*a[2][4]*a[3][3]*a[4][5]*a[5][2] - a[0][1]*a[1][0]*a[2][4]*a[3][5]*a[4][2]*a[5][3] + a[0][1]*a[1][0]*a[2][4]*a[3][5]*a[4][3]*a[5][2] + a[0][1]*a[1][0]*a[2][5]*a[3][2]*a[4][3]*a[5][4] - a[0][1]*a[1][0]*a[2][5]*a[3][2]*a[4][4]*a[5][3] - a[0][1]*a[1][0]*a[2][5]*a[3][3]*a[4][2]*a[5][4] + a[0][1]*a[1][0]*a[2][5]*a[3][3]*a[4][4]*a[5][2] + a[0][1]*a[1][0]*a[2][5]*a[3][4]*a[4][2]*a[5][3] - a[0][1]*a[1][0]*a[2][5]*a[3][4]*a[4][3]*a[5][2] + a[0][1]*a[1][2]*a[2][0]*a[3][3]*a[4][4]*a[5][5] - a[0][1]*a[1][2]*a[2][0]*a[3][3]*a[4][5]*a[5][4] - a[0][1]*a[1][2]*a[2][0]*a[3][4]*a[4][3]*a[5][5] + a[0][1]*a[1][2]*a[2][0]*a[3][4]*a[4][5]*a[5][3] + a[0][1]*a[1][2]*a[2][0]*a[3][5]*a[4][3]*a[5][4] - a[0][1]*a[1][2]*a[2][0]*a[3][5]*a[4][4]*a[5][3] - a[0][1]*a[1][2]*a[2][3]*a[3][0]*a[4][4]*a[5][5] + a[0][1]*a[1][2]*a[2][3]*a[3][0]*a[4][5]*a[5][4] + a[0][1]*a[1][2]*a[2][3]*a[3][4]*a[4][0]*a[5][5] - a[0][1]*a[1][2]*a[2][3]*a[3][4]*a[4][5]*a[5][0] - a[0][1]*a[1][2]*a[2][3]*a[3][5]*a[4][0]*a[5][4] + a[0][1]*a[1][2]*a[2][3]*a[3][5]*a[4][4]*a[5][0] + a[0][1]*a[1][2]*a[2][4]*a[3][0]*a[4][3]*a[5][5] - a[0][1]*a[1][2]*a[2][4]*a[3][0]*a[4][5]*a[5][3] - a[0][1]*a[1][2]*a[2][4]*a[3][3]*a[4][0]*a[5][5] + a[0][1]*a[1][2]*a[2][4]*a[3][3]*a[4][5]*a[5][0] + a[0][1]*a[1][2]*a[2][4]*a[3][5]*a[4][0]*a[5][3] - a[0][1]*a[1][2]*a[2][4]*a[3][5]*a[4][3]*a[5][0] - a[0][1]*a[1][2]*a[2][5]*a[3][0]*a[4][3]*a[5][4] + a[0][1]*a[1][2]*a[2][5]*a[3][0]*a[4][4]*a[5][3] + a[0][1]*a[1][2]*a[2][5]*a[3][3]*a[4][0]*a[5][4] - a[0][1]*a[1][2]*a[2][5]*a[3][3]*a[4][4]*a[5][0] - a[0][1]*a[1][2]*a[2][5]*a[3][4]*a[4][0]*a[5][3] + a[0][1]*a[1][2]*a[2][5]*a[3][4]*a[4][3]*a[5][0] - a[0][1]*a[1][3]*a[2][0]*a[3][2]*a[4][4]*a[5][5] + a[0][1]*a[1][3]*a[2][0]*a[3][2]*a[4][5]*a[5][4] + a[0][1]*a[1][3]*a[2][0]*a[3][4]*a[4][2]*a[5][5] - a[0][1]*a[1][3]*a[2][0]*a[3][4]*a[4][5]*a[5][2] - a[0][1]*a[1][3]*a[2][0]*a[3][5]*a[4][2]*a[5][4] + a[0][1]*a[1][3]*a[2][0]*a[3][5]*a[4][4]*a[5][2] + a[0][1]*a[1][3]*a[2][2]*a[3][0]*a[4][4]*a[5][5] - a[0][1]*a[1][3]*a[2][2]*a[3][0]*a[4][5]*a[5][4] - a[0][1]*a[1][3]*a[2][2]*a[3][4]*a[4][0]*a[5][5] + a[0][1]*a[1][3]*a[2][2]*a[3][4]*a[4][5]*a[5][0] + a[0][1]*a[1][3]*a[2][2]*a[3][5]*a[4][0]*a[5][4] - a[0][1]*a[1][3]*a[2][2]*a[3][5]*a[4][4]*a[5][0] - a[0][1]*a[1][3]*a[2][4]*a[3][0]*a[4][2]*a[5][5] + a[0][1]*a[1][3]*a[2][4]*a[3][0]*a[4][5]*a[5][2] + a[0][1]*a[1][3]*a[2][4]*a[3][2]*a[4][0]*a[5][5] - a[0][1]*a[1][3]*a[2][4]*a[3][2]*a[4][5]*a[5][0] - a[0][1]*a[1][3]*a[2][4]*a[3][5]*a[4][0]*a[5][2] + a[0][1]*a[1][3]*a[2][4]*a[3][5]*a[4][2]*a[5][0] + a[0][1]*a[1][3]*a[2][5]*a[3][0]*a[4][2]*a[5][4] - a[0][1]*a[1][3]*a[2][5]*a[3][0]*a[4][4]*a[5][2] - a[0][1]*a[1][3]*a[2][5]*a[3][2]*a[4][0]*a[5][4] + a[0][1]*a[1][3]*a[2][5]*a[3][2]*a[4][4]*a[5][0] + a[0][1]*a[1][3]*a[2][5]*a[3][4]*a[4][0]*a[5][2] - a[0][1]*a[1][3]*a[2][5]*a[3][4]*a[4][2]*a[5][0] + a[0][1]*a[1][4]*a[2][0]*a[3][2]*a[4][3]*a[5][5] - a[0][1]*a[1][4]*a[2][0]*a[3][2]*a[4][5]*a[5][3] - a[0][1]*a[1][4]*a[2][0]*a[3][3]*a[4][2]*a[5][5] + a[0][1]*a[1][4]*a[2][0]*a[3][3]*a[4][5]*a[5][2] + a[0][1]*a[1][4]*a[2][0]*a[3][5]*a[4][2]*a[5][3] - a[0][1]*a[1][4]*a[2][0]*a[3][5]*a[4][3]*a[5][2] - a[0][1]*a[1][4]*a[2][2]*a[3][0]*a[4][3]*a[5][5] + a[0][1]*a[1][4]*a[2][2]*a[3][0]*a[4][5]*a[5][3] + a[0][1]*a[1][4]*a[2][2]*a[3][3]*a[4][0]*a[5][5] - a[0][1]*a[1][4]*a[2][2]*a[3][3]*a[4][5]*a[5][0];
denom += -a[0][1]*a[1][4]*a[2][2]*a[3][5]*a[4][0]*a[5][3] + a[0][1]*a[1][4]*a[2][2]*a[3][5]*a[4][3]*a[5][0] + a[0][1]*a[1][4]*a[2][3]*a[3][0]*a[4][2]*a[5][5] - a[0][1]*a[1][4]*a[2][3]*a[3][0]*a[4][5]*a[5][2] - a[0][1]*a[1][4]*a[2][3]*a[3][2]*a[4][0]*a[5][5] + a[0][1]*a[1][4]*a[2][3]*a[3][2]*a[4][5]*a[5][0] + a[0][1]*a[1][4]*a[2][3]*a[3][5]*a[4][0]*a[5][2] - a[0][1]*a[1][4]*a[2][3]*a[3][5]*a[4][2]*a[5][0] - a[0][1]*a[1][4]*a[2][5]*a[3][0]*a[4][2]*a[5][3] + a[0][1]*a[1][4]*a[2][5]*a[3][0]*a[4][3]*a[5][2] + a[0][1]*a[1][4]*a[2][5]*a[3][2]*a[4][0]*a[5][3] - a[0][1]*a[1][4]*a[2][5]*a[3][2]*a[4][3]*a[5][0] - a[0][1]*a[1][4]*a[2][5]*a[3][3]*a[4][0]*a[5][2] + a[0][1]*a[1][4]*a[2][5]*a[3][3]*a[4][2]*a[5][0] - a[0][1]*a[1][5]*a[2][0]*a[3][2]*a[4][3]*a[5][4] + a[0][1]*a[1][5]*a[2][0]*a[3][2]*a[4][4]*a[5][3] + a[0][1]*a[1][5]*a[2][0]*a[3][3]*a[4][2]*a[5][4] - a[0][1]*a[1][5]*a[2][0]*a[3][3]*a[4][4]*a[5][2] - a[0][1]*a[1][5]*a[2][0]*a[3][4]*a[4][2]*a[5][3] + a[0][1]*a[1][5]*a[2][0]*a[3][4]*a[4][3]*a[5][2] + a[0][1]*a[1][5]*a[2][2]*a[3][0]*a[4][3]*a[5][4] - a[0][1]*a[1][5]*a[2][2]*a[3][0]*a[4][4]*a[5][3] - a[0][1]*a[1][5]*a[2][2]*a[3][3]*a[4][0]*a[5][4] + a[0][1]*a[1][5]*a[2][2]*a[3][3]*a[4][4]*a[5][0] + a[0][1]*a[1][5]*a[2][2]*a[3][4]*a[4][0]*a[5][3] - a[0][1]*a[1][5]*a[2][2]*a[3][4]*a[4][3]*a[5][0] - a[0][1]*a[1][5]*a[2][3]*a[3][0]*a[4][2]*a[5][4] + a[0][1]*a[1][5]*a[2][3]*a[3][0]*a[4][4]*a[5][2] + a[0][1]*a[1][5]*a[2][3]*a[3][2]*a[4][0]*a[5][4] - a[0][1]*a[1][5]*a[2][3]*a[3][2]*a[4][4]*a[5][0] - a[0][1]*a[1][5]*a[2][3]*a[3][4]*a[4][0]*a[5][2] + a[0][1]*a[1][5]*a[2][3]*a[3][4]*a[4][2]*a[5][0] + a[0][1]*a[1][5]*a[2][4]*a[3][0]*a[4][2]*a[5][3] - a[0][1]*a[1][5]*a[2][4]*a[3][0]*a[4][3]*a[5][2] - a[0][1]*a[1][5]*a[2][4]*a[3][2]*a[4][0]*a[5][3] + a[0][1]*a[1][5]*a[2][4]*a[3][2]*a[4][3]*a[5][0] + a[0][1]*a[1][5]*a[2][4]*a[3][3]*a[4][0]*a[5][2] - a[0][1]*a[1][5]*a[2][4]*a[3][3]*a[4][2]*a[5][0] + a[0][2]*a[1][0]*a[2][1]*a[3][3]*a[4][4]*a[5][5] - a[0][2]*a[1][0]*a[2][1]*a[3][3]*a[4][5]*a[5][4] - a[0][2]*a[1][0]*a[2][1]*a[3][4]*a[4][3]*a[5][5] + a[0][2]*a[1][0]*a[2][1]*a[3][4]*a[4][5]*a[5][3] + a[0][2]*a[1][0]*a[2][1]*a[3][5]*a[4][3]*a[5][4] - a[0][2]*a[1][0]*a[2][1]*a[3][5]*a[4][4]*a[5][3] - a[0][2]*a[1][0]*a[2][3]*a[3][1]*a[4][4]*a[5][5] + a[0][2]*a[1][0]*a[2][3]*a[3][1]*a[4][5]*a[5][4] + a[0][2]*a[1][0]*a[2][3]*a[3][4]*a[4][1]*a[5][5] - a[0][2]*a[1][0]*a[2][3]*a[3][4]*a[4][5]*a[5][1] - a[0][2]*a[1][0]*a[2][3]*a[3][5]*a[4][1]*a[5][4] + a[0][2]*a[1][0]*a[2][3]*a[3][5]*a[4][4]*a[5][1] + a[0][2]*a[1][0]*a[2][4]*a[3][1]*a[4][3]*a[5][5] - a[0][2]*a[1][0]*a[2][4]*a[3][1]*a[4][5]*a[5][3] - a[0][2]*a[1][0]*a[2][4]*a[3][3]*a[4][1]*a[5][5] + a[0][2]*a[1][0]*a[2][4]*a[3][3]*a[4][5]*a[5][1] + a[0][2]*a[1][0]*a[2][4]*a[3][5]*a[4][1]*a[5][3] - a[0][2]*a[1][0]*a[2][4]*a[3][5]*a[4][3]*a[5][1] - a[0][2]*a[1][0]*a[2][5]*a[3][1]*a[4][3]*a[5][4] + a[0][2]*a[1][0]*a[2][5]*a[3][1]*a[4][4]*a[5][3] + a[0][2]*a[1][0]*a[2][5]*a[3][3]*a[4][1]*a[5][4] - a[0][2]*a[1][0]*a[2][5]*a[3][3]*a[4][4]*a[5][1] - a[0][2]*a[1][0]*a[2][5]*a[3][4]*a[4][1]*a[5][3] + a[0][2]*a[1][0]*a[2][5]*a[3][4]*a[4][3]*a[5][1] - a[0][2]*a[1][1]*a[2][0]*a[3][3]*a[4][4]*a[5][5] + a[0][2]*a[1][1]*a[2][0]*a[3][3]*a[4][5]*a[5][4] + a[0][2]*a[1][1]*a[2][0]*a[3][4]*a[4][3]*a[5][5] - a[0][2]*a[1][1]*a[2][0]*a[3][4]*a[4][5]*a[5][3] - a[0][2]*a[1][1]*a[2][0]*a[3][5]*a[4][3]*a[5][4] + a[0][2]*a[1][1]*a[2][0]*a[3][5]*a[4][4]*a[5][3] + a[0][2]*a[1][1]*a[2][3]*a[3][0]*a[4][4]*a[5][5] - a[0][2]*a[1][1]*a[2][3]*a[3][0]*a[4][5]*a[5][4] - a[0][2]*a[1][1]*a[2][3]*a[3][4]*a[4][0]*a[5][5] + a[0][2]*a[1][1]*a[2][3]*a[3][4]*a[4][5]*a[5][0] + a[0][2]*a[1][1]*a[2][3]*a[3][5]*a[4][0]*a[5][4] - a[0][2]*a[1][1]*a[2][3]*a[3][5]*a[4][4]*a[5][0] - a[0][2]*a[1][1]*a[2][4]*a[3][0]*a[4][3]*a[5][5] + a[0][2]*a[1][1]*a[2][4]*a[3][0]*a[4][5]*a[5][3] + a[0][2]*a[1][1]*a[2][4]*a[3][3]*a[4][0]*a[5][5] - a[0][2]*a[1][1]*a[2][4]*a[3][3]*a[4][5]*a[5][0] - a[0][2]*a[1][1]*a[2][4]*a[3][5]*a[4][0]*a[5][3] + a[0][2]*a[1][1]*a[2][4]*a[3][5]*a[4][3]*a[5][0] + a[0][2]*a[1][1]*a[2][5]*a[3][0]*a[4][3]*a[5][4] - a[0][2]*a[1][1]*a[2][5]*a[3][0]*a[4][4]*a[5][3] - a[0][2]*a[1][1]*a[2][5]*a[3][3]*a[4][0]*a[5][4] + a[0][2]*a[1][1]*a[2][5]*a[3][3]*a[4][4]*a[5][0] + a[0][2]*a[1][1]*a[2][5]*a[3][4]*a[4][0]*a[5][3] - a[0][2]*a[1][1]*a[2][5]*a[3][4]*a[4][3]*a[5][0] + a[0][2]*a[1][3]*a[2][0]*a[3][1]*a[4][4]*a[5][5] - a[0][2]*a[1][3]*a[2][0]*a[3][1]*a[4][5]*a[5][4] - a[0][2]*a[1][3]*a[2][0]*a[3][4]*a[4][1]*a[5][5] + a[0][2]*a[1][3]*a[2][0]*a[3][4]*a[4][5]*a[5][1] + a[0][2]*a[1][3]*a[2][0]*a[3][5]*a[4][1]*a[5][4] - a[0][2]*a[1][3]*a[2][0]*a[3][5]*a[4][4]*a[5][1] - a[0][2]*a[1][3]*a[2][1]*a[3][0]*a[4][4]*a[5][5] + a[0][2]*a[1][3]*a[2][1]*a[3][0]*a[4][5]*a[5][4] + a[0][2]*a[1][3]*a[2][1]*a[3][4]*a[4][0]*a[5][5] - a[0][2]*a[1][3]*a[2][1]*a[3][4]*a[4][5]*a[5][0] - a[0][2]*a[1][3]*a[2][1]*a[3][5]*a[4][0]*a[5][4] + a[0][2]*a[1][3]*a[2][1]*a[3][5]*a[4][4]*a[5][0] + a[0][2]*a[1][3]*a[2][4]*a[3][0]*a[4][1]*a[5][5] - a[0][2]*a[1][3]*a[2][4]*a[3][0]*a[4][5]*a[5][1] - a[0][2]*a[1][3]*a[2][4]*a[3][1]*a[4][0]*a[5][5];
denom += a[0][2]*a[1][3]*a[2][4]*a[3][1]*a[4][5]*a[5][0] + a[0][2]*a[1][3]*a[2][4]*a[3][5]*a[4][0]*a[5][1] - a[0][2]*a[1][3]*a[2][4]*a[3][5]*a[4][1]*a[5][0] - a[0][2]*a[1][3]*a[2][5]*a[3][0]*a[4][1]*a[5][4] + a[0][2]*a[1][3]*a[2][5]*a[3][0]*a[4][4]*a[5][1] + a[0][2]*a[1][3]*a[2][5]*a[3][1]*a[4][0]*a[5][4] - a[0][2]*a[1][3]*a[2][5]*a[3][1]*a[4][4]*a[5][0] - a[0][2]*a[1][3]*a[2][5]*a[3][4]*a[4][0]*a[5][1] + a[0][2]*a[1][3]*a[2][5]*a[3][4]*a[4][1]*a[5][0] - a[0][2]*a[1][4]*a[2][0]*a[3][1]*a[4][3]*a[5][5] + a[0][2]*a[1][4]*a[2][0]*a[3][1]*a[4][5]*a[5][3] + a[0][2]*a[1][4]*a[2][0]*a[3][3]*a[4][1]*a[5][5] - a[0][2]*a[1][4]*a[2][0]*a[3][3]*a[4][5]*a[5][1] - a[0][2]*a[1][4]*a[2][0]*a[3][5]*a[4][1]*a[5][3] + a[0][2]*a[1][4]*a[2][0]*a[3][5]*a[4][3]*a[5][1] + a[0][2]*a[1][4]*a[2][1]*a[3][0]*a[4][3]*a[5][5] - a[0][2]*a[1][4]*a[2][1]*a[3][0]*a[4][5]*a[5][3] - a[0][2]*a[1][4]*a[2][1]*a[3][3]*a[4][0]*a[5][5] + a[0][2]*a[1][4]*a[2][1]*a[3][3]*a[4][5]*a[5][0] + a[0][2]*a[1][4]*a[2][1]*a[3][5]*a[4][0]*a[5][3] - a[0][2]*a[1][4]*a[2][1]*a[3][5]*a[4][3]*a[5][0] - a[0][2]*a[1][4]*a[2][3]*a[3][0]*a[4][1]*a[5][5] + a[0][2]*a[1][4]*a[2][3]*a[3][0]*a[4][5]*a[5][1] + a[0][2]*a[1][4]*a[2][3]*a[3][1]*a[4][0]*a[5][5] - a[0][2]*a[1][4]*a[2][3]*a[3][1]*a[4][5]*a[5][0] - a[0][2]*a[1][4]*a[2][3]*a[3][5]*a[4][0]*a[5][1] + a[0][2]*a[1][4]*a[2][3]*a[3][5]*a[4][1]*a[5][0] + a[0][2]*a[1][4]*a[2][5]*a[3][0]*a[4][1]*a[5][3] - a[0][2]*a[1][4]*a[2][5]*a[3][0]*a[4][3]*a[5][1] - a[0][2]*a[1][4]*a[2][5]*a[3][1]*a[4][0]*a[5][3] + a[0][2]*a[1][4]*a[2][5]*a[3][1]*a[4][3]*a[5][0] + a[0][2]*a[1][4]*a[2][5]*a[3][3]*a[4][0]*a[5][1] - a[0][2]*a[1][4]*a[2][5]*a[3][3]*a[4][1]*a[5][0] + a[0][2]*a[1][5]*a[2][0]*a[3][1]*a[4][3]*a[5][4] - a[0][2]*a[1][5]*a[2][0]*a[3][1]*a[4][4]*a[5][3] - a[0][2]*a[1][5]*a[2][0]*a[3][3]*a[4][1]*a[5][4] + a[0][2]*a[1][5]*a[2][0]*a[3][3]*a[4][4]*a[5][1] + a[0][2]*a[1][5]*a[2][0]*a[3][4]*a[4][1]*a[5][3] - a[0][2]*a[1][5]*a[2][0]*a[3][4]*a[4][3]*a[5][1] - a[0][2]*a[1][5]*a[2][1]*a[3][0]*a[4][3]*a[5][4] + a[0][2]*a[1][5]*a[2][1]*a[3][0]*a[4][4]*a[5][3] + a[0][2]*a[1][5]*a[2][1]*a[3][3]*a[4][0]*a[5][4] - a[0][2]*a[1][5]*a[2][1]*a[3][3]*a[4][4]*a[5][0] - a[0][2]*a[1][5]*a[2][1]*a[3][4]*a[4][0]*a[5][3] + a[0][2]*a[1][5]*a[2][1]*a[3][4]*a[4][3]*a[5][0] + a[0][2]*a[1][5]*a[2][3]*a[3][0]*a[4][1]*a[5][4] - a[0][2]*a[1][5]*a[2][3]*a[3][0]*a[4][4]*a[5][1] - a[0][2]*a[1][5]*a[2][3]*a[3][1]*a[4][0]*a[5][4] + a[0][2]*a[1][5]*a[2][3]*a[3][1]*a[4][4]*a[5][0] + a[0][2]*a[1][5]*a[2][3]*a[3][4]*a[4][0]*a[5][1] - a[0][2]*a[1][5]*a[2][3]*a[3][4]*a[4][1]*a[5][0] - a[0][2]*a[1][5]*a[2][4]*a[3][0]*a[4][1]*a[5][3] + a[0][2]*a[1][5]*a[2][4]*a[3][0]*a[4][3]*a[5][1] + a[0][2]*a[1][5]*a[2][4]*a[3][1]*a[4][0]*a[5][3] - a[0][2]*a[1][5]*a[2][4]*a[3][1]*a[4][3]*a[5][0] - a[0][2]*a[1][5]*a[2][4]*a[3][3]*a[4][0]*a[5][1] + a[0][2]*a[1][5]*a[2][4]*a[3][3]*a[4][1]*a[5][0] - a[0][3]*a[1][0]*a[2][1]*a[3][2]*a[4][4]*a[5][5] + a[0][3]*a[1][0]*a[2][1]*a[3][2]*a[4][5]*a[5][4] + a[0][3]*a[1][0]*a[2][1]*a[3][4]*a[4][2]*a[5][5] - a[0][3]*a[1][0]*a[2][1]*a[3][4]*a[4][5]*a[5][2] - a[0][3]*a[1][0]*a[2][1]*a[3][5]*a[4][2]*a[5][4] + a[0][3]*a[1][0]*a[2][1]*a[3][5]*a[4][4]*a[5][2] + a[0][3]*a[1][0]*a[2][2]*a[3][1]*a[4][4]*a[5][5] - a[0][3]*a[1][0]*a[2][2]*a[3][1]*a[4][5]*a[5][4] - a[0][3]*a[1][0]*a[2][2]*a[3][4]*a[4][1]*a[5][5] + a[0][3]*a[1][0]*a[2][2]*a[3][4]*a[4][5]*a[5][1] + a[0][3]*a[1][0]*a[2][2]*a[3][5]*a[4][1]*a[5][4] - a[0][3]*a[1][0]*a[2][2]*a[3][5]*a[4][4]*a[5][1] - a[0][3]*a[1][0]*a[2][4]*a[3][1]*a[4][2]*a[5][5] + a[0][3]*a[1][0]*a[2][4]*a[3][1]*a[4][5]*a[5][2] + a[0][3]*a[1][0]*a[2][4]*a[3][2]*a[4][1]*a[5][5] - a[0][3]*a[1][0]*a[2][4]*a[3][2]*a[4][5]*a[5][1] - a[0][3]*a[1][0]*a[2][4]*a[3][5]*a[4][1]*a[5][2] + a[0][3]*a[1][0]*a[2][4]*a[3][5]*a[4][2]*a[5][1] + a[0][3]*a[1][0]*a[2][5]*a[3][1]*a[4][2]*a[5][4] - a[0][3]*a[1][0]*a[2][5]*a[3][1]*a[4][4]*a[5][2] - a[0][3]*a[1][0]*a[2][5]*a[3][2]*a[4][1]*a[5][4] + a[0][3]*a[1][0]*a[2][5]*a[3][2]*a[4][4]*a[5][1] + a[0][3]*a[1][0]*a[2][5]*a[3][4]*a[4][1]*a[5][2] - a[0][3]*a[1][0]*a[2][5]*a[3][4]*a[4][2]*a[5][1] + a[0][3]*a[1][1]*a[2][0]*a[3][2]*a[4][4]*a[5][5] - a[0][3]*a[1][1]*a[2][0]*a[3][2]*a[4][5]*a[5][4] - a[0][3]*a[1][1]*a[2][0]*a[3][4]*a[4][2]*a[5][5] + a[0][3]*a[1][1]*a[2][0]*a[3][4]*a[4][5]*a[5][2] + a[0][3]*a[1][1]*a[2][0]*a[3][5]*a[4][2]*a[5][4] - a[0][3]*a[1][1]*a[2][0]*a[3][5]*a[4][4]*a[5][2] - a[0][3]*a[1][1]*a[2][2]*a[3][0]*a[4][4]*a[5][5] + a[0][3]*a[1][1]*a[2][2]*a[3][0]*a[4][5]*a[5][4] + a[0][3]*a[1][1]*a[2][2]*a[3][4]*a[4][0]*a[5][5] - a[0][3]*a[1][1]*a[2][2]*a[3][4]*a[4][5]*a[5][0] - a[0][3]*a[1][1]*a[2][2]*a[3][5]*a[4][0]*a[5][4] + a[0][3]*a[1][1]*a[2][2]*a[3][5]*a[4][4]*a[5][0] + a[0][3]*a[1][1]*a[2][4]*a[3][0]*a[4][2]*a[5][5] - a[0][3]*a[1][1]*a[2][4]*a[3][0]*a[4][5]*a[5][2] - a[0][3]*a[1][1]*a[2][4]*a[3][2]*a[4][0]*a[5][5] + a[0][3]*a[1][1]*a[2][4]*a[3][2]*a[4][5]*a[5][0] + a[0][3]*a[1][1]*a[2][4]*a[3][5]*a[4][0]*a[5][2] - a[0][3]*a[1][1]*a[2][4]*a[3][5]*a[4][2]*a[5][0] - a[0][3]*a[1][1]*a[2][5]*a[3][0]*a[4][2]*a[5][4] + a[0][3]*a[1][1]*a[2][5]*a[3][0]*a[4][4]*a[5][2];
denom += a[0][3]*a[1][1]*a[2][5]*a[3][2]*a[4][0]*a[5][4] - a[0][3]*a[1][1]*a[2][5]*a[3][2]*a[4][4]*a[5][0] - a[0][3]*a[1][1]*a[2][5]*a[3][4]*a[4][0]*a[5][2] + a[0][3]*a[1][1]*a[2][5]*a[3][4]*a[4][2]*a[5][0] - a[0][3]*a[1][2]*a[2][0]*a[3][1]*a[4][4]*a[5][5] + a[0][3]*a[1][2]*a[2][0]*a[3][1]*a[4][5]*a[5][4] + a[0][3]*a[1][2]*a[2][0]*a[3][4]*a[4][1]*a[5][5] - a[0][3]*a[1][2]*a[2][0]*a[3][4]*a[4][5]*a[5][1] - a[0][3]*a[1][2]*a[2][0]*a[3][5]*a[4][1]*a[5][4] + a[0][3]*a[1][2]*a[2][0]*a[3][5]*a[4][4]*a[5][1] + a[0][3]*a[1][2]*a[2][1]*a[3][0]*a[4][4]*a[5][5] - a[0][3]*a[1][2]*a[2][1]*a[3][0]*a[4][5]*a[5][4] - a[0][3]*a[1][2]*a[2][1]*a[3][4]*a[4][0]*a[5][5] + a[0][3]*a[1][2]*a[2][1]*a[3][4]*a[4][5]*a[5][0] + a[0][3]*a[1][2]*a[2][1]*a[3][5]*a[4][0]*a[5][4] - a[0][3]*a[1][2]*a[2][1]*a[3][5]*a[4][4]*a[5][0] - a[0][3]*a[1][2]*a[2][4]*a[3][0]*a[4][1]*a[5][5] + a[0][3]*a[1][2]*a[2][4]*a[3][0]*a[4][5]*a[5][1] + a[0][3]*a[1][2]*a[2][4]*a[3][1]*a[4][0]*a[5][5] - a[0][3]*a[1][2]*a[2][4]*a[3][1]*a[4][5]*a[5][0] - a[0][3]*a[1][2]*a[2][4]*a[3][5]*a[4][0]*a[5][1] + a[0][3]*a[1][2]*a[2][4]*a[3][5]*a[4][1]*a[5][0] + a[0][3]*a[1][2]*a[2][5]*a[3][0]*a[4][1]*a[5][4] - a[0][3]*a[1][2]*a[2][5]*a[3][0]*a[4][4]*a[5][1] - a[0][3]*a[1][2]*a[2][5]*a[3][1]*a[4][0]*a[5][4] + a[0][3]*a[1][2]*a[2][5]*a[3][1]*a[4][4]*a[5][0] + a[0][3]*a[1][2]*a[2][5]*a[3][4]*a[4][0]*a[5][1] - a[0][3]*a[1][2]*a[2][5]*a[3][4]*a[4][1]*a[5][0] + a[0][3]*a[1][4]*a[2][0]*a[3][1]*a[4][2]*a[5][5] - a[0][3]*a[1][4]*a[2][0]*a[3][1]*a[4][5]*a[5][2] - a[0][3]*a[1][4]*a[2][0]*a[3][2]*a[4][1]*a[5][5] + a[0][3]*a[1][4]*a[2][0]*a[3][2]*a[4][5]*a[5][1] + a[0][3]*a[1][4]*a[2][0]*a[3][5]*a[4][1]*a[5][2] - a[0][3]*a[1][4]*a[2][0]*a[3][5]*a[4][2]*a[5][1] - a[0][3]*a[1][4]*a[2][1]*a[3][0]*a[4][2]*a[5][5] + a[0][3]*a[1][4]*a[2][1]*a[3][0]*a[4][5]*a[5][2] + a[0][3]*a[1][4]*a[2][1]*a[3][2]*a[4][0]*a[5][5] - a[0][3]*a[1][4]*a[2][1]*a[3][2]*a[4][5]*a[5][0] - a[0][3]*a[1][4]*a[2][1]*a[3][5]*a[4][0]*a[5][2] + a[0][3]*a[1][4]*a[2][1]*a[3][5]*a[4][2]*a[5][0] + a[0][3]*a[1][4]*a[2][2]*a[3][0]*a[4][1]*a[5][5] - a[0][3]*a[1][4]*a[2][2]*a[3][0]*a[4][5]*a[5][1] - a[0][3]*a[1][4]*a[2][2]*a[3][1]*a[4][0]*a[5][5] + a[0][3]*a[1][4]*a[2][2]*a[3][1]*a[4][5]*a[5][0] + a[0][3]*a[1][4]*a[2][2]*a[3][5]*a[4][0]*a[5][1] - a[0][3]*a[1][4]*a[2][2]*a[3][5]*a[4][1]*a[5][0] - a[0][3]*a[1][4]*a[2][5]*a[3][0]*a[4][1]*a[5][2] + a[0][3]*a[1][4]*a[2][5]*a[3][0]*a[4][2]*a[5][1] + a[0][3]*a[1][4]*a[2][5]*a[3][1]*a[4][0]*a[5][2] - a[0][3]*a[1][4]*a[2][5]*a[3][1]*a[4][2]*a[5][0] - a[0][3]*a[1][4]*a[2][5]*a[3][2]*a[4][0]*a[5][1] + a[0][3]*a[1][4]*a[2][5]*a[3][2]*a[4][1]*a[5][0] - a[0][3]*a[1][5]*a[2][0]*a[3][1]*a[4][2]*a[5][4] + a[0][3]*a[1][5]*a[2][0]*a[3][1]*a[4][4]*a[5][2] + a[0][3]*a[1][5]*a[2][0]*a[3][2]*a[4][1]*a[5][4] - a[0][3]*a[1][5]*a[2][0]*a[3][2]*a[4][4]*a[5][1] - a[0][3]*a[1][5]*a[2][0]*a[3][4]*a[4][1]*a[5][2] + a[0][3]*a[1][5]*a[2][0]*a[3][4]*a[4][2]*a[5][1] + a[0][3]*a[1][5]*a[2][1]*a[3][0]*a[4][2]*a[5][4] - a[0][3]*a[1][5]*a[2][1]*a[3][0]*a[4][4]*a[5][2] - a[0][3]*a[1][5]*a[2][1]*a[3][2]*a[4][0]*a[5][4] + a[0][3]*a[1][5]*a[2][1]*a[3][2]*a[4][4]*a[5][0] + a[0][3]*a[1][5]*a[2][1]*a[3][4]*a[4][0]*a[5][2] - a[0][3]*a[1][5]*a[2][1]*a[3][4]*a[4][2]*a[5][0] - a[0][3]*a[1][5]*a[2][2]*a[3][0]*a[4][1]*a[5][4] + a[0][3]*a[1][5]*a[2][2]*a[3][0]*a[4][4]*a[5][1] + a[0][3]*a[1][5]*a[2][2]*a[3][1]*a[4][0]*a[5][4] - a[0][3]*a[1][5]*a[2][2]*a[3][1]*a[4][4]*a[5][0] - a[0][3]*a[1][5]*a[2][2]*a[3][4]*a[4][0]*a[5][1] + a[0][3]*a[1][5]*a[2][2]*a[3][4]*a[4][1]*a[5][0] + a[0][3]*a[1][5]*a[2][4]*a[3][0]*a[4][1]*a[5][2] - a[0][3]*a[1][5]*a[2][4]*a[3][0]*a[4][2]*a[5][1] - a[0][3]*a[1][5]*a[2][4]*a[3][1]*a[4][0]*a[5][2] + a[0][3]*a[1][5]*a[2][4]*a[3][1]*a[4][2]*a[5][0] + a[0][3]*a[1][5]*a[2][4]*a[3][2]*a[4][0]*a[5][1] - a[0][3]*a[1][5]*a[2][4]*a[3][2]*a[4][1]*a[5][0] + a[0][4]*a[1][0]*a[2][1]*a[3][2]*a[4][3]*a[5][5] - a[0][4]*a[1][0]*a[2][1]*a[3][2]*a[4][5]*a[5][3] - a[0][4]*a[1][0]*a[2][1]*a[3][3]*a[4][2]*a[5][5] + a[0][4]*a[1][0]*a[2][1]*a[3][3]*a[4][5]*a[5][2] + a[0][4]*a[1][0]*a[2][1]*a[3][5]*a[4][2]*a[5][3] - a[0][4]*a[1][0]*a[2][1]*a[3][5]*a[4][3]*a[5][2] - a[0][4]*a[1][0]*a[2][2]*a[3][1]*a[4][3]*a[5][5] + a[0][4]*a[1][0]*a[2][2]*a[3][1]*a[4][5]*a[5][3] + a[0][4]*a[1][0]*a[2][2]*a[3][3]*a[4][1]*a[5][5] - a[0][4]*a[1][0]*a[2][2]*a[3][3]*a[4][5]*a[5][1] - a[0][4]*a[1][0]*a[2][2]*a[3][5]*a[4][1]*a[5][3] + a[0][4]*a[1][0]*a[2][2]*a[3][5]*a[4][3]*a[5][1] + a[0][4]*a[1][0]*a[2][3]*a[3][1]*a[4][2]*a[5][5] - a[0][4]*a[1][0]*a[2][3]*a[3][1]*a[4][5]*a[5][2] - a[0][4]*a[1][0]*a[2][3]*a[3][2]*a[4][1]*a[5][5] + a[0][4]*a[1][0]*a[2][3]*a[3][2]*a[4][5]*a[5][1] + a[0][4]*a[1][0]*a[2][3]*a[3][5]*a[4][1]*a[5][2] - a[0][4]*a[1][0]*a[2][3]*a[3][5]*a[4][2]*a[5][1] - a[0][4]*a[1][0]*a[2][5]*a[3][1]*a[4][2]*a[5][3] + a[0][4]*a[1][0]*a[2][5]*a[3][1]*a[4][3]*a[5][2] + a[0][4]*a[1][0]*a[2][5]*a[3][2]*a[4][1]*a[5][3] - a[0][4]*a[1][0]*a[2][5]*a[3][2]*a[4][3]*a[5][1] - a[0][4]*a[1][0]*a[2][5]*a[3][3]*a[4][1]*a[5][2] + a[0][4]*a[1][0]*a[2][5]*a[3][3]*a[4][2]*a[5][1] - a[0][4]*a[1][1]*a[2][0]*a[3][2]*a[4][3]*a[5][5];
denom += a[0][4]*a[1][1]*a[2][0]*a[3][2]*a[4][5]*a[5][3] + a[0][4]*a[1][1]*a[2][0]*a[3][3]*a[4][2]*a[5][5] - a[0][4]*a[1][1]*a[2][0]*a[3][3]*a[4][5]*a[5][2] - a[0][4]*a[1][1]*a[2][0]*a[3][5]*a[4][2]*a[5][3] + a[0][4]*a[1][1]*a[2][0]*a[3][5]*a[4][3]*a[5][2] + a[0][4]*a[1][1]*a[2][2]*a[3][0]*a[4][3]*a[5][5] - a[0][4]*a[1][1]*a[2][2]*a[3][0]*a[4][5]*a[5][3] - a[0][4]*a[1][1]*a[2][2]*a[3][3]*a[4][0]*a[5][5] + a[0][4]*a[1][1]*a[2][2]*a[3][3]*a[4][5]*a[5][0] + a[0][4]*a[1][1]*a[2][2]*a[3][5]*a[4][0]*a[5][3] - a[0][4]*a[1][1]*a[2][2]*a[3][5]*a[4][3]*a[5][0] - a[0][4]*a[1][1]*a[2][3]*a[3][0]*a[4][2]*a[5][5] + a[0][4]*a[1][1]*a[2][3]*a[3][0]*a[4][5]*a[5][2] + a[0][4]*a[1][1]*a[2][3]*a[3][2]*a[4][0]*a[5][5] - a[0][4]*a[1][1]*a[2][3]*a[3][2]*a[4][5]*a[5][0] - a[0][4]*a[1][1]*a[2][3]*a[3][5]*a[4][0]*a[5][2] + a[0][4]*a[1][1]*a[2][3]*a[3][5]*a[4][2]*a[5][0] + a[0][4]*a[1][1]*a[2][5]*a[3][0]*a[4][2]*a[5][3] - a[0][4]*a[1][1]*a[2][5]*a[3][0]*a[4][3]*a[5][2] - a[0][4]*a[1][1]*a[2][5]*a[3][2]*a[4][0]*a[5][3] + a[0][4]*a[1][1]*a[2][5]*a[3][2]*a[4][3]*a[5][0] + a[0][4]*a[1][1]*a[2][5]*a[3][3]*a[4][0]*a[5][2] - a[0][4]*a[1][1]*a[2][5]*a[3][3]*a[4][2]*a[5][0] + a[0][4]*a[1][2]*a[2][0]*a[3][1]*a[4][3]*a[5][5] - a[0][4]*a[1][2]*a[2][0]*a[3][1]*a[4][5]*a[5][3] - a[0][4]*a[1][2]*a[2][0]*a[3][3]*a[4][1]*a[5][5] + a[0][4]*a[1][2]*a[2][0]*a[3][3]*a[4][5]*a[5][1] + a[0][4]*a[1][2]*a[2][0]*a[3][5]*a[4][1]*a[5][3] - a[0][4]*a[1][2]*a[2][0]*a[3][5]*a[4][3]*a[5][1] - a[0][4]*a[1][2]*a[2][1]*a[3][0]*a[4][3]*a[5][5] + a[0][4]*a[1][2]*a[2][1]*a[3][0]*a[4][5]*a[5][3] + a[0][4]*a[1][2]*a[2][1]*a[3][3]*a[4][0]*a[5][5] - a[0][4]*a[1][2]*a[2][1]*a[3][3]*a[4][5]*a[5][0] - a[0][4]*a[1][2]*a[2][1]*a[3][5]*a[4][0]*a[5][3] + a[0][4]*a[1][2]*a[2][1]*a[3][5]*a[4][3]*a[5][0] + a[0][4]*a[1][2]*a[2][3]*a[3][0]*a[4][1]*a[5][5] - a[0][4]*a[1][2]*a[2][3]*a[3][0]*a[4][5]*a[5][1] - a[0][4]*a[1][2]*a[2][3]*a[3][1]*a[4][0]*a[5][5] + a[0][4]*a[1][2]*a[2][3]*a[3][1]*a[4][5]*a[5][0] + a[0][4]*a[1][2]*a[2][3]*a[3][5]*a[4][0]*a[5][1] - a[0][4]*a[1][2]*a[2][3]*a[3][5]*a[4][1]*a[5][0] - a[0][4]*a[1][2]*a[2][5]*a[3][0]*a[4][1]*a[5][3] + a[0][4]*a[1][2]*a[2][5]*a[3][0]*a[4][3]*a[5][1] + a[0][4]*a[1][2]*a[2][5]*a[3][1]*a[4][0]*a[5][3] - a[0][4]*a[1][2]*a[2][5]*a[3][1]*a[4][3]*a[5][0] - a[0][4]*a[1][2]*a[2][5]*a[3][3]*a[4][0]*a[5][1] + a[0][4]*a[1][2]*a[2][5]*a[3][3]*a[4][1]*a[5][0] - a[0][4]*a[1][3]*a[2][0]*a[3][1]*a[4][2]*a[5][5] + a[0][4]*a[1][3]*a[2][0]*a[3][1]*a[4][5]*a[5][2] + a[0][4]*a[1][3]*a[2][0]*a[3][2]*a[4][1]*a[5][5] - a[0][4]*a[1][3]*a[2][0]*a[3][2]*a[4][5]*a[5][1] - a[0][4]*a[1][3]*a[2][0]*a[3][5]*a[4][1]*a[5][2] + a[0][4]*a[1][3]*a[2][0]*a[3][5]*a[4][2]*a[5][1] + a[0][4]*a[1][3]*a[2][1]*a[3][0]*a[4][2]*a[5][5] - a[0][4]*a[1][3]*a[2][1]*a[3][0]*a[4][5]*a[5][2] - a[0][4]*a[1][3]*a[2][1]*a[3][2]*a[4][0]*a[5][5] + a[0][4]*a[1][3]*a[2][1]*a[3][2]*a[4][5]*a[5][0] + a[0][4]*a[1][3]*a[2][1]*a[3][5]*a[4][0]*a[5][2] - a[0][4]*a[1][3]*a[2][1]*a[3][5]*a[4][2]*a[5][0] - a[0][4]*a[1][3]*a[2][2]*a[3][0]*a[4][1]*a[5][5] + a[0][4]*a[1][3]*a[2][2]*a[3][0]*a[4][5]*a[5][1] + a[0][4]*a[1][3]*a[2][2]*a[3][1]*a[4][0]*a[5][5] - a[0][4]*a[1][3]*a[2][2]*a[3][1]*a[4][5]*a[5][0] - a[0][4]*a[1][3]*a[2][2]*a[3][5]*a[4][0]*a[5][1] + a[0][4]*a[1][3]*a[2][2]*a[3][5]*a[4][1]*a[5][0] + a[0][4]*a[1][3]*a[2][5]*a[3][0]*a[4][1]*a[5][2] - a[0][4]*a[1][3]*a[2][5]*a[3][0]*a[4][2]*a[5][1] - a[0][4]*a[1][3]*a[2][5]*a[3][1]*a[4][0]*a[5][2] + a[0][4]*a[1][3]*a[2][5]*a[3][1]*a[4][2]*a[5][0] + a[0][4]*a[1][3]*a[2][5]*a[3][2]*a[4][0]*a[5][1] - a[0][4]*a[1][3]*a[2][5]*a[3][2]*a[4][1]*a[5][0] + a[0][4]*a[1][5]*a[2][0]*a[3][1]*a[4][2]*a[5][3] - a[0][4]*a[1][5]*a[2][0]*a[3][1]*a[4][3]*a[5][2] - a[0][4]*a[1][5]*a[2][0]*a[3][2]*a[4][1]*a[5][3] + a[0][4]*a[1][5]*a[2][0]*a[3][2]*a[4][3]*a[5][1] + a[0][4]*a[1][5]*a[2][0]*a[3][3]*a[4][1]*a[5][2] - a[0][4]*a[1][5]*a[2][0]*a[3][3]*a[4][2]*a[5][1] - a[0][4]*a[1][5]*a[2][1]*a[3][0]*a[4][2]*a[5][3] + a[0][4]*a[1][5]*a[2][1]*a[3][0]*a[4][3]*a[5][2] + a[0][4]*a[1][5]*a[2][1]*a[3][2]*a[4][0]*a[5][3] - a[0][4]*a[1][5]*a[2][1]*a[3][2]*a[4][3]*a[5][0] - a[0][4]*a[1][5]*a[2][1]*a[3][3]*a[4][0]*a[5][2] + a[0][4]*a[1][5]*a[2][1]*a[3][3]*a[4][2]*a[5][0] + a[0][4]*a[1][5]*a[2][2]*a[3][0]*a[4][1]*a[5][3] - a[0][4]*a[1][5]*a[2][2]*a[3][0]*a[4][3]*a[5][1] - a[0][4]*a[1][5]*a[2][2]*a[3][1]*a[4][0]*a[5][3] + a[0][4]*a[1][5]*a[2][2]*a[3][1]*a[4][3]*a[5][0] + a[0][4]*a[1][5]*a[2][2]*a[3][3]*a[4][0]*a[5][1] - a[0][4]*a[1][5]*a[2][2]*a[3][3]*a[4][1]*a[5][0] - a[0][4]*a[1][5]*a[2][3]*a[3][0]*a[4][1]*a[5][2] + a[0][4]*a[1][5]*a[2][3]*a[3][0]*a[4][2]*a[5][1] + a[0][4]*a[1][5]*a[2][3]*a[3][1]*a[4][0]*a[5][2] - a[0][4]*a[1][5]*a[2][3]*a[3][1]*a[4][2]*a[5][0] - a[0][4]*a[1][5]*a[2][3]*a[3][2]*a[4][0]*a[5][1] + a[0][4]*a[1][5]*a[2][3]*a[3][2]*a[4][1]*a[5][0] - a[0][5]*a[1][0]*a[2][1]*a[3][2]*a[4][3]*a[5][4] + a[0][5]*a[1][0]*a[2][1]*a[3][2]*a[4][4]*a[5][3] + a[0][5]*a[1][0]*a[2][1]*a[3][3]*a[4][2]*a[5][4] - a[0][5]*a[1][0]*a[2][1]*a[3][3]*a[4][4]*a[5][2] - a[0][5]*a[1][0]*a[2][1]*a[3][4]*a[4][2]*a[5][3] + a[0][5]*a[1][0]*a[2][1]*a[3][4]*a[4][3]*a[5][2];
denom += a[0][5]*a[1][0]*a[2][2]*a[3][1]*a[4][3]*a[5][4] - a[0][5]*a[1][0]*a[2][2]*a[3][1]*a[4][4]*a[5][3] - a[0][5]*a[1][0]*a[2][2]*a[3][3]*a[4][1]*a[5][4] + a[0][5]*a[1][0]*a[2][2]*a[3][3]*a[4][4]*a[5][1] + a[0][5]*a[1][0]*a[2][2]*a[3][4]*a[4][1]*a[5][3] - a[0][5]*a[1][0]*a[2][2]*a[3][4]*a[4][3]*a[5][1] - a[0][5]*a[1][0]*a[2][3]*a[3][1]*a[4][2]*a[5][4] + a[0][5]*a[1][0]*a[2][3]*a[3][1]*a[4][4]*a[5][2] + a[0][5]*a[1][0]*a[2][3]*a[3][2]*a[4][1]*a[5][4] - a[0][5]*a[1][0]*a[2][3]*a[3][2]*a[4][4]*a[5][1] - a[0][5]*a[1][0]*a[2][3]*a[3][4]*a[4][1]*a[5][2] + a[0][5]*a[1][0]*a[2][3]*a[3][4]*a[4][2]*a[5][1] + a[0][5]*a[1][0]*a[2][4]*a[3][1]*a[4][2]*a[5][3] - a[0][5]*a[1][0]*a[2][4]*a[3][1]*a[4][3]*a[5][2] - a[0][5]*a[1][0]*a[2][4]*a[3][2]*a[4][1]*a[5][3] + a[0][5]*a[1][0]*a[2][4]*a[3][2]*a[4][3]*a[5][1] + a[0][5]*a[1][0]*a[2][4]*a[3][3]*a[4][1]*a[5][2] - a[0][5]*a[1][0]*a[2][4]*a[3][3]*a[4][2]*a[5][1] + a[0][5]*a[1][1]*a[2][0]*a[3][2]*a[4][3]*a[5][4] - a[0][5]*a[1][1]*a[2][0]*a[3][2]*a[4][4]*a[5][3] - a[0][5]*a[1][1]*a[2][0]*a[3][3]*a[4][2]*a[5][4] + a[0][5]*a[1][1]*a[2][0]*a[3][3]*a[4][4]*a[5][2] + a[0][5]*a[1][1]*a[2][0]*a[3][4]*a[4][2]*a[5][3] - a[0][5]*a[1][1]*a[2][0]*a[3][4]*a[4][3]*a[5][2] - a[0][5]*a[1][1]*a[2][2]*a[3][0]*a[4][3]*a[5][4] + a[0][5]*a[1][1]*a[2][2]*a[3][0]*a[4][4]*a[5][3] + a[0][5]*a[1][1]*a[2][2]*a[3][3]*a[4][0]*a[5][4] - a[0][5]*a[1][1]*a[2][2]*a[3][3]*a[4][4]*a[5][0] - a[0][5]*a[1][1]*a[2][2]*a[3][4]*a[4][0]*a[5][3] + a[0][5]*a[1][1]*a[2][2]*a[3][4]*a[4][3]*a[5][0] + a[0][5]*a[1][1]*a[2][3]*a[3][0]*a[4][2]*a[5][4] - a[0][5]*a[1][1]*a[2][3]*a[3][0]*a[4][4]*a[5][2] - a[0][5]*a[1][1]*a[2][3]*a[3][2]*a[4][0]*a[5][4] + a[0][5]*a[1][1]*a[2][3]*a[3][2]*a[4][4]*a[5][0] + a[0][5]*a[1][1]*a[2][3]*a[3][4]*a[4][0]*a[5][2] - a[0][5]*a[1][1]*a[2][3]*a[3][4]*a[4][2]*a[5][0] - a[0][5]*a[1][1]*a[2][4]*a[3][0]*a[4][2]*a[5][3] + a[0][5]*a[1][1]*a[2][4]*a[3][0]*a[4][3]*a[5][2] + a[0][5]*a[1][1]*a[2][4]*a[3][2]*a[4][0]*a[5][3] - a[0][5]*a[1][1]*a[2][4]*a[3][2]*a[4][3]*a[5][0] - a[0][5]*a[1][1]*a[2][4]*a[3][3]*a[4][0]*a[5][2] + a[0][5]*a[1][1]*a[2][4]*a[3][3]*a[4][2]*a[5][0] - a[0][5]*a[1][2]*a[2][0]*a[3][1]*a[4][3]*a[5][4] + a[0][5]*a[1][2]*a[2][0]*a[3][1]*a[4][4]*a[5][3] + a[0][5]*a[1][2]*a[2][0]*a[3][3]*a[4][1]*a[5][4] - a[0][5]*a[1][2]*a[2][0]*a[3][3]*a[4][4]*a[5][1] - a[0][5]*a[1][2]*a[2][0]*a[3][4]*a[4][1]*a[5][3] + a[0][5]*a[1][2]*a[2][0]*a[3][4]*a[4][3]*a[5][1] + a[0][5]*a[1][2]*a[2][1]*a[3][0]*a[4][3]*a[5][4] - a[0][5]*a[1][2]*a[2][1]*a[3][0]*a[4][4]*a[5][3] - a[0][5]*a[1][2]*a[2][1]*a[3][3]*a[4][0]*a[5][4] + a[0][5]*a[1][2]*a[2][1]*a[3][3]*a[4][4]*a[5][0] + a[0][5]*a[1][2]*a[2][1]*a[3][4]*a[4][0]*a[5][3] - a[0][5]*a[1][2]*a[2][1]*a[3][4]*a[4][3]*a[5][0] - a[0][5]*a[1][2]*a[2][3]*a[3][0]*a[4][1]*a[5][4] + a[0][5]*a[1][2]*a[2][3]*a[3][0]*a[4][4]*a[5][1] + a[0][5]*a[1][2]*a[2][3]*a[3][1]*a[4][0]*a[5][4] - a[0][5]*a[1][2]*a[2][3]*a[3][1]*a[4][4]*a[5][0] - a[0][5]*a[1][2]*a[2][3]*a[3][4]*a[4][0]*a[5][1] + a[0][5]*a[1][2]*a[2][3]*a[3][4]*a[4][1]*a[5][0] + a[0][5]*a[1][2]*a[2][4]*a[3][0]*a[4][1]*a[5][3] - a[0][5]*a[1][2]*a[2][4]*a[3][0]*a[4][3]*a[5][1] - a[0][5]*a[1][2]*a[2][4]*a[3][1]*a[4][0]*a[5][3] + a[0][5]*a[1][2]*a[2][4]*a[3][1]*a[4][3]*a[5][0] + a[0][5]*a[1][2]*a[2][4]*a[3][3]*a[4][0]*a[5][1] - a[0][5]*a[1][2]*a[2][4]*a[3][3]*a[4][1]*a[5][0] + a[0][5]*a[1][3]*a[2][0]*a[3][1]*a[4][2]*a[5][4] - a[0][5]*a[1][3]*a[2][0]*a[3][1]*a[4][4]*a[5][2] - a[0][5]*a[1][3]*a[2][0]*a[3][2]*a[4][1]*a[5][4] + a[0][5]*a[1][3]*a[2][0]*a[3][2]*a[4][4]*a[5][1] + a[0][5]*a[1][3]*a[2][0]*a[3][4]*a[4][1]*a[5][2] - a[0][5]*a[1][3]*a[2][0]*a[3][4]*a[4][2]*a[5][1] - a[0][5]*a[1][3]*a[2][1]*a[3][0]*a[4][2]*a[5][4] + a[0][5]*a[1][3]*a[2][1]*a[3][0]*a[4][4]*a[5][2] + a[0][5]*a[1][3]*a[2][1]*a[3][2]*a[4][0]*a[5][4] - a[0][5]*a[1][3]*a[2][1]*a[3][2]*a[4][4]*a[5][0] - a[0][5]*a[1][3]*a[2][1]*a[3][4]*a[4][0]*a[5][2] + a[0][5]*a[1][3]*a[2][1]*a[3][4]*a[4][2]*a[5][0] + a[0][5]*a[1][3]*a[2][2]*a[3][0]*a[4][1]*a[5][4] - a[0][5]*a[1][3]*a[2][2]*a[3][0]*a[4][4]*a[5][1] - a[0][5]*a[1][3]*a[2][2]*a[3][1]*a[4][0]*a[5][4] + a[0][5]*a[1][3]*a[2][2]*a[3][1]*a[4][4]*a[5][0] + a[0][5]*a[1][3]*a[2][2]*a[3][4]*a[4][0]*a[5][1] - a[0][5]*a[1][3]*a[2][2]*a[3][4]*a[4][1]*a[5][0] - a[0][5]*a[1][3]*a[2][4]*a[3][0]*a[4][1]*a[5][2] + a[0][5]*a[1][3]*a[2][4]*a[3][0]*a[4][2]*a[5][1] + a[0][5]*a[1][3]*a[2][4]*a[3][1]*a[4][0]*a[5][2] - a[0][5]*a[1][3]*a[2][4]*a[3][1]*a[4][2]*a[5][0] - a[0][5]*a[1][3]*a[2][4]*a[3][2]*a[4][0]*a[5][1] + a[0][5]*a[1][3]*a[2][4]*a[3][2]*a[4][1]*a[5][0] - a[0][5]*a[1][4]*a[2][0]*a[3][1]*a[4][2]*a[5][3] + a[0][5]*a[1][4]*a[2][0]*a[3][1]*a[4][3]*a[5][2] + a[0][5]*a[1][4]*a[2][0]*a[3][2]*a[4][1]*a[5][3] - a[0][5]*a[1][4]*a[2][0]*a[3][2]*a[4][3]*a[5][1] - a[0][5]*a[1][4]*a[2][0]*a[3][3]*a[4][1]*a[5][2] + a[0][5]*a[1][4]*a[2][0]*a[3][3]*a[4][2]*a[5][1] + a[0][5]*a[1][4]*a[2][1]*a[3][0]*a[4][2]*a[5][3] - a[0][5]*a[1][4]*a[2][1]*a[3][0]*a[4][3]*a[5][2] - a[0][5]*a[1][4]*a[2][1]*a[3][2]*a[4][0]*a[5][3] + a[0][5]*a[1][4]*a[2][1]*a[3][2]*a[4][3]*a[5][0] + a[0][5]*a[1][4]*a[2][1]*a[3][3]*a[4][0]*a[5][2];
denom += -a[0][5]*a[1][4]*a[2][1]*a[3][3]*a[4][2]*a[5][0] - a[0][5]*a[1][4]*a[2][2]*a[3][0]*a[4][1]*a[5][3] + a[0][5]*a[1][4]*a[2][2]*a[3][0]*a[4][3]*a[5][1] + a[0][5]*a[1][4]*a[2][2]*a[3][1]*a[4][0]*a[5][3] - a[0][5]*a[1][4]*a[2][2]*a[3][1]*a[4][3]*a[5][0] - a[0][5]*a[1][4]*a[2][2]*a[3][3]*a[4][0]*a[5][1] + a[0][5]*a[1][4]*a[2][2]*a[3][3]*a[4][1]*a[5][0] + a[0][5]*a[1][4]*a[2][3]*a[3][0]*a[4][1]*a[5][2] - a[0][5]*a[1][4]*a[2][3]*a[3][0]*a[4][2]*a[5][1] - a[0][5]*a[1][4]*a[2][3]*a[3][1]*a[4][0]*a[5][2] + a[0][5]*a[1][4]*a[2][3]*a[3][1]*a[4][2]*a[5][0] + a[0][5]*a[1][4]*a[2][3]*a[3][2]*a[4][0]*a[5][1] - a[0][5]*a[1][4]*a[2][3]*a[3][2]*a[4][1]*a[5][0];
invA[0][0] = (a[1][1]*a[2][2]*a[3][3]*a[4][4]*a[5][5] - a[1][1]*a[2][2]*a[3][3]*a[4][5]*a[5][4] - a[1][1]*a[2][2]*a[3][4]*a[4][3]*a[5][5] + a[1][1]*a[2][2]*a[3][4]*a[4][5]*a[5][3] + a[1][1]*a[2][2]*a[3][5]*a[4][3]*a[5][4] - a[1][1]*a[2][2]*a[3][5]*a[4][4]*a[5][3] - a[1][1]*a[2][3]*a[3][2]*a[4][4]*a[5][5] + a[1][1]*a[2][3]*a[3][2]*a[4][5]*a[5][4] + a[1][1]*a[2][3]*a[3][4]*a[4][2]*a[5][5] - a[1][1]*a[2][3]*a[3][4]*a[4][5]*a[5][2] - a[1][1]*a[2][3]*a[3][5]*a[4][2]*a[5][4] + a[1][1]*a[2][3]*a[3][5]*a[4][4]*a[5][2] + a[1][1]*a[2][4]*a[3][2]*a[4][3]*a[5][5] - a[1][1]*a[2][4]*a[3][2]*a[4][5]*a[5][3] - a[1][1]*a[2][4]*a[3][3]*a[4][2]*a[5][5] + a[1][1]*a[2][4]*a[3][3]*a[4][5]*a[5][2] + a[1][1]*a[2][4]*a[3][5]*a[4][2]*a[5][3] - a[1][1]*a[2][4]*a[3][5]*a[4][3]*a[5][2] - a[1][1]*a[2][5]*a[3][2]*a[4][3]*a[5][4] + a[1][1]*a[2][5]*a[3][2]*a[4][4]*a[5][3] + a[1][1]*a[2][5]*a[3][3]*a[4][2]*a[5][4] - a[1][1]*a[2][5]*a[3][3]*a[4][4]*a[5][2] - a[1][1]*a[2][5]*a[3][4]*a[4][2]*a[5][3] + a[1][1]*a[2][5]*a[3][4]*a[4][3]*a[5][2] - a[1][2]*a[2][1]*a[3][3]*a[4][4]*a[5][5] + a[1][2]*a[2][1]*a[3][3]*a[4][5]*a[5][4] + a[1][2]*a[2][1]*a[3][4]*a[4][3]*a[5][5] - a[1][2]*a[2][1]*a[3][4]*a[4][5]*a[5][3] - a[1][2]*a[2][1]*a[3][5]*a[4][3]*a[5][4] + a[1][2]*a[2][1]*a[3][5]*a[4][4]*a[5][3] + a[1][2]*a[2][3]*a[3][1]*a[4][4]*a[5][5] - a[1][2]*a[2][3]*a[3][1]*a[4][5]*a[5][4] - a[1][2]*a[2][3]*a[3][4]*a[4][1]*a[5][5] + a[1][2]*a[2][3]*a[3][4]*a[4][5]*a[5][1] + a[1][2]*a[2][3]*a[3][5]*a[4][1]*a[5][4] - a[1][2]*a[2][3]*a[3][5]*a[4][4]*a[5][1] - a[1][2]*a[2][4]*a[3][1]*a[4][3]*a[5][5] + a[1][2]*a[2][4]*a[3][1]*a[4][5]*a[5][3] + a[1][2]*a[2][4]*a[3][3]*a[4][1]*a[5][5] - a[1][2]*a[2][4]*a[3][3]*a[4][5]*a[5][1] - a[1][2]*a[2][4]*a[3][5]*a[4][1]*a[5][3] + a[1][2]*a[2][4]*a[3][5]*a[4][3]*a[5][1] + a[1][2]*a[2][5]*a[3][1]*a[4][3]*a[5][4] - a[1][2]*a[2][5]*a[3][1]*a[4][4]*a[5][3] - a[1][2]*a[2][5]*a[3][3]*a[4][1]*a[5][4] + a[1][2]*a[2][5]*a[3][3]*a[4][4]*a[5][1] + a[1][2]*a[2][5]*a[3][4]*a[4][1]*a[5][3] - a[1][2]*a[2][5]*a[3][4]*a[4][3]*a[5][1] + a[1][3]*a[2][1]*a[3][2]*a[4][4]*a[5][5] - a[1][3]*a[2][1]*a[3][2]*a[4][5]*a[5][4] - a[1][3]*a[2][1]*a[3][4]*a[4][2]*a[5][5] + a[1][3]*a[2][1]*a[3][4]*a[4][5]*a[5][2] + a[1][3]*a[2][1]*a[3][5]*a[4][2]*a[5][4] - a[1][3]*a[2][1]*a[3][5]*a[4][4]*a[5][2] - a[1][3]*a[2][2]*a[3][1]*a[4][4]*a[5][5] + a[1][3]*a[2][2]*a[3][1]*a[4][5]*a[5][4] + a[1][3]*a[2][2]*a[3][4]*a[4][1]*a[5][5] - a[1][3]*a[2][2]*a[3][4]*a[4][5]*a[5][1] - a[1][3]*a[2][2]*a[3][5]*a[4][1]*a[5][4] + a[1][3]*a[2][2]*a[3][5]*a[4][4]*a[5][1] + a[1][3]*a[2][4]*a[3][1]*a[4][2]*a[5][5] - a[1][3]*a[2][4]*a[3][1]*a[4][5]*a[5][2] - a[1][3]*a[2][4]*a[3][2]*a[4][1]*a[5][5] + a[1][3]*a[2][4]*a[3][2]*a[4][5]*a[5][1] + a[1][3]*a[2][4]*a[3][5]*a[4][1]*a[5][2] - a[1][3]*a[2][4]*a[3][5]*a[4][2]*a[5][1] - a[1][3]*a[2][5]*a[3][1]*a[4][2]*a[5][4] + a[1][3]*a[2][5]*a[3][1]*a[4][4]*a[5][2] + a[1][3]*a[2][5]*a[3][2]*a[4][1]*a[5][4] - a[1][3]*a[2][5]*a[3][2]*a[4][4]*a[5][1] - a[1][3]*a[2][5]*a[3][4]*a[4][1]*a[5][2] + a[1][3]*a[2][5]*a[3][4]*a[4][2]*a[5][1] - a[1][4]*a[2][1]*a[3][2]*a[4][3]*a[5][5] + a[1][4]*a[2][1]*a[3][2]*a[4][5]*a[5][3] + a[1][4]*a[2][1]*a[3][3]*a[4][2]*a[5][5] - a[1][4]*a[2][1]*a[3][3]*a[4][5]*a[5][2] - a[1][4]*a[2][1]*a[3][5]*a[4][2]*a[5][3] + a[1][4]*a[2][1]*a[3][5]*a[4][3]*a[5][2] + a[1][4]*a[2][2]*a[3][1]*a[4][3]*a[5][5] - a[1][4]*a[2][2]*a[3][1]*a[4][5]*a[5][3] - a[1][4]*a[2][2]*a[3][3]*a[4][1]*a[5][5] + a[1][4]*a[2][2]*a[3][3]*a[4][5]*a[5][1] + a[1][4]*a[2][2]*a[3][5]*a[4][1]*a[5][3] - a[1][4]*a[2][2]*a[3][5]*a[4][3]*a[5][1] - a[1][4]*a[2][3]*a[3][1]*a[4][2]*a[5][5] + a[1][4]*a[2][3]*a[3][1]*a[4][5]*a[5][2] + a[1][4]*a[2][3]*a[3][2]*a[4][1]*a[5][5] - a[1][4]*a[2][3]*a[3][2]*a[4][5]*a[5][1] - a[1][4]*a[2][3]*a[3][5]*a[4][1]*a[5][2] + a[1][4]*a[2][3]*a[3][5]*a[4][2]*a[5][1] + a[1][4]*a[2][5]*a[3][1]*a[4][2]*a[5][3] - a[1][4]*a[2][5]*a[3][1]*a[4][3]*a[5][2] - a[1][4]*a[2][5]*a[3][2]*a[4][1]*a[5][3] + a[1][4]*a[2][5]*a[3][2]*a[4][3]*a[5][1] + a[1][4]*a[2][5]*a[3][3]*a[4][1]*a[5][2] - a[1][4]*a[2][5]*a[3][3]*a[4][2]*a[5][1] + a[1][5]*a[2][1]*a[3][2]*a[4][3]*a[5][4] - a[1][5]*a[2][1]*a[3][2]*a[4][4]*a[5][3] - a[1][5]*a[2][1]*a[3][3]*a[4][2]*a[5][4] + a[1][5]*a[2][1]*a[3][3]*a[4][4]*a[5][2] + a[1][5]*a[2][1]*a[3][4]*a[4][2]*a[5][3] - a[1][5]*a[2][1]*a[3][4]*a[4][3]*a[5][2] - a[1][5]*a[2][2]*a[3][1]*a[4][3]*a[5][4] + a[1][5]*a[2][2]*a[3][1]*a[4][4]*a[5][3] + a[1][5]*a[2][2]*a[3][3]*a[4][1]*a[5][4] - a[1][5]*a[2][2]*a[3][3]*a[4][4]*a[5][1] - a[1][5]*a[2][2]*a[3][4]*a[4][1]*a[5][3] + a[1][5]*a[2][2]*a[3][4]*a[4][3]*a[5][1] + a[1][5]*a[2][3]*a[3][1]*a[4][2]*a[5][4] - a[1][5]*a[2][3]*a[3][1]*a[4][4]*a[5][2] - a[1][5]*a[2][3]*a[3][2]*a[4][1]*a[5][4] + a[1][5]*a[2][3]*a[3][2]*a[4][4]*a[5][1] + a[1][5]*a[2][3]*a[3][4]*a[4][1]*a[5][2] - a[1][5]*a[2][3]*a[3][4]*a[4][2]*a[5][1] - a[1][5]*a[2][4]*a[3][1]*a[4][2]*a[5][3] + a[1][5]*a[2][4]*a[3][1]*a[4][3]*a[5][2] + a[1][5]*a[2][4]*a[3][2]*a[4][1]*a[5][3] - a[1][5]*a[2][4]*a[3][2]*a[4][3]*a[5][1] - a[1][5]*a[2][4]*a[3][3]*a[4][1]*a[5][2] + a[1][5]*a[2][4]*a[3][3]*a[4][2]*a[5][1])/denom;
invA[1][0] = -(a[1][0]*a[2][2]*a[3][3]*a[4][4]*a[5][5] - a[1][0]*a[2][2]*a[3][3]*a[4][5]*a[5][4] - a[1][0]*a[2][2]*a[3][4]*a[4][3]*a[5][5] + a[1][0]*a[2][2]*a[3][4]*a[4][5]*a[5][3] + a[1][0]*a[2][2]*a[3][5]*a[4][3]*a[5][4] - a[1][0]*a[2][2]*a[3][5]*a[4][4]*a[5][3] - a[1][0]*a[2][3]*a[3][2]*a[4][4]*a[5][5] + a[1][0]*a[2][3]*a[3][2]*a[4][5]*a[5][4] + a[1][0]*a[2][3]*a[3][4]*a[4][2]*a[5][5] - a[1][0]*a[2][3]*a[3][4]*a[4][5]*a[5][2] - a[1][0]*a[2][3]*a[3][5]*a[4][2]*a[5][4] + a[1][0]*a[2][3]*a[3][5]*a[4][4]*a[5][2] + a[1][0]*a[2][4]*a[3][2]*a[4][3]*a[5][5] - a[1][0]*a[2][4]*a[3][2]*a[4][5]*a[5][3] - a[1][0]*a[2][4]*a[3][3]*a[4][2]*a[5][5] + a[1][0]*a[2][4]*a[3][3]*a[4][5]*a[5][2] + a[1][0]*a[2][4]*a[3][5]*a[4][2]*a[5][3] - a[1][0]*a[2][4]*a[3][5]*a[4][3]*a[5][2] - a[1][0]*a[2][5]*a[3][2]*a[4][3]*a[5][4] + a[1][0]*a[2][5]*a[3][2]*a[4][4]*a[5][3] + a[1][0]*a[2][5]*a[3][3]*a[4][2]*a[5][4] - a[1][0]*a[2][5]*a[3][3]*a[4][4]*a[5][2] - a[1][0]*a[2][5]*a[3][4]*a[4][2]*a[5][3] + a[1][0]*a[2][5]*a[3][4]*a[4][3]*a[5][2] - a[1][2]*a[2][0]*a[3][3]*a[4][4]*a[5][5] + a[1][2]*a[2][0]*a[3][3]*a[4][5]*a[5][4] + a[1][2]*a[2][0]*a[3][4]*a[4][3]*a[5][5] - a[1][2]*a[2][0]*a[3][4]*a[4][5]*a[5][3] - a[1][2]*a[2][0]*a[3][5]*a[4][3]*a[5][4] + a[1][2]*a[2][0]*a[3][5]*a[4][4]*a[5][3] + a[1][2]*a[2][3]*a[3][0]*a[4][4]*a[5][5] - a[1][2]*a[2][3]*a[3][0]*a[4][5]*a[5][4] - a[1][2]*a[2][3]*a[3][4]*a[4][0]*a[5][5] + a[1][2]*a[2][3]*a[3][4]*a[4][5]*a[5][0] + a[1][2]*a[2][3]*a[3][5]*a[4][0]*a[5][4] - a[1][2]*a[2][3]*a[3][5]*a[4][4]*a[5][0] - a[1][2]*a[2][4]*a[3][0]*a[4][3]*a[5][5] + a[1][2]*a[2][4]*a[3][0]*a[4][5]*a[5][3] + a[1][2]*a[2][4]*a[3][3]*a[4][0]*a[5][5] - a[1][2]*a[2][4]*a[3][3]*a[4][5]*a[5][0] - a[1][2]*a[2][4]*a[3][5]*a[4][0]*a[5][3] + a[1][2]*a[2][4]*a[3][5]*a[4][3]*a[5][0] + a[1][2]*a[2][5]*a[3][0]*a[4][3]*a[5][4] - a[1][2]*a[2][5]*a[3][0]*a[4][4]*a[5][3] - a[1][2]*a[2][5]*a[3][3]*a[4][0]*a[5][4] + a[1][2]*a[2][5]*a[3][3]*a[4][4]*a[5][0] + a[1][2]*a[2][5]*a[3][4]*a[4][0]*a[5][3] - a[1][2]*a[2][5]*a[3][4]*a[4][3]*a[5][0] + a[1][3]*a[2][0]*a[3][2]*a[4][4]*a[5][5] - a[1][3]*a[2][0]*a[3][2]*a[4][5]*a[5][4] - a[1][3]*a[2][0]*a[3][4]*a[4][2]*a[5][5] + a[1][3]*a[2][0]*a[3][4]*a[4][5]*a[5][2] + a[1][3]*a[2][0]*a[3][5]*a[4][2]*a[5][4] - a[1][3]*a[2][0]*a[3][5]*a[4][4]*a[5][2] - a[1][3]*a[2][2]*a[3][0]*a[4][4]*a[5][5] + a[1][3]*a[2][2]*a[3][0]*a[4][5]*a[5][4] + a[1][3]*a[2][2]*a[3][4]*a[4][0]*a[5][5] - a[1][3]*a[2][2]*a[3][4]*a[4][5]*a[5][0] - a[1][3]*a[2][2]*a[3][5]*a[4][0]*a[5][4] + a[1][3]*a[2][2]*a[3][5]*a[4][4]*a[5][0] + a[1][3]*a[2][4]*a[3][0]*a[4][2]*a[5][5] - a[1][3]*a[2][4]*a[3][0]*a[4][5]*a[5][2] - a[1][3]*a[2][4]*a[3][2]*a[4][0]*a[5][5] + a[1][3]*a[2][4]*a[3][2]*a[4][5]*a[5][0] + a[1][3]*a[2][4]*a[3][5]*a[4][0]*a[5][2] - a[1][3]*a[2][4]*a[3][5]*a[4][2]*a[5][0] - a[1][3]*a[2][5]*a[3][0]*a[4][2]*a[5][4] + a[1][3]*a[2][5]*a[3][0]*a[4][4]*a[5][2] + a[1][3]*a[2][5]*a[3][2]*a[4][0]*a[5][4] - a[1][3]*a[2][5]*a[3][2]*a[4][4]*a[5][0] - a[1][3]*a[2][5]*a[3][4]*a[4][0]*a[5][2] + a[1][3]*a[2][5]*a[3][4]*a[4][2]*a[5][0] - a[1][4]*a[2][0]*a[3][2]*a[4][3]*a[5][5] + a[1][4]*a[2][0]*a[3][2]*a[4][5]*a[5][3] + a[1][4]*a[2][0]*a[3][3]*a[4][2]*a[5][5] - a[1][4]*a[2][0]*a[3][3]*a[4][5]*a[5][2] - a[1][4]*a[2][0]*a[3][5]*a[4][2]*a[5][3] + a[1][4]*a[2][0]*a[3][5]*a[4][3]*a[5][2] + a[1][4]*a[2][2]*a[3][0]*a[4][3]*a[5][5] - a[1][4]*a[2][2]*a[3][0]*a[4][5]*a[5][3] - a[1][4]*a[2][2]*a[3][3]*a[4][0]*a[5][5] + a[1][4]*a[2][2]*a[3][3]*a[4][5]*a[5][0] + a[1][4]*a[2][2]*a[3][5]*a[4][0]*a[5][3] - a[1][4]*a[2][2]*a[3][5]*a[4][3]*a[5][0] - a[1][4]*a[2][3]*a[3][0]*a[4][2]*a[5][5] + a[1][4]*a[2][3]*a[3][0]*a[4][5]*a[5][2] + a[1][4]*a[2][3]*a[3][2]*a[4][0]*a[5][5] - a[1][4]*a[2][3]*a[3][2]*a[4][5]*a[5][0] - a[1][4]*a[2][3]*a[3][5]*a[4][0]*a[5][2] + a[1][4]*a[2][3]*a[3][5]*a[4][2]*a[5][0] + a[1][4]*a[2][5]*a[3][0]*a[4][2]*a[5][3] - a[1][4]*a[2][5]*a[3][0]*a[4][3]*a[5][2] - a[1][4]*a[2][5]*a[3][2]*a[4][0]*a[5][3] + a[1][4]*a[2][5]*a[3][2]*a[4][3]*a[5][0] + a[1][4]*a[2][5]*a[3][3]*a[4][0]*a[5][2] - a[1][4]*a[2][5]*a[3][3]*a[4][2]*a[5][0] + a[1][5]*a[2][0]*a[3][2]*a[4][3]*a[5][4] - a[1][5]*a[2][0]*a[3][2]*a[4][4]*a[5][3] - a[1][5]*a[2][0]*a[3][3]*a[4][2]*a[5][4] + a[1][5]*a[2][0]*a[3][3]*a[4][4]*a[5][2] + a[1][5]*a[2][0]*a[3][4]*a[4][2]*a[5][3] - a[1][5]*a[2][0]*a[3][4]*a[4][3]*a[5][2] - a[1][5]*a[2][2]*a[3][0]*a[4][3]*a[5][4] + a[1][5]*a[2][2]*a[3][0]*a[4][4]*a[5][3] + a[1][5]*a[2][2]*a[3][3]*a[4][0]*a[5][4] - a[1][5]*a[2][2]*a[3][3]*a[4][4]*a[5][0] - a[1][5]*a[2][2]*a[3][4]*a[4][0]*a[5][3] + a[1][5]*a[2][2]*a[3][4]*a[4][3]*a[5][0] + a[1][5]*a[2][3]*a[3][0]*a[4][2]*a[5][4] - a[1][5]*a[2][3]*a[3][0]*a[4][4]*a[5][2] - a[1][5]*a[2][3]*a[3][2]*a[4][0]*a[5][4] + a[1][5]*a[2][3]*a[3][2]*a[4][4]*a[5][0] + a[1][5]*a[2][3]*a[3][4]*a[4][0]*a[5][2] - a[1][5]*a[2][3]*a[3][4]*a[4][2]*a[5][0] - a[1][5]*a[2][4]*a[3][0]*a[4][2]*a[5][3] + a[1][5]*a[2][4]*a[3][0]*a[4][3]*a[5][2] + a[1][5]*a[2][4]*a[3][2]*a[4][0]*a[5][3] - a[1][5]*a[2][4]*a[3][2]*a[4][3]*a[5][0] - a[1][5]*a[2][4]*a[3][3]*a[4][0]*a[5][2] + a[1][5]*a[2][4]*a[3][3]*a[4][2]*a[5][0])/denom;
invA[2][0] = (a[1][0]*a[2][1]*a[3][3]*a[4][4]*a[5][5] - a[1][0]*a[2][1]*a[3][3]*a[4][5]*a[5][4] - a[1][0]*a[2][1]*a[3][4]*a[4][3]*a[5][5] + a[1][0]*a[2][1]*a[3][4]*a[4][5]*a[5][3] + a[1][0]*a[2][1]*a[3][5]*a[4][3]*a[5][4] - a[1][0]*a[2][1]*a[3][5]*a[4][4]*a[5][3] - a[1][0]*a[2][3]*a[3][1]*a[4][4]*a[5][5] + a[1][0]*a[2][3]*a[3][1]*a[4][5]*a[5][4] + a[1][0]*a[2][3]*a[3][4]*a[4][1]*a[5][5] - a[1][0]*a[2][3]*a[3][4]*a[4][5]*a[5][1] - a[1][0]*a[2][3]*a[3][5]*a[4][1]*a[5][4] + a[1][0]*a[2][3]*a[3][5]*a[4][4]*a[5][1] + a[1][0]*a[2][4]*a[3][1]*a[4][3]*a[5][5] - a[1][0]*a[2][4]*a[3][1]*a[4][5]*a[5][3] - a[1][0]*a[2][4]*a[3][3]*a[4][1]*a[5][5] + a[1][0]*a[2][4]*a[3][3]*a[4][5]*a[5][1] + a[1][0]*a[2][4]*a[3][5]*a[4][1]*a[5][3] - a[1][0]*a[2][4]*a[3][5]*a[4][3]*a[5][1] - a[1][0]*a[2][5]*a[3][1]*a[4][3]*a[5][4] + a[1][0]*a[2][5]*a[3][1]*a[4][4]*a[5][3] + a[1][0]*a[2][5]*a[3][3]*a[4][1]*a[5][4] - a[1][0]*a[2][5]*a[3][3]*a[4][4]*a[5][1] - a[1][0]*a[2][5]*a[3][4]*a[4][1]*a[5][3] + a[1][0]*a[2][5]*a[3][4]*a[4][3]*a[5][1] - a[1][1]*a[2][0]*a[3][3]*a[4][4]*a[5][5] + a[1][1]*a[2][0]*a[3][3]*a[4][5]*a[5][4] + a[1][1]*a[2][0]*a[3][4]*a[4][3]*a[5][5] - a[1][1]*a[2][0]*a[3][4]*a[4][5]*a[5][3] - a[1][1]*a[2][0]*a[3][5]*a[4][3]*a[5][4] + a[1][1]*a[2][0]*a[3][5]*a[4][4]*a[5][3] + a[1][1]*a[2][3]*a[3][0]*a[4][4]*a[5][5] - a[1][1]*a[2][3]*a[3][0]*a[4][5]*a[5][4] - a[1][1]*a[2][3]*a[3][4]*a[4][0]*a[5][5] + a[1][1]*a[2][3]*a[3][4]*a[4][5]*a[5][0] + a[1][1]*a[2][3]*a[3][5]*a[4][0]*a[5][4] - a[1][1]*a[2][3]*a[3][5]*a[4][4]*a[5][0] - a[1][1]*a[2][4]*a[3][0]*a[4][3]*a[5][5] + a[1][1]*a[2][4]*a[3][0]*a[4][5]*a[5][3] + a[1][1]*a[2][4]*a[3][3]*a[4][0]*a[5][5] - a[1][1]*a[2][4]*a[3][3]*a[4][5]*a[5][0] - a[1][1]*a[2][4]*a[3][5]*a[4][0]*a[5][3] + a[1][1]*a[2][4]*a[3][5]*a[4][3]*a[5][0] + a[1][1]*a[2][5]*a[3][0]*a[4][3]*a[5][4] - a[1][1]*a[2][5]*a[3][0]*a[4][4]*a[5][3] - a[1][1]*a[2][5]*a[3][3]*a[4][0]*a[5][4] + a[1][1]*a[2][5]*a[3][3]*a[4][4]*a[5][0] + a[1][1]*a[2][5]*a[3][4]*a[4][0]*a[5][3] - a[1][1]*a[2][5]*a[3][4]*a[4][3]*a[5][0] + a[1][3]*a[2][0]*a[3][1]*a[4][4]*a[5][5] - a[1][3]*a[2][0]*a[3][1]*a[4][5]*a[5][4] - a[1][3]*a[2][0]*a[3][4]*a[4][1]*a[5][5] + a[1][3]*a[2][0]*a[3][4]*a[4][5]*a[5][1] + a[1][3]*a[2][0]*a[3][5]*a[4][1]*a[5][4] - a[1][3]*a[2][0]*a[3][5]*a[4][4]*a[5][1] - a[1][3]*a[2][1]*a[3][0]*a[4][4]*a[5][5] + a[1][3]*a[2][1]*a[3][0]*a[4][5]*a[5][4] + a[1][3]*a[2][1]*a[3][4]*a[4][0]*a[5][5] - a[1][3]*a[2][1]*a[3][4]*a[4][5]*a[5][0] - a[1][3]*a[2][1]*a[3][5]*a[4][0]*a[5][4] + a[1][3]*a[2][1]*a[3][5]*a[4][4]*a[5][0] + a[1][3]*a[2][4]*a[3][0]*a[4][1]*a[5][5] - a[1][3]*a[2][4]*a[3][0]*a[4][5]*a[5][1] - a[1][3]*a[2][4]*a[3][1]*a[4][0]*a[5][5] + a[1][3]*a[2][4]*a[3][1]*a[4][5]*a[5][0] + a[1][3]*a[2][4]*a[3][5]*a[4][0]*a[5][1] - a[1][3]*a[2][4]*a[3][5]*a[4][1]*a[5][0] - a[1][3]*a[2][5]*a[3][0]*a[4][1]*a[5][4] + a[1][3]*a[2][5]*a[3][0]*a[4][4]*a[5][1] + a[1][3]*a[2][5]*a[3][1]*a[4][0]*a[5][4] - a[1][3]*a[2][5]*a[3][1]*a[4][4]*a[5][0] - a[1][3]*a[2][5]*a[3][4]*a[4][0]*a[5][1] + a[1][3]*a[2][5]*a[3][4]*a[4][1]*a[5][0] - a[1][4]*a[2][0]*a[3][1]*a[4][3]*a[5][5] + a[1][4]*a[2][0]*a[3][1]*a[4][5]*a[5][3] + a[1][4]*a[2][0]*a[3][3]*a[4][1]*a[5][5] - a[1][4]*a[2][0]*a[3][3]*a[4][5]*a[5][1] - a[1][4]*a[2][0]*a[3][5]*a[4][1]*a[5][3] + a[1][4]*a[2][0]*a[3][5]*a[4][3]*a[5][1] + a[1][4]*a[2][1]*a[3][0]*a[4][3]*a[5][5] - a[1][4]*a[2][1]*a[3][0]*a[4][5]*a[5][3] - a[1][4]*a[2][1]*a[3][3]*a[4][0]*a[5][5] + a[1][4]*a[2][1]*a[3][3]*a[4][5]*a[5][0] + a[1][4]*a[2][1]*a[3][5]*a[4][0]*a[5][3] - a[1][4]*a[2][1]*a[3][5]*a[4][3]*a[5][0] - a[1][4]*a[2][3]*a[3][0]*a[4][1]*a[5][5] + a[1][4]*a[2][3]*a[3][0]*a[4][5]*a[5][1] + a[1][4]*a[2][3]*a[3][1]*a[4][0]*a[5][5] - a[1][4]*a[2][3]*a[3][1]*a[4][5]*a[5][0] - a[1][4]*a[2][3]*a[3][5]*a[4][0]*a[5][1] + a[1][4]*a[2][3]*a[3][5]*a[4][1]*a[5][0] + a[1][4]*a[2][5]*a[3][0]*a[4][1]*a[5][3] - a[1][4]*a[2][5]*a[3][0]*a[4][3]*a[5][1] - a[1][4]*a[2][5]*a[3][1]*a[4][0]*a[5][3] + a[1][4]*a[2][5]*a[3][1]*a[4][3]*a[5][0] + a[1][4]*a[2][5]*a[3][3]*a[4][0]*a[5][1] - a[1][4]*a[2][5]*a[3][3]*a[4][1]*a[5][0] + a[1][5]*a[2][0]*a[3][1]*a[4][3]*a[5][4] - a[1][5]*a[2][0]*a[3][1]*a[4][4]*a[5][3] - a[1][5]*a[2][0]*a[3][3]*a[4][1]*a[5][4] + a[1][5]*a[2][0]*a[3][3]*a[4][4]*a[5][1] + a[1][5]*a[2][0]*a[3][4]*a[4][1]*a[5][3] - a[1][5]*a[2][0]*a[3][4]*a[4][3]*a[5][1] - a[1][5]*a[2][1]*a[3][0]*a[4][3]*a[5][4] + a[1][5]*a[2][1]*a[3][0]*a[4][4]*a[5][3] + a[1][5]*a[2][1]*a[3][3]*a[4][0]*a[5][4] - a[1][5]*a[2][1]*a[3][3]*a[4][4]*a[5][0] - a[1][5]*a[2][1]*a[3][4]*a[4][0]*a[5][3] + a[1][5]*a[2][1]*a[3][4]*a[4][3]*a[5][0] + a[1][5]*a[2][3]*a[3][0]*a[4][1]*a[5][4] - a[1][5]*a[2][3]*a[3][0]*a[4][4]*a[5][1] - a[1][5]*a[2][3]*a[3][1]*a[4][0]*a[5][4] + a[1][5]*a[2][3]*a[3][1]*a[4][4]*a[5][0] + a[1][5]*a[2][3]*a[3][4]*a[4][0]*a[5][1] - a[1][5]*a[2][3]*a[3][4]*a[4][1]*a[5][0] - a[1][5]*a[2][4]*a[3][0]*a[4][1]*a[5][3] + a[1][5]*a[2][4]*a[3][0]*a[4][3]*a[5][1] + a[1][5]*a[2][4]*a[3][1]*a[4][0]*a[5][3] - a[1][5]*a[2][4]*a[3][1]*a[4][3]*a[5][0] - a[1][5]*a[2][4]*a[3][3]*a[4][0]*a[5][1] + a[1][5]*a[2][4]*a[3][3]*a[4][1]*a[5][0])/denom;
invA[3][0] = -(a[1][0]*a[2][1]*a[3][2]*a[4][4]*a[5][5] - a[1][0]*a[2][1]*a[3][2]*a[4][5]*a[5][4] - a[1][0]*a[2][1]*a[3][4]*a[4][2]*a[5][5] + a[1][0]*a[2][1]*a[3][4]*a[4][5]*a[5][2] + a[1][0]*a[2][1]*a[3][5]*a[4][2]*a[5][4] - a[1][0]*a[2][1]*a[3][5]*a[4][4]*a[5][2] - a[1][0]*a[2][2]*a[3][1]*a[4][4]*a[5][5] + a[1][0]*a[2][2]*a[3][1]*a[4][5]*a[5][4] + a[1][0]*a[2][2]*a[3][4]*a[4][1]*a[5][5] - a[1][0]*a[2][2]*a[3][4]*a[4][5]*a[5][1] - a[1][0]*a[2][2]*a[3][5]*a[4][1]*a[5][4] + a[1][0]*a[2][2]*a[3][5]*a[4][4]*a[5][1] + a[1][0]*a[2][4]*a[3][1]*a[4][2]*a[5][5] - a[1][0]*a[2][4]*a[3][1]*a[4][5]*a[5][2] - a[1][0]*a[2][4]*a[3][2]*a[4][1]*a[5][5] + a[1][0]*a[2][4]*a[3][2]*a[4][5]*a[5][1] + a[1][0]*a[2][4]*a[3][5]*a[4][1]*a[5][2] - a[1][0]*a[2][4]*a[3][5]*a[4][2]*a[5][1] - a[1][0]*a[2][5]*a[3][1]*a[4][2]*a[5][4] + a[1][0]*a[2][5]*a[3][1]*a[4][4]*a[5][2] + a[1][0]*a[2][5]*a[3][2]*a[4][1]*a[5][4] - a[1][0]*a[2][5]*a[3][2]*a[4][4]*a[5][1] - a[1][0]*a[2][5]*a[3][4]*a[4][1]*a[5][2] + a[1][0]*a[2][5]*a[3][4]*a[4][2]*a[5][1] - a[1][1]*a[2][0]*a[3][2]*a[4][4]*a[5][5] + a[1][1]*a[2][0]*a[3][2]*a[4][5]*a[5][4] + a[1][1]*a[2][0]*a[3][4]*a[4][2]*a[5][5] - a[1][1]*a[2][0]*a[3][4]*a[4][5]*a[5][2] - a[1][1]*a[2][0]*a[3][5]*a[4][2]*a[5][4] + a[1][1]*a[2][0]*a[3][5]*a[4][4]*a[5][2] + a[1][1]*a[2][2]*a[3][0]*a[4][4]*a[5][5] - a[1][1]*a[2][2]*a[3][0]*a[4][5]*a[5][4] - a[1][1]*a[2][2]*a[3][4]*a[4][0]*a[5][5] + a[1][1]*a[2][2]*a[3][4]*a[4][5]*a[5][0] + a[1][1]*a[2][2]*a[3][5]*a[4][0]*a[5][4] - a[1][1]*a[2][2]*a[3][5]*a[4][4]*a[5][0] - a[1][1]*a[2][4]*a[3][0]*a[4][2]*a[5][5] + a[1][1]*a[2][4]*a[3][0]*a[4][5]*a[5][2] + a[1][1]*a[2][4]*a[3][2]*a[4][0]*a[5][5] - a[1][1]*a[2][4]*a[3][2]*a[4][5]*a[5][0] - a[1][1]*a[2][4]*a[3][5]*a[4][0]*a[5][2] + a[1][1]*a[2][4]*a[3][5]*a[4][2]*a[5][0] + a[1][1]*a[2][5]*a[3][0]*a[4][2]*a[5][4] - a[1][1]*a[2][5]*a[3][0]*a[4][4]*a[5][2] - a[1][1]*a[2][5]*a[3][2]*a[4][0]*a[5][4] + a[1][1]*a[2][5]*a[3][2]*a[4][4]*a[5][0] + a[1][1]*a[2][5]*a[3][4]*a[4][0]*a[5][2] - a[1][1]*a[2][5]*a[3][4]*a[4][2]*a[5][0] + a[1][2]*a[2][0]*a[3][1]*a[4][4]*a[5][5] - a[1][2]*a[2][0]*a[3][1]*a[4][5]*a[5][4] - a[1][2]*a[2][0]*a[3][4]*a[4][1]*a[5][5] + a[1][2]*a[2][0]*a[3][4]*a[4][5]*a[5][1] + a[1][2]*a[2][0]*a[3][5]*a[4][1]*a[5][4] - a[1][2]*a[2][0]*a[3][5]*a[4][4]*a[5][1] - a[1][2]*a[2][1]*a[3][0]*a[4][4]*a[5][5] + a[1][2]*a[2][1]*a[3][0]*a[4][5]*a[5][4] + a[1][2]*a[2][1]*a[3][4]*a[4][0]*a[5][5] - a[1][2]*a[2][1]*a[3][4]*a[4][5]*a[5][0] - a[1][2]*a[2][1]*a[3][5]*a[4][0]*a[5][4] + a[1][2]*a[2][1]*a[3][5]*a[4][4]*a[5][0] + a[1][2]*a[2][4]*a[3][0]*a[4][1]*a[5][5] - a[1][2]*a[2][4]*a[3][0]*a[4][5]*a[5][1] - a[1][2]*a[2][4]*a[3][1]*a[4][0]*a[5][5] + a[1][2]*a[2][4]*a[3][1]*a[4][5]*a[5][0] + a[1][2]*a[2][4]*a[3][5]*a[4][0]*a[5][1] - a[1][2]*a[2][4]*a[3][5]*a[4][1]*a[5][0] - a[1][2]*a[2][5]*a[3][0]*a[4][1]*a[5][4] + a[1][2]*a[2][5]*a[3][0]*a[4][4]*a[5][1] + a[1][2]*a[2][5]*a[3][1]*a[4][0]*a[5][4] - a[1][2]*a[2][5]*a[3][1]*a[4][4]*a[5][0] - a[1][2]*a[2][5]*a[3][4]*a[4][0]*a[5][1] + a[1][2]*a[2][5]*a[3][4]*a[4][1]*a[5][0] - a[1][4]*a[2][0]*a[3][1]*a[4][2]*a[5][5] + a[1][4]*a[2][0]*a[3][1]*a[4][5]*a[5][2] + a[1][4]*a[2][0]*a[3][2]*a[4][1]*a[5][5] - a[1][4]*a[2][0]*a[3][2]*a[4][5]*a[5][1] - a[1][4]*a[2][0]*a[3][5]*a[4][1]*a[5][2] + a[1][4]*a[2][0]*a[3][5]*a[4][2]*a[5][1] + a[1][4]*a[2][1]*a[3][0]*a[4][2]*a[5][5] - a[1][4]*a[2][1]*a[3][0]*a[4][5]*a[5][2] - a[1][4]*a[2][1]*a[3][2]*a[4][0]*a[5][5] + a[1][4]*a[2][1]*a[3][2]*a[4][5]*a[5][0] + a[1][4]*a[2][1]*a[3][5]*a[4][0]*a[5][2] - a[1][4]*a[2][1]*a[3][5]*a[4][2]*a[5][0] - a[1][4]*a[2][2]*a[3][0]*a[4][1]*a[5][5] + a[1][4]*a[2][2]*a[3][0]*a[4][5]*a[5][1] + a[1][4]*a[2][2]*a[3][1]*a[4][0]*a[5][5] - a[1][4]*a[2][2]*a[3][1]*a[4][5]*a[5][0] - a[1][4]*a[2][2]*a[3][5]*a[4][0]*a[5][1] + a[1][4]*a[2][2]*a[3][5]*a[4][1]*a[5][0] + a[1][4]*a[2][5]*a[3][0]*a[4][1]*a[5][2] - a[1][4]*a[2][5]*a[3][0]*a[4][2]*a[5][1] - a[1][4]*a[2][5]*a[3][1]*a[4][0]*a[5][2] + a[1][4]*a[2][5]*a[3][1]*a[4][2]*a[5][0] + a[1][4]*a[2][5]*a[3][2]*a[4][0]*a[5][1] - a[1][4]*a[2][5]*a[3][2]*a[4][1]*a[5][0] + a[1][5]*a[2][0]*a[3][1]*a[4][2]*a[5][4] - a[1][5]*a[2][0]*a[3][1]*a[4][4]*a[5][2] - a[1][5]*a[2][0]*a[3][2]*a[4][1]*a[5][4] + a[1][5]*a[2][0]*a[3][2]*a[4][4]*a[5][1] + a[1][5]*a[2][0]*a[3][4]*a[4][1]*a[5][2] - a[1][5]*a[2][0]*a[3][4]*a[4][2]*a[5][1] - a[1][5]*a[2][1]*a[3][0]*a[4][2]*a[5][4] + a[1][5]*a[2][1]*a[3][0]*a[4][4]*a[5][2] + a[1][5]*a[2][1]*a[3][2]*a[4][0]*a[5][4] - a[1][5]*a[2][1]*a[3][2]*a[4][4]*a[5][0] - a[1][5]*a[2][1]*a[3][4]*a[4][0]*a[5][2] + a[1][5]*a[2][1]*a[3][4]*a[4][2]*a[5][0] + a[1][5]*a[2][2]*a[3][0]*a[4][1]*a[5][4] - a[1][5]*a[2][2]*a[3][0]*a[4][4]*a[5][1] - a[1][5]*a[2][2]*a[3][1]*a[4][0]*a[5][4] + a[1][5]*a[2][2]*a[3][1]*a[4][4]*a[5][0] + a[1][5]*a[2][2]*a[3][4]*a[4][0]*a[5][1] - a[1][5]*a[2][2]*a[3][4]*a[4][1]*a[5][0] - a[1][5]*a[2][4]*a[3][0]*a[4][1]*a[5][2] + a[1][5]*a[2][4]*a[3][0]*a[4][2]*a[5][1] + a[1][5]*a[2][4]*a[3][1]*a[4][0]*a[5][2] - a[1][5]*a[2][4]*a[3][1]*a[4][2]*a[5][0] - a[1][5]*a[2][4]*a[3][2]*a[4][0]*a[5][1] + a[1][5]*a[2][4]*a[3][2]*a[4][1]*a[5][0])/denom;
invA[4][0] = (a[1][0]*a[2][1]*a[3][2]*a[4][3]*a[5][5] - a[1][0]*a[2][1]*a[3][2]*a[4][5]*a[5][3] - a[1][0]*a[2][1]*a[3][3]*a[4][2]*a[5][5] + a[1][0]*a[2][1]*a[3][3]*a[4][5]*a[5][2] + a[1][0]*a[2][1]*a[3][5]*a[4][2]*a[5][3] - a[1][0]*a[2][1]*a[3][5]*a[4][3]*a[5][2] - a[1][0]*a[2][2]*a[3][1]*a[4][3]*a[5][5] + a[1][0]*a[2][2]*a[3][1]*a[4][5]*a[5][3] + a[1][0]*a[2][2]*a[3][3]*a[4][1]*a[5][5] - a[1][0]*a[2][2]*a[3][3]*a[4][5]*a[5][1] - a[1][0]*a[2][2]*a[3][5]*a[4][1]*a[5][3] + a[1][0]*a[2][2]*a[3][5]*a[4][3]*a[5][1] + a[1][0]*a[2][3]*a[3][1]*a[4][2]*a[5][5] - a[1][0]*a[2][3]*a[3][1]*a[4][5]*a[5][2] - a[1][0]*a[2][3]*a[3][2]*a[4][1]*a[5][5] + a[1][0]*a[2][3]*a[3][2]*a[4][5]*a[5][1] + a[1][0]*a[2][3]*a[3][5]*a[4][1]*a[5][2] - a[1][0]*a[2][3]*a[3][5]*a[4][2]*a[5][1] - a[1][0]*a[2][5]*a[3][1]*a[4][2]*a[5][3] + a[1][0]*a[2][5]*a[3][1]*a[4][3]*a[5][2] + a[1][0]*a[2][5]*a[3][2]*a[4][1]*a[5][3] - a[1][0]*a[2][5]*a[3][2]*a[4][3]*a[5][1] - a[1][0]*a[2][5]*a[3][3]*a[4][1]*a[5][2] + a[1][0]*a[2][5]*a[3][3]*a[4][2]*a[5][1] - a[1][1]*a[2][0]*a[3][2]*a[4][3]*a[5][5] + a[1][1]*a[2][0]*a[3][2]*a[4][5]*a[5][3] + a[1][1]*a[2][0]*a[3][3]*a[4][2]*a[5][5] - a[1][1]*a[2][0]*a[3][3]*a[4][5]*a[5][2] - a[1][1]*a[2][0]*a[3][5]*a[4][2]*a[5][3] + a[1][1]*a[2][0]*a[3][5]*a[4][3]*a[5][2] + a[1][1]*a[2][2]*a[3][0]*a[4][3]*a[5][5] - a[1][1]*a[2][2]*a[3][0]*a[4][5]*a[5][3] - a[1][1]*a[2][2]*a[3][3]*a[4][0]*a[5][5] + a[1][1]*a[2][2]*a[3][3]*a[4][5]*a[5][0] + a[1][1]*a[2][2]*a[3][5]*a[4][0]*a[5][3] - a[1][1]*a[2][2]*a[3][5]*a[4][3]*a[5][0] - a[1][1]*a[2][3]*a[3][0]*a[4][2]*a[5][5] + a[1][1]*a[2][3]*a[3][0]*a[4][5]*a[5][2] + a[1][1]*a[2][3]*a[3][2]*a[4][0]*a[5][5] - a[1][1]*a[2][3]*a[3][2]*a[4][5]*a[5][0] - a[1][1]*a[2][3]*a[3][5]*a[4][0]*a[5][2] + a[1][1]*a[2][3]*a[3][5]*a[4][2]*a[5][0] + a[1][1]*a[2][5]*a[3][0]*a[4][2]*a[5][3] - a[1][1]*a[2][5]*a[3][0]*a[4][3]*a[5][2] - a[1][1]*a[2][5]*a[3][2]*a[4][0]*a[5][3] + a[1][1]*a[2][5]*a[3][2]*a[4][3]*a[5][0] + a[1][1]*a[2][5]*a[3][3]*a[4][0]*a[5][2] - a[1][1]*a[2][5]*a[3][3]*a[4][2]*a[5][0] + a[1][2]*a[2][0]*a[3][1]*a[4][3]*a[5][5] - a[1][2]*a[2][0]*a[3][1]*a[4][5]*a[5][3] - a[1][2]*a[2][0]*a[3][3]*a[4][1]*a[5][5] + a[1][2]*a[2][0]*a[3][3]*a[4][5]*a[5][1] + a[1][2]*a[2][0]*a[3][5]*a[4][1]*a[5][3] - a[1][2]*a[2][0]*a[3][5]*a[4][3]*a[5][1] - a[1][2]*a[2][1]*a[3][0]*a[4][3]*a[5][5] + a[1][2]*a[2][1]*a[3][0]*a[4][5]*a[5][3] + a[1][2]*a[2][1]*a[3][3]*a[4][0]*a[5][5] - a[1][2]*a[2][1]*a[3][3]*a[4][5]*a[5][0] - a[1][2]*a[2][1]*a[3][5]*a[4][0]*a[5][3] + a[1][2]*a[2][1]*a[3][5]*a[4][3]*a[5][0] + a[1][2]*a[2][3]*a[3][0]*a[4][1]*a[5][5] - a[1][2]*a[2][3]*a[3][0]*a[4][5]*a[5][1] - a[1][2]*a[2][3]*a[3][1]*a[4][0]*a[5][5] + a[1][2]*a[2][3]*a[3][1]*a[4][5]*a[5][0] + a[1][2]*a[2][3]*a[3][5]*a[4][0]*a[5][1] - a[1][2]*a[2][3]*a[3][5]*a[4][1]*a[5][0] - a[1][2]*a[2][5]*a[3][0]*a[4][1]*a[5][3] + a[1][2]*a[2][5]*a[3][0]*a[4][3]*a[5][1] + a[1][2]*a[2][5]*a[3][1]*a[4][0]*a[5][3] - a[1][2]*a[2][5]*a[3][1]*a[4][3]*a[5][0] - a[1][2]*a[2][5]*a[3][3]*a[4][0]*a[5][1] + a[1][2]*a[2][5]*a[3][3]*a[4][1]*a[5][0] - a[1][3]*a[2][0]*a[3][1]*a[4][2]*a[5][5] + a[1][3]*a[2][0]*a[3][1]*a[4][5]*a[5][2] + a[1][3]*a[2][0]*a[3][2]*a[4][1]*a[5][5] - a[1][3]*a[2][0]*a[3][2]*a[4][5]*a[5][1] - a[1][3]*a[2][0]*a[3][5]*a[4][1]*a[5][2] + a[1][3]*a[2][0]*a[3][5]*a[4][2]*a[5][1] + a[1][3]*a[2][1]*a[3][0]*a[4][2]*a[5][5] - a[1][3]*a[2][1]*a[3][0]*a[4][5]*a[5][2] - a[1][3]*a[2][1]*a[3][2]*a[4][0]*a[5][5] + a[1][3]*a[2][1]*a[3][2]*a[4][5]*a[5][0] + a[1][3]*a[2][1]*a[3][5]*a[4][0]*a[5][2] - a[1][3]*a[2][1]*a[3][5]*a[4][2]*a[5][0] - a[1][3]*a[2][2]*a[3][0]*a[4][1]*a[5][5] + a[1][3]*a[2][2]*a[3][0]*a[4][5]*a[5][1] + a[1][3]*a[2][2]*a[3][1]*a[4][0]*a[5][5] - a[1][3]*a[2][2]*a[3][1]*a[4][5]*a[5][0] - a[1][3]*a[2][2]*a[3][5]*a[4][0]*a[5][1] + a[1][3]*a[2][2]*a[3][5]*a[4][1]*a[5][0] + a[1][3]*a[2][5]*a[3][0]*a[4][1]*a[5][2] - a[1][3]*a[2][5]*a[3][0]*a[4][2]*a[5][1] - a[1][3]*a[2][5]*a[3][1]*a[4][0]*a[5][2] + a[1][3]*a[2][5]*a[3][1]*a[4][2]*a[5][0] + a[1][3]*a[2][5]*a[3][2]*a[4][0]*a[5][1] - a[1][3]*a[2][5]*a[3][2]*a[4][1]*a[5][0] + a[1][5]*a[2][0]*a[3][1]*a[4][2]*a[5][3] - a[1][5]*a[2][0]*a[3][1]*a[4][3]*a[5][2] - a[1][5]*a[2][0]*a[3][2]*a[4][1]*a[5][3] + a[1][5]*a[2][0]*a[3][2]*a[4][3]*a[5][1] + a[1][5]*a[2][0]*a[3][3]*a[4][1]*a[5][2] - a[1][5]*a[2][0]*a[3][3]*a[4][2]*a[5][1] - a[1][5]*a[2][1]*a[3][0]*a[4][2]*a[5][3] + a[1][5]*a[2][1]*a[3][0]*a[4][3]*a[5][2] + a[1][5]*a[2][1]*a[3][2]*a[4][0]*a[5][3] - a[1][5]*a[2][1]*a[3][2]*a[4][3]*a[5][0] - a[1][5]*a[2][1]*a[3][3]*a[4][0]*a[5][2] + a[1][5]*a[2][1]*a[3][3]*a[4][2]*a[5][0] + a[1][5]*a[2][2]*a[3][0]*a[4][1]*a[5][3] - a[1][5]*a[2][2]*a[3][0]*a[4][3]*a[5][1] - a[1][5]*a[2][2]*a[3][1]*a[4][0]*a[5][3] + a[1][5]*a[2][2]*a[3][1]*a[4][3]*a[5][0] + a[1][5]*a[2][2]*a[3][3]*a[4][0]*a[5][1] - a[1][5]*a[2][2]*a[3][3]*a[4][1]*a[5][0] - a[1][5]*a[2][3]*a[3][0]*a[4][1]*a[5][2] + a[1][5]*a[2][3]*a[3][0]*a[4][2]*a[5][1] + a[1][5]*a[2][3]*a[3][1]*a[4][0]*a[5][2] - a[1][5]*a[2][3]*a[3][1]*a[4][2]*a[5][0] - a[1][5]*a[2][3]*a[3][2]*a[4][0]*a[5][1] + a[1][5]*a[2][3]*a[3][2]*a[4][1]*a[5][0])/denom;
invA[5][0] = -(a[1][0]*a[2][1]*a[3][2]*a[4][3]*a[5][4] - a[1][0]*a[2][1]*a[3][2]*a[4][4]*a[5][3] - a[1][0]*a[2][1]*a[3][3]*a[4][2]*a[5][4] + a[1][0]*a[2][1]*a[3][3]*a[4][4]*a[5][2] + a[1][0]*a[2][1]*a[3][4]*a[4][2]*a[5][3] - a[1][0]*a[2][1]*a[3][4]*a[4][3]*a[5][2] - a[1][0]*a[2][2]*a[3][1]*a[4][3]*a[5][4] + a[1][0]*a[2][2]*a[3][1]*a[4][4]*a[5][3] + a[1][0]*a[2][2]*a[3][3]*a[4][1]*a[5][4] - a[1][0]*a[2][2]*a[3][3]*a[4][4]*a[5][1] - a[1][0]*a[2][2]*a[3][4]*a[4][1]*a[5][3] + a[1][0]*a[2][2]*a[3][4]*a[4][3]*a[5][1] + a[1][0]*a[2][3]*a[3][1]*a[4][2]*a[5][4] - a[1][0]*a[2][3]*a[3][1]*a[4][4]*a[5][2] - a[1][0]*a[2][3]*a[3][2]*a[4][1]*a[5][4] + a[1][0]*a[2][3]*a[3][2]*a[4][4]*a[5][1] + a[1][0]*a[2][3]*a[3][4]*a[4][1]*a[5][2] - a[1][0]*a[2][3]*a[3][4]*a[4][2]*a[5][1] - a[1][0]*a[2][4]*a[3][1]*a[4][2]*a[5][3] + a[1][0]*a[2][4]*a[3][1]*a[4][3]*a[5][2] + a[1][0]*a[2][4]*a[3][2]*a[4][1]*a[5][3] - a[1][0]*a[2][4]*a[3][2]*a[4][3]*a[5][1] - a[1][0]*a[2][4]*a[3][3]*a[4][1]*a[5][2] + a[1][0]*a[2][4]*a[3][3]*a[4][2]*a[5][1] - a[1][1]*a[2][0]*a[3][2]*a[4][3]*a[5][4] + a[1][1]*a[2][0]*a[3][2]*a[4][4]*a[5][3] + a[1][1]*a[2][0]*a[3][3]*a[4][2]*a[5][4] - a[1][1]*a[2][0]*a[3][3]*a[4][4]*a[5][2] - a[1][1]*a[2][0]*a[3][4]*a[4][2]*a[5][3] + a[1][1]*a[2][0]*a[3][4]*a[4][3]*a[5][2] + a[1][1]*a[2][2]*a[3][0]*a[4][3]*a[5][4] - a[1][1]*a[2][2]*a[3][0]*a[4][4]*a[5][3] - a[1][1]*a[2][2]*a[3][3]*a[4][0]*a[5][4] + a[1][1]*a[2][2]*a[3][3]*a[4][4]*a[5][0] + a[1][1]*a[2][2]*a[3][4]*a[4][0]*a[5][3] - a[1][1]*a[2][2]*a[3][4]*a[4][3]*a[5][0] - a[1][1]*a[2][3]*a[3][0]*a[4][2]*a[5][4] + a[1][1]*a[2][3]*a[3][0]*a[4][4]*a[5][2] + a[1][1]*a[2][3]*a[3][2]*a[4][0]*a[5][4] - a[1][1]*a[2][3]*a[3][2]*a[4][4]*a[5][0] - a[1][1]*a[2][3]*a[3][4]*a[4][0]*a[5][2] + a[1][1]*a[2][3]*a[3][4]*a[4][2]*a[5][0] + a[1][1]*a[2][4]*a[3][0]*a[4][2]*a[5][3] - a[1][1]*a[2][4]*a[3][0]*a[4][3]*a[5][2] - a[1][1]*a[2][4]*a[3][2]*a[4][0]*a[5][3] + a[1][1]*a[2][4]*a[3][2]*a[4][3]*a[5][0] + a[1][1]*a[2][4]*a[3][3]*a[4][0]*a[5][2] - a[1][1]*a[2][4]*a[3][3]*a[4][2]*a[5][0] + a[1][2]*a[2][0]*a[3][1]*a[4][3]*a[5][4] - a[1][2]*a[2][0]*a[3][1]*a[4][4]*a[5][3] - a[1][2]*a[2][0]*a[3][3]*a[4][1]*a[5][4] + a[1][2]*a[2][0]*a[3][3]*a[4][4]*a[5][1] + a[1][2]*a[2][0]*a[3][4]*a[4][1]*a[5][3] - a[1][2]*a[2][0]*a[3][4]*a[4][3]*a[5][1] - a[1][2]*a[2][1]*a[3][0]*a[4][3]*a[5][4] + a[1][2]*a[2][1]*a[3][0]*a[4][4]*a[5][3] + a[1][2]*a[2][1]*a[3][3]*a[4][0]*a[5][4] - a[1][2]*a[2][1]*a[3][3]*a[4][4]*a[5][0] - a[1][2]*a[2][1]*a[3][4]*a[4][0]*a[5][3] + a[1][2]*a[2][1]*a[3][4]*a[4][3]*a[5][0] + a[1][2]*a[2][3]*a[3][0]*a[4][1]*a[5][4] - a[1][2]*a[2][3]*a[3][0]*a[4][4]*a[5][1] - a[1][2]*a[2][3]*a[3][1]*a[4][0]*a[5][4] + a[1][2]*a[2][3]*a[3][1]*a[4][4]*a[5][0] + a[1][2]*a[2][3]*a[3][4]*a[4][0]*a[5][1] - a[1][2]*a[2][3]*a[3][4]*a[4][1]*a[5][0] - a[1][2]*a[2][4]*a[3][0]*a[4][1]*a[5][3] + a[1][2]*a[2][4]*a[3][0]*a[4][3]*a[5][1] + a[1][2]*a[2][4]*a[3][1]*a[4][0]*a[5][3] - a[1][2]*a[2][4]*a[3][1]*a[4][3]*a[5][0] - a[1][2]*a[2][4]*a[3][3]*a[4][0]*a[5][1] + a[1][2]*a[2][4]*a[3][3]*a[4][1]*a[5][0] - a[1][3]*a[2][0]*a[3][1]*a[4][2]*a[5][4] + a[1][3]*a[2][0]*a[3][1]*a[4][4]*a[5][2] + a[1][3]*a[2][0]*a[3][2]*a[4][1]*a[5][4] - a[1][3]*a[2][0]*a[3][2]*a[4][4]*a[5][1] - a[1][3]*a[2][0]*a[3][4]*a[4][1]*a[5][2] + a[1][3]*a[2][0]*a[3][4]*a[4][2]*a[5][1] + a[1][3]*a[2][1]*a[3][0]*a[4][2]*a[5][4] - a[1][3]*a[2][1]*a[3][0]*a[4][4]*a[5][2] - a[1][3]*a[2][1]*a[3][2]*a[4][0]*a[5][4] + a[1][3]*a[2][1]*a[3][2]*a[4][4]*a[5][0] + a[1][3]*a[2][1]*a[3][4]*a[4][0]*a[5][2] - a[1][3]*a[2][1]*a[3][4]*a[4][2]*a[5][0] - a[1][3]*a[2][2]*a[3][0]*a[4][1]*a[5][4] + a[1][3]*a[2][2]*a[3][0]*a[4][4]*a[5][1] + a[1][3]*a[2][2]*a[3][1]*a[4][0]*a[5][4] - a[1][3]*a[2][2]*a[3][1]*a[4][4]*a[5][0] - a[1][3]*a[2][2]*a[3][4]*a[4][0]*a[5][1] + a[1][3]*a[2][2]*a[3][4]*a[4][1]*a[5][0] + a[1][3]*a[2][4]*a[3][0]*a[4][1]*a[5][2] - a[1][3]*a[2][4]*a[3][0]*a[4][2]*a[5][1] - a[1][3]*a[2][4]*a[3][1]*a[4][0]*a[5][2] + a[1][3]*a[2][4]*a[3][1]*a[4][2]*a[5][0] + a[1][3]*a[2][4]*a[3][2]*a[4][0]*a[5][1] - a[1][3]*a[2][4]*a[3][2]*a[4][1]*a[5][0] + a[1][4]*a[2][0]*a[3][1]*a[4][2]*a[5][3] - a[1][4]*a[2][0]*a[3][1]*a[4][3]*a[5][2] - a[1][4]*a[2][0]*a[3][2]*a[4][1]*a[5][3] + a[1][4]*a[2][0]*a[3][2]*a[4][3]*a[5][1] + a[1][4]*a[2][0]*a[3][3]*a[4][1]*a[5][2] - a[1][4]*a[2][0]*a[3][3]*a[4][2]*a[5][1] - a[1][4]*a[2][1]*a[3][0]*a[4][2]*a[5][3] + a[1][4]*a[2][1]*a[3][0]*a[4][3]*a[5][2] + a[1][4]*a[2][1]*a[3][2]*a[4][0]*a[5][3] - a[1][4]*a[2][1]*a[3][2]*a[4][3]*a[5][0] - a[1][4]*a[2][1]*a[3][3]*a[4][0]*a[5][2] + a[1][4]*a[2][1]*a[3][3]*a[4][2]*a[5][0] + a[1][4]*a[2][2]*a[3][0]*a[4][1]*a[5][3] - a[1][4]*a[2][2]*a[3][0]*a[4][3]*a[5][1] - a[1][4]*a[2][2]*a[3][1]*a[4][0]*a[5][3] + a[1][4]*a[2][2]*a[3][1]*a[4][3]*a[5][0] + a[1][4]*a[2][2]*a[3][3]*a[4][0]*a[5][1] - a[1][4]*a[2][2]*a[3][3]*a[4][1]*a[5][0] - a[1][4]*a[2][3]*a[3][0]*a[4][1]*a[5][2] + a[1][4]*a[2][3]*a[3][0]*a[4][2]*a[5][1] + a[1][4]*a[2][3]*a[3][1]*a[4][0]*a[5][2] - a[1][4]*a[2][3]*a[3][1]*a[4][2]*a[5][0] - a[1][4]*a[2][3]*a[3][2]*a[4][0]*a[5][1] + a[1][4]*a[2][3]*a[3][2]*a[4][1]*a[5][0])/denom;
invA[0][1] = -(a[0][1]*a[2][2]*a[3][3]*a[4][4]*a[5][5] - a[0][1]*a[2][2]*a[3][3]*a[4][5]*a[5][4] - a[0][1]*a[2][2]*a[3][4]*a[4][3]*a[5][5] + a[0][1]*a[2][2]*a[3][4]*a[4][5]*a[5][3] + a[0][1]*a[2][2]*a[3][5]*a[4][3]*a[5][4] - a[0][1]*a[2][2]*a[3][5]*a[4][4]*a[5][3] - a[0][1]*a[2][3]*a[3][2]*a[4][4]*a[5][5] + a[0][1]*a[2][3]*a[3][2]*a[4][5]*a[5][4] + a[0][1]*a[2][3]*a[3][4]*a[4][2]*a[5][5] - a[0][1]*a[2][3]*a[3][4]*a[4][5]*a[5][2] - a[0][1]*a[2][3]*a[3][5]*a[4][2]*a[5][4] + a[0][1]*a[2][3]*a[3][5]*a[4][4]*a[5][2] + a[0][1]*a[2][4]*a[3][2]*a[4][3]*a[5][5] - a[0][1]*a[2][4]*a[3][2]*a[4][5]*a[5][3] - a[0][1]*a[2][4]*a[3][3]*a[4][2]*a[5][5] + a[0][1]*a[2][4]*a[3][3]*a[4][5]*a[5][2] + a[0][1]*a[2][4]*a[3][5]*a[4][2]*a[5][3] - a[0][1]*a[2][4]*a[3][5]*a[4][3]*a[5][2] - a[0][1]*a[2][5]*a[3][2]*a[4][3]*a[5][4] + a[0][1]*a[2][5]*a[3][2]*a[4][4]*a[5][3] + a[0][1]*a[2][5]*a[3][3]*a[4][2]*a[5][4] - a[0][1]*a[2][5]*a[3][3]*a[4][4]*a[5][2] - a[0][1]*a[2][5]*a[3][4]*a[4][2]*a[5][3] + a[0][1]*a[2][5]*a[3][4]*a[4][3]*a[5][2] - a[0][2]*a[2][1]*a[3][3]*a[4][4]*a[5][5] + a[0][2]*a[2][1]*a[3][3]*a[4][5]*a[5][4] + a[0][2]*a[2][1]*a[3][4]*a[4][3]*a[5][5] - a[0][2]*a[2][1]*a[3][4]*a[4][5]*a[5][3] - a[0][2]*a[2][1]*a[3][5]*a[4][3]*a[5][4] + a[0][2]*a[2][1]*a[3][5]*a[4][4]*a[5][3] + a[0][2]*a[2][3]*a[3][1]*a[4][4]*a[5][5] - a[0][2]*a[2][3]*a[3][1]*a[4][5]*a[5][4] - a[0][2]*a[2][3]*a[3][4]*a[4][1]*a[5][5] + a[0][2]*a[2][3]*a[3][4]*a[4][5]*a[5][1] + a[0][2]*a[2][3]*a[3][5]*a[4][1]*a[5][4] - a[0][2]*a[2][3]*a[3][5]*a[4][4]*a[5][1] - a[0][2]*a[2][4]*a[3][1]*a[4][3]*a[5][5] + a[0][2]*a[2][4]*a[3][1]*a[4][5]*a[5][3] + a[0][2]*a[2][4]*a[3][3]*a[4][1]*a[5][5] - a[0][2]*a[2][4]*a[3][3]*a[4][5]*a[5][1] - a[0][2]*a[2][4]*a[3][5]*a[4][1]*a[5][3] + a[0][2]*a[2][4]*a[3][5]*a[4][3]*a[5][1] + a[0][2]*a[2][5]*a[3][1]*a[4][3]*a[5][4] - a[0][2]*a[2][5]*a[3][1]*a[4][4]*a[5][3] - a[0][2]*a[2][5]*a[3][3]*a[4][1]*a[5][4] + a[0][2]*a[2][5]*a[3][3]*a[4][4]*a[5][1] + a[0][2]*a[2][5]*a[3][4]*a[4][1]*a[5][3] - a[0][2]*a[2][5]*a[3][4]*a[4][3]*a[5][1] + a[0][3]*a[2][1]*a[3][2]*a[4][4]*a[5][5] - a[0][3]*a[2][1]*a[3][2]*a[4][5]*a[5][4] - a[0][3]*a[2][1]*a[3][4]*a[4][2]*a[5][5] + a[0][3]*a[2][1]*a[3][4]*a[4][5]*a[5][2] + a[0][3]*a[2][1]*a[3][5]*a[4][2]*a[5][4] - a[0][3]*a[2][1]*a[3][5]*a[4][4]*a[5][2] - a[0][3]*a[2][2]*a[3][1]*a[4][4]*a[5][5] + a[0][3]*a[2][2]*a[3][1]*a[4][5]*a[5][4] + a[0][3]*a[2][2]*a[3][4]*a[4][1]*a[5][5] - a[0][3]*a[2][2]*a[3][4]*a[4][5]*a[5][1] - a[0][3]*a[2][2]*a[3][5]*a[4][1]*a[5][4] + a[0][3]*a[2][2]*a[3][5]*a[4][4]*a[5][1] + a[0][3]*a[2][4]*a[3][1]*a[4][2]*a[5][5] - a[0][3]*a[2][4]*a[3][1]*a[4][5]*a[5][2] - a[0][3]*a[2][4]*a[3][2]*a[4][1]*a[5][5] + a[0][3]*a[2][4]*a[3][2]*a[4][5]*a[5][1] + a[0][3]*a[2][4]*a[3][5]*a[4][1]*a[5][2] - a[0][3]*a[2][4]*a[3][5]*a[4][2]*a[5][1] - a[0][3]*a[2][5]*a[3][1]*a[4][2]*a[5][4] + a[0][3]*a[2][5]*a[3][1]*a[4][4]*a[5][2] + a[0][3]*a[2][5]*a[3][2]*a[4][1]*a[5][4] - a[0][3]*a[2][5]*a[3][2]*a[4][4]*a[5][1] - a[0][3]*a[2][5]*a[3][4]*a[4][1]*a[5][2] + a[0][3]*a[2][5]*a[3][4]*a[4][2]*a[5][1] - a[0][4]*a[2][1]*a[3][2]*a[4][3]*a[5][5] + a[0][4]*a[2][1]*a[3][2]*a[4][5]*a[5][3] + a[0][4]*a[2][1]*a[3][3]*a[4][2]*a[5][5] - a[0][4]*a[2][1]*a[3][3]*a[4][5]*a[5][2] - a[0][4]*a[2][1]*a[3][5]*a[4][2]*a[5][3] + a[0][4]*a[2][1]*a[3][5]*a[4][3]*a[5][2] + a[0][4]*a[2][2]*a[3][1]*a[4][3]*a[5][5] - a[0][4]*a[2][2]*a[3][1]*a[4][5]*a[5][3] - a[0][4]*a[2][2]*a[3][3]*a[4][1]*a[5][5] + a[0][4]*a[2][2]*a[3][3]*a[4][5]*a[5][1] + a[0][4]*a[2][2]*a[3][5]*a[4][1]*a[5][3] - a[0][4]*a[2][2]*a[3][5]*a[4][3]*a[5][1] - a[0][4]*a[2][3]*a[3][1]*a[4][2]*a[5][5] + a[0][4]*a[2][3]*a[3][1]*a[4][5]*a[5][2] + a[0][4]*a[2][3]*a[3][2]*a[4][1]*a[5][5] - a[0][4]*a[2][3]*a[3][2]*a[4][5]*a[5][1] - a[0][4]*a[2][3]*a[3][5]*a[4][1]*a[5][2] + a[0][4]*a[2][3]*a[3][5]*a[4][2]*a[5][1] + a[0][4]*a[2][5]*a[3][1]*a[4][2]*a[5][3] - a[0][4]*a[2][5]*a[3][1]*a[4][3]*a[5][2] - a[0][4]*a[2][5]*a[3][2]*a[4][1]*a[5][3] + a[0][4]*a[2][5]*a[3][2]*a[4][3]*a[5][1] + a[0][4]*a[2][5]*a[3][3]*a[4][1]*a[5][2] - a[0][4]*a[2][5]*a[3][3]*a[4][2]*a[5][1] + a[0][5]*a[2][1]*a[3][2]*a[4][3]*a[5][4] - a[0][5]*a[2][1]*a[3][2]*a[4][4]*a[5][3] - a[0][5]*a[2][1]*a[3][3]*a[4][2]*a[5][4] + a[0][5]*a[2][1]*a[3][3]*a[4][4]*a[5][2] + a[0][5]*a[2][1]*a[3][4]*a[4][2]*a[5][3] - a[0][5]*a[2][1]*a[3][4]*a[4][3]*a[5][2] - a[0][5]*a[2][2]*a[3][1]*a[4][3]*a[5][4] + a[0][5]*a[2][2]*a[3][1]*a[4][4]*a[5][3] + a[0][5]*a[2][2]*a[3][3]*a[4][1]*a[5][4] - a[0][5]*a[2][2]*a[3][3]*a[4][4]*a[5][1] - a[0][5]*a[2][2]*a[3][4]*a[4][1]*a[5][3] + a[0][5]*a[2][2]*a[3][4]*a[4][3]*a[5][1] + a[0][5]*a[2][3]*a[3][1]*a[4][2]*a[5][4] - a[0][5]*a[2][3]*a[3][1]*a[4][4]*a[5][2] - a[0][5]*a[2][3]*a[3][2]*a[4][1]*a[5][4] + a[0][5]*a[2][3]*a[3][2]*a[4][4]*a[5][1] + a[0][5]*a[2][3]*a[3][4]*a[4][1]*a[5][2] - a[0][5]*a[2][3]*a[3][4]*a[4][2]*a[5][1] - a[0][5]*a[2][4]*a[3][1]*a[4][2]*a[5][3] + a[0][5]*a[2][4]*a[3][1]*a[4][3]*a[5][2] + a[0][5]*a[2][4]*a[3][2]*a[4][1]*a[5][3] - a[0][5]*a[2][4]*a[3][2]*a[4][3]*a[5][1] - a[0][5]*a[2][4]*a[3][3]*a[4][1]*a[5][2] + a[0][5]*a[2][4]*a[3][3]*a[4][2]*a[5][1])/denom;
invA[1][1] = (a[0][0]*a[2][2]*a[3][3]*a[4][4]*a[5][5] - a[0][0]*a[2][2]*a[3][3]*a[4][5]*a[5][4] - a[0][0]*a[2][2]*a[3][4]*a[4][3]*a[5][5] + a[0][0]*a[2][2]*a[3][4]*a[4][5]*a[5][3] + a[0][0]*a[2][2]*a[3][5]*a[4][3]*a[5][4] - a[0][0]*a[2][2]*a[3][5]*a[4][4]*a[5][3] - a[0][0]*a[2][3]*a[3][2]*a[4][4]*a[5][5] + a[0][0]*a[2][3]*a[3][2]*a[4][5]*a[5][4] + a[0][0]*a[2][3]*a[3][4]*a[4][2]*a[5][5] - a[0][0]*a[2][3]*a[3][4]*a[4][5]*a[5][2] - a[0][0]*a[2][3]*a[3][5]*a[4][2]*a[5][4] + a[0][0]*a[2][3]*a[3][5]*a[4][4]*a[5][2] + a[0][0]*a[2][4]*a[3][2]*a[4][3]*a[5][5] - a[0][0]*a[2][4]*a[3][2]*a[4][5]*a[5][3] - a[0][0]*a[2][4]*a[3][3]*a[4][2]*a[5][5] + a[0][0]*a[2][4]*a[3][3]*a[4][5]*a[5][2] + a[0][0]*a[2][4]*a[3][5]*a[4][2]*a[5][3] - a[0][0]*a[2][4]*a[3][5]*a[4][3]*a[5][2] - a[0][0]*a[2][5]*a[3][2]*a[4][3]*a[5][4] + a[0][0]*a[2][5]*a[3][2]*a[4][4]*a[5][3] + a[0][0]*a[2][5]*a[3][3]*a[4][2]*a[5][4] - a[0][0]*a[2][5]*a[3][3]*a[4][4]*a[5][2] - a[0][0]*a[2][5]*a[3][4]*a[4][2]*a[5][3] + a[0][0]*a[2][5]*a[3][4]*a[4][3]*a[5][2] - a[0][2]*a[2][0]*a[3][3]*a[4][4]*a[5][5] + a[0][2]*a[2][0]*a[3][3]*a[4][5]*a[5][4] + a[0][2]*a[2][0]*a[3][4]*a[4][3]*a[5][5] - a[0][2]*a[2][0]*a[3][4]*a[4][5]*a[5][3] - a[0][2]*a[2][0]*a[3][5]*a[4][3]*a[5][4] + a[0][2]*a[2][0]*a[3][5]*a[4][4]*a[5][3] + a[0][2]*a[2][3]*a[3][0]*a[4][4]*a[5][5] - a[0][2]*a[2][3]*a[3][0]*a[4][5]*a[5][4] - a[0][2]*a[2][3]*a[3][4]*a[4][0]*a[5][5] + a[0][2]*a[2][3]*a[3][4]*a[4][5]*a[5][0] + a[0][2]*a[2][3]*a[3][5]*a[4][0]*a[5][4] - a[0][2]*a[2][3]*a[3][5]*a[4][4]*a[5][0] - a[0][2]*a[2][4]*a[3][0]*a[4][3]*a[5][5] + a[0][2]*a[2][4]*a[3][0]*a[4][5]*a[5][3] + a[0][2]*a[2][4]*a[3][3]*a[4][0]*a[5][5] - a[0][2]*a[2][4]*a[3][3]*a[4][5]*a[5][0] - a[0][2]*a[2][4]*a[3][5]*a[4][0]*a[5][3] + a[0][2]*a[2][4]*a[3][5]*a[4][3]*a[5][0] + a[0][2]*a[2][5]*a[3][0]*a[4][3]*a[5][4] - a[0][2]*a[2][5]*a[3][0]*a[4][4]*a[5][3] - a[0][2]*a[2][5]*a[3][3]*a[4][0]*a[5][4] + a[0][2]*a[2][5]*a[3][3]*a[4][4]*a[5][0] + a[0][2]*a[2][5]*a[3][4]*a[4][0]*a[5][3] - a[0][2]*a[2][5]*a[3][4]*a[4][3]*a[5][0] + a[0][3]*a[2][0]*a[3][2]*a[4][4]*a[5][5] - a[0][3]*a[2][0]*a[3][2]*a[4][5]*a[5][4] - a[0][3]*a[2][0]*a[3][4]*a[4][2]*a[5][5] + a[0][3]*a[2][0]*a[3][4]*a[4][5]*a[5][2] + a[0][3]*a[2][0]*a[3][5]*a[4][2]*a[5][4] - a[0][3]*a[2][0]*a[3][5]*a[4][4]*a[5][2] - a[0][3]*a[2][2]*a[3][0]*a[4][4]*a[5][5] + a[0][3]*a[2][2]*a[3][0]*a[4][5]*a[5][4] + a[0][3]*a[2][2]*a[3][4]*a[4][0]*a[5][5] - a[0][3]*a[2][2]*a[3][4]*a[4][5]*a[5][0] - a[0][3]*a[2][2]*a[3][5]*a[4][0]*a[5][4] + a[0][3]*a[2][2]*a[3][5]*a[4][4]*a[5][0] + a[0][3]*a[2][4]*a[3][0]*a[4][2]*a[5][5] - a[0][3]*a[2][4]*a[3][0]*a[4][5]*a[5][2] - a[0][3]*a[2][4]*a[3][2]*a[4][0]*a[5][5] + a[0][3]*a[2][4]*a[3][2]*a[4][5]*a[5][0] + a[0][3]*a[2][4]*a[3][5]*a[4][0]*a[5][2] - a[0][3]*a[2][4]*a[3][5]*a[4][2]*a[5][0] - a[0][3]*a[2][5]*a[3][0]*a[4][2]*a[5][4] + a[0][3]*a[2][5]*a[3][0]*a[4][4]*a[5][2] + a[0][3]*a[2][5]*a[3][2]*a[4][0]*a[5][4] - a[0][3]*a[2][5]*a[3][2]*a[4][4]*a[5][0] - a[0][3]*a[2][5]*a[3][4]*a[4][0]*a[5][2] + a[0][3]*a[2][5]*a[3][4]*a[4][2]*a[5][0] - a[0][4]*a[2][0]*a[3][2]*a[4][3]*a[5][5] + a[0][4]*a[2][0]*a[3][2]*a[4][5]*a[5][3] + a[0][4]*a[2][0]*a[3][3]*a[4][2]*a[5][5] - a[0][4]*a[2][0]*a[3][3]*a[4][5]*a[5][2] - a[0][4]*a[2][0]*a[3][5]*a[4][2]*a[5][3] + a[0][4]*a[2][0]*a[3][5]*a[4][3]*a[5][2] + a[0][4]*a[2][2]*a[3][0]*a[4][3]*a[5][5] - a[0][4]*a[2][2]*a[3][0]*a[4][5]*a[5][3] - a[0][4]*a[2][2]*a[3][3]*a[4][0]*a[5][5] + a[0][4]*a[2][2]*a[3][3]*a[4][5]*a[5][0] + a[0][4]*a[2][2]*a[3][5]*a[4][0]*a[5][3] - a[0][4]*a[2][2]*a[3][5]*a[4][3]*a[5][0] - a[0][4]*a[2][3]*a[3][0]*a[4][2]*a[5][5] + a[0][4]*a[2][3]*a[3][0]*a[4][5]*a[5][2] + a[0][4]*a[2][3]*a[3][2]*a[4][0]*a[5][5] - a[0][4]*a[2][3]*a[3][2]*a[4][5]*a[5][0] - a[0][4]*a[2][3]*a[3][5]*a[4][0]*a[5][2] + a[0][4]*a[2][3]*a[3][5]*a[4][2]*a[5][0] + a[0][4]*a[2][5]*a[3][0]*a[4][2]*a[5][3] - a[0][4]*a[2][5]*a[3][0]*a[4][3]*a[5][2] - a[0][4]*a[2][5]*a[3][2]*a[4][0]*a[5][3] + a[0][4]*a[2][5]*a[3][2]*a[4][3]*a[5][0] + a[0][4]*a[2][5]*a[3][3]*a[4][0]*a[5][2] - a[0][4]*a[2][5]*a[3][3]*a[4][2]*a[5][0] + a[0][5]*a[2][0]*a[3][2]*a[4][3]*a[5][4] - a[0][5]*a[2][0]*a[3][2]*a[4][4]*a[5][3] - a[0][5]*a[2][0]*a[3][3]*a[4][2]*a[5][4] + a[0][5]*a[2][0]*a[3][3]*a[4][4]*a[5][2] + a[0][5]*a[2][0]*a[3][4]*a[4][2]*a[5][3] - a[0][5]*a[2][0]*a[3][4]*a[4][3]*a[5][2] - a[0][5]*a[2][2]*a[3][0]*a[4][3]*a[5][4] + a[0][5]*a[2][2]*a[3][0]*a[4][4]*a[5][3] + a[0][5]*a[2][2]*a[3][3]*a[4][0]*a[5][4] - a[0][5]*a[2][2]*a[3][3]*a[4][4]*a[5][0] - a[0][5]*a[2][2]*a[3][4]*a[4][0]*a[5][3] + a[0][5]*a[2][2]*a[3][4]*a[4][3]*a[5][0] + a[0][5]*a[2][3]*a[3][0]*a[4][2]*a[5][4] - a[0][5]*a[2][3]*a[3][0]*a[4][4]*a[5][2] - a[0][5]*a[2][3]*a[3][2]*a[4][0]*a[5][4] + a[0][5]*a[2][3]*a[3][2]*a[4][4]*a[5][0] + a[0][5]*a[2][3]*a[3][4]*a[4][0]*a[5][2] - a[0][5]*a[2][3]*a[3][4]*a[4][2]*a[5][0] - a[0][5]*a[2][4]*a[3][0]*a[4][2]*a[5][3] + a[0][5]*a[2][4]*a[3][0]*a[4][3]*a[5][2] + a[0][5]*a[2][4]*a[3][2]*a[4][0]*a[5][3] - a[0][5]*a[2][4]*a[3][2]*a[4][3]*a[5][0] - a[0][5]*a[2][4]*a[3][3]*a[4][0]*a[5][2] + a[0][5]*a[2][4]*a[3][3]*a[4][2]*a[5][0])/denom;
invA[2][1] = -(a[0][0]*a[2][1]*a[3][3]*a[4][4]*a[5][5] - a[0][0]*a[2][1]*a[3][3]*a[4][5]*a[5][4] - a[0][0]*a[2][1]*a[3][4]*a[4][3]*a[5][5] + a[0][0]*a[2][1]*a[3][4]*a[4][5]*a[5][3] + a[0][0]*a[2][1]*a[3][5]*a[4][3]*a[5][4] - a[0][0]*a[2][1]*a[3][5]*a[4][4]*a[5][3] - a[0][0]*a[2][3]*a[3][1]*a[4][4]*a[5][5] + a[0][0]*a[2][3]*a[3][1]*a[4][5]*a[5][4] + a[0][0]*a[2][3]*a[3][4]*a[4][1]*a[5][5] - a[0][0]*a[2][3]*a[3][4]*a[4][5]*a[5][1] - a[0][0]*a[2][3]*a[3][5]*a[4][1]*a[5][4] + a[0][0]*a[2][3]*a[3][5]*a[4][4]*a[5][1] + a[0][0]*a[2][4]*a[3][1]*a[4][3]*a[5][5] - a[0][0]*a[2][4]*a[3][1]*a[4][5]*a[5][3] - a[0][0]*a[2][4]*a[3][3]*a[4][1]*a[5][5] + a[0][0]*a[2][4]*a[3][3]*a[4][5]*a[5][1] + a[0][0]*a[2][4]*a[3][5]*a[4][1]*a[5][3] - a[0][0]*a[2][4]*a[3][5]*a[4][3]*a[5][1] - a[0][0]*a[2][5]*a[3][1]*a[4][3]*a[5][4] + a[0][0]*a[2][5]*a[3][1]*a[4][4]*a[5][3] + a[0][0]*a[2][5]*a[3][3]*a[4][1]*a[5][4] - a[0][0]*a[2][5]*a[3][3]*a[4][4]*a[5][1] - a[0][0]*a[2][5]*a[3][4]*a[4][1]*a[5][3] + a[0][0]*a[2][5]*a[3][4]*a[4][3]*a[5][1] - a[0][1]*a[2][0]*a[3][3]*a[4][4]*a[5][5] + a[0][1]*a[2][0]*a[3][3]*a[4][5]*a[5][4] + a[0][1]*a[2][0]*a[3][4]*a[4][3]*a[5][5] - a[0][1]*a[2][0]*a[3][4]*a[4][5]*a[5][3] - a[0][1]*a[2][0]*a[3][5]*a[4][3]*a[5][4] + a[0][1]*a[2][0]*a[3][5]*a[4][4]*a[5][3] + a[0][1]*a[2][3]*a[3][0]*a[4][4]*a[5][5] - a[0][1]*a[2][3]*a[3][0]*a[4][5]*a[5][4] - a[0][1]*a[2][3]*a[3][4]*a[4][0]*a[5][5] + a[0][1]*a[2][3]*a[3][4]*a[4][5]*a[5][0] + a[0][1]*a[2][3]*a[3][5]*a[4][0]*a[5][4] - a[0][1]*a[2][3]*a[3][5]*a[4][4]*a[5][0] - a[0][1]*a[2][4]*a[3][0]*a[4][3]*a[5][5] + a[0][1]*a[2][4]*a[3][0]*a[4][5]*a[5][3] + a[0][1]*a[2][4]*a[3][3]*a[4][0]*a[5][5] - a[0][1]*a[2][4]*a[3][3]*a[4][5]*a[5][0] - a[0][1]*a[2][4]*a[3][5]*a[4][0]*a[5][3] + a[0][1]*a[2][4]*a[3][5]*a[4][3]*a[5][0] + a[0][1]*a[2][5]*a[3][0]*a[4][3]*a[5][4] - a[0][1]*a[2][5]*a[3][0]*a[4][4]*a[5][3] - a[0][1]*a[2][5]*a[3][3]*a[4][0]*a[5][4] + a[0][1]*a[2][5]*a[3][3]*a[4][4]*a[5][0] + a[0][1]*a[2][5]*a[3][4]*a[4][0]*a[5][3] - a[0][1]*a[2][5]*a[3][4]*a[4][3]*a[5][0] + a[0][3]*a[2][0]*a[3][1]*a[4][4]*a[5][5] - a[0][3]*a[2][0]*a[3][1]*a[4][5]*a[5][4] - a[0][3]*a[2][0]*a[3][4]*a[4][1]*a[5][5] + a[0][3]*a[2][0]*a[3][4]*a[4][5]*a[5][1] + a[0][3]*a[2][0]*a[3][5]*a[4][1]*a[5][4] - a[0][3]*a[2][0]*a[3][5]*a[4][4]*a[5][1] - a[0][3]*a[2][1]*a[3][0]*a[4][4]*a[5][5] + a[0][3]*a[2][1]*a[3][0]*a[4][5]*a[5][4] + a[0][3]*a[2][1]*a[3][4]*a[4][0]*a[5][5] - a[0][3]*a[2][1]*a[3][4]*a[4][5]*a[5][0] - a[0][3]*a[2][1]*a[3][5]*a[4][0]*a[5][4] + a[0][3]*a[2][1]*a[3][5]*a[4][4]*a[5][0] + a[0][3]*a[2][4]*a[3][0]*a[4][1]*a[5][5] - a[0][3]*a[2][4]*a[3][0]*a[4][5]*a[5][1] - a[0][3]*a[2][4]*a[3][1]*a[4][0]*a[5][5] + a[0][3]*a[2][4]*a[3][1]*a[4][5]*a[5][0] + a[0][3]*a[2][4]*a[3][5]*a[4][0]*a[5][1] - a[0][3]*a[2][4]*a[3][5]*a[4][1]*a[5][0] - a[0][3]*a[2][5]*a[3][0]*a[4][1]*a[5][4] + a[0][3]*a[2][5]*a[3][0]*a[4][4]*a[5][1] + a[0][3]*a[2][5]*a[3][1]*a[4][0]*a[5][4] - a[0][3]*a[2][5]*a[3][1]*a[4][4]*a[5][0] - a[0][3]*a[2][5]*a[3][4]*a[4][0]*a[5][1] + a[0][3]*a[2][5]*a[3][4]*a[4][1]*a[5][0] - a[0][4]*a[2][0]*a[3][1]*a[4][3]*a[5][5] + a[0][4]*a[2][0]*a[3][1]*a[4][5]*a[5][3] + a[0][4]*a[2][0]*a[3][3]*a[4][1]*a[5][5] - a[0][4]*a[2][0]*a[3][3]*a[4][5]*a[5][1] - a[0][4]*a[2][0]*a[3][5]*a[4][1]*a[5][3] + a[0][4]*a[2][0]*a[3][5]*a[4][3]*a[5][1] + a[0][4]*a[2][1]*a[3][0]*a[4][3]*a[5][5] - a[0][4]*a[2][1]*a[3][0]*a[4][5]*a[5][3] - a[0][4]*a[2][1]*a[3][3]*a[4][0]*a[5][5] + a[0][4]*a[2][1]*a[3][3]*a[4][5]*a[5][0] + a[0][4]*a[2][1]*a[3][5]*a[4][0]*a[5][3] - a[0][4]*a[2][1]*a[3][5]*a[4][3]*a[5][0] - a[0][4]*a[2][3]*a[3][0]*a[4][1]*a[5][5] + a[0][4]*a[2][3]*a[3][0]*a[4][5]*a[5][1] + a[0][4]*a[2][3]*a[3][1]*a[4][0]*a[5][5] - a[0][4]*a[2][3]*a[3][1]*a[4][5]*a[5][0] - a[0][4]*a[2][3]*a[3][5]*a[4][0]*a[5][1] + a[0][4]*a[2][3]*a[3][5]*a[4][1]*a[5][0] + a[0][4]*a[2][5]*a[3][0]*a[4][1]*a[5][3] - a[0][4]*a[2][5]*a[3][0]*a[4][3]*a[5][1] - a[0][4]*a[2][5]*a[3][1]*a[4][0]*a[5][3] + a[0][4]*a[2][5]*a[3][1]*a[4][3]*a[5][0] + a[0][4]*a[2][5]*a[3][3]*a[4][0]*a[5][1] - a[0][4]*a[2][5]*a[3][3]*a[4][1]*a[5][0] + a[0][5]*a[2][0]*a[3][1]*a[4][3]*a[5][4] - a[0][5]*a[2][0]*a[3][1]*a[4][4]*a[5][3] - a[0][5]*a[2][0]*a[3][3]*a[4][1]*a[5][4] + a[0][5]*a[2][0]*a[3][3]*a[4][4]*a[5][1] + a[0][5]*a[2][0]*a[3][4]*a[4][1]*a[5][3] - a[0][5]*a[2][0]*a[3][4]*a[4][3]*a[5][1] - a[0][5]*a[2][1]*a[3][0]*a[4][3]*a[5][4] + a[0][5]*a[2][1]*a[3][0]*a[4][4]*a[5][3] + a[0][5]*a[2][1]*a[3][3]*a[4][0]*a[5][4] - a[0][5]*a[2][1]*a[3][3]*a[4][4]*a[5][0] - a[0][5]*a[2][1]*a[3][4]*a[4][0]*a[5][3] + a[0][5]*a[2][1]*a[3][4]*a[4][3]*a[5][0] + a[0][5]*a[2][3]*a[3][0]*a[4][1]*a[5][4] - a[0][5]*a[2][3]*a[3][0]*a[4][4]*a[5][1] - a[0][5]*a[2][3]*a[3][1]*a[4][0]*a[5][4] + a[0][5]*a[2][3]*a[3][1]*a[4][4]*a[5][0] + a[0][5]*a[2][3]*a[3][4]*a[4][0]*a[5][1] - a[0][5]*a[2][3]*a[3][4]*a[4][1]*a[5][0] - a[0][5]*a[2][4]*a[3][0]*a[4][1]*a[5][3] + a[0][5]*a[2][4]*a[3][0]*a[4][3]*a[5][1] + a[0][5]*a[2][4]*a[3][1]*a[4][0]*a[5][3] - a[0][5]*a[2][4]*a[3][1]*a[4][3]*a[5][0] - a[0][5]*a[2][4]*a[3][3]*a[4][0]*a[5][1] + a[0][5]*a[2][4]*a[3][3]*a[4][1]*a[5][0])/denom;
invA[3][1] = (a[0][0]*a[2][1]*a[3][2]*a[4][4]*a[5][5] - a[0][0]*a[2][1]*a[3][2]*a[4][5]*a[5][4] - a[0][0]*a[2][1]*a[3][4]*a[4][2]*a[5][5] + a[0][0]*a[2][1]*a[3][4]*a[4][5]*a[5][2] + a[0][0]*a[2][1]*a[3][5]*a[4][2]*a[5][4] - a[0][0]*a[2][1]*a[3][5]*a[4][4]*a[5][2] - a[0][0]*a[2][2]*a[3][1]*a[4][4]*a[5][5] + a[0][0]*a[2][2]*a[3][1]*a[4][5]*a[5][4] + a[0][0]*a[2][2]*a[3][4]*a[4][1]*a[5][5] - a[0][0]*a[2][2]*a[3][4]*a[4][5]*a[5][1] - a[0][0]*a[2][2]*a[3][5]*a[4][1]*a[5][4] + a[0][0]*a[2][2]*a[3][5]*a[4][4]*a[5][1] + a[0][0]*a[2][4]*a[3][1]*a[4][2]*a[5][5] - a[0][0]*a[2][4]*a[3][1]*a[4][5]*a[5][2] - a[0][0]*a[2][4]*a[3][2]*a[4][1]*a[5][5] + a[0][0]*a[2][4]*a[3][2]*a[4][5]*a[5][1] + a[0][0]*a[2][4]*a[3][5]*a[4][1]*a[5][2] - a[0][0]*a[2][4]*a[3][5]*a[4][2]*a[5][1] - a[0][0]*a[2][5]*a[3][1]*a[4][2]*a[5][4] + a[0][0]*a[2][5]*a[3][1]*a[4][4]*a[5][2] + a[0][0]*a[2][5]*a[3][2]*a[4][1]*a[5][4] - a[0][0]*a[2][5]*a[3][2]*a[4][4]*a[5][1] - a[0][0]*a[2][5]*a[3][4]*a[4][1]*a[5][2] + a[0][0]*a[2][5]*a[3][4]*a[4][2]*a[5][1] - a[0][1]*a[2][0]*a[3][2]*a[4][4]*a[5][5] + a[0][1]*a[2][0]*a[3][2]*a[4][5]*a[5][4] + a[0][1]*a[2][0]*a[3][4]*a[4][2]*a[5][5] - a[0][1]*a[2][0]*a[3][4]*a[4][5]*a[5][2] - a[0][1]*a[2][0]*a[3][5]*a[4][2]*a[5][4] + a[0][1]*a[2][0]*a[3][5]*a[4][4]*a[5][2] + a[0][1]*a[2][2]*a[3][0]*a[4][4]*a[5][5] - a[0][1]*a[2][2]*a[3][0]*a[4][5]*a[5][4] - a[0][1]*a[2][2]*a[3][4]*a[4][0]*a[5][5] + a[0][1]*a[2][2]*a[3][4]*a[4][5]*a[5][0] + a[0][1]*a[2][2]*a[3][5]*a[4][0]*a[5][4] - a[0][1]*a[2][2]*a[3][5]*a[4][4]*a[5][0] - a[0][1]*a[2][4]*a[3][0]*a[4][2]*a[5][5] + a[0][1]*a[2][4]*a[3][0]*a[4][5]*a[5][2] + a[0][1]*a[2][4]*a[3][2]*a[4][0]*a[5][5] - a[0][1]*a[2][4]*a[3][2]*a[4][5]*a[5][0] - a[0][1]*a[2][4]*a[3][5]*a[4][0]*a[5][2] + a[0][1]*a[2][4]*a[3][5]*a[4][2]*a[5][0] + a[0][1]*a[2][5]*a[3][0]*a[4][2]*a[5][4] - a[0][1]*a[2][5]*a[3][0]*a[4][4]*a[5][2] - a[0][1]*a[2][5]*a[3][2]*a[4][0]*a[5][4] + a[0][1]*a[2][5]*a[3][2]*a[4][4]*a[5][0] + a[0][1]*a[2][5]*a[3][4]*a[4][0]*a[5][2] - a[0][1]*a[2][5]*a[3][4]*a[4][2]*a[5][0] + a[0][2]*a[2][0]*a[3][1]*a[4][4]*a[5][5] - a[0][2]*a[2][0]*a[3][1]*a[4][5]*a[5][4] - a[0][2]*a[2][0]*a[3][4]*a[4][1]*a[5][5] + a[0][2]*a[2][0]*a[3][4]*a[4][5]*a[5][1] + a[0][2]*a[2][0]*a[3][5]*a[4][1]*a[5][4] - a[0][2]*a[2][0]*a[3][5]*a[4][4]*a[5][1] - a[0][2]*a[2][1]*a[3][0]*a[4][4]*a[5][5] + a[0][2]*a[2][1]*a[3][0]*a[4][5]*a[5][4] + a[0][2]*a[2][1]*a[3][4]*a[4][0]*a[5][5] - a[0][2]*a[2][1]*a[3][4]*a[4][5]*a[5][0] - a[0][2]*a[2][1]*a[3][5]*a[4][0]*a[5][4] + a[0][2]*a[2][1]*a[3][5]*a[4][4]*a[5][0] + a[0][2]*a[2][4]*a[3][0]*a[4][1]*a[5][5] - a[0][2]*a[2][4]*a[3][0]*a[4][5]*a[5][1] - a[0][2]*a[2][4]*a[3][1]*a[4][0]*a[5][5] + a[0][2]*a[2][4]*a[3][1]*a[4][5]*a[5][0] + a[0][2]*a[2][4]*a[3][5]*a[4][0]*a[5][1] - a[0][2]*a[2][4]*a[3][5]*a[4][1]*a[5][0] - a[0][2]*a[2][5]*a[3][0]*a[4][1]*a[5][4] + a[0][2]*a[2][5]*a[3][0]*a[4][4]*a[5][1] + a[0][2]*a[2][5]*a[3][1]*a[4][0]*a[5][4] - a[0][2]*a[2][5]*a[3][1]*a[4][4]*a[5][0] - a[0][2]*a[2][5]*a[3][4]*a[4][0]*a[5][1] + a[0][2]*a[2][5]*a[3][4]*a[4][1]*a[5][0] - a[0][4]*a[2][0]*a[3][1]*a[4][2]*a[5][5] + a[0][4]*a[2][0]*a[3][1]*a[4][5]*a[5][2] + a[0][4]*a[2][0]*a[3][2]*a[4][1]*a[5][5] - a[0][4]*a[2][0]*a[3][2]*a[4][5]*a[5][1] - a[0][4]*a[2][0]*a[3][5]*a[4][1]*a[5][2] + a[0][4]*a[2][0]*a[3][5]*a[4][2]*a[5][1] + a[0][4]*a[2][1]*a[3][0]*a[4][2]*a[5][5] - a[0][4]*a[2][1]*a[3][0]*a[4][5]*a[5][2] - a[0][4]*a[2][1]*a[3][2]*a[4][0]*a[5][5] + a[0][4]*a[2][1]*a[3][2]*a[4][5]*a[5][0] + a[0][4]*a[2][1]*a[3][5]*a[4][0]*a[5][2] - a[0][4]*a[2][1]*a[3][5]*a[4][2]*a[5][0] - a[0][4]*a[2][2]*a[3][0]*a[4][1]*a[5][5] + a[0][4]*a[2][2]*a[3][0]*a[4][5]*a[5][1] + a[0][4]*a[2][2]*a[3][1]*a[4][0]*a[5][5] - a[0][4]*a[2][2]*a[3][1]*a[4][5]*a[5][0] - a[0][4]*a[2][2]*a[3][5]*a[4][0]*a[5][1] + a[0][4]*a[2][2]*a[3][5]*a[4][1]*a[5][0] + a[0][4]*a[2][5]*a[3][0]*a[4][1]*a[5][2] - a[0][4]*a[2][5]*a[3][0]*a[4][2]*a[5][1] - a[0][4]*a[2][5]*a[3][1]*a[4][0]*a[5][2] + a[0][4]*a[2][5]*a[3][1]*a[4][2]*a[5][0] + a[0][4]*a[2][5]*a[3][2]*a[4][0]*a[5][1] - a[0][4]*a[2][5]*a[3][2]*a[4][1]*a[5][0] + a[0][5]*a[2][0]*a[3][1]*a[4][2]*a[5][4] - a[0][5]*a[2][0]*a[3][1]*a[4][4]*a[5][2] - a[0][5]*a[2][0]*a[3][2]*a[4][1]*a[5][4] + a[0][5]*a[2][0]*a[3][2]*a[4][4]*a[5][1] + a[0][5]*a[2][0]*a[3][4]*a[4][1]*a[5][2] - a[0][5]*a[2][0]*a[3][4]*a[4][2]*a[5][1] - a[0][5]*a[2][1]*a[3][0]*a[4][2]*a[5][4] + a[0][5]*a[2][1]*a[3][0]*a[4][4]*a[5][2] + a[0][5]*a[2][1]*a[3][2]*a[4][0]*a[5][4] - a[0][5]*a[2][1]*a[3][2]*a[4][4]*a[5][0] - a[0][5]*a[2][1]*a[3][4]*a[4][0]*a[5][2] + a[0][5]*a[2][1]*a[3][4]*a[4][2]*a[5][0] + a[0][5]*a[2][2]*a[3][0]*a[4][1]*a[5][4] - a[0][5]*a[2][2]*a[3][0]*a[4][4]*a[5][1] - a[0][5]*a[2][2]*a[3][1]*a[4][0]*a[5][4] + a[0][5]*a[2][2]*a[3][1]*a[4][4]*a[5][0] + a[0][5]*a[2][2]*a[3][4]*a[4][0]*a[5][1] - a[0][5]*a[2][2]*a[3][4]*a[4][1]*a[5][0] - a[0][5]*a[2][4]*a[3][0]*a[4][1]*a[5][2] + a[0][5]*a[2][4]*a[3][0]*a[4][2]*a[5][1] + a[0][5]*a[2][4]*a[3][1]*a[4][0]*a[5][2] - a[0][5]*a[2][4]*a[3][1]*a[4][2]*a[5][0] - a[0][5]*a[2][4]*a[3][2]*a[4][0]*a[5][1] + a[0][5]*a[2][4]*a[3][2]*a[4][1]*a[5][0])/denom;
invA[4][1] = -(a[0][0]*a[2][1]*a[3][2]*a[4][3]*a[5][5] - a[0][0]*a[2][1]*a[3][2]*a[4][5]*a[5][3] - a[0][0]*a[2][1]*a[3][3]*a[4][2]*a[5][5] + a[0][0]*a[2][1]*a[3][3]*a[4][5]*a[5][2] + a[0][0]*a[2][1]*a[3][5]*a[4][2]*a[5][3] - a[0][0]*a[2][1]*a[3][5]*a[4][3]*a[5][2] - a[0][0]*a[2][2]*a[3][1]*a[4][3]*a[5][5] + a[0][0]*a[2][2]*a[3][1]*a[4][5]*a[5][3] + a[0][0]*a[2][2]*a[3][3]*a[4][1]*a[5][5] - a[0][0]*a[2][2]*a[3][3]*a[4][5]*a[5][1] - a[0][0]*a[2][2]*a[3][5]*a[4][1]*a[5][3] + a[0][0]*a[2][2]*a[3][5]*a[4][3]*a[5][1] + a[0][0]*a[2][3]*a[3][1]*a[4][2]*a[5][5] - a[0][0]*a[2][3]*a[3][1]*a[4][5]*a[5][2] - a[0][0]*a[2][3]*a[3][2]*a[4][1]*a[5][5] + a[0][0]*a[2][3]*a[3][2]*a[4][5]*a[5][1] + a[0][0]*a[2][3]*a[3][5]*a[4][1]*a[5][2] - a[0][0]*a[2][3]*a[3][5]*a[4][2]*a[5][1] - a[0][0]*a[2][5]*a[3][1]*a[4][2]*a[5][3] + a[0][0]*a[2][5]*a[3][1]*a[4][3]*a[5][2] + a[0][0]*a[2][5]*a[3][2]*a[4][1]*a[5][3] - a[0][0]*a[2][5]*a[3][2]*a[4][3]*a[5][1] - a[0][0]*a[2][5]*a[3][3]*a[4][1]*a[5][2] + a[0][0]*a[2][5]*a[3][3]*a[4][2]*a[5][1] - a[0][1]*a[2][0]*a[3][2]*a[4][3]*a[5][5] + a[0][1]*a[2][0]*a[3][2]*a[4][5]*a[5][3] + a[0][1]*a[2][0]*a[3][3]*a[4][2]*a[5][5] - a[0][1]*a[2][0]*a[3][3]*a[4][5]*a[5][2] - a[0][1]*a[2][0]*a[3][5]*a[4][2]*a[5][3] + a[0][1]*a[2][0]*a[3][5]*a[4][3]*a[5][2] + a[0][1]*a[2][2]*a[3][0]*a[4][3]*a[5][5] - a[0][1]*a[2][2]*a[3][0]*a[4][5]*a[5][3] - a[0][1]*a[2][2]*a[3][3]*a[4][0]*a[5][5] + a[0][1]*a[2][2]*a[3][3]*a[4][5]*a[5][0] + a[0][1]*a[2][2]*a[3][5]*a[4][0]*a[5][3] - a[0][1]*a[2][2]*a[3][5]*a[4][3]*a[5][0] - a[0][1]*a[2][3]*a[3][0]*a[4][2]*a[5][5] + a[0][1]*a[2][3]*a[3][0]*a[4][5]*a[5][2] + a[0][1]*a[2][3]*a[3][2]*a[4][0]*a[5][5] - a[0][1]*a[2][3]*a[3][2]*a[4][5]*a[5][0] - a[0][1]*a[2][3]*a[3][5]*a[4][0]*a[5][2] + a[0][1]*a[2][3]*a[3][5]*a[4][2]*a[5][0] + a[0][1]*a[2][5]*a[3][0]*a[4][2]*a[5][3] - a[0][1]*a[2][5]*a[3][0]*a[4][3]*a[5][2] - a[0][1]*a[2][5]*a[3][2]*a[4][0]*a[5][3] + a[0][1]*a[2][5]*a[3][2]*a[4][3]*a[5][0] + a[0][1]*a[2][5]*a[3][3]*a[4][0]*a[5][2] - a[0][1]*a[2][5]*a[3][3]*a[4][2]*a[5][0] + a[0][2]*a[2][0]*a[3][1]*a[4][3]*a[5][5] - a[0][2]*a[2][0]*a[3][1]*a[4][5]*a[5][3] - a[0][2]*a[2][0]*a[3][3]*a[4][1]*a[5][5] + a[0][2]*a[2][0]*a[3][3]*a[4][5]*a[5][1] + a[0][2]*a[2][0]*a[3][5]*a[4][1]*a[5][3] - a[0][2]*a[2][0]*a[3][5]*a[4][3]*a[5][1] - a[0][2]*a[2][1]*a[3][0]*a[4][3]*a[5][5] + a[0][2]*a[2][1]*a[3][0]*a[4][5]*a[5][3] + a[0][2]*a[2][1]*a[3][3]*a[4][0]*a[5][5] - a[0][2]*a[2][1]*a[3][3]*a[4][5]*a[5][0] - a[0][2]*a[2][1]*a[3][5]*a[4][0]*a[5][3] + a[0][2]*a[2][1]*a[3][5]*a[4][3]*a[5][0] + a[0][2]*a[2][3]*a[3][0]*a[4][1]*a[5][5] - a[0][2]*a[2][3]*a[3][0]*a[4][5]*a[5][1] - a[0][2]*a[2][3]*a[3][1]*a[4][0]*a[5][5] + a[0][2]*a[2][3]*a[3][1]*a[4][5]*a[5][0] + a[0][2]*a[2][3]*a[3][5]*a[4][0]*a[5][1] - a[0][2]*a[2][3]*a[3][5]*a[4][1]*a[5][0] - a[0][2]*a[2][5]*a[3][0]*a[4][1]*a[5][3] + a[0][2]*a[2][5]*a[3][0]*a[4][3]*a[5][1] + a[0][2]*a[2][5]*a[3][1]*a[4][0]*a[5][3] - a[0][2]*a[2][5]*a[3][1]*a[4][3]*a[5][0] - a[0][2]*a[2][5]*a[3][3]*a[4][0]*a[5][1] + a[0][2]*a[2][5]*a[3][3]*a[4][1]*a[5][0] - a[0][3]*a[2][0]*a[3][1]*a[4][2]*a[5][5] + a[0][3]*a[2][0]*a[3][1]*a[4][5]*a[5][2] + a[0][3]*a[2][0]*a[3][2]*a[4][1]*a[5][5] - a[0][3]*a[2][0]*a[3][2]*a[4][5]*a[5][1] - a[0][3]*a[2][0]*a[3][5]*a[4][1]*a[5][2] + a[0][3]*a[2][0]*a[3][5]*a[4][2]*a[5][1] + a[0][3]*a[2][1]*a[3][0]*a[4][2]*a[5][5] - a[0][3]*a[2][1]*a[3][0]*a[4][5]*a[5][2] - a[0][3]*a[2][1]*a[3][2]*a[4][0]*a[5][5] + a[0][3]*a[2][1]*a[3][2]*a[4][5]*a[5][0] + a[0][3]*a[2][1]*a[3][5]*a[4][0]*a[5][2] - a[0][3]*a[2][1]*a[3][5]*a[4][2]*a[5][0] - a[0][3]*a[2][2]*a[3][0]*a[4][1]*a[5][5] + a[0][3]*a[2][2]*a[3][0]*a[4][5]*a[5][1] + a[0][3]*a[2][2]*a[3][1]*a[4][0]*a[5][5] - a[0][3]*a[2][2]*a[3][1]*a[4][5]*a[5][0] - a[0][3]*a[2][2]*a[3][5]*a[4][0]*a[5][1] + a[0][3]*a[2][2]*a[3][5]*a[4][1]*a[5][0] + a[0][3]*a[2][5]*a[3][0]*a[4][1]*a[5][2] - a[0][3]*a[2][5]*a[3][0]*a[4][2]*a[5][1] - a[0][3]*a[2][5]*a[3][1]*a[4][0]*a[5][2] + a[0][3]*a[2][5]*a[3][1]*a[4][2]*a[5][0] + a[0][3]*a[2][5]*a[3][2]*a[4][0]*a[5][1] - a[0][3]*a[2][5]*a[3][2]*a[4][1]*a[5][0] + a[0][5]*a[2][0]*a[3][1]*a[4][2]*a[5][3] - a[0][5]*a[2][0]*a[3][1]*a[4][3]*a[5][2] - a[0][5]*a[2][0]*a[3][2]*a[4][1]*a[5][3] + a[0][5]*a[2][0]*a[3][2]*a[4][3]*a[5][1] + a[0][5]*a[2][0]*a[3][3]*a[4][1]*a[5][2] - a[0][5]*a[2][0]*a[3][3]*a[4][2]*a[5][1] - a[0][5]*a[2][1]*a[3][0]*a[4][2]*a[5][3] + a[0][5]*a[2][1]*a[3][0]*a[4][3]*a[5][2] + a[0][5]*a[2][1]*a[3][2]*a[4][0]*a[5][3] - a[0][5]*a[2][1]*a[3][2]*a[4][3]*a[5][0] - a[0][5]*a[2][1]*a[3][3]*a[4][0]*a[5][2] + a[0][5]*a[2][1]*a[3][3]*a[4][2]*a[5][0] + a[0][5]*a[2][2]*a[3][0]*a[4][1]*a[5][3] - a[0][5]*a[2][2]*a[3][0]*a[4][3]*a[5][1] - a[0][5]*a[2][2]*a[3][1]*a[4][0]*a[5][3] + a[0][5]*a[2][2]*a[3][1]*a[4][3]*a[5][0] + a[0][5]*a[2][2]*a[3][3]*a[4][0]*a[5][1] - a[0][5]*a[2][2]*a[3][3]*a[4][1]*a[5][0] - a[0][5]*a[2][3]*a[3][0]*a[4][1]*a[5][2] + a[0][5]*a[2][3]*a[3][0]*a[4][2]*a[5][1] + a[0][5]*a[2][3]*a[3][1]*a[4][0]*a[5][2] - a[0][5]*a[2][3]*a[3][1]*a[4][2]*a[5][0] - a[0][5]*a[2][3]*a[3][2]*a[4][0]*a[5][1] + a[0][5]*a[2][3]*a[3][2]*a[4][1]*a[5][0])/denom;
invA[5][1] = (a[0][0]*a[2][1]*a[3][2]*a[4][3]*a[5][4] - a[0][0]*a[2][1]*a[3][2]*a[4][4]*a[5][3] - a[0][0]*a[2][1]*a[3][3]*a[4][2]*a[5][4] + a[0][0]*a[2][1]*a[3][3]*a[4][4]*a[5][2] + a[0][0]*a[2][1]*a[3][4]*a[4][2]*a[5][3] - a[0][0]*a[2][1]*a[3][4]*a[4][3]*a[5][2] - a[0][0]*a[2][2]*a[3][1]*a[4][3]*a[5][4] + a[0][0]*a[2][2]*a[3][1]*a[4][4]*a[5][3] + a[0][0]*a[2][2]*a[3][3]*a[4][1]*a[5][4] - a[0][0]*a[2][2]*a[3][3]*a[4][4]*a[5][1] - a[0][0]*a[2][2]*a[3][4]*a[4][1]*a[5][3] + a[0][0]*a[2][2]*a[3][4]*a[4][3]*a[5][1] + a[0][0]*a[2][3]*a[3][1]*a[4][2]*a[5][4] - a[0][0]*a[2][3]*a[3][1]*a[4][4]*a[5][2] - a[0][0]*a[2][3]*a[3][2]*a[4][1]*a[5][4] + a[0][0]*a[2][3]*a[3][2]*a[4][4]*a[5][1] + a[0][0]*a[2][3]*a[3][4]*a[4][1]*a[5][2] - a[0][0]*a[2][3]*a[3][4]*a[4][2]*a[5][1] - a[0][0]*a[2][4]*a[3][1]*a[4][2]*a[5][3] + a[0][0]*a[2][4]*a[3][1]*a[4][3]*a[5][2] + a[0][0]*a[2][4]*a[3][2]*a[4][1]*a[5][3] - a[0][0]*a[2][4]*a[3][2]*a[4][3]*a[5][1] - a[0][0]*a[2][4]*a[3][3]*a[4][1]*a[5][2] + a[0][0]*a[2][4]*a[3][3]*a[4][2]*a[5][1] - a[0][1]*a[2][0]*a[3][2]*a[4][3]*a[5][4] + a[0][1]*a[2][0]*a[3][2]*a[4][4]*a[5][3] + a[0][1]*a[2][0]*a[3][3]*a[4][2]*a[5][4] - a[0][1]*a[2][0]*a[3][3]*a[4][4]*a[5][2] - a[0][1]*a[2][0]*a[3][4]*a[4][2]*a[5][3] + a[0][1]*a[2][0]*a[3][4]*a[4][3]*a[5][2] + a[0][1]*a[2][2]*a[3][0]*a[4][3]*a[5][4] - a[0][1]*a[2][2]*a[3][0]*a[4][4]*a[5][3] - a[0][1]*a[2][2]*a[3][3]*a[4][0]*a[5][4] + a[0][1]*a[2][2]*a[3][3]*a[4][4]*a[5][0] + a[0][1]*a[2][2]*a[3][4]*a[4][0]*a[5][3] - a[0][1]*a[2][2]*a[3][4]*a[4][3]*a[5][0] - a[0][1]*a[2][3]*a[3][0]*a[4][2]*a[5][4] + a[0][1]*a[2][3]*a[3][0]*a[4][4]*a[5][2] + a[0][1]*a[2][3]*a[3][2]*a[4][0]*a[5][4] - a[0][1]*a[2][3]*a[3][2]*a[4][4]*a[5][0] - a[0][1]*a[2][3]*a[3][4]*a[4][0]*a[5][2] + a[0][1]*a[2][3]*a[3][4]*a[4][2]*a[5][0] + a[0][1]*a[2][4]*a[3][0]*a[4][2]*a[5][3] - a[0][1]*a[2][4]*a[3][0]*a[4][3]*a[5][2] - a[0][1]*a[2][4]*a[3][2]*a[4][0]*a[5][3] + a[0][1]*a[2][4]*a[3][2]*a[4][3]*a[5][0] + a[0][1]*a[2][4]*a[3][3]*a[4][0]*a[5][2] - a[0][1]*a[2][4]*a[3][3]*a[4][2]*a[5][0] + a[0][2]*a[2][0]*a[3][1]*a[4][3]*a[5][4] - a[0][2]*a[2][0]*a[3][1]*a[4][4]*a[5][3] - a[0][2]*a[2][0]*a[3][3]*a[4][1]*a[5][4] + a[0][2]*a[2][0]*a[3][3]*a[4][4]*a[5][1] + a[0][2]*a[2][0]*a[3][4]*a[4][1]*a[5][3] - a[0][2]*a[2][0]*a[3][4]*a[4][3]*a[5][1] - a[0][2]*a[2][1]*a[3][0]*a[4][3]*a[5][4] + a[0][2]*a[2][1]*a[3][0]*a[4][4]*a[5][3] + a[0][2]*a[2][1]*a[3][3]*a[4][0]*a[5][4] - a[0][2]*a[2][1]*a[3][3]*a[4][4]*a[5][0] - a[0][2]*a[2][1]*a[3][4]*a[4][0]*a[5][3] + a[0][2]*a[2][1]*a[3][4]*a[4][3]*a[5][0] + a[0][2]*a[2][3]*a[3][0]*a[4][1]*a[5][4] - a[0][2]*a[2][3]*a[3][0]*a[4][4]*a[5][1] - a[0][2]*a[2][3]*a[3][1]*a[4][0]*a[5][4] + a[0][2]*a[2][3]*a[3][1]*a[4][4]*a[5][0] + a[0][2]*a[2][3]*a[3][4]*a[4][0]*a[5][1] - a[0][2]*a[2][3]*a[3][4]*a[4][1]*a[5][0] - a[0][2]*a[2][4]*a[3][0]*a[4][1]*a[5][3] + a[0][2]*a[2][4]*a[3][0]*a[4][3]*a[5][1] + a[0][2]*a[2][4]*a[3][1]*a[4][0]*a[5][3] - a[0][2]*a[2][4]*a[3][1]*a[4][3]*a[5][0] - a[0][2]*a[2][4]*a[3][3]*a[4][0]*a[5][1] + a[0][2]*a[2][4]*a[3][3]*a[4][1]*a[5][0] - a[0][3]*a[2][0]*a[3][1]*a[4][2]*a[5][4] + a[0][3]*a[2][0]*a[3][1]*a[4][4]*a[5][2] + a[0][3]*a[2][0]*a[3][2]*a[4][1]*a[5][4] - a[0][3]*a[2][0]*a[3][2]*a[4][4]*a[5][1] - a[0][3]*a[2][0]*a[3][4]*a[4][1]*a[5][2] + a[0][3]*a[2][0]*a[3][4]*a[4][2]*a[5][1] + a[0][3]*a[2][1]*a[3][0]*a[4][2]*a[5][4] - a[0][3]*a[2][1]*a[3][0]*a[4][4]*a[5][2] - a[0][3]*a[2][1]*a[3][2]*a[4][0]*a[5][4] + a[0][3]*a[2][1]*a[3][2]*a[4][4]*a[5][0] + a[0][3]*a[2][1]*a[3][4]*a[4][0]*a[5][2] - a[0][3]*a[2][1]*a[3][4]*a[4][2]*a[5][0] - a[0][3]*a[2][2]*a[3][0]*a[4][1]*a[5][4] + a[0][3]*a[2][2]*a[3][0]*a[4][4]*a[5][1] + a[0][3]*a[2][2]*a[3][1]*a[4][0]*a[5][4] - a[0][3]*a[2][2]*a[3][1]*a[4][4]*a[5][0] - a[0][3]*a[2][2]*a[3][4]*a[4][0]*a[5][1] + a[0][3]*a[2][2]*a[3][4]*a[4][1]*a[5][0] + a[0][3]*a[2][4]*a[3][0]*a[4][1]*a[5][2] - a[0][3]*a[2][4]*a[3][0]*a[4][2]*a[5][1] - a[0][3]*a[2][4]*a[3][1]*a[4][0]*a[5][2] + a[0][3]*a[2][4]*a[3][1]*a[4][2]*a[5][0] + a[0][3]*a[2][4]*a[3][2]*a[4][0]*a[5][1] - a[0][3]*a[2][4]*a[3][2]*a[4][1]*a[5][0] + a[0][4]*a[2][0]*a[3][1]*a[4][2]*a[5][3] - a[0][4]*a[2][0]*a[3][1]*a[4][3]*a[5][2] - a[0][4]*a[2][0]*a[3][2]*a[4][1]*a[5][3] + a[0][4]*a[2][0]*a[3][2]*a[4][3]*a[5][1] + a[0][4]*a[2][0]*a[3][3]*a[4][1]*a[5][2] - a[0][4]*a[2][0]*a[3][3]*a[4][2]*a[5][1] - a[0][4]*a[2][1]*a[3][0]*a[4][2]*a[5][3] + a[0][4]*a[2][1]*a[3][0]*a[4][3]*a[5][2] + a[0][4]*a[2][1]*a[3][2]*a[4][0]*a[5][3] - a[0][4]*a[2][1]*a[3][2]*a[4][3]*a[5][0] - a[0][4]*a[2][1]*a[3][3]*a[4][0]*a[5][2] + a[0][4]*a[2][1]*a[3][3]*a[4][2]*a[5][0] + a[0][4]*a[2][2]*a[3][0]*a[4][1]*a[5][3] - a[0][4]*a[2][2]*a[3][0]*a[4][3]*a[5][1] - a[0][4]*a[2][2]*a[3][1]*a[4][0]*a[5][3] + a[0][4]*a[2][2]*a[3][1]*a[4][3]*a[5][0] + a[0][4]*a[2][2]*a[3][3]*a[4][0]*a[5][1] - a[0][4]*a[2][2]*a[3][3]*a[4][1]*a[5][0] - a[0][4]*a[2][3]*a[3][0]*a[4][1]*a[5][2] + a[0][4]*a[2][3]*a[3][0]*a[4][2]*a[5][1] + a[0][4]*a[2][3]*a[3][1]*a[4][0]*a[5][2] - a[0][4]*a[2][3]*a[3][1]*a[4][2]*a[5][0] - a[0][4]*a[2][3]*a[3][2]*a[4][0]*a[5][1] + a[0][4]*a[2][3]*a[3][2]*a[4][1]*a[5][0])/denom;
invA[0][2] = (a[0][1]*a[1][2]*a[3][3]*a[4][4]*a[5][5] - a[0][1]*a[1][2]*a[3][3]*a[4][5]*a[5][4] - a[0][1]*a[1][2]*a[3][4]*a[4][3]*a[5][5] + a[0][1]*a[1][2]*a[3][4]*a[4][5]*a[5][3] + a[0][1]*a[1][2]*a[3][5]*a[4][3]*a[5][4] - a[0][1]*a[1][2]*a[3][5]*a[4][4]*a[5][3] - a[0][1]*a[1][3]*a[3][2]*a[4][4]*a[5][5] + a[0][1]*a[1][3]*a[3][2]*a[4][5]*a[5][4] + a[0][1]*a[1][3]*a[3][4]*a[4][2]*a[5][5] - a[0][1]*a[1][3]*a[3][4]*a[4][5]*a[5][2] - a[0][1]*a[1][3]*a[3][5]*a[4][2]*a[5][4] + a[0][1]*a[1][3]*a[3][5]*a[4][4]*a[5][2] + a[0][1]*a[1][4]*a[3][2]*a[4][3]*a[5][5] - a[0][1]*a[1][4]*a[3][2]*a[4][5]*a[5][3] - a[0][1]*a[1][4]*a[3][3]*a[4][2]*a[5][5] + a[0][1]*a[1][4]*a[3][3]*a[4][5]*a[5][2] + a[0][1]*a[1][4]*a[3][5]*a[4][2]*a[5][3] - a[0][1]*a[1][4]*a[3][5]*a[4][3]*a[5][2] - a[0][1]*a[1][5]*a[3][2]*a[4][3]*a[5][4] + a[0][1]*a[1][5]*a[3][2]*a[4][4]*a[5][3] + a[0][1]*a[1][5]*a[3][3]*a[4][2]*a[5][4] - a[0][1]*a[1][5]*a[3][3]*a[4][4]*a[5][2] - a[0][1]*a[1][5]*a[3][4]*a[4][2]*a[5][3] + a[0][1]*a[1][5]*a[3][4]*a[4][3]*a[5][2] - a[0][2]*a[1][1]*a[3][3]*a[4][4]*a[5][5] + a[0][2]*a[1][1]*a[3][3]*a[4][5]*a[5][4] + a[0][2]*a[1][1]*a[3][4]*a[4][3]*a[5][5] - a[0][2]*a[1][1]*a[3][4]*a[4][5]*a[5][3] - a[0][2]*a[1][1]*a[3][5]*a[4][3]*a[5][4] + a[0][2]*a[1][1]*a[3][5]*a[4][4]*a[5][3] + a[0][2]*a[1][3]*a[3][1]*a[4][4]*a[5][5] - a[0][2]*a[1][3]*a[3][1]*a[4][5]*a[5][4] - a[0][2]*a[1][3]*a[3][4]*a[4][1]*a[5][5] + a[0][2]*a[1][3]*a[3][4]*a[4][5]*a[5][1] + a[0][2]*a[1][3]*a[3][5]*a[4][1]*a[5][4] - a[0][2]*a[1][3]*a[3][5]*a[4][4]*a[5][1] - a[0][2]*a[1][4]*a[3][1]*a[4][3]*a[5][5] + a[0][2]*a[1][4]*a[3][1]*a[4][5]*a[5][3] + a[0][2]*a[1][4]*a[3][3]*a[4][1]*a[5][5] - a[0][2]*a[1][4]*a[3][3]*a[4][5]*a[5][1] - a[0][2]*a[1][4]*a[3][5]*a[4][1]*a[5][3] + a[0][2]*a[1][4]*a[3][5]*a[4][3]*a[5][1] + a[0][2]*a[1][5]*a[3][1]*a[4][3]*a[5][4] - a[0][2]*a[1][5]*a[3][1]*a[4][4]*a[5][3] - a[0][2]*a[1][5]*a[3][3]*a[4][1]*a[5][4] + a[0][2]*a[1][5]*a[3][3]*a[4][4]*a[5][1] + a[0][2]*a[1][5]*a[3][4]*a[4][1]*a[5][3] - a[0][2]*a[1][5]*a[3][4]*a[4][3]*a[5][1] + a[0][3]*a[1][1]*a[3][2]*a[4][4]*a[5][5] - a[0][3]*a[1][1]*a[3][2]*a[4][5]*a[5][4] - a[0][3]*a[1][1]*a[3][4]*a[4][2]*a[5][5] + a[0][3]*a[1][1]*a[3][4]*a[4][5]*a[5][2] + a[0][3]*a[1][1]*a[3][5]*a[4][2]*a[5][4] - a[0][3]*a[1][1]*a[3][5]*a[4][4]*a[5][2] - a[0][3]*a[1][2]*a[3][1]*a[4][4]*a[5][5] + a[0][3]*a[1][2]*a[3][1]*a[4][5]*a[5][4] + a[0][3]*a[1][2]*a[3][4]*a[4][1]*a[5][5] - a[0][3]*a[1][2]*a[3][4]*a[4][5]*a[5][1] - a[0][3]*a[1][2]*a[3][5]*a[4][1]*a[5][4] + a[0][3]*a[1][2]*a[3][5]*a[4][4]*a[5][1] + a[0][3]*a[1][4]*a[3][1]*a[4][2]*a[5][5] - a[0][3]*a[1][4]*a[3][1]*a[4][5]*a[5][2] - a[0][3]*a[1][4]*a[3][2]*a[4][1]*a[5][5] + a[0][3]*a[1][4]*a[3][2]*a[4][5]*a[5][1] + a[0][3]*a[1][4]*a[3][5]*a[4][1]*a[5][2] - a[0][3]*a[1][4]*a[3][5]*a[4][2]*a[5][1] - a[0][3]*a[1][5]*a[3][1]*a[4][2]*a[5][4] + a[0][3]*a[1][5]*a[3][1]*a[4][4]*a[5][2] + a[0][3]*a[1][5]*a[3][2]*a[4][1]*a[5][4] - a[0][3]*a[1][5]*a[3][2]*a[4][4]*a[5][1] - a[0][3]*a[1][5]*a[3][4]*a[4][1]*a[5][2] + a[0][3]*a[1][5]*a[3][4]*a[4][2]*a[5][1] - a[0][4]*a[1][1]*a[3][2]*a[4][3]*a[5][5] + a[0][4]*a[1][1]*a[3][2]*a[4][5]*a[5][3] + a[0][4]*a[1][1]*a[3][3]*a[4][2]*a[5][5] - a[0][4]*a[1][1]*a[3][3]*a[4][5]*a[5][2] - a[0][4]*a[1][1]*a[3][5]*a[4][2]*a[5][3] + a[0][4]*a[1][1]*a[3][5]*a[4][3]*a[5][2] + a[0][4]*a[1][2]*a[3][1]*a[4][3]*a[5][5] - a[0][4]*a[1][2]*a[3][1]*a[4][5]*a[5][3] - a[0][4]*a[1][2]*a[3][3]*a[4][1]*a[5][5] + a[0][4]*a[1][2]*a[3][3]*a[4][5]*a[5][1] + a[0][4]*a[1][2]*a[3][5]*a[4][1]*a[5][3] - a[0][4]*a[1][2]*a[3][5]*a[4][3]*a[5][1] - a[0][4]*a[1][3]*a[3][1]*a[4][2]*a[5][5] + a[0][4]*a[1][3]*a[3][1]*a[4][5]*a[5][2] + a[0][4]*a[1][3]*a[3][2]*a[4][1]*a[5][5] - a[0][4]*a[1][3]*a[3][2]*a[4][5]*a[5][1] - a[0][4]*a[1][3]*a[3][5]*a[4][1]*a[5][2] + a[0][4]*a[1][3]*a[3][5]*a[4][2]*a[5][1] + a[0][4]*a[1][5]*a[3][1]*a[4][2]*a[5][3] - a[0][4]*a[1][5]*a[3][1]*a[4][3]*a[5][2] - a[0][4]*a[1][5]*a[3][2]*a[4][1]*a[5][3] + a[0][4]*a[1][5]*a[3][2]*a[4][3]*a[5][1] + a[0][4]*a[1][5]*a[3][3]*a[4][1]*a[5][2] - a[0][4]*a[1][5]*a[3][3]*a[4][2]*a[5][1] + a[0][5]*a[1][1]*a[3][2]*a[4][3]*a[5][4] - a[0][5]*a[1][1]*a[3][2]*a[4][4]*a[5][3] - a[0][5]*a[1][1]*a[3][3]*a[4][2]*a[5][4] + a[0][5]*a[1][1]*a[3][3]*a[4][4]*a[5][2] + a[0][5]*a[1][1]*a[3][4]*a[4][2]*a[5][3] - a[0][5]*a[1][1]*a[3][4]*a[4][3]*a[5][2] - a[0][5]*a[1][2]*a[3][1]*a[4][3]*a[5][4] + a[0][5]*a[1][2]*a[3][1]*a[4][4]*a[5][3] + a[0][5]*a[1][2]*a[3][3]*a[4][1]*a[5][4] - a[0][5]*a[1][2]*a[3][3]*a[4][4]*a[5][1] - a[0][5]*a[1][2]*a[3][4]*a[4][1]*a[5][3] + a[0][5]*a[1][2]*a[3][4]*a[4][3]*a[5][1] + a[0][5]*a[1][3]*a[3][1]*a[4][2]*a[5][4] - a[0][5]*a[1][3]*a[3][1]*a[4][4]*a[5][2] - a[0][5]*a[1][3]*a[3][2]*a[4][1]*a[5][4] + a[0][5]*a[1][3]*a[3][2]*a[4][4]*a[5][1] + a[0][5]*a[1][3]*a[3][4]*a[4][1]*a[5][2] - a[0][5]*a[1][3]*a[3][4]*a[4][2]*a[5][1] - a[0][5]*a[1][4]*a[3][1]*a[4][2]*a[5][3] + a[0][5]*a[1][4]*a[3][1]*a[4][3]*a[5][2] + a[0][5]*a[1][4]*a[3][2]*a[4][1]*a[5][3] - a[0][5]*a[1][4]*a[3][2]*a[4][3]*a[5][1] - a[0][5]*a[1][4]*a[3][3]*a[4][1]*a[5][2] + a[0][5]*a[1][4]*a[3][3]*a[4][2]*a[5][1])/denom;
invA[1][2] = -(a[0][0]*a[1][2]*a[3][3]*a[4][4]*a[5][5] - a[0][0]*a[1][2]*a[3][3]*a[4][5]*a[5][4] - a[0][0]*a[1][2]*a[3][4]*a[4][3]*a[5][5] + a[0][0]*a[1][2]*a[3][4]*a[4][5]*a[5][3] + a[0][0]*a[1][2]*a[3][5]*a[4][3]*a[5][4] - a[0][0]*a[1][2]*a[3][5]*a[4][4]*a[5][3] - a[0][0]*a[1][3]*a[3][2]*a[4][4]*a[5][5] + a[0][0]*a[1][3]*a[3][2]*a[4][5]*a[5][4] + a[0][0]*a[1][3]*a[3][4]*a[4][2]*a[5][5] - a[0][0]*a[1][3]*a[3][4]*a[4][5]*a[5][2] - a[0][0]*a[1][3]*a[3][5]*a[4][2]*a[5][4] + a[0][0]*a[1][3]*a[3][5]*a[4][4]*a[5][2] + a[0][0]*a[1][4]*a[3][2]*a[4][3]*a[5][5] - a[0][0]*a[1][4]*a[3][2]*a[4][5]*a[5][3] - a[0][0]*a[1][4]*a[3][3]*a[4][2]*a[5][5] + a[0][0]*a[1][4]*a[3][3]*a[4][5]*a[5][2] + a[0][0]*a[1][4]*a[3][5]*a[4][2]*a[5][3] - a[0][0]*a[1][4]*a[3][5]*a[4][3]*a[5][2] - a[0][0]*a[1][5]*a[3][2]*a[4][3]*a[5][4] + a[0][0]*a[1][5]*a[3][2]*a[4][4]*a[5][3] + a[0][0]*a[1][5]*a[3][3]*a[4][2]*a[5][4] - a[0][0]*a[1][5]*a[3][3]*a[4][4]*a[5][2] - a[0][0]*a[1][5]*a[3][4]*a[4][2]*a[5][3] + a[0][0]*a[1][5]*a[3][4]*a[4][3]*a[5][2] - a[0][2]*a[1][0]*a[3][3]*a[4][4]*a[5][5] + a[0][2]*a[1][0]*a[3][3]*a[4][5]*a[5][4] + a[0][2]*a[1][0]*a[3][4]*a[4][3]*a[5][5] - a[0][2]*a[1][0]*a[3][4]*a[4][5]*a[5][3] - a[0][2]*a[1][0]*a[3][5]*a[4][3]*a[5][4] + a[0][2]*a[1][0]*a[3][5]*a[4][4]*a[5][3] + a[0][2]*a[1][3]*a[3][0]*a[4][4]*a[5][5] - a[0][2]*a[1][3]*a[3][0]*a[4][5]*a[5][4] - a[0][2]*a[1][3]*a[3][4]*a[4][0]*a[5][5] + a[0][2]*a[1][3]*a[3][4]*a[4][5]*a[5][0] + a[0][2]*a[1][3]*a[3][5]*a[4][0]*a[5][4] - a[0][2]*a[1][3]*a[3][5]*a[4][4]*a[5][0] - a[0][2]*a[1][4]*a[3][0]*a[4][3]*a[5][5] + a[0][2]*a[1][4]*a[3][0]*a[4][5]*a[5][3] + a[0][2]*a[1][4]*a[3][3]*a[4][0]*a[5][5] - a[0][2]*a[1][4]*a[3][3]*a[4][5]*a[5][0] - a[0][2]*a[1][4]*a[3][5]*a[4][0]*a[5][3] + a[0][2]*a[1][4]*a[3][5]*a[4][3]*a[5][0] + a[0][2]*a[1][5]*a[3][0]*a[4][3]*a[5][4] - a[0][2]*a[1][5]*a[3][0]*a[4][4]*a[5][3] - a[0][2]*a[1][5]*a[3][3]*a[4][0]*a[5][4] + a[0][2]*a[1][5]*a[3][3]*a[4][4]*a[5][0] + a[0][2]*a[1][5]*a[3][4]*a[4][0]*a[5][3] - a[0][2]*a[1][5]*a[3][4]*a[4][3]*a[5][0] + a[0][3]*a[1][0]*a[3][2]*a[4][4]*a[5][5] - a[0][3]*a[1][0]*a[3][2]*a[4][5]*a[5][4] - a[0][3]*a[1][0]*a[3][4]*a[4][2]*a[5][5] + a[0][3]*a[1][0]*a[3][4]*a[4][5]*a[5][2] + a[0][3]*a[1][0]*a[3][5]*a[4][2]*a[5][4] - a[0][3]*a[1][0]*a[3][5]*a[4][4]*a[5][2] - a[0][3]*a[1][2]*a[3][0]*a[4][4]*a[5][5] + a[0][3]*a[1][2]*a[3][0]*a[4][5]*a[5][4] + a[0][3]*a[1][2]*a[3][4]*a[4][0]*a[5][5] - a[0][3]*a[1][2]*a[3][4]*a[4][5]*a[5][0] - a[0][3]*a[1][2]*a[3][5]*a[4][0]*a[5][4] + a[0][3]*a[1][2]*a[3][5]*a[4][4]*a[5][0] + a[0][3]*a[1][4]*a[3][0]*a[4][2]*a[5][5] - a[0][3]*a[1][4]*a[3][0]*a[4][5]*a[5][2] - a[0][3]*a[1][4]*a[3][2]*a[4][0]*a[5][5] + a[0][3]*a[1][4]*a[3][2]*a[4][5]*a[5][0] + a[0][3]*a[1][4]*a[3][5]*a[4][0]*a[5][2] - a[0][3]*a[1][4]*a[3][5]*a[4][2]*a[5][0] - a[0][3]*a[1][5]*a[3][0]*a[4][2]*a[5][4] + a[0][3]*a[1][5]*a[3][0]*a[4][4]*a[5][2] + a[0][3]*a[1][5]*a[3][2]*a[4][0]*a[5][4] - a[0][3]*a[1][5]*a[3][2]*a[4][4]*a[5][0] - a[0][3]*a[1][5]*a[3][4]*a[4][0]*a[5][2] + a[0][3]*a[1][5]*a[3][4]*a[4][2]*a[5][0] - a[0][4]*a[1][0]*a[3][2]*a[4][3]*a[5][5] + a[0][4]*a[1][0]*a[3][2]*a[4][5]*a[5][3] + a[0][4]*a[1][0]*a[3][3]*a[4][2]*a[5][5] - a[0][4]*a[1][0]*a[3][3]*a[4][5]*a[5][2] - a[0][4]*a[1][0]*a[3][5]*a[4][2]*a[5][3] + a[0][4]*a[1][0]*a[3][5]*a[4][3]*a[5][2] + a[0][4]*a[1][2]*a[3][0]*a[4][3]*a[5][5] - a[0][4]*a[1][2]*a[3][0]*a[4][5]*a[5][3] - a[0][4]*a[1][2]*a[3][3]*a[4][0]*a[5][5] + a[0][4]*a[1][2]*a[3][3]*a[4][5]*a[5][0] + a[0][4]*a[1][2]*a[3][5]*a[4][0]*a[5][3] - a[0][4]*a[1][2]*a[3][5]*a[4][3]*a[5][0] - a[0][4]*a[1][3]*a[3][0]*a[4][2]*a[5][5] + a[0][4]*a[1][3]*a[3][0]*a[4][5]*a[5][2] + a[0][4]*a[1][3]*a[3][2]*a[4][0]*a[5][5] - a[0][4]*a[1][3]*a[3][2]*a[4][5]*a[5][0] - a[0][4]*a[1][3]*a[3][5]*a[4][0]*a[5][2] + a[0][4]*a[1][3]*a[3][5]*a[4][2]*a[5][0] + a[0][4]*a[1][5]*a[3][0]*a[4][2]*a[5][3] - a[0][4]*a[1][5]*a[3][0]*a[4][3]*a[5][2] - a[0][4]*a[1][5]*a[3][2]*a[4][0]*a[5][3] + a[0][4]*a[1][5]*a[3][2]*a[4][3]*a[5][0] + a[0][4]*a[1][5]*a[3][3]*a[4][0]*a[5][2] - a[0][4]*a[1][5]*a[3][3]*a[4][2]*a[5][0] + a[0][5]*a[1][0]*a[3][2]*a[4][3]*a[5][4] - a[0][5]*a[1][0]*a[3][2]*a[4][4]*a[5][3] - a[0][5]*a[1][0]*a[3][3]*a[4][2]*a[5][4] + a[0][5]*a[1][0]*a[3][3]*a[4][4]*a[5][2] + a[0][5]*a[1][0]*a[3][4]*a[4][2]*a[5][3] - a[0][5]*a[1][0]*a[3][4]*a[4][3]*a[5][2] - a[0][5]*a[1][2]*a[3][0]*a[4][3]*a[5][4] + a[0][5]*a[1][2]*a[3][0]*a[4][4]*a[5][3] + a[0][5]*a[1][2]*a[3][3]*a[4][0]*a[5][4] - a[0][5]*a[1][2]*a[3][3]*a[4][4]*a[5][0] - a[0][5]*a[1][2]*a[3][4]*a[4][0]*a[5][3] + a[0][5]*a[1][2]*a[3][4]*a[4][3]*a[5][0] + a[0][5]*a[1][3]*a[3][0]*a[4][2]*a[5][4] - a[0][5]*a[1][3]*a[3][0]*a[4][4]*a[5][2] - a[0][5]*a[1][3]*a[3][2]*a[4][0]*a[5][4] + a[0][5]*a[1][3]*a[3][2]*a[4][4]*a[5][0] + a[0][5]*a[1][3]*a[3][4]*a[4][0]*a[5][2] - a[0][5]*a[1][3]*a[3][4]*a[4][2]*a[5][0] - a[0][5]*a[1][4]*a[3][0]*a[4][2]*a[5][3] + a[0][5]*a[1][4]*a[3][0]*a[4][3]*a[5][2] + a[0][5]*a[1][4]*a[3][2]*a[4][0]*a[5][3] - a[0][5]*a[1][4]*a[3][2]*a[4][3]*a[5][0] - a[0][5]*a[1][4]*a[3][3]*a[4][0]*a[5][2] + a[0][5]*a[1][4]*a[3][3]*a[4][2]*a[5][0])/denom;
invA[2][2] = (a[0][0]*a[1][1]*a[3][3]*a[4][4]*a[5][5] - a[0][0]*a[1][1]*a[3][3]*a[4][5]*a[5][4] - a[0][0]*a[1][1]*a[3][4]*a[4][3]*a[5][5] + a[0][0]*a[1][1]*a[3][4]*a[4][5]*a[5][3] + a[0][0]*a[1][1]*a[3][5]*a[4][3]*a[5][4] - a[0][0]*a[1][1]*a[3][5]*a[4][4]*a[5][3] - a[0][0]*a[1][3]*a[3][1]*a[4][4]*a[5][5] + a[0][0]*a[1][3]*a[3][1]*a[4][5]*a[5][4] + a[0][0]*a[1][3]*a[3][4]*a[4][1]*a[5][5] - a[0][0]*a[1][3]*a[3][4]*a[4][5]*a[5][1] - a[0][0]*a[1][3]*a[3][5]*a[4][1]*a[5][4] + a[0][0]*a[1][3]*a[3][5]*a[4][4]*a[5][1] + a[0][0]*a[1][4]*a[3][1]*a[4][3]*a[5][5] - a[0][0]*a[1][4]*a[3][1]*a[4][5]*a[5][3] - a[0][0]*a[1][4]*a[3][3]*a[4][1]*a[5][5] + a[0][0]*a[1][4]*a[3][3]*a[4][5]*a[5][1] + a[0][0]*a[1][4]*a[3][5]*a[4][1]*a[5][3] - a[0][0]*a[1][4]*a[3][5]*a[4][3]*a[5][1] - a[0][0]*a[1][5]*a[3][1]*a[4][3]*a[5][4] + a[0][0]*a[1][5]*a[3][1]*a[4][4]*a[5][3] + a[0][0]*a[1][5]*a[3][3]*a[4][1]*a[5][4] - a[0][0]*a[1][5]*a[3][3]*a[4][4]*a[5][1] - a[0][0]*a[1][5]*a[3][4]*a[4][1]*a[5][3] + a[0][0]*a[1][5]*a[3][4]*a[4][3]*a[5][1] - a[0][1]*a[1][0]*a[3][3]*a[4][4]*a[5][5] + a[0][1]*a[1][0]*a[3][3]*a[4][5]*a[5][4] + a[0][1]*a[1][0]*a[3][4]*a[4][3]*a[5][5] - a[0][1]*a[1][0]*a[3][4]*a[4][5]*a[5][3] - a[0][1]*a[1][0]*a[3][5]*a[4][3]*a[5][4] + a[0][1]*a[1][0]*a[3][5]*a[4][4]*a[5][3] + a[0][1]*a[1][3]*a[3][0]*a[4][4]*a[5][5] - a[0][1]*a[1][3]*a[3][0]*a[4][5]*a[5][4] - a[0][1]*a[1][3]*a[3][4]*a[4][0]*a[5][5] + a[0][1]*a[1][3]*a[3][4]*a[4][5]*a[5][0] + a[0][1]*a[1][3]*a[3][5]*a[4][0]*a[5][4] - a[0][1]*a[1][3]*a[3][5]*a[4][4]*a[5][0] - a[0][1]*a[1][4]*a[3][0]*a[4][3]*a[5][5] + a[0][1]*a[1][4]*a[3][0]*a[4][5]*a[5][3] + a[0][1]*a[1][4]*a[3][3]*a[4][0]*a[5][5] - a[0][1]*a[1][4]*a[3][3]*a[4][5]*a[5][0] - a[0][1]*a[1][4]*a[3][5]*a[4][0]*a[5][3] + a[0][1]*a[1][4]*a[3][5]*a[4][3]*a[5][0] + a[0][1]*a[1][5]*a[3][0]*a[4][3]*a[5][4] - a[0][1]*a[1][5]*a[3][0]*a[4][4]*a[5][3] - a[0][1]*a[1][5]*a[3][3]*a[4][0]*a[5][4] + a[0][1]*a[1][5]*a[3][3]*a[4][4]*a[5][0] + a[0][1]*a[1][5]*a[3][4]*a[4][0]*a[5][3] - a[0][1]*a[1][5]*a[3][4]*a[4][3]*a[5][0] + a[0][3]*a[1][0]*a[3][1]*a[4][4]*a[5][5] - a[0][3]*a[1][0]*a[3][1]*a[4][5]*a[5][4] - a[0][3]*a[1][0]*a[3][4]*a[4][1]*a[5][5] + a[0][3]*a[1][0]*a[3][4]*a[4][5]*a[5][1] + a[0][3]*a[1][0]*a[3][5]*a[4][1]*a[5][4] - a[0][3]*a[1][0]*a[3][5]*a[4][4]*a[5][1] - a[0][3]*a[1][1]*a[3][0]*a[4][4]*a[5][5] + a[0][3]*a[1][1]*a[3][0]*a[4][5]*a[5][4] + a[0][3]*a[1][1]*a[3][4]*a[4][0]*a[5][5] - a[0][3]*a[1][1]*a[3][4]*a[4][5]*a[5][0] - a[0][3]*a[1][1]*a[3][5]*a[4][0]*a[5][4] + a[0][3]*a[1][1]*a[3][5]*a[4][4]*a[5][0] + a[0][3]*a[1][4]*a[3][0]*a[4][1]*a[5][5] - a[0][3]*a[1][4]*a[3][0]*a[4][5]*a[5][1] - a[0][3]*a[1][4]*a[3][1]*a[4][0]*a[5][5] + a[0][3]*a[1][4]*a[3][1]*a[4][5]*a[5][0] + a[0][3]*a[1][4]*a[3][5]*a[4][0]*a[5][1] - a[0][3]*a[1][4]*a[3][5]*a[4][1]*a[5][0] - a[0][3]*a[1][5]*a[3][0]*a[4][1]*a[5][4] + a[0][3]*a[1][5]*a[3][0]*a[4][4]*a[5][1] + a[0][3]*a[1][5]*a[3][1]*a[4][0]*a[5][4] - a[0][3]*a[1][5]*a[3][1]*a[4][4]*a[5][0] - a[0][3]*a[1][5]*a[3][4]*a[4][0]*a[5][1] + a[0][3]*a[1][5]*a[3][4]*a[4][1]*a[5][0] - a[0][4]*a[1][0]*a[3][1]*a[4][3]*a[5][5] + a[0][4]*a[1][0]*a[3][1]*a[4][5]*a[5][3] + a[0][4]*a[1][0]*a[3][3]*a[4][1]*a[5][5] - a[0][4]*a[1][0]*a[3][3]*a[4][5]*a[5][1] - a[0][4]*a[1][0]*a[3][5]*a[4][1]*a[5][3] + a[0][4]*a[1][0]*a[3][5]*a[4][3]*a[5][1] + a[0][4]*a[1][1]*a[3][0]*a[4][3]*a[5][5] - a[0][4]*a[1][1]*a[3][0]*a[4][5]*a[5][3] - a[0][4]*a[1][1]*a[3][3]*a[4][0]*a[5][5] + a[0][4]*a[1][1]*a[3][3]*a[4][5]*a[5][0] + a[0][4]*a[1][1]*a[3][5]*a[4][0]*a[5][3] - a[0][4]*a[1][1]*a[3][5]*a[4][3]*a[5][0] - a[0][4]*a[1][3]*a[3][0]*a[4][1]*a[5][5] + a[0][4]*a[1][3]*a[3][0]*a[4][5]*a[5][1] + a[0][4]*a[1][3]*a[3][1]*a[4][0]*a[5][5] - a[0][4]*a[1][3]*a[3][1]*a[4][5]*a[5][0] - a[0][4]*a[1][3]*a[3][5]*a[4][0]*a[5][1] + a[0][4]*a[1][3]*a[3][5]*a[4][1]*a[5][0] + a[0][4]*a[1][5]*a[3][0]*a[4][1]*a[5][3] - a[0][4]*a[1][5]*a[3][0]*a[4][3]*a[5][1] - a[0][4]*a[1][5]*a[3][1]*a[4][0]*a[5][3] + a[0][4]*a[1][5]*a[3][1]*a[4][3]*a[5][0] + a[0][4]*a[1][5]*a[3][3]*a[4][0]*a[5][1] - a[0][4]*a[1][5]*a[3][3]*a[4][1]*a[5][0] + a[0][5]*a[1][0]*a[3][1]*a[4][3]*a[5][4] - a[0][5]*a[1][0]*a[3][1]*a[4][4]*a[5][3] - a[0][5]*a[1][0]*a[3][3]*a[4][1]*a[5][4] + a[0][5]*a[1][0]*a[3][3]*a[4][4]*a[5][1] + a[0][5]*a[1][0]*a[3][4]*a[4][1]*a[5][3] - a[0][5]*a[1][0]*a[3][4]*a[4][3]*a[5][1] - a[0][5]*a[1][1]*a[3][0]*a[4][3]*a[5][4] + a[0][5]*a[1][1]*a[3][0]*a[4][4]*a[5][3] + a[0][5]*a[1][1]*a[3][3]*a[4][0]*a[5][4] - a[0][5]*a[1][1]*a[3][3]*a[4][4]*a[5][0] - a[0][5]*a[1][1]*a[3][4]*a[4][0]*a[5][3] + a[0][5]*a[1][1]*a[3][4]*a[4][3]*a[5][0] + a[0][5]*a[1][3]*a[3][0]*a[4][1]*a[5][4] - a[0][5]*a[1][3]*a[3][0]*a[4][4]*a[5][1] - a[0][5]*a[1][3]*a[3][1]*a[4][0]*a[5][4] + a[0][5]*a[1][3]*a[3][1]*a[4][4]*a[5][0] + a[0][5]*a[1][3]*a[3][4]*a[4][0]*a[5][1] - a[0][5]*a[1][3]*a[3][4]*a[4][1]*a[5][0] - a[0][5]*a[1][4]*a[3][0]*a[4][1]*a[5][3] + a[0][5]*a[1][4]*a[3][0]*a[4][3]*a[5][1] + a[0][5]*a[1][4]*a[3][1]*a[4][0]*a[5][3] - a[0][5]*a[1][4]*a[3][1]*a[4][3]*a[5][0] - a[0][5]*a[1][4]*a[3][3]*a[4][0]*a[5][1] + a[0][5]*a[1][4]*a[3][3]*a[4][1]*a[5][0])/denom;
invA[3][2] = -(a[0][0]*a[1][1]*a[3][2]*a[4][4]*a[5][5] - a[0][0]*a[1][1]*a[3][2]*a[4][5]*a[5][4] - a[0][0]*a[1][1]*a[3][4]*a[4][2]*a[5][5] + a[0][0]*a[1][1]*a[3][4]*a[4][5]*a[5][2] + a[0][0]*a[1][1]*a[3][5]*a[4][2]*a[5][4] - a[0][0]*a[1][1]*a[3][5]*a[4][4]*a[5][2] - a[0][0]*a[1][2]*a[3][1]*a[4][4]*a[5][5] + a[0][0]*a[1][2]*a[3][1]*a[4][5]*a[5][4] + a[0][0]*a[1][2]*a[3][4]*a[4][1]*a[5][5] - a[0][0]*a[1][2]*a[3][4]*a[4][5]*a[5][1] - a[0][0]*a[1][2]*a[3][5]*a[4][1]*a[5][4] + a[0][0]*a[1][2]*a[3][5]*a[4][4]*a[5][1] + a[0][0]*a[1][4]*a[3][1]*a[4][2]*a[5][5] - a[0][0]*a[1][4]*a[3][1]*a[4][5]*a[5][2] - a[0][0]*a[1][4]*a[3][2]*a[4][1]*a[5][5] + a[0][0]*a[1][4]*a[3][2]*a[4][5]*a[5][1] + a[0][0]*a[1][4]*a[3][5]*a[4][1]*a[5][2] - a[0][0]*a[1][4]*a[3][5]*a[4][2]*a[5][1] - a[0][0]*a[1][5]*a[3][1]*a[4][2]*a[5][4] + a[0][0]*a[1][5]*a[3][1]*a[4][4]*a[5][2] + a[0][0]*a[1][5]*a[3][2]*a[4][1]*a[5][4] - a[0][0]*a[1][5]*a[3][2]*a[4][4]*a[5][1] - a[0][0]*a[1][5]*a[3][4]*a[4][1]*a[5][2] + a[0][0]*a[1][5]*a[3][4]*a[4][2]*a[5][1] - a[0][1]*a[1][0]*a[3][2]*a[4][4]*a[5][5] + a[0][1]*a[1][0]*a[3][2]*a[4][5]*a[5][4] + a[0][1]*a[1][0]*a[3][4]*a[4][2]*a[5][5] - a[0][1]*a[1][0]*a[3][4]*a[4][5]*a[5][2] - a[0][1]*a[1][0]*a[3][5]*a[4][2]*a[5][4] + a[0][1]*a[1][0]*a[3][5]*a[4][4]*a[5][2] + a[0][1]*a[1][2]*a[3][0]*a[4][4]*a[5][5] - a[0][1]*a[1][2]*a[3][0]*a[4][5]*a[5][4] - a[0][1]*a[1][2]*a[3][4]*a[4][0]*a[5][5] + a[0][1]*a[1][2]*a[3][4]*a[4][5]*a[5][0] + a[0][1]*a[1][2]*a[3][5]*a[4][0]*a[5][4] - a[0][1]*a[1][2]*a[3][5]*a[4][4]*a[5][0] - a[0][1]*a[1][4]*a[3][0]*a[4][2]*a[5][5] + a[0][1]*a[1][4]*a[3][0]*a[4][5]*a[5][2] + a[0][1]*a[1][4]*a[3][2]*a[4][0]*a[5][5] - a[0][1]*a[1][4]*a[3][2]*a[4][5]*a[5][0] - a[0][1]*a[1][4]*a[3][5]*a[4][0]*a[5][2] + a[0][1]*a[1][4]*a[3][5]*a[4][2]*a[5][0] + a[0][1]*a[1][5]*a[3][0]*a[4][2]*a[5][4] - a[0][1]*a[1][5]*a[3][0]*a[4][4]*a[5][2] - a[0][1]*a[1][5]*a[3][2]*a[4][0]*a[5][4] + a[0][1]*a[1][5]*a[3][2]*a[4][4]*a[5][0] + a[0][1]*a[1][5]*a[3][4]*a[4][0]*a[5][2] - a[0][1]*a[1][5]*a[3][4]*a[4][2]*a[5][0] + a[0][2]*a[1][0]*a[3][1]*a[4][4]*a[5][5] - a[0][2]*a[1][0]*a[3][1]*a[4][5]*a[5][4] - a[0][2]*a[1][0]*a[3][4]*a[4][1]*a[5][5] + a[0][2]*a[1][0]*a[3][4]*a[4][5]*a[5][1] + a[0][2]*a[1][0]*a[3][5]*a[4][1]*a[5][4] - a[0][2]*a[1][0]*a[3][5]*a[4][4]*a[5][1] - a[0][2]*a[1][1]*a[3][0]*a[4][4]*a[5][5] + a[0][2]*a[1][1]*a[3][0]*a[4][5]*a[5][4] + a[0][2]*a[1][1]*a[3][4]*a[4][0]*a[5][5] - a[0][2]*a[1][1]*a[3][4]*a[4][5]*a[5][0] - a[0][2]*a[1][1]*a[3][5]*a[4][0]*a[5][4] + a[0][2]*a[1][1]*a[3][5]*a[4][4]*a[5][0] + a[0][2]*a[1][4]*a[3][0]*a[4][1]*a[5][5] - a[0][2]*a[1][4]*a[3][0]*a[4][5]*a[5][1] - a[0][2]*a[1][4]*a[3][1]*a[4][0]*a[5][5] + a[0][2]*a[1][4]*a[3][1]*a[4][5]*a[5][0] + a[0][2]*a[1][4]*a[3][5]*a[4][0]*a[5][1] - a[0][2]*a[1][4]*a[3][5]*a[4][1]*a[5][0] - a[0][2]*a[1][5]*a[3][0]*a[4][1]*a[5][4] + a[0][2]*a[1][5]*a[3][0]*a[4][4]*a[5][1] + a[0][2]*a[1][5]*a[3][1]*a[4][0]*a[5][4] - a[0][2]*a[1][5]*a[3][1]*a[4][4]*a[5][0] - a[0][2]*a[1][5]*a[3][4]*a[4][0]*a[5][1] + a[0][2]*a[1][5]*a[3][4]*a[4][1]*a[5][0] - a[0][4]*a[1][0]*a[3][1]*a[4][2]*a[5][5] + a[0][4]*a[1][0]*a[3][1]*a[4][5]*a[5][2] + a[0][4]*a[1][0]*a[3][2]*a[4][1]*a[5][5] - a[0][4]*a[1][0]*a[3][2]*a[4][5]*a[5][1] - a[0][4]*a[1][0]*a[3][5]*a[4][1]*a[5][2] + a[0][4]*a[1][0]*a[3][5]*a[4][2]*a[5][1] + a[0][4]*a[1][1]*a[3][0]*a[4][2]*a[5][5] - a[0][4]*a[1][1]*a[3][0]*a[4][5]*a[5][2] - a[0][4]*a[1][1]*a[3][2]*a[4][0]*a[5][5] + a[0][4]*a[1][1]*a[3][2]*a[4][5]*a[5][0] + a[0][4]*a[1][1]*a[3][5]*a[4][0]*a[5][2] - a[0][4]*a[1][1]*a[3][5]*a[4][2]*a[5][0] - a[0][4]*a[1][2]*a[3][0]*a[4][1]*a[5][5] + a[0][4]*a[1][2]*a[3][0]*a[4][5]*a[5][1] + a[0][4]*a[1][2]*a[3][1]*a[4][0]*a[5][5] - a[0][4]*a[1][2]*a[3][1]*a[4][5]*a[5][0] - a[0][4]*a[1][2]*a[3][5]*a[4][0]*a[5][1] + a[0][4]*a[1][2]*a[3][5]*a[4][1]*a[5][0] + a[0][4]*a[1][5]*a[3][0]*a[4][1]*a[5][2] - a[0][4]*a[1][5]*a[3][0]*a[4][2]*a[5][1] - a[0][4]*a[1][5]*a[3][1]*a[4][0]*a[5][2] + a[0][4]*a[1][5]*a[3][1]*a[4][2]*a[5][0] + a[0][4]*a[1][5]*a[3][2]*a[4][0]*a[5][1] - a[0][4]*a[1][5]*a[3][2]*a[4][1]*a[5][0] + a[0][5]*a[1][0]*a[3][1]*a[4][2]*a[5][4] - a[0][5]*a[1][0]*a[3][1]*a[4][4]*a[5][2] - a[0][5]*a[1][0]*a[3][2]*a[4][1]*a[5][4] + a[0][5]*a[1][0]*a[3][2]*a[4][4]*a[5][1] + a[0][5]*a[1][0]*a[3][4]*a[4][1]*a[5][2] - a[0][5]*a[1][0]*a[3][4]*a[4][2]*a[5][1] - a[0][5]*a[1][1]*a[3][0]*a[4][2]*a[5][4] + a[0][5]*a[1][1]*a[3][0]*a[4][4]*a[5][2] + a[0][5]*a[1][1]*a[3][2]*a[4][0]*a[5][4] - a[0][5]*a[1][1]*a[3][2]*a[4][4]*a[5][0] - a[0][5]*a[1][1]*a[3][4]*a[4][0]*a[5][2] + a[0][5]*a[1][1]*a[3][4]*a[4][2]*a[5][0] + a[0][5]*a[1][2]*a[3][0]*a[4][1]*a[5][4] - a[0][5]*a[1][2]*a[3][0]*a[4][4]*a[5][1] - a[0][5]*a[1][2]*a[3][1]*a[4][0]*a[5][4] + a[0][5]*a[1][2]*a[3][1]*a[4][4]*a[5][0] + a[0][5]*a[1][2]*a[3][4]*a[4][0]*a[5][1] - a[0][5]*a[1][2]*a[3][4]*a[4][1]*a[5][0] - a[0][5]*a[1][4]*a[3][0]*a[4][1]*a[5][2] + a[0][5]*a[1][4]*a[3][0]*a[4][2]*a[5][1] + a[0][5]*a[1][4]*a[3][1]*a[4][0]*a[5][2] - a[0][5]*a[1][4]*a[3][1]*a[4][2]*a[5][0] - a[0][5]*a[1][4]*a[3][2]*a[4][0]*a[5][1] + a[0][5]*a[1][4]*a[3][2]*a[4][1]*a[5][0])/denom;
invA[4][2] = (a[0][0]*a[1][1]*a[3][2]*a[4][3]*a[5][5] - a[0][0]*a[1][1]*a[3][2]*a[4][5]*a[5][3] - a[0][0]*a[1][1]*a[3][3]*a[4][2]*a[5][5] + a[0][0]*a[1][1]*a[3][3]*a[4][5]*a[5][2] + a[0][0]*a[1][1]*a[3][5]*a[4][2]*a[5][3] - a[0][0]*a[1][1]*a[3][5]*a[4][3]*a[5][2] - a[0][0]*a[1][2]*a[3][1]*a[4][3]*a[5][5] + a[0][0]*a[1][2]*a[3][1]*a[4][5]*a[5][3] + a[0][0]*a[1][2]*a[3][3]*a[4][1]*a[5][5] - a[0][0]*a[1][2]*a[3][3]*a[4][5]*a[5][1] - a[0][0]*a[1][2]*a[3][5]*a[4][1]*a[5][3] + a[0][0]*a[1][2]*a[3][5]*a[4][3]*a[5][1] + a[0][0]*a[1][3]*a[3][1]*a[4][2]*a[5][5] - a[0][0]*a[1][3]*a[3][1]*a[4][5]*a[5][2] - a[0][0]*a[1][3]*a[3][2]*a[4][1]*a[5][5] + a[0][0]*a[1][3]*a[3][2]*a[4][5]*a[5][1] + a[0][0]*a[1][3]*a[3][5]*a[4][1]*a[5][2] - a[0][0]*a[1][3]*a[3][5]*a[4][2]*a[5][1] - a[0][0]*a[1][5]*a[3][1]*a[4][2]*a[5][3] + a[0][0]*a[1][5]*a[3][1]*a[4][3]*a[5][2] + a[0][0]*a[1][5]*a[3][2]*a[4][1]*a[5][3] - a[0][0]*a[1][5]*a[3][2]*a[4][3]*a[5][1] - a[0][0]*a[1][5]*a[3][3]*a[4][1]*a[5][2] + a[0][0]*a[1][5]*a[3][3]*a[4][2]*a[5][1] - a[0][1]*a[1][0]*a[3][2]*a[4][3]*a[5][5] + a[0][1]*a[1][0]*a[3][2]*a[4][5]*a[5][3] + a[0][1]*a[1][0]*a[3][3]*a[4][2]*a[5][5] - a[0][1]*a[1][0]*a[3][3]*a[4][5]*a[5][2] - a[0][1]*a[1][0]*a[3][5]*a[4][2]*a[5][3] + a[0][1]*a[1][0]*a[3][5]*a[4][3]*a[5][2] + a[0][1]*a[1][2]*a[3][0]*a[4][3]*a[5][5] - a[0][1]*a[1][2]*a[3][0]*a[4][5]*a[5][3] - a[0][1]*a[1][2]*a[3][3]*a[4][0]*a[5][5] + a[0][1]*a[1][2]*a[3][3]*a[4][5]*a[5][0] + a[0][1]*a[1][2]*a[3][5]*a[4][0]*a[5][3] - a[0][1]*a[1][2]*a[3][5]*a[4][3]*a[5][0] - a[0][1]*a[1][3]*a[3][0]*a[4][2]*a[5][5] + a[0][1]*a[1][3]*a[3][0]*a[4][5]*a[5][2] + a[0][1]*a[1][3]*a[3][2]*a[4][0]*a[5][5] - a[0][1]*a[1][3]*a[3][2]*a[4][5]*a[5][0] - a[0][1]*a[1][3]*a[3][5]*a[4][0]*a[5][2] + a[0][1]*a[1][3]*a[3][5]*a[4][2]*a[5][0] + a[0][1]*a[1][5]*a[3][0]*a[4][2]*a[5][3] - a[0][1]*a[1][5]*a[3][0]*a[4][3]*a[5][2] - a[0][1]*a[1][5]*a[3][2]*a[4][0]*a[5][3] + a[0][1]*a[1][5]*a[3][2]*a[4][3]*a[5][0] + a[0][1]*a[1][5]*a[3][3]*a[4][0]*a[5][2] - a[0][1]*a[1][5]*a[3][3]*a[4][2]*a[5][0] + a[0][2]*a[1][0]*a[3][1]*a[4][3]*a[5][5] - a[0][2]*a[1][0]*a[3][1]*a[4][5]*a[5][3] - a[0][2]*a[1][0]*a[3][3]*a[4][1]*a[5][5] + a[0][2]*a[1][0]*a[3][3]*a[4][5]*a[5][1] + a[0][2]*a[1][0]*a[3][5]*a[4][1]*a[5][3] - a[0][2]*a[1][0]*a[3][5]*a[4][3]*a[5][1] - a[0][2]*a[1][1]*a[3][0]*a[4][3]*a[5][5] + a[0][2]*a[1][1]*a[3][0]*a[4][5]*a[5][3] + a[0][2]*a[1][1]*a[3][3]*a[4][0]*a[5][5] - a[0][2]*a[1][1]*a[3][3]*a[4][5]*a[5][0] - a[0][2]*a[1][1]*a[3][5]*a[4][0]*a[5][3] + a[0][2]*a[1][1]*a[3][5]*a[4][3]*a[5][0] + a[0][2]*a[1][3]*a[3][0]*a[4][1]*a[5][5] - a[0][2]*a[1][3]*a[3][0]*a[4][5]*a[5][1] - a[0][2]*a[1][3]*a[3][1]*a[4][0]*a[5][5] + a[0][2]*a[1][3]*a[3][1]*a[4][5]*a[5][0] + a[0][2]*a[1][3]*a[3][5]*a[4][0]*a[5][1] - a[0][2]*a[1][3]*a[3][5]*a[4][1]*a[5][0] - a[0][2]*a[1][5]*a[3][0]*a[4][1]*a[5][3] + a[0][2]*a[1][5]*a[3][0]*a[4][3]*a[5][1] + a[0][2]*a[1][5]*a[3][1]*a[4][0]*a[5][3] - a[0][2]*a[1][5]*a[3][1]*a[4][3]*a[5][0] - a[0][2]*a[1][5]*a[3][3]*a[4][0]*a[5][1] + a[0][2]*a[1][5]*a[3][3]*a[4][1]*a[5][0] - a[0][3]*a[1][0]*a[3][1]*a[4][2]*a[5][5] + a[0][3]*a[1][0]*a[3][1]*a[4][5]*a[5][2] + a[0][3]*a[1][0]*a[3][2]*a[4][1]*a[5][5] - a[0][3]*a[1][0]*a[3][2]*a[4][5]*a[5][1] - a[0][3]*a[1][0]*a[3][5]*a[4][1]*a[5][2] + a[0][3]*a[1][0]*a[3][5]*a[4][2]*a[5][1] + a[0][3]*a[1][1]*a[3][0]*a[4][2]*a[5][5] - a[0][3]*a[1][1]*a[3][0]*a[4][5]*a[5][2] - a[0][3]*a[1][1]*a[3][2]*a[4][0]*a[5][5] + a[0][3]*a[1][1]*a[3][2]*a[4][5]*a[5][0] + a[0][3]*a[1][1]*a[3][5]*a[4][0]*a[5][2] - a[0][3]*a[1][1]*a[3][5]*a[4][2]*a[5][0] - a[0][3]*a[1][2]*a[3][0]*a[4][1]*a[5][5] + a[0][3]*a[1][2]*a[3][0]*a[4][5]*a[5][1] + a[0][3]*a[1][2]*a[3][1]*a[4][0]*a[5][5] - a[0][3]*a[1][2]*a[3][1]*a[4][5]*a[5][0] - a[0][3]*a[1][2]*a[3][5]*a[4][0]*a[5][1] + a[0][3]*a[1][2]*a[3][5]*a[4][1]*a[5][0] + a[0][3]*a[1][5]*a[3][0]*a[4][1]*a[5][2] - a[0][3]*a[1][5]*a[3][0]*a[4][2]*a[5][1] - a[0][3]*a[1][5]*a[3][1]*a[4][0]*a[5][2] + a[0][3]*a[1][5]*a[3][1]*a[4][2]*a[5][0] + a[0][3]*a[1][5]*a[3][2]*a[4][0]*a[5][1] - a[0][3]*a[1][5]*a[3][2]*a[4][1]*a[5][0] + a[0][5]*a[1][0]*a[3][1]*a[4][2]*a[5][3] - a[0][5]*a[1][0]*a[3][1]*a[4][3]*a[5][2] - a[0][5]*a[1][0]*a[3][2]*a[4][1]*a[5][3] + a[0][5]*a[1][0]*a[3][2]*a[4][3]*a[5][1] + a[0][5]*a[1][0]*a[3][3]*a[4][1]*a[5][2] - a[0][5]*a[1][0]*a[3][3]*a[4][2]*a[5][1] - a[0][5]*a[1][1]*a[3][0]*a[4][2]*a[5][3] + a[0][5]*a[1][1]*a[3][0]*a[4][3]*a[5][2] + a[0][5]*a[1][1]*a[3][2]*a[4][0]*a[5][3] - a[0][5]*a[1][1]*a[3][2]*a[4][3]*a[5][0] - a[0][5]*a[1][1]*a[3][3]*a[4][0]*a[5][2] + a[0][5]*a[1][1]*a[3][3]*a[4][2]*a[5][0] + a[0][5]*a[1][2]*a[3][0]*a[4][1]*a[5][3] - a[0][5]*a[1][2]*a[3][0]*a[4][3]*a[5][1] - a[0][5]*a[1][2]*a[3][1]*a[4][0]*a[5][3] + a[0][5]*a[1][2]*a[3][1]*a[4][3]*a[5][0] + a[0][5]*a[1][2]*a[3][3]*a[4][0]*a[5][1] - a[0][5]*a[1][2]*a[3][3]*a[4][1]*a[5][0] - a[0][5]*a[1][3]*a[3][0]*a[4][1]*a[5][2] + a[0][5]*a[1][3]*a[3][0]*a[4][2]*a[5][1] + a[0][5]*a[1][3]*a[3][1]*a[4][0]*a[5][2] - a[0][5]*a[1][3]*a[3][1]*a[4][2]*a[5][0] - a[0][5]*a[1][3]*a[3][2]*a[4][0]*a[5][1] + a[0][5]*a[1][3]*a[3][2]*a[4][1]*a[5][0])/denom;
invA[5][2] = -(a[0][0]*a[1][1]*a[3][2]*a[4][3]*a[5][4] - a[0][0]*a[1][1]*a[3][2]*a[4][4]*a[5][3] - a[0][0]*a[1][1]*a[3][3]*a[4][2]*a[5][4] + a[0][0]*a[1][1]*a[3][3]*a[4][4]*a[5][2] + a[0][0]*a[1][1]*a[3][4]*a[4][2]*a[5][3] - a[0][0]*a[1][1]*a[3][4]*a[4][3]*a[5][2] - a[0][0]*a[1][2]*a[3][1]*a[4][3]*a[5][4] + a[0][0]*a[1][2]*a[3][1]*a[4][4]*a[5][3] + a[0][0]*a[1][2]*a[3][3]*a[4][1]*a[5][4] - a[0][0]*a[1][2]*a[3][3]*a[4][4]*a[5][1] - a[0][0]*a[1][2]*a[3][4]*a[4][1]*a[5][3] + a[0][0]*a[1][2]*a[3][4]*a[4][3]*a[5][1] + a[0][0]*a[1][3]*a[3][1]*a[4][2]*a[5][4] - a[0][0]*a[1][3]*a[3][1]*a[4][4]*a[5][2] - a[0][0]*a[1][3]*a[3][2]*a[4][1]*a[5][4] + a[0][0]*a[1][3]*a[3][2]*a[4][4]*a[5][1] + a[0][0]*a[1][3]*a[3][4]*a[4][1]*a[5][2] - a[0][0]*a[1][3]*a[3][4]*a[4][2]*a[5][1] - a[0][0]*a[1][4]*a[3][1]*a[4][2]*a[5][3] + a[0][0]*a[1][4]*a[3][1]*a[4][3]*a[5][2] + a[0][0]*a[1][4]*a[3][2]*a[4][1]*a[5][3] - a[0][0]*a[1][4]*a[3][2]*a[4][3]*a[5][1] - a[0][0]*a[1][4]*a[3][3]*a[4][1]*a[5][2] + a[0][0]*a[1][4]*a[3][3]*a[4][2]*a[5][1] - a[0][1]*a[1][0]*a[3][2]*a[4][3]*a[5][4] + a[0][1]*a[1][0]*a[3][2]*a[4][4]*a[5][3] + a[0][1]*a[1][0]*a[3][3]*a[4][2]*a[5][4] - a[0][1]*a[1][0]*a[3][3]*a[4][4]*a[5][2] - a[0][1]*a[1][0]*a[3][4]*a[4][2]*a[5][3] + a[0][1]*a[1][0]*a[3][4]*a[4][3]*a[5][2] + a[0][1]*a[1][2]*a[3][0]*a[4][3]*a[5][4] - a[0][1]*a[1][2]*a[3][0]*a[4][4]*a[5][3] - a[0][1]*a[1][2]*a[3][3]*a[4][0]*a[5][4] + a[0][1]*a[1][2]*a[3][3]*a[4][4]*a[5][0] + a[0][1]*a[1][2]*a[3][4]*a[4][0]*a[5][3] - a[0][1]*a[1][2]*a[3][4]*a[4][3]*a[5][0] - a[0][1]*a[1][3]*a[3][0]*a[4][2]*a[5][4] + a[0][1]*a[1][3]*a[3][0]*a[4][4]*a[5][2] + a[0][1]*a[1][3]*a[3][2]*a[4][0]*a[5][4] - a[0][1]*a[1][3]*a[3][2]*a[4][4]*a[5][0] - a[0][1]*a[1][3]*a[3][4]*a[4][0]*a[5][2] + a[0][1]*a[1][3]*a[3][4]*a[4][2]*a[5][0] + a[0][1]*a[1][4]*a[3][0]*a[4][2]*a[5][3] - a[0][1]*a[1][4]*a[3][0]*a[4][3]*a[5][2] - a[0][1]*a[1][4]*a[3][2]*a[4][0]*a[5][3] + a[0][1]*a[1][4]*a[3][2]*a[4][3]*a[5][0] + a[0][1]*a[1][4]*a[3][3]*a[4][0]*a[5][2] - a[0][1]*a[1][4]*a[3][3]*a[4][2]*a[5][0] + a[0][2]*a[1][0]*a[3][1]*a[4][3]*a[5][4] - a[0][2]*a[1][0]*a[3][1]*a[4][4]*a[5][3] - a[0][2]*a[1][0]*a[3][3]*a[4][1]*a[5][4] + a[0][2]*a[1][0]*a[3][3]*a[4][4]*a[5][1] + a[0][2]*a[1][0]*a[3][4]*a[4][1]*a[5][3] - a[0][2]*a[1][0]*a[3][4]*a[4][3]*a[5][1] - a[0][2]*a[1][1]*a[3][0]*a[4][3]*a[5][4] + a[0][2]*a[1][1]*a[3][0]*a[4][4]*a[5][3] + a[0][2]*a[1][1]*a[3][3]*a[4][0]*a[5][4] - a[0][2]*a[1][1]*a[3][3]*a[4][4]*a[5][0] - a[0][2]*a[1][1]*a[3][4]*a[4][0]*a[5][3] + a[0][2]*a[1][1]*a[3][4]*a[4][3]*a[5][0] + a[0][2]*a[1][3]*a[3][0]*a[4][1]*a[5][4] - a[0][2]*a[1][3]*a[3][0]*a[4][4]*a[5][1] - a[0][2]*a[1][3]*a[3][1]*a[4][0]*a[5][4] + a[0][2]*a[1][3]*a[3][1]*a[4][4]*a[5][0] + a[0][2]*a[1][3]*a[3][4]*a[4][0]*a[5][1] - a[0][2]*a[1][3]*a[3][4]*a[4][1]*a[5][0] - a[0][2]*a[1][4]*a[3][0]*a[4][1]*a[5][3] + a[0][2]*a[1][4]*a[3][0]*a[4][3]*a[5][1] + a[0][2]*a[1][4]*a[3][1]*a[4][0]*a[5][3] - a[0][2]*a[1][4]*a[3][1]*a[4][3]*a[5][0] - a[0][2]*a[1][4]*a[3][3]*a[4][0]*a[5][1] + a[0][2]*a[1][4]*a[3][3]*a[4][1]*a[5][0] - a[0][3]*a[1][0]*a[3][1]*a[4][2]*a[5][4] + a[0][3]*a[1][0]*a[3][1]*a[4][4]*a[5][2] + a[0][3]*a[1][0]*a[3][2]*a[4][1]*a[5][4] - a[0][3]*a[1][0]*a[3][2]*a[4][4]*a[5][1] - a[0][3]*a[1][0]*a[3][4]*a[4][1]*a[5][2] + a[0][3]*a[1][0]*a[3][4]*a[4][2]*a[5][1] + a[0][3]*a[1][1]*a[3][0]*a[4][2]*a[5][4] - a[0][3]*a[1][1]*a[3][0]*a[4][4]*a[5][2] - a[0][3]*a[1][1]*a[3][2]*a[4][0]*a[5][4] + a[0][3]*a[1][1]*a[3][2]*a[4][4]*a[5][0] + a[0][3]*a[1][1]*a[3][4]*a[4][0]*a[5][2] - a[0][3]*a[1][1]*a[3][4]*a[4][2]*a[5][0] - a[0][3]*a[1][2]*a[3][0]*a[4][1]*a[5][4] + a[0][3]*a[1][2]*a[3][0]*a[4][4]*a[5][1] + a[0][3]*a[1][2]*a[3][1]*a[4][0]*a[5][4] - a[0][3]*a[1][2]*a[3][1]*a[4][4]*a[5][0] - a[0][3]*a[1][2]*a[3][4]*a[4][0]*a[5][1] + a[0][3]*a[1][2]*a[3][4]*a[4][1]*a[5][0] + a[0][3]*a[1][4]*a[3][0]*a[4][1]*a[5][2] - a[0][3]*a[1][4]*a[3][0]*a[4][2]*a[5][1] - a[0][3]*a[1][4]*a[3][1]*a[4][0]*a[5][2] + a[0][3]*a[1][4]*a[3][1]*a[4][2]*a[5][0] + a[0][3]*a[1][4]*a[3][2]*a[4][0]*a[5][1] - a[0][3]*a[1][4]*a[3][2]*a[4][1]*a[5][0] + a[0][4]*a[1][0]*a[3][1]*a[4][2]*a[5][3] - a[0][4]*a[1][0]*a[3][1]*a[4][3]*a[5][2] - a[0][4]*a[1][0]*a[3][2]*a[4][1]*a[5][3] + a[0][4]*a[1][0]*a[3][2]*a[4][3]*a[5][1] + a[0][4]*a[1][0]*a[3][3]*a[4][1]*a[5][2] - a[0][4]*a[1][0]*a[3][3]*a[4][2]*a[5][1] - a[0][4]*a[1][1]*a[3][0]*a[4][2]*a[5][3] + a[0][4]*a[1][1]*a[3][0]*a[4][3]*a[5][2] + a[0][4]*a[1][1]*a[3][2]*a[4][0]*a[5][3] - a[0][4]*a[1][1]*a[3][2]*a[4][3]*a[5][0] - a[0][4]*a[1][1]*a[3][3]*a[4][0]*a[5][2] + a[0][4]*a[1][1]*a[3][3]*a[4][2]*a[5][0] + a[0][4]*a[1][2]*a[3][0]*a[4][1]*a[5][3] - a[0][4]*a[1][2]*a[3][0]*a[4][3]*a[5][1] - a[0][4]*a[1][2]*a[3][1]*a[4][0]*a[5][3] + a[0][4]*a[1][2]*a[3][1]*a[4][3]*a[5][0] + a[0][4]*a[1][2]*a[3][3]*a[4][0]*a[5][1] - a[0][4]*a[1][2]*a[3][3]*a[4][1]*a[5][0] - a[0][4]*a[1][3]*a[3][0]*a[4][1]*a[5][2] + a[0][4]*a[1][3]*a[3][0]*a[4][2]*a[5][1] + a[0][4]*a[1][3]*a[3][1]*a[4][0]*a[5][2] - a[0][4]*a[1][3]*a[3][1]*a[4][2]*a[5][0] - a[0][4]*a[1][3]*a[3][2]*a[4][0]*a[5][1] + a[0][4]*a[1][3]*a[3][2]*a[4][1]*a[5][0])/denom;
invA[0][3] = -(a[0][1]*a[1][2]*a[2][3]*a[4][4]*a[5][5] - a[0][1]*a[1][2]*a[2][3]*a[4][5]*a[5][4] - a[0][1]*a[1][2]*a[2][4]*a[4][3]*a[5][5] + a[0][1]*a[1][2]*a[2][4]*a[4][5]*a[5][3] + a[0][1]*a[1][2]*a[2][5]*a[4][3]*a[5][4] - a[0][1]*a[1][2]*a[2][5]*a[4][4]*a[5][3] - a[0][1]*a[1][3]*a[2][2]*a[4][4]*a[5][5] + a[0][1]*a[1][3]*a[2][2]*a[4][5]*a[5][4] + a[0][1]*a[1][3]*a[2][4]*a[4][2]*a[5][5] - a[0][1]*a[1][3]*a[2][4]*a[4][5]*a[5][2] - a[0][1]*a[1][3]*a[2][5]*a[4][2]*a[5][4] + a[0][1]*a[1][3]*a[2][5]*a[4][4]*a[5][2] + a[0][1]*a[1][4]*a[2][2]*a[4][3]*a[5][5] - a[0][1]*a[1][4]*a[2][2]*a[4][5]*a[5][3] - a[0][1]*a[1][4]*a[2][3]*a[4][2]*a[5][5] + a[0][1]*a[1][4]*a[2][3]*a[4][5]*a[5][2] + a[0][1]*a[1][4]*a[2][5]*a[4][2]*a[5][3] - a[0][1]*a[1][4]*a[2][5]*a[4][3]*a[5][2] - a[0][1]*a[1][5]*a[2][2]*a[4][3]*a[5][4] + a[0][1]*a[1][5]*a[2][2]*a[4][4]*a[5][3] + a[0][1]*a[1][5]*a[2][3]*a[4][2]*a[5][4] - a[0][1]*a[1][5]*a[2][3]*a[4][4]*a[5][2] - a[0][1]*a[1][5]*a[2][4]*a[4][2]*a[5][3] + a[0][1]*a[1][5]*a[2][4]*a[4][3]*a[5][2] - a[0][2]*a[1][1]*a[2][3]*a[4][4]*a[5][5] + a[0][2]*a[1][1]*a[2][3]*a[4][5]*a[5][4] + a[0][2]*a[1][1]*a[2][4]*a[4][3]*a[5][5] - a[0][2]*a[1][1]*a[2][4]*a[4][5]*a[5][3] - a[0][2]*a[1][1]*a[2][5]*a[4][3]*a[5][4] + a[0][2]*a[1][1]*a[2][5]*a[4][4]*a[5][3] + a[0][2]*a[1][3]*a[2][1]*a[4][4]*a[5][5] - a[0][2]*a[1][3]*a[2][1]*a[4][5]*a[5][4] - a[0][2]*a[1][3]*a[2][4]*a[4][1]*a[5][5] + a[0][2]*a[1][3]*a[2][4]*a[4][5]*a[5][1] + a[0][2]*a[1][3]*a[2][5]*a[4][1]*a[5][4] - a[0][2]*a[1][3]*a[2][5]*a[4][4]*a[5][1] - a[0][2]*a[1][4]*a[2][1]*a[4][3]*a[5][5] + a[0][2]*a[1][4]*a[2][1]*a[4][5]*a[5][3] + a[0][2]*a[1][4]*a[2][3]*a[4][1]*a[5][5] - a[0][2]*a[1][4]*a[2][3]*a[4][5]*a[5][1] - a[0][2]*a[1][4]*a[2][5]*a[4][1]*a[5][3] + a[0][2]*a[1][4]*a[2][5]*a[4][3]*a[5][1] + a[0][2]*a[1][5]*a[2][1]*a[4][3]*a[5][4] - a[0][2]*a[1][5]*a[2][1]*a[4][4]*a[5][3] - a[0][2]*a[1][5]*a[2][3]*a[4][1]*a[5][4] + a[0][2]*a[1][5]*a[2][3]*a[4][4]*a[5][1] + a[0][2]*a[1][5]*a[2][4]*a[4][1]*a[5][3] - a[0][2]*a[1][5]*a[2][4]*a[4][3]*a[5][1] + a[0][3]*a[1][1]*a[2][2]*a[4][4]*a[5][5] - a[0][3]*a[1][1]*a[2][2]*a[4][5]*a[5][4] - a[0][3]*a[1][1]*a[2][4]*a[4][2]*a[5][5] + a[0][3]*a[1][1]*a[2][4]*a[4][5]*a[5][2] + a[0][3]*a[1][1]*a[2][5]*a[4][2]*a[5][4] - a[0][3]*a[1][1]*a[2][5]*a[4][4]*a[5][2] - a[0][3]*a[1][2]*a[2][1]*a[4][4]*a[5][5] + a[0][3]*a[1][2]*a[2][1]*a[4][5]*a[5][4] + a[0][3]*a[1][2]*a[2][4]*a[4][1]*a[5][5] - a[0][3]*a[1][2]*a[2][4]*a[4][5]*a[5][1] - a[0][3]*a[1][2]*a[2][5]*a[4][1]*a[5][4] + a[0][3]*a[1][2]*a[2][5]*a[4][4]*a[5][1] + a[0][3]*a[1][4]*a[2][1]*a[4][2]*a[5][5] - a[0][3]*a[1][4]*a[2][1]*a[4][5]*a[5][2] - a[0][3]*a[1][4]*a[2][2]*a[4][1]*a[5][5] + a[0][3]*a[1][4]*a[2][2]*a[4][5]*a[5][1] + a[0][3]*a[1][4]*a[2][5]*a[4][1]*a[5][2] - a[0][3]*a[1][4]*a[2][5]*a[4][2]*a[5][1] - a[0][3]*a[1][5]*a[2][1]*a[4][2]*a[5][4] + a[0][3]*a[1][5]*a[2][1]*a[4][4]*a[5][2] + a[0][3]*a[1][5]*a[2][2]*a[4][1]*a[5][4] - a[0][3]*a[1][5]*a[2][2]*a[4][4]*a[5][1] - a[0][3]*a[1][5]*a[2][4]*a[4][1]*a[5][2] + a[0][3]*a[1][5]*a[2][4]*a[4][2]*a[5][1] - a[0][4]*a[1][1]*a[2][2]*a[4][3]*a[5][5] + a[0][4]*a[1][1]*a[2][2]*a[4][5]*a[5][3] + a[0][4]*a[1][1]*a[2][3]*a[4][2]*a[5][5] - a[0][4]*a[1][1]*a[2][3]*a[4][5]*a[5][2] - a[0][4]*a[1][1]*a[2][5]*a[4][2]*a[5][3] + a[0][4]*a[1][1]*a[2][5]*a[4][3]*a[5][2] + a[0][4]*a[1][2]*a[2][1]*a[4][3]*a[5][5] - a[0][4]*a[1][2]*a[2][1]*a[4][5]*a[5][3] - a[0][4]*a[1][2]*a[2][3]*a[4][1]*a[5][5] + a[0][4]*a[1][2]*a[2][3]*a[4][5]*a[5][1] + a[0][4]*a[1][2]*a[2][5]*a[4][1]*a[5][3] - a[0][4]*a[1][2]*a[2][5]*a[4][3]*a[5][1] - a[0][4]*a[1][3]*a[2][1]*a[4][2]*a[5][5] + a[0][4]*a[1][3]*a[2][1]*a[4][5]*a[5][2] + a[0][4]*a[1][3]*a[2][2]*a[4][1]*a[5][5] - a[0][4]*a[1][3]*a[2][2]*a[4][5]*a[5][1] - a[0][4]*a[1][3]*a[2][5]*a[4][1]*a[5][2] + a[0][4]*a[1][3]*a[2][5]*a[4][2]*a[5][1] + a[0][4]*a[1][5]*a[2][1]*a[4][2]*a[5][3] - a[0][4]*a[1][5]*a[2][1]*a[4][3]*a[5][2] - a[0][4]*a[1][5]*a[2][2]*a[4][1]*a[5][3] + a[0][4]*a[1][5]*a[2][2]*a[4][3]*a[5][1] + a[0][4]*a[1][5]*a[2][3]*a[4][1]*a[5][2] - a[0][4]*a[1][5]*a[2][3]*a[4][2]*a[5][1] + a[0][5]*a[1][1]*a[2][2]*a[4][3]*a[5][4] - a[0][5]*a[1][1]*a[2][2]*a[4][4]*a[5][3] - a[0][5]*a[1][1]*a[2][3]*a[4][2]*a[5][4] + a[0][5]*a[1][1]*a[2][3]*a[4][4]*a[5][2] + a[0][5]*a[1][1]*a[2][4]*a[4][2]*a[5][3] - a[0][5]*a[1][1]*a[2][4]*a[4][3]*a[5][2] - a[0][5]*a[1][2]*a[2][1]*a[4][3]*a[5][4] + a[0][5]*a[1][2]*a[2][1]*a[4][4]*a[5][3] + a[0][5]*a[1][2]*a[2][3]*a[4][1]*a[5][4] - a[0][5]*a[1][2]*a[2][3]*a[4][4]*a[5][1] - a[0][5]*a[1][2]*a[2][4]*a[4][1]*a[5][3] + a[0][5]*a[1][2]*a[2][4]*a[4][3]*a[5][1] + a[0][5]*a[1][3]*a[2][1]*a[4][2]*a[5][4] - a[0][5]*a[1][3]*a[2][1]*a[4][4]*a[5][2] - a[0][5]*a[1][3]*a[2][2]*a[4][1]*a[5][4] + a[0][5]*a[1][3]*a[2][2]*a[4][4]*a[5][1] + a[0][5]*a[1][3]*a[2][4]*a[4][1]*a[5][2] - a[0][5]*a[1][3]*a[2][4]*a[4][2]*a[5][1] - a[0][5]*a[1][4]*a[2][1]*a[4][2]*a[5][3] + a[0][5]*a[1][4]*a[2][1]*a[4][3]*a[5][2] + a[0][5]*a[1][4]*a[2][2]*a[4][1]*a[5][3] - a[0][5]*a[1][4]*a[2][2]*a[4][3]*a[5][1] - a[0][5]*a[1][4]*a[2][3]*a[4][1]*a[5][2] + a[0][5]*a[1][4]*a[2][3]*a[4][2]*a[5][1])/denom;
invA[1][3] = (a[0][0]*a[1][2]*a[2][3]*a[4][4]*a[5][5] - a[0][0]*a[1][2]*a[2][3]*a[4][5]*a[5][4] - a[0][0]*a[1][2]*a[2][4]*a[4][3]*a[5][5] + a[0][0]*a[1][2]*a[2][4]*a[4][5]*a[5][3] + a[0][0]*a[1][2]*a[2][5]*a[4][3]*a[5][4] - a[0][0]*a[1][2]*a[2][5]*a[4][4]*a[5][3] - a[0][0]*a[1][3]*a[2][2]*a[4][4]*a[5][5] + a[0][0]*a[1][3]*a[2][2]*a[4][5]*a[5][4] + a[0][0]*a[1][3]*a[2][4]*a[4][2]*a[5][5] - a[0][0]*a[1][3]*a[2][4]*a[4][5]*a[5][2] - a[0][0]*a[1][3]*a[2][5]*a[4][2]*a[5][4] + a[0][0]*a[1][3]*a[2][5]*a[4][4]*a[5][2] + a[0][0]*a[1][4]*a[2][2]*a[4][3]*a[5][5] - a[0][0]*a[1][4]*a[2][2]*a[4][5]*a[5][3] - a[0][0]*a[1][4]*a[2][3]*a[4][2]*a[5][5] + a[0][0]*a[1][4]*a[2][3]*a[4][5]*a[5][2] + a[0][0]*a[1][4]*a[2][5]*a[4][2]*a[5][3] - a[0][0]*a[1][4]*a[2][5]*a[4][3]*a[5][2] - a[0][0]*a[1][5]*a[2][2]*a[4][3]*a[5][4] + a[0][0]*a[1][5]*a[2][2]*a[4][4]*a[5][3] + a[0][0]*a[1][5]*a[2][3]*a[4][2]*a[5][4] - a[0][0]*a[1][5]*a[2][3]*a[4][4]*a[5][2] - a[0][0]*a[1][5]*a[2][4]*a[4][2]*a[5][3] + a[0][0]*a[1][5]*a[2][4]*a[4][3]*a[5][2] - a[0][2]*a[1][0]*a[2][3]*a[4][4]*a[5][5] + a[0][2]*a[1][0]*a[2][3]*a[4][5]*a[5][4] + a[0][2]*a[1][0]*a[2][4]*a[4][3]*a[5][5] - a[0][2]*a[1][0]*a[2][4]*a[4][5]*a[5][3] - a[0][2]*a[1][0]*a[2][5]*a[4][3]*a[5][4] + a[0][2]*a[1][0]*a[2][5]*a[4][4]*a[5][3] + a[0][2]*a[1][3]*a[2][0]*a[4][4]*a[5][5] - a[0][2]*a[1][3]*a[2][0]*a[4][5]*a[5][4] - a[0][2]*a[1][3]*a[2][4]*a[4][0]*a[5][5] + a[0][2]*a[1][3]*a[2][4]*a[4][5]*a[5][0] + a[0][2]*a[1][3]*a[2][5]*a[4][0]*a[5][4] - a[0][2]*a[1][3]*a[2][5]*a[4][4]*a[5][0] - a[0][2]*a[1][4]*a[2][0]*a[4][3]*a[5][5] + a[0][2]*a[1][4]*a[2][0]*a[4][5]*a[5][3] + a[0][2]*a[1][4]*a[2][3]*a[4][0]*a[5][5] - a[0][2]*a[1][4]*a[2][3]*a[4][5]*a[5][0] - a[0][2]*a[1][4]*a[2][5]*a[4][0]*a[5][3] + a[0][2]*a[1][4]*a[2][5]*a[4][3]*a[5][0] + a[0][2]*a[1][5]*a[2][0]*a[4][3]*a[5][4] - a[0][2]*a[1][5]*a[2][0]*a[4][4]*a[5][3] - a[0][2]*a[1][5]*a[2][3]*a[4][0]*a[5][4] + a[0][2]*a[1][5]*a[2][3]*a[4][4]*a[5][0] + a[0][2]*a[1][5]*a[2][4]*a[4][0]*a[5][3] - a[0][2]*a[1][5]*a[2][4]*a[4][3]*a[5][0] + a[0][3]*a[1][0]*a[2][2]*a[4][4]*a[5][5] - a[0][3]*a[1][0]*a[2][2]*a[4][5]*a[5][4] - a[0][3]*a[1][0]*a[2][4]*a[4][2]*a[5][5] + a[0][3]*a[1][0]*a[2][4]*a[4][5]*a[5][2] + a[0][3]*a[1][0]*a[2][5]*a[4][2]*a[5][4] - a[0][3]*a[1][0]*a[2][5]*a[4][4]*a[5][2] - a[0][3]*a[1][2]*a[2][0]*a[4][4]*a[5][5] + a[0][3]*a[1][2]*a[2][0]*a[4][5]*a[5][4] + a[0][3]*a[1][2]*a[2][4]*a[4][0]*a[5][5] - a[0][3]*a[1][2]*a[2][4]*a[4][5]*a[5][0] - a[0][3]*a[1][2]*a[2][5]*a[4][0]*a[5][4] + a[0][3]*a[1][2]*a[2][5]*a[4][4]*a[5][0] + a[0][3]*a[1][4]*a[2][0]*a[4][2]*a[5][5] - a[0][3]*a[1][4]*a[2][0]*a[4][5]*a[5][2] - a[0][3]*a[1][4]*a[2][2]*a[4][0]*a[5][5] + a[0][3]*a[1][4]*a[2][2]*a[4][5]*a[5][0] + a[0][3]*a[1][4]*a[2][5]*a[4][0]*a[5][2] - a[0][3]*a[1][4]*a[2][5]*a[4][2]*a[5][0] - a[0][3]*a[1][5]*a[2][0]*a[4][2]*a[5][4] + a[0][3]*a[1][5]*a[2][0]*a[4][4]*a[5][2] + a[0][3]*a[1][5]*a[2][2]*a[4][0]*a[5][4] - a[0][3]*a[1][5]*a[2][2]*a[4][4]*a[5][0] - a[0][3]*a[1][5]*a[2][4]*a[4][0]*a[5][2] + a[0][3]*a[1][5]*a[2][4]*a[4][2]*a[5][0] - a[0][4]*a[1][0]*a[2][2]*a[4][3]*a[5][5] + a[0][4]*a[1][0]*a[2][2]*a[4][5]*a[5][3] + a[0][4]*a[1][0]*a[2][3]*a[4][2]*a[5][5] - a[0][4]*a[1][0]*a[2][3]*a[4][5]*a[5][2] - a[0][4]*a[1][0]*a[2][5]*a[4][2]*a[5][3] + a[0][4]*a[1][0]*a[2][5]*a[4][3]*a[5][2] + a[0][4]*a[1][2]*a[2][0]*a[4][3]*a[5][5] - a[0][4]*a[1][2]*a[2][0]*a[4][5]*a[5][3] - a[0][4]*a[1][2]*a[2][3]*a[4][0]*a[5][5] + a[0][4]*a[1][2]*a[2][3]*a[4][5]*a[5][0] + a[0][4]*a[1][2]*a[2][5]*a[4][0]*a[5][3] - a[0][4]*a[1][2]*a[2][5]*a[4][3]*a[5][0] - a[0][4]*a[1][3]*a[2][0]*a[4][2]*a[5][5] + a[0][4]*a[1][3]*a[2][0]*a[4][5]*a[5][2] + a[0][4]*a[1][3]*a[2][2]*a[4][0]*a[5][5] - a[0][4]*a[1][3]*a[2][2]*a[4][5]*a[5][0] - a[0][4]*a[1][3]*a[2][5]*a[4][0]*a[5][2] + a[0][4]*a[1][3]*a[2][5]*a[4][2]*a[5][0] + a[0][4]*a[1][5]*a[2][0]*a[4][2]*a[5][3] - a[0][4]*a[1][5]*a[2][0]*a[4][3]*a[5][2] - a[0][4]*a[1][5]*a[2][2]*a[4][0]*a[5][3] + a[0][4]*a[1][5]*a[2][2]*a[4][3]*a[5][0] + a[0][4]*a[1][5]*a[2][3]*a[4][0]*a[5][2] - a[0][4]*a[1][5]*a[2][3]*a[4][2]*a[5][0] + a[0][5]*a[1][0]*a[2][2]*a[4][3]*a[5][4] - a[0][5]*a[1][0]*a[2][2]*a[4][4]*a[5][3] - a[0][5]*a[1][0]*a[2][3]*a[4][2]*a[5][4] + a[0][5]*a[1][0]*a[2][3]*a[4][4]*a[5][2] + a[0][5]*a[1][0]*a[2][4]*a[4][2]*a[5][3] - a[0][5]*a[1][0]*a[2][4]*a[4][3]*a[5][2] - a[0][5]*a[1][2]*a[2][0]*a[4][3]*a[5][4] + a[0][5]*a[1][2]*a[2][0]*a[4][4]*a[5][3] + a[0][5]*a[1][2]*a[2][3]*a[4][0]*a[5][4] - a[0][5]*a[1][2]*a[2][3]*a[4][4]*a[5][0] - a[0][5]*a[1][2]*a[2][4]*a[4][0]*a[5][3] + a[0][5]*a[1][2]*a[2][4]*a[4][3]*a[5][0] + a[0][5]*a[1][3]*a[2][0]*a[4][2]*a[5][4] - a[0][5]*a[1][3]*a[2][0]*a[4][4]*a[5][2] - a[0][5]*a[1][3]*a[2][2]*a[4][0]*a[5][4] + a[0][5]*a[1][3]*a[2][2]*a[4][4]*a[5][0] + a[0][5]*a[1][3]*a[2][4]*a[4][0]*a[5][2] - a[0][5]*a[1][3]*a[2][4]*a[4][2]*a[5][0] - a[0][5]*a[1][4]*a[2][0]*a[4][2]*a[5][3] + a[0][5]*a[1][4]*a[2][0]*a[4][3]*a[5][2] + a[0][5]*a[1][4]*a[2][2]*a[4][0]*a[5][3] - a[0][5]*a[1][4]*a[2][2]*a[4][3]*a[5][0] - a[0][5]*a[1][4]*a[2][3]*a[4][0]*a[5][2] + a[0][5]*a[1][4]*a[2][3]*a[4][2]*a[5][0])/denom;
invA[2][3] = -(a[0][0]*a[1][1]*a[2][3]*a[4][4]*a[5][5] - a[0][0]*a[1][1]*a[2][3]*a[4][5]*a[5][4] - a[0][0]*a[1][1]*a[2][4]*a[4][3]*a[5][5] + a[0][0]*a[1][1]*a[2][4]*a[4][5]*a[5][3] + a[0][0]*a[1][1]*a[2][5]*a[4][3]*a[5][4] - a[0][0]*a[1][1]*a[2][5]*a[4][4]*a[5][3] - a[0][0]*a[1][3]*a[2][1]*a[4][4]*a[5][5] + a[0][0]*a[1][3]*a[2][1]*a[4][5]*a[5][4] + a[0][0]*a[1][3]*a[2][4]*a[4][1]*a[5][5] - a[0][0]*a[1][3]*a[2][4]*a[4][5]*a[5][1] - a[0][0]*a[1][3]*a[2][5]*a[4][1]*a[5][4] + a[0][0]*a[1][3]*a[2][5]*a[4][4]*a[5][1] + a[0][0]*a[1][4]*a[2][1]*a[4][3]*a[5][5] - a[0][0]*a[1][4]*a[2][1]*a[4][5]*a[5][3] - a[0][0]*a[1][4]*a[2][3]*a[4][1]*a[5][5] + a[0][0]*a[1][4]*a[2][3]*a[4][5]*a[5][1] + a[0][0]*a[1][4]*a[2][5]*a[4][1]*a[5][3] - a[0][0]*a[1][4]*a[2][5]*a[4][3]*a[5][1] - a[0][0]*a[1][5]*a[2][1]*a[4][3]*a[5][4] + a[0][0]*a[1][5]*a[2][1]*a[4][4]*a[5][3] + a[0][0]*a[1][5]*a[2][3]*a[4][1]*a[5][4] - a[0][0]*a[1][5]*a[2][3]*a[4][4]*a[5][1] - a[0][0]*a[1][5]*a[2][4]*a[4][1]*a[5][3] + a[0][0]*a[1][5]*a[2][4]*a[4][3]*a[5][1] - a[0][1]*a[1][0]*a[2][3]*a[4][4]*a[5][5] + a[0][1]*a[1][0]*a[2][3]*a[4][5]*a[5][4] + a[0][1]*a[1][0]*a[2][4]*a[4][3]*a[5][5] - a[0][1]*a[1][0]*a[2][4]*a[4][5]*a[5][3] - a[0][1]*a[1][0]*a[2][5]*a[4][3]*a[5][4] + a[0][1]*a[1][0]*a[2][5]*a[4][4]*a[5][3] + a[0][1]*a[1][3]*a[2][0]*a[4][4]*a[5][5] - a[0][1]*a[1][3]*a[2][0]*a[4][5]*a[5][4] - a[0][1]*a[1][3]*a[2][4]*a[4][0]*a[5][5] + a[0][1]*a[1][3]*a[2][4]*a[4][5]*a[5][0] + a[0][1]*a[1][3]*a[2][5]*a[4][0]*a[5][4] - a[0][1]*a[1][3]*a[2][5]*a[4][4]*a[5][0] - a[0][1]*a[1][4]*a[2][0]*a[4][3]*a[5][5] + a[0][1]*a[1][4]*a[2][0]*a[4][5]*a[5][3] + a[0][1]*a[1][4]*a[2][3]*a[4][0]*a[5][5] - a[0][1]*a[1][4]*a[2][3]*a[4][5]*a[5][0] - a[0][1]*a[1][4]*a[2][5]*a[4][0]*a[5][3] + a[0][1]*a[1][4]*a[2][5]*a[4][3]*a[5][0] + a[0][1]*a[1][5]*a[2][0]*a[4][3]*a[5][4] - a[0][1]*a[1][5]*a[2][0]*a[4][4]*a[5][3] - a[0][1]*a[1][5]*a[2][3]*a[4][0]*a[5][4] + a[0][1]*a[1][5]*a[2][3]*a[4][4]*a[5][0] + a[0][1]*a[1][5]*a[2][4]*a[4][0]*a[5][3] - a[0][1]*a[1][5]*a[2][4]*a[4][3]*a[5][0] + a[0][3]*a[1][0]*a[2][1]*a[4][4]*a[5][5] - a[0][3]*a[1][0]*a[2][1]*a[4][5]*a[5][4] - a[0][3]*a[1][0]*a[2][4]*a[4][1]*a[5][5] + a[0][3]*a[1][0]*a[2][4]*a[4][5]*a[5][1] + a[0][3]*a[1][0]*a[2][5]*a[4][1]*a[5][4] - a[0][3]*a[1][0]*a[2][5]*a[4][4]*a[5][1] - a[0][3]*a[1][1]*a[2][0]*a[4][4]*a[5][5] + a[0][3]*a[1][1]*a[2][0]*a[4][5]*a[5][4] + a[0][3]*a[1][1]*a[2][4]*a[4][0]*a[5][5] - a[0][3]*a[1][1]*a[2][4]*a[4][5]*a[5][0] - a[0][3]*a[1][1]*a[2][5]*a[4][0]*a[5][4] + a[0][3]*a[1][1]*a[2][5]*a[4][4]*a[5][0] + a[0][3]*a[1][4]*a[2][0]*a[4][1]*a[5][5] - a[0][3]*a[1][4]*a[2][0]*a[4][5]*a[5][1] - a[0][3]*a[1][4]*a[2][1]*a[4][0]*a[5][5] + a[0][3]*a[1][4]*a[2][1]*a[4][5]*a[5][0] + a[0][3]*a[1][4]*a[2][5]*a[4][0]*a[5][1] - a[0][3]*a[1][4]*a[2][5]*a[4][1]*a[5][0] - a[0][3]*a[1][5]*a[2][0]*a[4][1]*a[5][4] + a[0][3]*a[1][5]*a[2][0]*a[4][4]*a[5][1] + a[0][3]*a[1][5]*a[2][1]*a[4][0]*a[5][4] - a[0][3]*a[1][5]*a[2][1]*a[4][4]*a[5][0] - a[0][3]*a[1][5]*a[2][4]*a[4][0]*a[5][1] + a[0][3]*a[1][5]*a[2][4]*a[4][1]*a[5][0] - a[0][4]*a[1][0]*a[2][1]*a[4][3]*a[5][5] + a[0][4]*a[1][0]*a[2][1]*a[4][5]*a[5][3] + a[0][4]*a[1][0]*a[2][3]*a[4][1]*a[5][5] - a[0][4]*a[1][0]*a[2][3]*a[4][5]*a[5][1] - a[0][4]*a[1][0]*a[2][5]*a[4][1]*a[5][3] + a[0][4]*a[1][0]*a[2][5]*a[4][3]*a[5][1] + a[0][4]*a[1][1]*a[2][0]*a[4][3]*a[5][5] - a[0][4]*a[1][1]*a[2][0]*a[4][5]*a[5][3] - a[0][4]*a[1][1]*a[2][3]*a[4][0]*a[5][5] + a[0][4]*a[1][1]*a[2][3]*a[4][5]*a[5][0] + a[0][4]*a[1][1]*a[2][5]*a[4][0]*a[5][3] - a[0][4]*a[1][1]*a[2][5]*a[4][3]*a[5][0] - a[0][4]*a[1][3]*a[2][0]*a[4][1]*a[5][5] + a[0][4]*a[1][3]*a[2][0]*a[4][5]*a[5][1] + a[0][4]*a[1][3]*a[2][1]*a[4][0]*a[5][5] - a[0][4]*a[1][3]*a[2][1]*a[4][5]*a[5][0] - a[0][4]*a[1][3]*a[2][5]*a[4][0]*a[5][1] + a[0][4]*a[1][3]*a[2][5]*a[4][1]*a[5][0] + a[0][4]*a[1][5]*a[2][0]*a[4][1]*a[5][3] - a[0][4]*a[1][5]*a[2][0]*a[4][3]*a[5][1] - a[0][4]*a[1][5]*a[2][1]*a[4][0]*a[5][3] + a[0][4]*a[1][5]*a[2][1]*a[4][3]*a[5][0] + a[0][4]*a[1][5]*a[2][3]*a[4][0]*a[5][1] - a[0][4]*a[1][5]*a[2][3]*a[4][1]*a[5][0] + a[0][5]*a[1][0]*a[2][1]*a[4][3]*a[5][4] - a[0][5]*a[1][0]*a[2][1]*a[4][4]*a[5][3] - a[0][5]*a[1][0]*a[2][3]*a[4][1]*a[5][4] + a[0][5]*a[1][0]*a[2][3]*a[4][4]*a[5][1] + a[0][5]*a[1][0]*a[2][4]*a[4][1]*a[5][3] - a[0][5]*a[1][0]*a[2][4]*a[4][3]*a[5][1] - a[0][5]*a[1][1]*a[2][0]*a[4][3]*a[5][4] + a[0][5]*a[1][1]*a[2][0]*a[4][4]*a[5][3] + a[0][5]*a[1][1]*a[2][3]*a[4][0]*a[5][4] - a[0][5]*a[1][1]*a[2][3]*a[4][4]*a[5][0] - a[0][5]*a[1][1]*a[2][4]*a[4][0]*a[5][3] + a[0][5]*a[1][1]*a[2][4]*a[4][3]*a[5][0] + a[0][5]*a[1][3]*a[2][0]*a[4][1]*a[5][4] - a[0][5]*a[1][3]*a[2][0]*a[4][4]*a[5][1] - a[0][5]*a[1][3]*a[2][1]*a[4][0]*a[5][4] + a[0][5]*a[1][3]*a[2][1]*a[4][4]*a[5][0] + a[0][5]*a[1][3]*a[2][4]*a[4][0]*a[5][1] - a[0][5]*a[1][3]*a[2][4]*a[4][1]*a[5][0] - a[0][5]*a[1][4]*a[2][0]*a[4][1]*a[5][3] + a[0][5]*a[1][4]*a[2][0]*a[4][3]*a[5][1] + a[0][5]*a[1][4]*a[2][1]*a[4][0]*a[5][3] - a[0][5]*a[1][4]*a[2][1]*a[4][3]*a[5][0] - a[0][5]*a[1][4]*a[2][3]*a[4][0]*a[5][1] + a[0][5]*a[1][4]*a[2][3]*a[4][1]*a[5][0])/denom;
invA[3][3] = (a[0][0]*a[1][1]*a[2][2]*a[4][4]*a[5][5] - a[0][0]*a[1][1]*a[2][2]*a[4][5]*a[5][4] - a[0][0]*a[1][1]*a[2][4]*a[4][2]*a[5][5] + a[0][0]*a[1][1]*a[2][4]*a[4][5]*a[5][2] + a[0][0]*a[1][1]*a[2][5]*a[4][2]*a[5][4] - a[0][0]*a[1][1]*a[2][5]*a[4][4]*a[5][2] - a[0][0]*a[1][2]*a[2][1]*a[4][4]*a[5][5] + a[0][0]*a[1][2]*a[2][1]*a[4][5]*a[5][4] + a[0][0]*a[1][2]*a[2][4]*a[4][1]*a[5][5] - a[0][0]*a[1][2]*a[2][4]*a[4][5]*a[5][1] - a[0][0]*a[1][2]*a[2][5]*a[4][1]*a[5][4] + a[0][0]*a[1][2]*a[2][5]*a[4][4]*a[5][1] + a[0][0]*a[1][4]*a[2][1]*a[4][2]*a[5][5] - a[0][0]*a[1][4]*a[2][1]*a[4][5]*a[5][2] - a[0][0]*a[1][4]*a[2][2]*a[4][1]*a[5][5] + a[0][0]*a[1][4]*a[2][2]*a[4][5]*a[5][1] + a[0][0]*a[1][4]*a[2][5]*a[4][1]*a[5][2] - a[0][0]*a[1][4]*a[2][5]*a[4][2]*a[5][1] - a[0][0]*a[1][5]*a[2][1]*a[4][2]*a[5][4] + a[0][0]*a[1][5]*a[2][1]*a[4][4]*a[5][2] + a[0][0]*a[1][5]*a[2][2]*a[4][1]*a[5][4] - a[0][0]*a[1][5]*a[2][2]*a[4][4]*a[5][1] - a[0][0]*a[1][5]*a[2][4]*a[4][1]*a[5][2] + a[0][0]*a[1][5]*a[2][4]*a[4][2]*a[5][1] - a[0][1]*a[1][0]*a[2][2]*a[4][4]*a[5][5] + a[0][1]*a[1][0]*a[2][2]*a[4][5]*a[5][4] + a[0][1]*a[1][0]*a[2][4]*a[4][2]*a[5][5] - a[0][1]*a[1][0]*a[2][4]*a[4][5]*a[5][2] - a[0][1]*a[1][0]*a[2][5]*a[4][2]*a[5][4] + a[0][1]*a[1][0]*a[2][5]*a[4][4]*a[5][2] + a[0][1]*a[1][2]*a[2][0]*a[4][4]*a[5][5] - a[0][1]*a[1][2]*a[2][0]*a[4][5]*a[5][4] - a[0][1]*a[1][2]*a[2][4]*a[4][0]*a[5][5] + a[0][1]*a[1][2]*a[2][4]*a[4][5]*a[5][0] + a[0][1]*a[1][2]*a[2][5]*a[4][0]*a[5][4] - a[0][1]*a[1][2]*a[2][5]*a[4][4]*a[5][0] - a[0][1]*a[1][4]*a[2][0]*a[4][2]*a[5][5] + a[0][1]*a[1][4]*a[2][0]*a[4][5]*a[5][2] + a[0][1]*a[1][4]*a[2][2]*a[4][0]*a[5][5] - a[0][1]*a[1][4]*a[2][2]*a[4][5]*a[5][0] - a[0][1]*a[1][4]*a[2][5]*a[4][0]*a[5][2] + a[0][1]*a[1][4]*a[2][5]*a[4][2]*a[5][0] + a[0][1]*a[1][5]*a[2][0]*a[4][2]*a[5][4] - a[0][1]*a[1][5]*a[2][0]*a[4][4]*a[5][2] - a[0][1]*a[1][5]*a[2][2]*a[4][0]*a[5][4] + a[0][1]*a[1][5]*a[2][2]*a[4][4]*a[5][0] + a[0][1]*a[1][5]*a[2][4]*a[4][0]*a[5][2] - a[0][1]*a[1][5]*a[2][4]*a[4][2]*a[5][0] + a[0][2]*a[1][0]*a[2][1]*a[4][4]*a[5][5] - a[0][2]*a[1][0]*a[2][1]*a[4][5]*a[5][4] - a[0][2]*a[1][0]*a[2][4]*a[4][1]*a[5][5] + a[0][2]*a[1][0]*a[2][4]*a[4][5]*a[5][1] + a[0][2]*a[1][0]*a[2][5]*a[4][1]*a[5][4] - a[0][2]*a[1][0]*a[2][5]*a[4][4]*a[5][1] - a[0][2]*a[1][1]*a[2][0]*a[4][4]*a[5][5] + a[0][2]*a[1][1]*a[2][0]*a[4][5]*a[5][4] + a[0][2]*a[1][1]*a[2][4]*a[4][0]*a[5][5] - a[0][2]*a[1][1]*a[2][4]*a[4][5]*a[5][0] - a[0][2]*a[1][1]*a[2][5]*a[4][0]*a[5][4] + a[0][2]*a[1][1]*a[2][5]*a[4][4]*a[5][0] + a[0][2]*a[1][4]*a[2][0]*a[4][1]*a[5][5] - a[0][2]*a[1][4]*a[2][0]*a[4][5]*a[5][1] - a[0][2]*a[1][4]*a[2][1]*a[4][0]*a[5][5] + a[0][2]*a[1][4]*a[2][1]*a[4][5]*a[5][0] + a[0][2]*a[1][4]*a[2][5]*a[4][0]*a[5][1] - a[0][2]*a[1][4]*a[2][5]*a[4][1]*a[5][0] - a[0][2]*a[1][5]*a[2][0]*a[4][1]*a[5][4] + a[0][2]*a[1][5]*a[2][0]*a[4][4]*a[5][1] + a[0][2]*a[1][5]*a[2][1]*a[4][0]*a[5][4] - a[0][2]*a[1][5]*a[2][1]*a[4][4]*a[5][0] - a[0][2]*a[1][5]*a[2][4]*a[4][0]*a[5][1] + a[0][2]*a[1][5]*a[2][4]*a[4][1]*a[5][0] - a[0][4]*a[1][0]*a[2][1]*a[4][2]*a[5][5] + a[0][4]*a[1][0]*a[2][1]*a[4][5]*a[5][2] + a[0][4]*a[1][0]*a[2][2]*a[4][1]*a[5][5] - a[0][4]*a[1][0]*a[2][2]*a[4][5]*a[5][1] - a[0][4]*a[1][0]*a[2][5]*a[4][1]*a[5][2] + a[0][4]*a[1][0]*a[2][5]*a[4][2]*a[5][1] + a[0][4]*a[1][1]*a[2][0]*a[4][2]*a[5][5] - a[0][4]*a[1][1]*a[2][0]*a[4][5]*a[5][2] - a[0][4]*a[1][1]*a[2][2]*a[4][0]*a[5][5] + a[0][4]*a[1][1]*a[2][2]*a[4][5]*a[5][0] + a[0][4]*a[1][1]*a[2][5]*a[4][0]*a[5][2] - a[0][4]*a[1][1]*a[2][5]*a[4][2]*a[5][0] - a[0][4]*a[1][2]*a[2][0]*a[4][1]*a[5][5] + a[0][4]*a[1][2]*a[2][0]*a[4][5]*a[5][1] + a[0][4]*a[1][2]*a[2][1]*a[4][0]*a[5][5] - a[0][4]*a[1][2]*a[2][1]*a[4][5]*a[5][0] - a[0][4]*a[1][2]*a[2][5]*a[4][0]*a[5][1] + a[0][4]*a[1][2]*a[2][5]*a[4][1]*a[5][0] + a[0][4]*a[1][5]*a[2][0]*a[4][1]*a[5][2] - a[0][4]*a[1][5]*a[2][0]*a[4][2]*a[5][1] - a[0][4]*a[1][5]*a[2][1]*a[4][0]*a[5][2] + a[0][4]*a[1][5]*a[2][1]*a[4][2]*a[5][0] + a[0][4]*a[1][5]*a[2][2]*a[4][0]*a[5][1] - a[0][4]*a[1][5]*a[2][2]*a[4][1]*a[5][0] + a[0][5]*a[1][0]*a[2][1]*a[4][2]*a[5][4] - a[0][5]*a[1][0]*a[2][1]*a[4][4]*a[5][2] - a[0][5]*a[1][0]*a[2][2]*a[4][1]*a[5][4] + a[0][5]*a[1][0]*a[2][2]*a[4][4]*a[5][1] + a[0][5]*a[1][0]*a[2][4]*a[4][1]*a[5][2] - a[0][5]*a[1][0]*a[2][4]*a[4][2]*a[5][1] - a[0][5]*a[1][1]*a[2][0]*a[4][2]*a[5][4] + a[0][5]*a[1][1]*a[2][0]*a[4][4]*a[5][2] + a[0][5]*a[1][1]*a[2][2]*a[4][0]*a[5][4] - a[0][5]*a[1][1]*a[2][2]*a[4][4]*a[5][0] - a[0][5]*a[1][1]*a[2][4]*a[4][0]*a[5][2] + a[0][5]*a[1][1]*a[2][4]*a[4][2]*a[5][0] + a[0][5]*a[1][2]*a[2][0]*a[4][1]*a[5][4] - a[0][5]*a[1][2]*a[2][0]*a[4][4]*a[5][1] - a[0][5]*a[1][2]*a[2][1]*a[4][0]*a[5][4] + a[0][5]*a[1][2]*a[2][1]*a[4][4]*a[5][0] + a[0][5]*a[1][2]*a[2][4]*a[4][0]*a[5][1] - a[0][5]*a[1][2]*a[2][4]*a[4][1]*a[5][0] - a[0][5]*a[1][4]*a[2][0]*a[4][1]*a[5][2] + a[0][5]*a[1][4]*a[2][0]*a[4][2]*a[5][1] + a[0][5]*a[1][4]*a[2][1]*a[4][0]*a[5][2] - a[0][5]*a[1][4]*a[2][1]*a[4][2]*a[5][0] - a[0][5]*a[1][4]*a[2][2]*a[4][0]*a[5][1] + a[0][5]*a[1][4]*a[2][2]*a[4][1]*a[5][0])/denom;
invA[4][3] = -(a[0][0]*a[1][1]*a[2][2]*a[4][3]*a[5][5] - a[0][0]*a[1][1]*a[2][2]*a[4][5]*a[5][3] - a[0][0]*a[1][1]*a[2][3]*a[4][2]*a[5][5] + a[0][0]*a[1][1]*a[2][3]*a[4][5]*a[5][2] + a[0][0]*a[1][1]*a[2][5]*a[4][2]*a[5][3] - a[0][0]*a[1][1]*a[2][5]*a[4][3]*a[5][2] - a[0][0]*a[1][2]*a[2][1]*a[4][3]*a[5][5] + a[0][0]*a[1][2]*a[2][1]*a[4][5]*a[5][3] + a[0][0]*a[1][2]*a[2][3]*a[4][1]*a[5][5] - a[0][0]*a[1][2]*a[2][3]*a[4][5]*a[5][1] - a[0][0]*a[1][2]*a[2][5]*a[4][1]*a[5][3] + a[0][0]*a[1][2]*a[2][5]*a[4][3]*a[5][1] + a[0][0]*a[1][3]*a[2][1]*a[4][2]*a[5][5] - a[0][0]*a[1][3]*a[2][1]*a[4][5]*a[5][2] - a[0][0]*a[1][3]*a[2][2]*a[4][1]*a[5][5] + a[0][0]*a[1][3]*a[2][2]*a[4][5]*a[5][1] + a[0][0]*a[1][3]*a[2][5]*a[4][1]*a[5][2] - a[0][0]*a[1][3]*a[2][5]*a[4][2]*a[5][1] - a[0][0]*a[1][5]*a[2][1]*a[4][2]*a[5][3] + a[0][0]*a[1][5]*a[2][1]*a[4][3]*a[5][2] + a[0][0]*a[1][5]*a[2][2]*a[4][1]*a[5][3] - a[0][0]*a[1][5]*a[2][2]*a[4][3]*a[5][1] - a[0][0]*a[1][5]*a[2][3]*a[4][1]*a[5][2] + a[0][0]*a[1][5]*a[2][3]*a[4][2]*a[5][1] - a[0][1]*a[1][0]*a[2][2]*a[4][3]*a[5][5] + a[0][1]*a[1][0]*a[2][2]*a[4][5]*a[5][3] + a[0][1]*a[1][0]*a[2][3]*a[4][2]*a[5][5] - a[0][1]*a[1][0]*a[2][3]*a[4][5]*a[5][2] - a[0][1]*a[1][0]*a[2][5]*a[4][2]*a[5][3] + a[0][1]*a[1][0]*a[2][5]*a[4][3]*a[5][2] + a[0][1]*a[1][2]*a[2][0]*a[4][3]*a[5][5] - a[0][1]*a[1][2]*a[2][0]*a[4][5]*a[5][3] - a[0][1]*a[1][2]*a[2][3]*a[4][0]*a[5][5] + a[0][1]*a[1][2]*a[2][3]*a[4][5]*a[5][0] + a[0][1]*a[1][2]*a[2][5]*a[4][0]*a[5][3] - a[0][1]*a[1][2]*a[2][5]*a[4][3]*a[5][0] - a[0][1]*a[1][3]*a[2][0]*a[4][2]*a[5][5] + a[0][1]*a[1][3]*a[2][0]*a[4][5]*a[5][2] + a[0][1]*a[1][3]*a[2][2]*a[4][0]*a[5][5] - a[0][1]*a[1][3]*a[2][2]*a[4][5]*a[5][0] - a[0][1]*a[1][3]*a[2][5]*a[4][0]*a[5][2] + a[0][1]*a[1][3]*a[2][5]*a[4][2]*a[5][0] + a[0][1]*a[1][5]*a[2][0]*a[4][2]*a[5][3] - a[0][1]*a[1][5]*a[2][0]*a[4][3]*a[5][2] - a[0][1]*a[1][5]*a[2][2]*a[4][0]*a[5][3] + a[0][1]*a[1][5]*a[2][2]*a[4][3]*a[5][0] + a[0][1]*a[1][5]*a[2][3]*a[4][0]*a[5][2] - a[0][1]*a[1][5]*a[2][3]*a[4][2]*a[5][0] + a[0][2]*a[1][0]*a[2][1]*a[4][3]*a[5][5] - a[0][2]*a[1][0]*a[2][1]*a[4][5]*a[5][3] - a[0][2]*a[1][0]*a[2][3]*a[4][1]*a[5][5] + a[0][2]*a[1][0]*a[2][3]*a[4][5]*a[5][1] + a[0][2]*a[1][0]*a[2][5]*a[4][1]*a[5][3] - a[0][2]*a[1][0]*a[2][5]*a[4][3]*a[5][1] - a[0][2]*a[1][1]*a[2][0]*a[4][3]*a[5][5] + a[0][2]*a[1][1]*a[2][0]*a[4][5]*a[5][3] + a[0][2]*a[1][1]*a[2][3]*a[4][0]*a[5][5] - a[0][2]*a[1][1]*a[2][3]*a[4][5]*a[5][0] - a[0][2]*a[1][1]*a[2][5]*a[4][0]*a[5][3] + a[0][2]*a[1][1]*a[2][5]*a[4][3]*a[5][0] + a[0][2]*a[1][3]*a[2][0]*a[4][1]*a[5][5] - a[0][2]*a[1][3]*a[2][0]*a[4][5]*a[5][1] - a[0][2]*a[1][3]*a[2][1]*a[4][0]*a[5][5] + a[0][2]*a[1][3]*a[2][1]*a[4][5]*a[5][0] + a[0][2]*a[1][3]*a[2][5]*a[4][0]*a[5][1] - a[0][2]*a[1][3]*a[2][5]*a[4][1]*a[5][0] - a[0][2]*a[1][5]*a[2][0]*a[4][1]*a[5][3] + a[0][2]*a[1][5]*a[2][0]*a[4][3]*a[5][1] + a[0][2]*a[1][5]*a[2][1]*a[4][0]*a[5][3] - a[0][2]*a[1][5]*a[2][1]*a[4][3]*a[5][0] - a[0][2]*a[1][5]*a[2][3]*a[4][0]*a[5][1] + a[0][2]*a[1][5]*a[2][3]*a[4][1]*a[5][0] - a[0][3]*a[1][0]*a[2][1]*a[4][2]*a[5][5] + a[0][3]*a[1][0]*a[2][1]*a[4][5]*a[5][2] + a[0][3]*a[1][0]*a[2][2]*a[4][1]*a[5][5] - a[0][3]*a[1][0]*a[2][2]*a[4][5]*a[5][1] - a[0][3]*a[1][0]*a[2][5]*a[4][1]*a[5][2] + a[0][3]*a[1][0]*a[2][5]*a[4][2]*a[5][1] + a[0][3]*a[1][1]*a[2][0]*a[4][2]*a[5][5] - a[0][3]*a[1][1]*a[2][0]*a[4][5]*a[5][2] - a[0][3]*a[1][1]*a[2][2]*a[4][0]*a[5][5] + a[0][3]*a[1][1]*a[2][2]*a[4][5]*a[5][0] + a[0][3]*a[1][1]*a[2][5]*a[4][0]*a[5][2] - a[0][3]*a[1][1]*a[2][5]*a[4][2]*a[5][0] - a[0][3]*a[1][2]*a[2][0]*a[4][1]*a[5][5] + a[0][3]*a[1][2]*a[2][0]*a[4][5]*a[5][1] + a[0][3]*a[1][2]*a[2][1]*a[4][0]*a[5][5] - a[0][3]*a[1][2]*a[2][1]*a[4][5]*a[5][0] - a[0][3]*a[1][2]*a[2][5]*a[4][0]*a[5][1] + a[0][3]*a[1][2]*a[2][5]*a[4][1]*a[5][0] + a[0][3]*a[1][5]*a[2][0]*a[4][1]*a[5][2] - a[0][3]*a[1][5]*a[2][0]*a[4][2]*a[5][1] - a[0][3]*a[1][5]*a[2][1]*a[4][0]*a[5][2] + a[0][3]*a[1][5]*a[2][1]*a[4][2]*a[5][0] + a[0][3]*a[1][5]*a[2][2]*a[4][0]*a[5][1] - a[0][3]*a[1][5]*a[2][2]*a[4][1]*a[5][0] + a[0][5]*a[1][0]*a[2][1]*a[4][2]*a[5][3] - a[0][5]*a[1][0]*a[2][1]*a[4][3]*a[5][2] - a[0][5]*a[1][0]*a[2][2]*a[4][1]*a[5][3] + a[0][5]*a[1][0]*a[2][2]*a[4][3]*a[5][1] + a[0][5]*a[1][0]*a[2][3]*a[4][1]*a[5][2] - a[0][5]*a[1][0]*a[2][3]*a[4][2]*a[5][1] - a[0][5]*a[1][1]*a[2][0]*a[4][2]*a[5][3] + a[0][5]*a[1][1]*a[2][0]*a[4][3]*a[5][2] + a[0][5]*a[1][1]*a[2][2]*a[4][0]*a[5][3] - a[0][5]*a[1][1]*a[2][2]*a[4][3]*a[5][0] - a[0][5]*a[1][1]*a[2][3]*a[4][0]*a[5][2] + a[0][5]*a[1][1]*a[2][3]*a[4][2]*a[5][0] + a[0][5]*a[1][2]*a[2][0]*a[4][1]*a[5][3] - a[0][5]*a[1][2]*a[2][0]*a[4][3]*a[5][1] - a[0][5]*a[1][2]*a[2][1]*a[4][0]*a[5][3] + a[0][5]*a[1][2]*a[2][1]*a[4][3]*a[5][0] + a[0][5]*a[1][2]*a[2][3]*a[4][0]*a[5][1] - a[0][5]*a[1][2]*a[2][3]*a[4][1]*a[5][0] - a[0][5]*a[1][3]*a[2][0]*a[4][1]*a[5][2] + a[0][5]*a[1][3]*a[2][0]*a[4][2]*a[5][1] + a[0][5]*a[1][3]*a[2][1]*a[4][0]*a[5][2] - a[0][5]*a[1][3]*a[2][1]*a[4][2]*a[5][0] - a[0][5]*a[1][3]*a[2][2]*a[4][0]*a[5][1] + a[0][5]*a[1][3]*a[2][2]*a[4][1]*a[5][0])/denom;
invA[5][3] = (a[0][0]*a[1][1]*a[2][2]*a[4][3]*a[5][4] - a[0][0]*a[1][1]*a[2][2]*a[4][4]*a[5][3] - a[0][0]*a[1][1]*a[2][3]*a[4][2]*a[5][4] + a[0][0]*a[1][1]*a[2][3]*a[4][4]*a[5][2] + a[0][0]*a[1][1]*a[2][4]*a[4][2]*a[5][3] - a[0][0]*a[1][1]*a[2][4]*a[4][3]*a[5][2] - a[0][0]*a[1][2]*a[2][1]*a[4][3]*a[5][4] + a[0][0]*a[1][2]*a[2][1]*a[4][4]*a[5][3] + a[0][0]*a[1][2]*a[2][3]*a[4][1]*a[5][4] - a[0][0]*a[1][2]*a[2][3]*a[4][4]*a[5][1] - a[0][0]*a[1][2]*a[2][4]*a[4][1]*a[5][3] + a[0][0]*a[1][2]*a[2][4]*a[4][3]*a[5][1] + a[0][0]*a[1][3]*a[2][1]*a[4][2]*a[5][4] - a[0][0]*a[1][3]*a[2][1]*a[4][4]*a[5][2] - a[0][0]*a[1][3]*a[2][2]*a[4][1]*a[5][4] + a[0][0]*a[1][3]*a[2][2]*a[4][4]*a[5][1] + a[0][0]*a[1][3]*a[2][4]*a[4][1]*a[5][2] - a[0][0]*a[1][3]*a[2][4]*a[4][2]*a[5][1] - a[0][0]*a[1][4]*a[2][1]*a[4][2]*a[5][3] + a[0][0]*a[1][4]*a[2][1]*a[4][3]*a[5][2] + a[0][0]*a[1][4]*a[2][2]*a[4][1]*a[5][3] - a[0][0]*a[1][4]*a[2][2]*a[4][3]*a[5][1] - a[0][0]*a[1][4]*a[2][3]*a[4][1]*a[5][2] + a[0][0]*a[1][4]*a[2][3]*a[4][2]*a[5][1] - a[0][1]*a[1][0]*a[2][2]*a[4][3]*a[5][4] + a[0][1]*a[1][0]*a[2][2]*a[4][4]*a[5][3] + a[0][1]*a[1][0]*a[2][3]*a[4][2]*a[5][4] - a[0][1]*a[1][0]*a[2][3]*a[4][4]*a[5][2] - a[0][1]*a[1][0]*a[2][4]*a[4][2]*a[5][3] + a[0][1]*a[1][0]*a[2][4]*a[4][3]*a[5][2] + a[0][1]*a[1][2]*a[2][0]*a[4][3]*a[5][4] - a[0][1]*a[1][2]*a[2][0]*a[4][4]*a[5][3] - a[0][1]*a[1][2]*a[2][3]*a[4][0]*a[5][4] + a[0][1]*a[1][2]*a[2][3]*a[4][4]*a[5][0] + a[0][1]*a[1][2]*a[2][4]*a[4][0]*a[5][3] - a[0][1]*a[1][2]*a[2][4]*a[4][3]*a[5][0] - a[0][1]*a[1][3]*a[2][0]*a[4][2]*a[5][4] + a[0][1]*a[1][3]*a[2][0]*a[4][4]*a[5][2] + a[0][1]*a[1][3]*a[2][2]*a[4][0]*a[5][4] - a[0][1]*a[1][3]*a[2][2]*a[4][4]*a[5][0] - a[0][1]*a[1][3]*a[2][4]*a[4][0]*a[5][2] + a[0][1]*a[1][3]*a[2][4]*a[4][2]*a[5][0] + a[0][1]*a[1][4]*a[2][0]*a[4][2]*a[5][3] - a[0][1]*a[1][4]*a[2][0]*a[4][3]*a[5][2] - a[0][1]*a[1][4]*a[2][2]*a[4][0]*a[5][3] + a[0][1]*a[1][4]*a[2][2]*a[4][3]*a[5][0] + a[0][1]*a[1][4]*a[2][3]*a[4][0]*a[5][2] - a[0][1]*a[1][4]*a[2][3]*a[4][2]*a[5][0] + a[0][2]*a[1][0]*a[2][1]*a[4][3]*a[5][4] - a[0][2]*a[1][0]*a[2][1]*a[4][4]*a[5][3] - a[0][2]*a[1][0]*a[2][3]*a[4][1]*a[5][4] + a[0][2]*a[1][0]*a[2][3]*a[4][4]*a[5][1] + a[0][2]*a[1][0]*a[2][4]*a[4][1]*a[5][3] - a[0][2]*a[1][0]*a[2][4]*a[4][3]*a[5][1] - a[0][2]*a[1][1]*a[2][0]*a[4][3]*a[5][4] + a[0][2]*a[1][1]*a[2][0]*a[4][4]*a[5][3] + a[0][2]*a[1][1]*a[2][3]*a[4][0]*a[5][4] - a[0][2]*a[1][1]*a[2][3]*a[4][4]*a[5][0] - a[0][2]*a[1][1]*a[2][4]*a[4][0]*a[5][3] + a[0][2]*a[1][1]*a[2][4]*a[4][3]*a[5][0] + a[0][2]*a[1][3]*a[2][0]*a[4][1]*a[5][4] - a[0][2]*a[1][3]*a[2][0]*a[4][4]*a[5][1] - a[0][2]*a[1][3]*a[2][1]*a[4][0]*a[5][4] + a[0][2]*a[1][3]*a[2][1]*a[4][4]*a[5][0] + a[0][2]*a[1][3]*a[2][4]*a[4][0]*a[5][1] - a[0][2]*a[1][3]*a[2][4]*a[4][1]*a[5][0] - a[0][2]*a[1][4]*a[2][0]*a[4][1]*a[5][3] + a[0][2]*a[1][4]*a[2][0]*a[4][3]*a[5][1] + a[0][2]*a[1][4]*a[2][1]*a[4][0]*a[5][3] - a[0][2]*a[1][4]*a[2][1]*a[4][3]*a[5][0] - a[0][2]*a[1][4]*a[2][3]*a[4][0]*a[5][1] + a[0][2]*a[1][4]*a[2][3]*a[4][1]*a[5][0] - a[0][3]*a[1][0]*a[2][1]*a[4][2]*a[5][4] + a[0][3]*a[1][0]*a[2][1]*a[4][4]*a[5][2] + a[0][3]*a[1][0]*a[2][2]*a[4][1]*a[5][4] - a[0][3]*a[1][0]*a[2][2]*a[4][4]*a[5][1] - a[0][3]*a[1][0]*a[2][4]*a[4][1]*a[5][2] + a[0][3]*a[1][0]*a[2][4]*a[4][2]*a[5][1] + a[0][3]*a[1][1]*a[2][0]*a[4][2]*a[5][4] - a[0][3]*a[1][1]*a[2][0]*a[4][4]*a[5][2] - a[0][3]*a[1][1]*a[2][2]*a[4][0]*a[5][4] + a[0][3]*a[1][1]*a[2][2]*a[4][4]*a[5][0] + a[0][3]*a[1][1]*a[2][4]*a[4][0]*a[5][2] - a[0][3]*a[1][1]*a[2][4]*a[4][2]*a[5][0] - a[0][3]*a[1][2]*a[2][0]*a[4][1]*a[5][4] + a[0][3]*a[1][2]*a[2][0]*a[4][4]*a[5][1] + a[0][3]*a[1][2]*a[2][1]*a[4][0]*a[5][4] - a[0][3]*a[1][2]*a[2][1]*a[4][4]*a[5][0] - a[0][3]*a[1][2]*a[2][4]*a[4][0]*a[5][1] + a[0][3]*a[1][2]*a[2][4]*a[4][1]*a[5][0] + a[0][3]*a[1][4]*a[2][0]*a[4][1]*a[5][2] - a[0][3]*a[1][4]*a[2][0]*a[4][2]*a[5][1] - a[0][3]*a[1][4]*a[2][1]*a[4][0]*a[5][2] + a[0][3]*a[1][4]*a[2][1]*a[4][2]*a[5][0] + a[0][3]*a[1][4]*a[2][2]*a[4][0]*a[5][1] - a[0][3]*a[1][4]*a[2][2]*a[4][1]*a[5][0] + a[0][4]*a[1][0]*a[2][1]*a[4][2]*a[5][3] - a[0][4]*a[1][0]*a[2][1]*a[4][3]*a[5][2] - a[0][4]*a[1][0]*a[2][2]*a[4][1]*a[5][3] + a[0][4]*a[1][0]*a[2][2]*a[4][3]*a[5][1] + a[0][4]*a[1][0]*a[2][3]*a[4][1]*a[5][2] - a[0][4]*a[1][0]*a[2][3]*a[4][2]*a[5][1] - a[0][4]*a[1][1]*a[2][0]*a[4][2]*a[5][3] + a[0][4]*a[1][1]*a[2][0]*a[4][3]*a[5][2] + a[0][4]*a[1][1]*a[2][2]*a[4][0]*a[5][3] - a[0][4]*a[1][1]*a[2][2]*a[4][3]*a[5][0] - a[0][4]*a[1][1]*a[2][3]*a[4][0]*a[5][2] + a[0][4]*a[1][1]*a[2][3]*a[4][2]*a[5][0] + a[0][4]*a[1][2]*a[2][0]*a[4][1]*a[5][3] - a[0][4]*a[1][2]*a[2][0]*a[4][3]*a[5][1] - a[0][4]*a[1][2]*a[2][1]*a[4][0]*a[5][3] + a[0][4]*a[1][2]*a[2][1]*a[4][3]*a[5][0] + a[0][4]*a[1][2]*a[2][3]*a[4][0]*a[5][1] - a[0][4]*a[1][2]*a[2][3]*a[4][1]*a[5][0] - a[0][4]*a[1][3]*a[2][0]*a[4][1]*a[5][2] + a[0][4]*a[1][3]*a[2][0]*a[4][2]*a[5][1] + a[0][4]*a[1][3]*a[2][1]*a[4][0]*a[5][2] - a[0][4]*a[1][3]*a[2][1]*a[4][2]*a[5][0] - a[0][4]*a[1][3]*a[2][2]*a[4][0]*a[5][1] + a[0][4]*a[1][3]*a[2][2]*a[4][1]*a[5][0])/denom;
invA[0][4] = (a[0][1]*a[1][2]*a[2][3]*a[3][4]*a[5][5] - a[0][1]*a[1][2]*a[2][3]*a[3][5]*a[5][4] - a[0][1]*a[1][2]*a[2][4]*a[3][3]*a[5][5] + a[0][1]*a[1][2]*a[2][4]*a[3][5]*a[5][3] + a[0][1]*a[1][2]*a[2][5]*a[3][3]*a[5][4] - a[0][1]*a[1][2]*a[2][5]*a[3][4]*a[5][3] - a[0][1]*a[1][3]*a[2][2]*a[3][4]*a[5][5] + a[0][1]*a[1][3]*a[2][2]*a[3][5]*a[5][4] + a[0][1]*a[1][3]*a[2][4]*a[3][2]*a[5][5] - a[0][1]*a[1][3]*a[2][4]*a[3][5]*a[5][2] - a[0][1]*a[1][3]*a[2][5]*a[3][2]*a[5][4] + a[0][1]*a[1][3]*a[2][5]*a[3][4]*a[5][2] + a[0][1]*a[1][4]*a[2][2]*a[3][3]*a[5][5] - a[0][1]*a[1][4]*a[2][2]*a[3][5]*a[5][3] - a[0][1]*a[1][4]*a[2][3]*a[3][2]*a[5][5] + a[0][1]*a[1][4]*a[2][3]*a[3][5]*a[5][2] + a[0][1]*a[1][4]*a[2][5]*a[3][2]*a[5][3] - a[0][1]*a[1][4]*a[2][5]*a[3][3]*a[5][2] - a[0][1]*a[1][5]*a[2][2]*a[3][3]*a[5][4] + a[0][1]*a[1][5]*a[2][2]*a[3][4]*a[5][3] + a[0][1]*a[1][5]*a[2][3]*a[3][2]*a[5][4] - a[0][1]*a[1][5]*a[2][3]*a[3][4]*a[5][2] - a[0][1]*a[1][5]*a[2][4]*a[3][2]*a[5][3] + a[0][1]*a[1][5]*a[2][4]*a[3][3]*a[5][2] - a[0][2]*a[1][1]*a[2][3]*a[3][4]*a[5][5] + a[0][2]*a[1][1]*a[2][3]*a[3][5]*a[5][4] + a[0][2]*a[1][1]*a[2][4]*a[3][3]*a[5][5] - a[0][2]*a[1][1]*a[2][4]*a[3][5]*a[5][3] - a[0][2]*a[1][1]*a[2][5]*a[3][3]*a[5][4] + a[0][2]*a[1][1]*a[2][5]*a[3][4]*a[5][3] + a[0][2]*a[1][3]*a[2][1]*a[3][4]*a[5][5] - a[0][2]*a[1][3]*a[2][1]*a[3][5]*a[5][4] - a[0][2]*a[1][3]*a[2][4]*a[3][1]*a[5][5] + a[0][2]*a[1][3]*a[2][4]*a[3][5]*a[5][1] + a[0][2]*a[1][3]*a[2][5]*a[3][1]*a[5][4] - a[0][2]*a[1][3]*a[2][5]*a[3][4]*a[5][1] - a[0][2]*a[1][4]*a[2][1]*a[3][3]*a[5][5] + a[0][2]*a[1][4]*a[2][1]*a[3][5]*a[5][3] + a[0][2]*a[1][4]*a[2][3]*a[3][1]*a[5][5] - a[0][2]*a[1][4]*a[2][3]*a[3][5]*a[5][1] - a[0][2]*a[1][4]*a[2][5]*a[3][1]*a[5][3] + a[0][2]*a[1][4]*a[2][5]*a[3][3]*a[5][1] + a[0][2]*a[1][5]*a[2][1]*a[3][3]*a[5][4] - a[0][2]*a[1][5]*a[2][1]*a[3][4]*a[5][3] - a[0][2]*a[1][5]*a[2][3]*a[3][1]*a[5][4] + a[0][2]*a[1][5]*a[2][3]*a[3][4]*a[5][1] + a[0][2]*a[1][5]*a[2][4]*a[3][1]*a[5][3] - a[0][2]*a[1][5]*a[2][4]*a[3][3]*a[5][1] + a[0][3]*a[1][1]*a[2][2]*a[3][4]*a[5][5] - a[0][3]*a[1][1]*a[2][2]*a[3][5]*a[5][4] - a[0][3]*a[1][1]*a[2][4]*a[3][2]*a[5][5] + a[0][3]*a[1][1]*a[2][4]*a[3][5]*a[5][2] + a[0][3]*a[1][1]*a[2][5]*a[3][2]*a[5][4] - a[0][3]*a[1][1]*a[2][5]*a[3][4]*a[5][2] - a[0][3]*a[1][2]*a[2][1]*a[3][4]*a[5][5] + a[0][3]*a[1][2]*a[2][1]*a[3][5]*a[5][4] + a[0][3]*a[1][2]*a[2][4]*a[3][1]*a[5][5] - a[0][3]*a[1][2]*a[2][4]*a[3][5]*a[5][1] - a[0][3]*a[1][2]*a[2][5]*a[3][1]*a[5][4] + a[0][3]*a[1][2]*a[2][5]*a[3][4]*a[5][1] + a[0][3]*a[1][4]*a[2][1]*a[3][2]*a[5][5] - a[0][3]*a[1][4]*a[2][1]*a[3][5]*a[5][2] - a[0][3]*a[1][4]*a[2][2]*a[3][1]*a[5][5] + a[0][3]*a[1][4]*a[2][2]*a[3][5]*a[5][1] + a[0][3]*a[1][4]*a[2][5]*a[3][1]*a[5][2] - a[0][3]*a[1][4]*a[2][5]*a[3][2]*a[5][1] - a[0][3]*a[1][5]*a[2][1]*a[3][2]*a[5][4] + a[0][3]*a[1][5]*a[2][1]*a[3][4]*a[5][2] + a[0][3]*a[1][5]*a[2][2]*a[3][1]*a[5][4] - a[0][3]*a[1][5]*a[2][2]*a[3][4]*a[5][1] - a[0][3]*a[1][5]*a[2][4]*a[3][1]*a[5][2] + a[0][3]*a[1][5]*a[2][4]*a[3][2]*a[5][1] - a[0][4]*a[1][1]*a[2][2]*a[3][3]*a[5][5] + a[0][4]*a[1][1]*a[2][2]*a[3][5]*a[5][3] + a[0][4]*a[1][1]*a[2][3]*a[3][2]*a[5][5] - a[0][4]*a[1][1]*a[2][3]*a[3][5]*a[5][2] - a[0][4]*a[1][1]*a[2][5]*a[3][2]*a[5][3] + a[0][4]*a[1][1]*a[2][5]*a[3][3]*a[5][2] + a[0][4]*a[1][2]*a[2][1]*a[3][3]*a[5][5] - a[0][4]*a[1][2]*a[2][1]*a[3][5]*a[5][3] - a[0][4]*a[1][2]*a[2][3]*a[3][1]*a[5][5] + a[0][4]*a[1][2]*a[2][3]*a[3][5]*a[5][1] + a[0][4]*a[1][2]*a[2][5]*a[3][1]*a[5][3] - a[0][4]*a[1][2]*a[2][5]*a[3][3]*a[5][1] - a[0][4]*a[1][3]*a[2][1]*a[3][2]*a[5][5] + a[0][4]*a[1][3]*a[2][1]*a[3][5]*a[5][2] + a[0][4]*a[1][3]*a[2][2]*a[3][1]*a[5][5] - a[0][4]*a[1][3]*a[2][2]*a[3][5]*a[5][1] - a[0][4]*a[1][3]*a[2][5]*a[3][1]*a[5][2] + a[0][4]*a[1][3]*a[2][5]*a[3][2]*a[5][1] + a[0][4]*a[1][5]*a[2][1]*a[3][2]*a[5][3] - a[0][4]*a[1][5]*a[2][1]*a[3][3]*a[5][2] - a[0][4]*a[1][5]*a[2][2]*a[3][1]*a[5][3] + a[0][4]*a[1][5]*a[2][2]*a[3][3]*a[5][1] + a[0][4]*a[1][5]*a[2][3]*a[3][1]*a[5][2] - a[0][4]*a[1][5]*a[2][3]*a[3][2]*a[5][1] + a[0][5]*a[1][1]*a[2][2]*a[3][3]*a[5][4] - a[0][5]*a[1][1]*a[2][2]*a[3][4]*a[5][3] - a[0][5]*a[1][1]*a[2][3]*a[3][2]*a[5][4] + a[0][5]*a[1][1]*a[2][3]*a[3][4]*a[5][2] + a[0][5]*a[1][1]*a[2][4]*a[3][2]*a[5][3] - a[0][5]*a[1][1]*a[2][4]*a[3][3]*a[5][2] - a[0][5]*a[1][2]*a[2][1]*a[3][3]*a[5][4] + a[0][5]*a[1][2]*a[2][1]*a[3][4]*a[5][3] + a[0][5]*a[1][2]*a[2][3]*a[3][1]*a[5][4] - a[0][5]*a[1][2]*a[2][3]*a[3][4]*a[5][1] - a[0][5]*a[1][2]*a[2][4]*a[3][1]*a[5][3] + a[0][5]*a[1][2]*a[2][4]*a[3][3]*a[5][1] + a[0][5]*a[1][3]*a[2][1]*a[3][2]*a[5][4] - a[0][5]*a[1][3]*a[2][1]*a[3][4]*a[5][2] - a[0][5]*a[1][3]*a[2][2]*a[3][1]*a[5][4] + a[0][5]*a[1][3]*a[2][2]*a[3][4]*a[5][1] + a[0][5]*a[1][3]*a[2][4]*a[3][1]*a[5][2] - a[0][5]*a[1][3]*a[2][4]*a[3][2]*a[5][1] - a[0][5]*a[1][4]*a[2][1]*a[3][2]*a[5][3] + a[0][5]*a[1][4]*a[2][1]*a[3][3]*a[5][2] + a[0][5]*a[1][4]*a[2][2]*a[3][1]*a[5][3] - a[0][5]*a[1][4]*a[2][2]*a[3][3]*a[5][1] - a[0][5]*a[1][4]*a[2][3]*a[3][1]*a[5][2] + a[0][5]*a[1][4]*a[2][3]*a[3][2]*a[5][1])/denom;
invA[1][4] = -(a[0][0]*a[1][2]*a[2][3]*a[3][4]*a[5][5] - a[0][0]*a[1][2]*a[2][3]*a[3][5]*a[5][4] - a[0][0]*a[1][2]*a[2][4]*a[3][3]*a[5][5] + a[0][0]*a[1][2]*a[2][4]*a[3][5]*a[5][3] + a[0][0]*a[1][2]*a[2][5]*a[3][3]*a[5][4] - a[0][0]*a[1][2]*a[2][5]*a[3][4]*a[5][3] - a[0][0]*a[1][3]*a[2][2]*a[3][4]*a[5][5] + a[0][0]*a[1][3]*a[2][2]*a[3][5]*a[5][4] + a[0][0]*a[1][3]*a[2][4]*a[3][2]*a[5][5] - a[0][0]*a[1][3]*a[2][4]*a[3][5]*a[5][2] - a[0][0]*a[1][3]*a[2][5]*a[3][2]*a[5][4] + a[0][0]*a[1][3]*a[2][5]*a[3][4]*a[5][2] + a[0][0]*a[1][4]*a[2][2]*a[3][3]*a[5][5] - a[0][0]*a[1][4]*a[2][2]*a[3][5]*a[5][3] - a[0][0]*a[1][4]*a[2][3]*a[3][2]*a[5][5] + a[0][0]*a[1][4]*a[2][3]*a[3][5]*a[5][2] + a[0][0]*a[1][4]*a[2][5]*a[3][2]*a[5][3] - a[0][0]*a[1][4]*a[2][5]*a[3][3]*a[5][2] - a[0][0]*a[1][5]*a[2][2]*a[3][3]*a[5][4] + a[0][0]*a[1][5]*a[2][2]*a[3][4]*a[5][3] + a[0][0]*a[1][5]*a[2][3]*a[3][2]*a[5][4] - a[0][0]*a[1][5]*a[2][3]*a[3][4]*a[5][2] - a[0][0]*a[1][5]*a[2][4]*a[3][2]*a[5][3] + a[0][0]*a[1][5]*a[2][4]*a[3][3]*a[5][2] - a[0][2]*a[1][0]*a[2][3]*a[3][4]*a[5][5] + a[0][2]*a[1][0]*a[2][3]*a[3][5]*a[5][4] + a[0][2]*a[1][0]*a[2][4]*a[3][3]*a[5][5] - a[0][2]*a[1][0]*a[2][4]*a[3][5]*a[5][3] - a[0][2]*a[1][0]*a[2][5]*a[3][3]*a[5][4] + a[0][2]*a[1][0]*a[2][5]*a[3][4]*a[5][3] + a[0][2]*a[1][3]*a[2][0]*a[3][4]*a[5][5] - a[0][2]*a[1][3]*a[2][0]*a[3][5]*a[5][4] - a[0][2]*a[1][3]*a[2][4]*a[3][0]*a[5][5] + a[0][2]*a[1][3]*a[2][4]*a[3][5]*a[5][0] + a[0][2]*a[1][3]*a[2][5]*a[3][0]*a[5][4] - a[0][2]*a[1][3]*a[2][5]*a[3][4]*a[5][0] - a[0][2]*a[1][4]*a[2][0]*a[3][3]*a[5][5] + a[0][2]*a[1][4]*a[2][0]*a[3][5]*a[5][3] + a[0][2]*a[1][4]*a[2][3]*a[3][0]*a[5][5] - a[0][2]*a[1][4]*a[2][3]*a[3][5]*a[5][0] - a[0][2]*a[1][4]*a[2][5]*a[3][0]*a[5][3] + a[0][2]*a[1][4]*a[2][5]*a[3][3]*a[5][0] + a[0][2]*a[1][5]*a[2][0]*a[3][3]*a[5][4] - a[0][2]*a[1][5]*a[2][0]*a[3][4]*a[5][3] - a[0][2]*a[1][5]*a[2][3]*a[3][0]*a[5][4] + a[0][2]*a[1][5]*a[2][3]*a[3][4]*a[5][0] + a[0][2]*a[1][5]*a[2][4]*a[3][0]*a[5][3] - a[0][2]*a[1][5]*a[2][4]*a[3][3]*a[5][0] + a[0][3]*a[1][0]*a[2][2]*a[3][4]*a[5][5] - a[0][3]*a[1][0]*a[2][2]*a[3][5]*a[5][4] - a[0][3]*a[1][0]*a[2][4]*a[3][2]*a[5][5] + a[0][3]*a[1][0]*a[2][4]*a[3][5]*a[5][2] + a[0][3]*a[1][0]*a[2][5]*a[3][2]*a[5][4] - a[0][3]*a[1][0]*a[2][5]*a[3][4]*a[5][2] - a[0][3]*a[1][2]*a[2][0]*a[3][4]*a[5][5] + a[0][3]*a[1][2]*a[2][0]*a[3][5]*a[5][4] + a[0][3]*a[1][2]*a[2][4]*a[3][0]*a[5][5] - a[0][3]*a[1][2]*a[2][4]*a[3][5]*a[5][0] - a[0][3]*a[1][2]*a[2][5]*a[3][0]*a[5][4] + a[0][3]*a[1][2]*a[2][5]*a[3][4]*a[5][0] + a[0][3]*a[1][4]*a[2][0]*a[3][2]*a[5][5] - a[0][3]*a[1][4]*a[2][0]*a[3][5]*a[5][2] - a[0][3]*a[1][4]*a[2][2]*a[3][0]*a[5][5] + a[0][3]*a[1][4]*a[2][2]*a[3][5]*a[5][0] + a[0][3]*a[1][4]*a[2][5]*a[3][0]*a[5][2] - a[0][3]*a[1][4]*a[2][5]*a[3][2]*a[5][0] - a[0][3]*a[1][5]*a[2][0]*a[3][2]*a[5][4] + a[0][3]*a[1][5]*a[2][0]*a[3][4]*a[5][2] + a[0][3]*a[1][5]*a[2][2]*a[3][0]*a[5][4] - a[0][3]*a[1][5]*a[2][2]*a[3][4]*a[5][0] - a[0][3]*a[1][5]*a[2][4]*a[3][0]*a[5][2] + a[0][3]*a[1][5]*a[2][4]*a[3][2]*a[5][0] - a[0][4]*a[1][0]*a[2][2]*a[3][3]*a[5][5] + a[0][4]*a[1][0]*a[2][2]*a[3][5]*a[5][3] + a[0][4]*a[1][0]*a[2][3]*a[3][2]*a[5][5] - a[0][4]*a[1][0]*a[2][3]*a[3][5]*a[5][2] - a[0][4]*a[1][0]*a[2][5]*a[3][2]*a[5][3] + a[0][4]*a[1][0]*a[2][5]*a[3][3]*a[5][2] + a[0][4]*a[1][2]*a[2][0]*a[3][3]*a[5][5] - a[0][4]*a[1][2]*a[2][0]*a[3][5]*a[5][3] - a[0][4]*a[1][2]*a[2][3]*a[3][0]*a[5][5] + a[0][4]*a[1][2]*a[2][3]*a[3][5]*a[5][0] + a[0][4]*a[1][2]*a[2][5]*a[3][0]*a[5][3] - a[0][4]*a[1][2]*a[2][5]*a[3][3]*a[5][0] - a[0][4]*a[1][3]*a[2][0]*a[3][2]*a[5][5] + a[0][4]*a[1][3]*a[2][0]*a[3][5]*a[5][2] + a[0][4]*a[1][3]*a[2][2]*a[3][0]*a[5][5] - a[0][4]*a[1][3]*a[2][2]*a[3][5]*a[5][0] - a[0][4]*a[1][3]*a[2][5]*a[3][0]*a[5][2] + a[0][4]*a[1][3]*a[2][5]*a[3][2]*a[5][0] + a[0][4]*a[1][5]*a[2][0]*a[3][2]*a[5][3] - a[0][4]*a[1][5]*a[2][0]*a[3][3]*a[5][2] - a[0][4]*a[1][5]*a[2][2]*a[3][0]*a[5][3] + a[0][4]*a[1][5]*a[2][2]*a[3][3]*a[5][0] + a[0][4]*a[1][5]*a[2][3]*a[3][0]*a[5][2] - a[0][4]*a[1][5]*a[2][3]*a[3][2]*a[5][0] + a[0][5]*a[1][0]*a[2][2]*a[3][3]*a[5][4] - a[0][5]*a[1][0]*a[2][2]*a[3][4]*a[5][3] - a[0][5]*a[1][0]*a[2][3]*a[3][2]*a[5][4] + a[0][5]*a[1][0]*a[2][3]*a[3][4]*a[5][2] + a[0][5]*a[1][0]*a[2][4]*a[3][2]*a[5][3] - a[0][5]*a[1][0]*a[2][4]*a[3][3]*a[5][2] - a[0][5]*a[1][2]*a[2][0]*a[3][3]*a[5][4] + a[0][5]*a[1][2]*a[2][0]*a[3][4]*a[5][3] + a[0][5]*a[1][2]*a[2][3]*a[3][0]*a[5][4] - a[0][5]*a[1][2]*a[2][3]*a[3][4]*a[5][0] - a[0][5]*a[1][2]*a[2][4]*a[3][0]*a[5][3] + a[0][5]*a[1][2]*a[2][4]*a[3][3]*a[5][0] + a[0][5]*a[1][3]*a[2][0]*a[3][2]*a[5][4] - a[0][5]*a[1][3]*a[2][0]*a[3][4]*a[5][2] - a[0][5]*a[1][3]*a[2][2]*a[3][0]*a[5][4] + a[0][5]*a[1][3]*a[2][2]*a[3][4]*a[5][0] + a[0][5]*a[1][3]*a[2][4]*a[3][0]*a[5][2] - a[0][5]*a[1][3]*a[2][4]*a[3][2]*a[5][0] - a[0][5]*a[1][4]*a[2][0]*a[3][2]*a[5][3] + a[0][5]*a[1][4]*a[2][0]*a[3][3]*a[5][2] + a[0][5]*a[1][4]*a[2][2]*a[3][0]*a[5][3] - a[0][5]*a[1][4]*a[2][2]*a[3][3]*a[5][0] - a[0][5]*a[1][4]*a[2][3]*a[3][0]*a[5][2] + a[0][5]*a[1][4]*a[2][3]*a[3][2]*a[5][0])/denom;
invA[2][4] = (a[0][0]*a[1][1]*a[2][3]*a[3][4]*a[5][5] - a[0][0]*a[1][1]*a[2][3]*a[3][5]*a[5][4] - a[0][0]*a[1][1]*a[2][4]*a[3][3]*a[5][5] + a[0][0]*a[1][1]*a[2][4]*a[3][5]*a[5][3] + a[0][0]*a[1][1]*a[2][5]*a[3][3]*a[5][4] - a[0][0]*a[1][1]*a[2][5]*a[3][4]*a[5][3] - a[0][0]*a[1][3]*a[2][1]*a[3][4]*a[5][5] + a[0][0]*a[1][3]*a[2][1]*a[3][5]*a[5][4] + a[0][0]*a[1][3]*a[2][4]*a[3][1]*a[5][5] - a[0][0]*a[1][3]*a[2][4]*a[3][5]*a[5][1] - a[0][0]*a[1][3]*a[2][5]*a[3][1]*a[5][4] + a[0][0]*a[1][3]*a[2][5]*a[3][4]*a[5][1] + a[0][0]*a[1][4]*a[2][1]*a[3][3]*a[5][5] - a[0][0]*a[1][4]*a[2][1]*a[3][5]*a[5][3] - a[0][0]*a[1][4]*a[2][3]*a[3][1]*a[5][5] + a[0][0]*a[1][4]*a[2][3]*a[3][5]*a[5][1] + a[0][0]*a[1][4]*a[2][5]*a[3][1]*a[5][3] - a[0][0]*a[1][4]*a[2][5]*a[3][3]*a[5][1] - a[0][0]*a[1][5]*a[2][1]*a[3][3]*a[5][4] + a[0][0]*a[1][5]*a[2][1]*a[3][4]*a[5][3] + a[0][0]*a[1][5]*a[2][3]*a[3][1]*a[5][4] - a[0][0]*a[1][5]*a[2][3]*a[3][4]*a[5][1] - a[0][0]*a[1][5]*a[2][4]*a[3][1]*a[5][3] + a[0][0]*a[1][5]*a[2][4]*a[3][3]*a[5][1] - a[0][1]*a[1][0]*a[2][3]*a[3][4]*a[5][5] + a[0][1]*a[1][0]*a[2][3]*a[3][5]*a[5][4] + a[0][1]*a[1][0]*a[2][4]*a[3][3]*a[5][5] - a[0][1]*a[1][0]*a[2][4]*a[3][5]*a[5][3] - a[0][1]*a[1][0]*a[2][5]*a[3][3]*a[5][4] + a[0][1]*a[1][0]*a[2][5]*a[3][4]*a[5][3] + a[0][1]*a[1][3]*a[2][0]*a[3][4]*a[5][5] - a[0][1]*a[1][3]*a[2][0]*a[3][5]*a[5][4] - a[0][1]*a[1][3]*a[2][4]*a[3][0]*a[5][5] + a[0][1]*a[1][3]*a[2][4]*a[3][5]*a[5][0] + a[0][1]*a[1][3]*a[2][5]*a[3][0]*a[5][4] - a[0][1]*a[1][3]*a[2][5]*a[3][4]*a[5][0] - a[0][1]*a[1][4]*a[2][0]*a[3][3]*a[5][5] + a[0][1]*a[1][4]*a[2][0]*a[3][5]*a[5][3] + a[0][1]*a[1][4]*a[2][3]*a[3][0]*a[5][5] - a[0][1]*a[1][4]*a[2][3]*a[3][5]*a[5][0] - a[0][1]*a[1][4]*a[2][5]*a[3][0]*a[5][3] + a[0][1]*a[1][4]*a[2][5]*a[3][3]*a[5][0] + a[0][1]*a[1][5]*a[2][0]*a[3][3]*a[5][4] - a[0][1]*a[1][5]*a[2][0]*a[3][4]*a[5][3] - a[0][1]*a[1][5]*a[2][3]*a[3][0]*a[5][4] + a[0][1]*a[1][5]*a[2][3]*a[3][4]*a[5][0] + a[0][1]*a[1][5]*a[2][4]*a[3][0]*a[5][3] - a[0][1]*a[1][5]*a[2][4]*a[3][3]*a[5][0] + a[0][3]*a[1][0]*a[2][1]*a[3][4]*a[5][5] - a[0][3]*a[1][0]*a[2][1]*a[3][5]*a[5][4] - a[0][3]*a[1][0]*a[2][4]*a[3][1]*a[5][5] + a[0][3]*a[1][0]*a[2][4]*a[3][5]*a[5][1] + a[0][3]*a[1][0]*a[2][5]*a[3][1]*a[5][4] - a[0][3]*a[1][0]*a[2][5]*a[3][4]*a[5][1] - a[0][3]*a[1][1]*a[2][0]*a[3][4]*a[5][5] + a[0][3]*a[1][1]*a[2][0]*a[3][5]*a[5][4] + a[0][3]*a[1][1]*a[2][4]*a[3][0]*a[5][5] - a[0][3]*a[1][1]*a[2][4]*a[3][5]*a[5][0] - a[0][3]*a[1][1]*a[2][5]*a[3][0]*a[5][4] + a[0][3]*a[1][1]*a[2][5]*a[3][4]*a[5][0] + a[0][3]*a[1][4]*a[2][0]*a[3][1]*a[5][5] - a[0][3]*a[1][4]*a[2][0]*a[3][5]*a[5][1] - a[0][3]*a[1][4]*a[2][1]*a[3][0]*a[5][5] + a[0][3]*a[1][4]*a[2][1]*a[3][5]*a[5][0] + a[0][3]*a[1][4]*a[2][5]*a[3][0]*a[5][1] - a[0][3]*a[1][4]*a[2][5]*a[3][1]*a[5][0] - a[0][3]*a[1][5]*a[2][0]*a[3][1]*a[5][4] + a[0][3]*a[1][5]*a[2][0]*a[3][4]*a[5][1] + a[0][3]*a[1][5]*a[2][1]*a[3][0]*a[5][4] - a[0][3]*a[1][5]*a[2][1]*a[3][4]*a[5][0] - a[0][3]*a[1][5]*a[2][4]*a[3][0]*a[5][1] + a[0][3]*a[1][5]*a[2][4]*a[3][1]*a[5][0] - a[0][4]*a[1][0]*a[2][1]*a[3][3]*a[5][5] + a[0][4]*a[1][0]*a[2][1]*a[3][5]*a[5][3] + a[0][4]*a[1][0]*a[2][3]*a[3][1]*a[5][5] - a[0][4]*a[1][0]*a[2][3]*a[3][5]*a[5][1] - a[0][4]*a[1][0]*a[2][5]*a[3][1]*a[5][3] + a[0][4]*a[1][0]*a[2][5]*a[3][3]*a[5][1] + a[0][4]*a[1][1]*a[2][0]*a[3][3]*a[5][5] - a[0][4]*a[1][1]*a[2][0]*a[3][5]*a[5][3] - a[0][4]*a[1][1]*a[2][3]*a[3][0]*a[5][5] + a[0][4]*a[1][1]*a[2][3]*a[3][5]*a[5][0] + a[0][4]*a[1][1]*a[2][5]*a[3][0]*a[5][3] - a[0][4]*a[1][1]*a[2][5]*a[3][3]*a[5][0] - a[0][4]*a[1][3]*a[2][0]*a[3][1]*a[5][5] + a[0][4]*a[1][3]*a[2][0]*a[3][5]*a[5][1] + a[0][4]*a[1][3]*a[2][1]*a[3][0]*a[5][5] - a[0][4]*a[1][3]*a[2][1]*a[3][5]*a[5][0] - a[0][4]*a[1][3]*a[2][5]*a[3][0]*a[5][1] + a[0][4]*a[1][3]*a[2][5]*a[3][1]*a[5][0] + a[0][4]*a[1][5]*a[2][0]*a[3][1]*a[5][3] - a[0][4]*a[1][5]*a[2][0]*a[3][3]*a[5][1] - a[0][4]*a[1][5]*a[2][1]*a[3][0]*a[5][3] + a[0][4]*a[1][5]*a[2][1]*a[3][3]*a[5][0] + a[0][4]*a[1][5]*a[2][3]*a[3][0]*a[5][1] - a[0][4]*a[1][5]*a[2][3]*a[3][1]*a[5][0] + a[0][5]*a[1][0]*a[2][1]*a[3][3]*a[5][4] - a[0][5]*a[1][0]*a[2][1]*a[3][4]*a[5][3] - a[0][5]*a[1][0]*a[2][3]*a[3][1]*a[5][4] + a[0][5]*a[1][0]*a[2][3]*a[3][4]*a[5][1] + a[0][5]*a[1][0]*a[2][4]*a[3][1]*a[5][3] - a[0][5]*a[1][0]*a[2][4]*a[3][3]*a[5][1] - a[0][5]*a[1][1]*a[2][0]*a[3][3]*a[5][4] + a[0][5]*a[1][1]*a[2][0]*a[3][4]*a[5][3] + a[0][5]*a[1][1]*a[2][3]*a[3][0]*a[5][4] - a[0][5]*a[1][1]*a[2][3]*a[3][4]*a[5][0] - a[0][5]*a[1][1]*a[2][4]*a[3][0]*a[5][3] + a[0][5]*a[1][1]*a[2][4]*a[3][3]*a[5][0] + a[0][5]*a[1][3]*a[2][0]*a[3][1]*a[5][4] - a[0][5]*a[1][3]*a[2][0]*a[3][4]*a[5][1] - a[0][5]*a[1][3]*a[2][1]*a[3][0]*a[5][4] + a[0][5]*a[1][3]*a[2][1]*a[3][4]*a[5][0] + a[0][5]*a[1][3]*a[2][4]*a[3][0]*a[5][1] - a[0][5]*a[1][3]*a[2][4]*a[3][1]*a[5][0] - a[0][5]*a[1][4]*a[2][0]*a[3][1]*a[5][3] + a[0][5]*a[1][4]*a[2][0]*a[3][3]*a[5][1] + a[0][5]*a[1][4]*a[2][1]*a[3][0]*a[5][3] - a[0][5]*a[1][4]*a[2][1]*a[3][3]*a[5][0] - a[0][5]*a[1][4]*a[2][3]*a[3][0]*a[5][1] + a[0][5]*a[1][4]*a[2][3]*a[3][1]*a[5][0])/denom;
invA[3][4] = -(a[0][0]*a[1][1]*a[2][2]*a[3][4]*a[5][5] - a[0][0]*a[1][1]*a[2][2]*a[3][5]*a[5][4] - a[0][0]*a[1][1]*a[2][4]*a[3][2]*a[5][5] + a[0][0]*a[1][1]*a[2][4]*a[3][5]*a[5][2] + a[0][0]*a[1][1]*a[2][5]*a[3][2]*a[5][4] - a[0][0]*a[1][1]*a[2][5]*a[3][4]*a[5][2] - a[0][0]*a[1][2]*a[2][1]*a[3][4]*a[5][5] + a[0][0]*a[1][2]*a[2][1]*a[3][5]*a[5][4] + a[0][0]*a[1][2]*a[2][4]*a[3][1]*a[5][5] - a[0][0]*a[1][2]*a[2][4]*a[3][5]*a[5][1] - a[0][0]*a[1][2]*a[2][5]*a[3][1]*a[5][4] + a[0][0]*a[1][2]*a[2][5]*a[3][4]*a[5][1] + a[0][0]*a[1][4]*a[2][1]*a[3][2]*a[5][5] - a[0][0]*a[1][4]*a[2][1]*a[3][5]*a[5][2] - a[0][0]*a[1][4]*a[2][2]*a[3][1]*a[5][5] + a[0][0]*a[1][4]*a[2][2]*a[3][5]*a[5][1] + a[0][0]*a[1][4]*a[2][5]*a[3][1]*a[5][2] - a[0][0]*a[1][4]*a[2][5]*a[3][2]*a[5][1] - a[0][0]*a[1][5]*a[2][1]*a[3][2]*a[5][4] + a[0][0]*a[1][5]*a[2][1]*a[3][4]*a[5][2] + a[0][0]*a[1][5]*a[2][2]*a[3][1]*a[5][4] - a[0][0]*a[1][5]*a[2][2]*a[3][4]*a[5][1] - a[0][0]*a[1][5]*a[2][4]*a[3][1]*a[5][2] + a[0][0]*a[1][5]*a[2][4]*a[3][2]*a[5][1] - a[0][1]*a[1][0]*a[2][2]*a[3][4]*a[5][5] + a[0][1]*a[1][0]*a[2][2]*a[3][5]*a[5][4] + a[0][1]*a[1][0]*a[2][4]*a[3][2]*a[5][5] - a[0][1]*a[1][0]*a[2][4]*a[3][5]*a[5][2] - a[0][1]*a[1][0]*a[2][5]*a[3][2]*a[5][4] + a[0][1]*a[1][0]*a[2][5]*a[3][4]*a[5][2] + a[0][1]*a[1][2]*a[2][0]*a[3][4]*a[5][5] - a[0][1]*a[1][2]*a[2][0]*a[3][5]*a[5][4] - a[0][1]*a[1][2]*a[2][4]*a[3][0]*a[5][5] + a[0][1]*a[1][2]*a[2][4]*a[3][5]*a[5][0] + a[0][1]*a[1][2]*a[2][5]*a[3][0]*a[5][4] - a[0][1]*a[1][2]*a[2][5]*a[3][4]*a[5][0] - a[0][1]*a[1][4]*a[2][0]*a[3][2]*a[5][5] + a[0][1]*a[1][4]*a[2][0]*a[3][5]*a[5][2] + a[0][1]*a[1][4]*a[2][2]*a[3][0]*a[5][5] - a[0][1]*a[1][4]*a[2][2]*a[3][5]*a[5][0] - a[0][1]*a[1][4]*a[2][5]*a[3][0]*a[5][2] + a[0][1]*a[1][4]*a[2][5]*a[3][2]*a[5][0] + a[0][1]*a[1][5]*a[2][0]*a[3][2]*a[5][4] - a[0][1]*a[1][5]*a[2][0]*a[3][4]*a[5][2] - a[0][1]*a[1][5]*a[2][2]*a[3][0]*a[5][4] + a[0][1]*a[1][5]*a[2][2]*a[3][4]*a[5][0] + a[0][1]*a[1][5]*a[2][4]*a[3][0]*a[5][2] - a[0][1]*a[1][5]*a[2][4]*a[3][2]*a[5][0] + a[0][2]*a[1][0]*a[2][1]*a[3][4]*a[5][5] - a[0][2]*a[1][0]*a[2][1]*a[3][5]*a[5][4] - a[0][2]*a[1][0]*a[2][4]*a[3][1]*a[5][5] + a[0][2]*a[1][0]*a[2][4]*a[3][5]*a[5][1] + a[0][2]*a[1][0]*a[2][5]*a[3][1]*a[5][4] - a[0][2]*a[1][0]*a[2][5]*a[3][4]*a[5][1] - a[0][2]*a[1][1]*a[2][0]*a[3][4]*a[5][5] + a[0][2]*a[1][1]*a[2][0]*a[3][5]*a[5][4] + a[0][2]*a[1][1]*a[2][4]*a[3][0]*a[5][5] - a[0][2]*a[1][1]*a[2][4]*a[3][5]*a[5][0] - a[0][2]*a[1][1]*a[2][5]*a[3][0]*a[5][4] + a[0][2]*a[1][1]*a[2][5]*a[3][4]*a[5][0] + a[0][2]*a[1][4]*a[2][0]*a[3][1]*a[5][5] - a[0][2]*a[1][4]*a[2][0]*a[3][5]*a[5][1] - a[0][2]*a[1][4]*a[2][1]*a[3][0]*a[5][5] + a[0][2]*a[1][4]*a[2][1]*a[3][5]*a[5][0] + a[0][2]*a[1][4]*a[2][5]*a[3][0]*a[5][1] - a[0][2]*a[1][4]*a[2][5]*a[3][1]*a[5][0] - a[0][2]*a[1][5]*a[2][0]*a[3][1]*a[5][4] + a[0][2]*a[1][5]*a[2][0]*a[3][4]*a[5][1] + a[0][2]*a[1][5]*a[2][1]*a[3][0]*a[5][4] - a[0][2]*a[1][5]*a[2][1]*a[3][4]*a[5][0] - a[0][2]*a[1][5]*a[2][4]*a[3][0]*a[5][1] + a[0][2]*a[1][5]*a[2][4]*a[3][1]*a[5][0] - a[0][4]*a[1][0]*a[2][1]*a[3][2]*a[5][5] + a[0][4]*a[1][0]*a[2][1]*a[3][5]*a[5][2] + a[0][4]*a[1][0]*a[2][2]*a[3][1]*a[5][5] - a[0][4]*a[1][0]*a[2][2]*a[3][5]*a[5][1] - a[0][4]*a[1][0]*a[2][5]*a[3][1]*a[5][2] + a[0][4]*a[1][0]*a[2][5]*a[3][2]*a[5][1] + a[0][4]*a[1][1]*a[2][0]*a[3][2]*a[5][5] - a[0][4]*a[1][1]*a[2][0]*a[3][5]*a[5][2] - a[0][4]*a[1][1]*a[2][2]*a[3][0]*a[5][5] + a[0][4]*a[1][1]*a[2][2]*a[3][5]*a[5][0] + a[0][4]*a[1][1]*a[2][5]*a[3][0]*a[5][2] - a[0][4]*a[1][1]*a[2][5]*a[3][2]*a[5][0] - a[0][4]*a[1][2]*a[2][0]*a[3][1]*a[5][5] + a[0][4]*a[1][2]*a[2][0]*a[3][5]*a[5][1] + a[0][4]*a[1][2]*a[2][1]*a[3][0]*a[5][5] - a[0][4]*a[1][2]*a[2][1]*a[3][5]*a[5][0] - a[0][4]*a[1][2]*a[2][5]*a[3][0]*a[5][1] + a[0][4]*a[1][2]*a[2][5]*a[3][1]*a[5][0] + a[0][4]*a[1][5]*a[2][0]*a[3][1]*a[5][2] - a[0][4]*a[1][5]*a[2][0]*a[3][2]*a[5][1] - a[0][4]*a[1][5]*a[2][1]*a[3][0]*a[5][2] + a[0][4]*a[1][5]*a[2][1]*a[3][2]*a[5][0] + a[0][4]*a[1][5]*a[2][2]*a[3][0]*a[5][1] - a[0][4]*a[1][5]*a[2][2]*a[3][1]*a[5][0] + a[0][5]*a[1][0]*a[2][1]*a[3][2]*a[5][4] - a[0][5]*a[1][0]*a[2][1]*a[3][4]*a[5][2] - a[0][5]*a[1][0]*a[2][2]*a[3][1]*a[5][4] + a[0][5]*a[1][0]*a[2][2]*a[3][4]*a[5][1] + a[0][5]*a[1][0]*a[2][4]*a[3][1]*a[5][2] - a[0][5]*a[1][0]*a[2][4]*a[3][2]*a[5][1] - a[0][5]*a[1][1]*a[2][0]*a[3][2]*a[5][4] + a[0][5]*a[1][1]*a[2][0]*a[3][4]*a[5][2] + a[0][5]*a[1][1]*a[2][2]*a[3][0]*a[5][4] - a[0][5]*a[1][1]*a[2][2]*a[3][4]*a[5][0] - a[0][5]*a[1][1]*a[2][4]*a[3][0]*a[5][2] + a[0][5]*a[1][1]*a[2][4]*a[3][2]*a[5][0] + a[0][5]*a[1][2]*a[2][0]*a[3][1]*a[5][4] - a[0][5]*a[1][2]*a[2][0]*a[3][4]*a[5][1] - a[0][5]*a[1][2]*a[2][1]*a[3][0]*a[5][4] + a[0][5]*a[1][2]*a[2][1]*a[3][4]*a[5][0] + a[0][5]*a[1][2]*a[2][4]*a[3][0]*a[5][1] - a[0][5]*a[1][2]*a[2][4]*a[3][1]*a[5][0] - a[0][5]*a[1][4]*a[2][0]*a[3][1]*a[5][2] + a[0][5]*a[1][4]*a[2][0]*a[3][2]*a[5][1] + a[0][5]*a[1][4]*a[2][1]*a[3][0]*a[5][2] - a[0][5]*a[1][4]*a[2][1]*a[3][2]*a[5][0] - a[0][5]*a[1][4]*a[2][2]*a[3][0]*a[5][1] + a[0][5]*a[1][4]*a[2][2]*a[3][1]*a[5][0])/denom;
invA[4][4] = (a[0][0]*a[1][1]*a[2][2]*a[3][3]*a[5][5] - a[0][0]*a[1][1]*a[2][2]*a[3][5]*a[5][3] - a[0][0]*a[1][1]*a[2][3]*a[3][2]*a[5][5] + a[0][0]*a[1][1]*a[2][3]*a[3][5]*a[5][2] + a[0][0]*a[1][1]*a[2][5]*a[3][2]*a[5][3] - a[0][0]*a[1][1]*a[2][5]*a[3][3]*a[5][2] - a[0][0]*a[1][2]*a[2][1]*a[3][3]*a[5][5] + a[0][0]*a[1][2]*a[2][1]*a[3][5]*a[5][3] + a[0][0]*a[1][2]*a[2][3]*a[3][1]*a[5][5] - a[0][0]*a[1][2]*a[2][3]*a[3][5]*a[5][1] - a[0][0]*a[1][2]*a[2][5]*a[3][1]*a[5][3] + a[0][0]*a[1][2]*a[2][5]*a[3][3]*a[5][1] + a[0][0]*a[1][3]*a[2][1]*a[3][2]*a[5][5] - a[0][0]*a[1][3]*a[2][1]*a[3][5]*a[5][2] - a[0][0]*a[1][3]*a[2][2]*a[3][1]*a[5][5] + a[0][0]*a[1][3]*a[2][2]*a[3][5]*a[5][1] + a[0][0]*a[1][3]*a[2][5]*a[3][1]*a[5][2] - a[0][0]*a[1][3]*a[2][5]*a[3][2]*a[5][1] - a[0][0]*a[1][5]*a[2][1]*a[3][2]*a[5][3] + a[0][0]*a[1][5]*a[2][1]*a[3][3]*a[5][2] + a[0][0]*a[1][5]*a[2][2]*a[3][1]*a[5][3] - a[0][0]*a[1][5]*a[2][2]*a[3][3]*a[5][1] - a[0][0]*a[1][5]*a[2][3]*a[3][1]*a[5][2] + a[0][0]*a[1][5]*a[2][3]*a[3][2]*a[5][1] - a[0][1]*a[1][0]*a[2][2]*a[3][3]*a[5][5] + a[0][1]*a[1][0]*a[2][2]*a[3][5]*a[5][3] + a[0][1]*a[1][0]*a[2][3]*a[3][2]*a[5][5] - a[0][1]*a[1][0]*a[2][3]*a[3][5]*a[5][2] - a[0][1]*a[1][0]*a[2][5]*a[3][2]*a[5][3] + a[0][1]*a[1][0]*a[2][5]*a[3][3]*a[5][2] + a[0][1]*a[1][2]*a[2][0]*a[3][3]*a[5][5] - a[0][1]*a[1][2]*a[2][0]*a[3][5]*a[5][3] - a[0][1]*a[1][2]*a[2][3]*a[3][0]*a[5][5] + a[0][1]*a[1][2]*a[2][3]*a[3][5]*a[5][0] + a[0][1]*a[1][2]*a[2][5]*a[3][0]*a[5][3] - a[0][1]*a[1][2]*a[2][5]*a[3][3]*a[5][0] - a[0][1]*a[1][3]*a[2][0]*a[3][2]*a[5][5] + a[0][1]*a[1][3]*a[2][0]*a[3][5]*a[5][2] + a[0][1]*a[1][3]*a[2][2]*a[3][0]*a[5][5] - a[0][1]*a[1][3]*a[2][2]*a[3][5]*a[5][0] - a[0][1]*a[1][3]*a[2][5]*a[3][0]*a[5][2] + a[0][1]*a[1][3]*a[2][5]*a[3][2]*a[5][0] + a[0][1]*a[1][5]*a[2][0]*a[3][2]*a[5][3] - a[0][1]*a[1][5]*a[2][0]*a[3][3]*a[5][2] - a[0][1]*a[1][5]*a[2][2]*a[3][0]*a[5][3] + a[0][1]*a[1][5]*a[2][2]*a[3][3]*a[5][0] + a[0][1]*a[1][5]*a[2][3]*a[3][0]*a[5][2] - a[0][1]*a[1][5]*a[2][3]*a[3][2]*a[5][0] + a[0][2]*a[1][0]*a[2][1]*a[3][3]*a[5][5] - a[0][2]*a[1][0]*a[2][1]*a[3][5]*a[5][3] - a[0][2]*a[1][0]*a[2][3]*a[3][1]*a[5][5] + a[0][2]*a[1][0]*a[2][3]*a[3][5]*a[5][1] + a[0][2]*a[1][0]*a[2][5]*a[3][1]*a[5][3] - a[0][2]*a[1][0]*a[2][5]*a[3][3]*a[5][1] - a[0][2]*a[1][1]*a[2][0]*a[3][3]*a[5][5] + a[0][2]*a[1][1]*a[2][0]*a[3][5]*a[5][3] + a[0][2]*a[1][1]*a[2][3]*a[3][0]*a[5][5] - a[0][2]*a[1][1]*a[2][3]*a[3][5]*a[5][0] - a[0][2]*a[1][1]*a[2][5]*a[3][0]*a[5][3] + a[0][2]*a[1][1]*a[2][5]*a[3][3]*a[5][0] + a[0][2]*a[1][3]*a[2][0]*a[3][1]*a[5][5] - a[0][2]*a[1][3]*a[2][0]*a[3][5]*a[5][1] - a[0][2]*a[1][3]*a[2][1]*a[3][0]*a[5][5] + a[0][2]*a[1][3]*a[2][1]*a[3][5]*a[5][0] + a[0][2]*a[1][3]*a[2][5]*a[3][0]*a[5][1] - a[0][2]*a[1][3]*a[2][5]*a[3][1]*a[5][0] - a[0][2]*a[1][5]*a[2][0]*a[3][1]*a[5][3] + a[0][2]*a[1][5]*a[2][0]*a[3][3]*a[5][1] + a[0][2]*a[1][5]*a[2][1]*a[3][0]*a[5][3] - a[0][2]*a[1][5]*a[2][1]*a[3][3]*a[5][0] - a[0][2]*a[1][5]*a[2][3]*a[3][0]*a[5][1] + a[0][2]*a[1][5]*a[2][3]*a[3][1]*a[5][0] - a[0][3]*a[1][0]*a[2][1]*a[3][2]*a[5][5] + a[0][3]*a[1][0]*a[2][1]*a[3][5]*a[5][2] + a[0][3]*a[1][0]*a[2][2]*a[3][1]*a[5][5] - a[0][3]*a[1][0]*a[2][2]*a[3][5]*a[5][1] - a[0][3]*a[1][0]*a[2][5]*a[3][1]*a[5][2] + a[0][3]*a[1][0]*a[2][5]*a[3][2]*a[5][1] + a[0][3]*a[1][1]*a[2][0]*a[3][2]*a[5][5] - a[0][3]*a[1][1]*a[2][0]*a[3][5]*a[5][2] - a[0][3]*a[1][1]*a[2][2]*a[3][0]*a[5][5] + a[0][3]*a[1][1]*a[2][2]*a[3][5]*a[5][0] + a[0][3]*a[1][1]*a[2][5]*a[3][0]*a[5][2] - a[0][3]*a[1][1]*a[2][5]*a[3][2]*a[5][0] - a[0][3]*a[1][2]*a[2][0]*a[3][1]*a[5][5] + a[0][3]*a[1][2]*a[2][0]*a[3][5]*a[5][1] + a[0][3]*a[1][2]*a[2][1]*a[3][0]*a[5][5] - a[0][3]*a[1][2]*a[2][1]*a[3][5]*a[5][0] - a[0][3]*a[1][2]*a[2][5]*a[3][0]*a[5][1] + a[0][3]*a[1][2]*a[2][5]*a[3][1]*a[5][0] + a[0][3]*a[1][5]*a[2][0]*a[3][1]*a[5][2] - a[0][3]*a[1][5]*a[2][0]*a[3][2]*a[5][1] - a[0][3]*a[1][5]*a[2][1]*a[3][0]*a[5][2] + a[0][3]*a[1][5]*a[2][1]*a[3][2]*a[5][0] + a[0][3]*a[1][5]*a[2][2]*a[3][0]*a[5][1] - a[0][3]*a[1][5]*a[2][2]*a[3][1]*a[5][0] + a[0][5]*a[1][0]*a[2][1]*a[3][2]*a[5][3] - a[0][5]*a[1][0]*a[2][1]*a[3][3]*a[5][2] - a[0][5]*a[1][0]*a[2][2]*a[3][1]*a[5][3] + a[0][5]*a[1][0]*a[2][2]*a[3][3]*a[5][1] + a[0][5]*a[1][0]*a[2][3]*a[3][1]*a[5][2] - a[0][5]*a[1][0]*a[2][3]*a[3][2]*a[5][1] - a[0][5]*a[1][1]*a[2][0]*a[3][2]*a[5][3] + a[0][5]*a[1][1]*a[2][0]*a[3][3]*a[5][2] + a[0][5]*a[1][1]*a[2][2]*a[3][0]*a[5][3] - a[0][5]*a[1][1]*a[2][2]*a[3][3]*a[5][0] - a[0][5]*a[1][1]*a[2][3]*a[3][0]*a[5][2] + a[0][5]*a[1][1]*a[2][3]*a[3][2]*a[5][0] + a[0][5]*a[1][2]*a[2][0]*a[3][1]*a[5][3] - a[0][5]*a[1][2]*a[2][0]*a[3][3]*a[5][1] - a[0][5]*a[1][2]*a[2][1]*a[3][0]*a[5][3] + a[0][5]*a[1][2]*a[2][1]*a[3][3]*a[5][0] + a[0][5]*a[1][2]*a[2][3]*a[3][0]*a[5][1] - a[0][5]*a[1][2]*a[2][3]*a[3][1]*a[5][0] - a[0][5]*a[1][3]*a[2][0]*a[3][1]*a[5][2] + a[0][5]*a[1][3]*a[2][0]*a[3][2]*a[5][1] + a[0][5]*a[1][3]*a[2][1]*a[3][0]*a[5][2] - a[0][5]*a[1][3]*a[2][1]*a[3][2]*a[5][0] - a[0][5]*a[1][3]*a[2][2]*a[3][0]*a[5][1] + a[0][5]*a[1][3]*a[2][2]*a[3][1]*a[5][0])/denom;
invA[5][4] = -(a[0][0]*a[1][1]*a[2][2]*a[3][3]*a[5][4] - a[0][0]*a[1][1]*a[2][2]*a[3][4]*a[5][3] - a[0][0]*a[1][1]*a[2][3]*a[3][2]*a[5][4] + a[0][0]*a[1][1]*a[2][3]*a[3][4]*a[5][2] + a[0][0]*a[1][1]*a[2][4]*a[3][2]*a[5][3] - a[0][0]*a[1][1]*a[2][4]*a[3][3]*a[5][2] - a[0][0]*a[1][2]*a[2][1]*a[3][3]*a[5][4] + a[0][0]*a[1][2]*a[2][1]*a[3][4]*a[5][3] + a[0][0]*a[1][2]*a[2][3]*a[3][1]*a[5][4] - a[0][0]*a[1][2]*a[2][3]*a[3][4]*a[5][1] - a[0][0]*a[1][2]*a[2][4]*a[3][1]*a[5][3] + a[0][0]*a[1][2]*a[2][4]*a[3][3]*a[5][1] + a[0][0]*a[1][3]*a[2][1]*a[3][2]*a[5][4] - a[0][0]*a[1][3]*a[2][1]*a[3][4]*a[5][2] - a[0][0]*a[1][3]*a[2][2]*a[3][1]*a[5][4] + a[0][0]*a[1][3]*a[2][2]*a[3][4]*a[5][1] + a[0][0]*a[1][3]*a[2][4]*a[3][1]*a[5][2] - a[0][0]*a[1][3]*a[2][4]*a[3][2]*a[5][1] - a[0][0]*a[1][4]*a[2][1]*a[3][2]*a[5][3] + a[0][0]*a[1][4]*a[2][1]*a[3][3]*a[5][2] + a[0][0]*a[1][4]*a[2][2]*a[3][1]*a[5][3] - a[0][0]*a[1][4]*a[2][2]*a[3][3]*a[5][1] - a[0][0]*a[1][4]*a[2][3]*a[3][1]*a[5][2] + a[0][0]*a[1][4]*a[2][3]*a[3][2]*a[5][1] - a[0][1]*a[1][0]*a[2][2]*a[3][3]*a[5][4] + a[0][1]*a[1][0]*a[2][2]*a[3][4]*a[5][3] + a[0][1]*a[1][0]*a[2][3]*a[3][2]*a[5][4] - a[0][1]*a[1][0]*a[2][3]*a[3][4]*a[5][2] - a[0][1]*a[1][0]*a[2][4]*a[3][2]*a[5][3] + a[0][1]*a[1][0]*a[2][4]*a[3][3]*a[5][2] + a[0][1]*a[1][2]*a[2][0]*a[3][3]*a[5][4] - a[0][1]*a[1][2]*a[2][0]*a[3][4]*a[5][3] - a[0][1]*a[1][2]*a[2][3]*a[3][0]*a[5][4] + a[0][1]*a[1][2]*a[2][3]*a[3][4]*a[5][0] + a[0][1]*a[1][2]*a[2][4]*a[3][0]*a[5][3] - a[0][1]*a[1][2]*a[2][4]*a[3][3]*a[5][0] - a[0][1]*a[1][3]*a[2][0]*a[3][2]*a[5][4] + a[0][1]*a[1][3]*a[2][0]*a[3][4]*a[5][2] + a[0][1]*a[1][3]*a[2][2]*a[3][0]*a[5][4] - a[0][1]*a[1][3]*a[2][2]*a[3][4]*a[5][0] - a[0][1]*a[1][3]*a[2][4]*a[3][0]*a[5][2] + a[0][1]*a[1][3]*a[2][4]*a[3][2]*a[5][0] + a[0][1]*a[1][4]*a[2][0]*a[3][2]*a[5][3] - a[0][1]*a[1][4]*a[2][0]*a[3][3]*a[5][2] - a[0][1]*a[1][4]*a[2][2]*a[3][0]*a[5][3] + a[0][1]*a[1][4]*a[2][2]*a[3][3]*a[5][0] + a[0][1]*a[1][4]*a[2][3]*a[3][0]*a[5][2] - a[0][1]*a[1][4]*a[2][3]*a[3][2]*a[5][0] + a[0][2]*a[1][0]*a[2][1]*a[3][3]*a[5][4] - a[0][2]*a[1][0]*a[2][1]*a[3][4]*a[5][3] - a[0][2]*a[1][0]*a[2][3]*a[3][1]*a[5][4] + a[0][2]*a[1][0]*a[2][3]*a[3][4]*a[5][1] + a[0][2]*a[1][0]*a[2][4]*a[3][1]*a[5][3] - a[0][2]*a[1][0]*a[2][4]*a[3][3]*a[5][1] - a[0][2]*a[1][1]*a[2][0]*a[3][3]*a[5][4] + a[0][2]*a[1][1]*a[2][0]*a[3][4]*a[5][3] + a[0][2]*a[1][1]*a[2][3]*a[3][0]*a[5][4] - a[0][2]*a[1][1]*a[2][3]*a[3][4]*a[5][0] - a[0][2]*a[1][1]*a[2][4]*a[3][0]*a[5][3] + a[0][2]*a[1][1]*a[2][4]*a[3][3]*a[5][0] + a[0][2]*a[1][3]*a[2][0]*a[3][1]*a[5][4] - a[0][2]*a[1][3]*a[2][0]*a[3][4]*a[5][1] - a[0][2]*a[1][3]*a[2][1]*a[3][0]*a[5][4] + a[0][2]*a[1][3]*a[2][1]*a[3][4]*a[5][0] + a[0][2]*a[1][3]*a[2][4]*a[3][0]*a[5][1] - a[0][2]*a[1][3]*a[2][4]*a[3][1]*a[5][0] - a[0][2]*a[1][4]*a[2][0]*a[3][1]*a[5][3] + a[0][2]*a[1][4]*a[2][0]*a[3][3]*a[5][1] + a[0][2]*a[1][4]*a[2][1]*a[3][0]*a[5][3] - a[0][2]*a[1][4]*a[2][1]*a[3][3]*a[5][0] - a[0][2]*a[1][4]*a[2][3]*a[3][0]*a[5][1] + a[0][2]*a[1][4]*a[2][3]*a[3][1]*a[5][0] - a[0][3]*a[1][0]*a[2][1]*a[3][2]*a[5][4] + a[0][3]*a[1][0]*a[2][1]*a[3][4]*a[5][2] + a[0][3]*a[1][0]*a[2][2]*a[3][1]*a[5][4] - a[0][3]*a[1][0]*a[2][2]*a[3][4]*a[5][1] - a[0][3]*a[1][0]*a[2][4]*a[3][1]*a[5][2] + a[0][3]*a[1][0]*a[2][4]*a[3][2]*a[5][1] + a[0][3]*a[1][1]*a[2][0]*a[3][2]*a[5][4] - a[0][3]*a[1][1]*a[2][0]*a[3][4]*a[5][2] - a[0][3]*a[1][1]*a[2][2]*a[3][0]*a[5][4] + a[0][3]*a[1][1]*a[2][2]*a[3][4]*a[5][0] + a[0][3]*a[1][1]*a[2][4]*a[3][0]*a[5][2] - a[0][3]*a[1][1]*a[2][4]*a[3][2]*a[5][0] - a[0][3]*a[1][2]*a[2][0]*a[3][1]*a[5][4] + a[0][3]*a[1][2]*a[2][0]*a[3][4]*a[5][1] + a[0][3]*a[1][2]*a[2][1]*a[3][0]*a[5][4] - a[0][3]*a[1][2]*a[2][1]*a[3][4]*a[5][0] - a[0][3]*a[1][2]*a[2][4]*a[3][0]*a[5][1] + a[0][3]*a[1][2]*a[2][4]*a[3][1]*a[5][0] + a[0][3]*a[1][4]*a[2][0]*a[3][1]*a[5][2] - a[0][3]*a[1][4]*a[2][0]*a[3][2]*a[5][1] - a[0][3]*a[1][4]*a[2][1]*a[3][0]*a[5][2] + a[0][3]*a[1][4]*a[2][1]*a[3][2]*a[5][0] + a[0][3]*a[1][4]*a[2][2]*a[3][0]*a[5][1] - a[0][3]*a[1][4]*a[2][2]*a[3][1]*a[5][0] + a[0][4]*a[1][0]*a[2][1]*a[3][2]*a[5][3] - a[0][4]*a[1][0]*a[2][1]*a[3][3]*a[5][2] - a[0][4]*a[1][0]*a[2][2]*a[3][1]*a[5][3] + a[0][4]*a[1][0]*a[2][2]*a[3][3]*a[5][1] + a[0][4]*a[1][0]*a[2][3]*a[3][1]*a[5][2] - a[0][4]*a[1][0]*a[2][3]*a[3][2]*a[5][1] - a[0][4]*a[1][1]*a[2][0]*a[3][2]*a[5][3] + a[0][4]*a[1][1]*a[2][0]*a[3][3]*a[5][2] + a[0][4]*a[1][1]*a[2][2]*a[3][0]*a[5][3] - a[0][4]*a[1][1]*a[2][2]*a[3][3]*a[5][0] - a[0][4]*a[1][1]*a[2][3]*a[3][0]*a[5][2] + a[0][4]*a[1][1]*a[2][3]*a[3][2]*a[5][0] + a[0][4]*a[1][2]*a[2][0]*a[3][1]*a[5][3] - a[0][4]*a[1][2]*a[2][0]*a[3][3]*a[5][1] - a[0][4]*a[1][2]*a[2][1]*a[3][0]*a[5][3] + a[0][4]*a[1][2]*a[2][1]*a[3][3]*a[5][0] + a[0][4]*a[1][2]*a[2][3]*a[3][0]*a[5][1] - a[0][4]*a[1][2]*a[2][3]*a[3][1]*a[5][0] - a[0][4]*a[1][3]*a[2][0]*a[3][1]*a[5][2] + a[0][4]*a[1][3]*a[2][0]*a[3][2]*a[5][1] + a[0][4]*a[1][3]*a[2][1]*a[3][0]*a[5][2] - a[0][4]*a[1][3]*a[2][1]*a[3][2]*a[5][0] - a[0][4]*a[1][3]*a[2][2]*a[3][0]*a[5][1] + a[0][4]*a[1][3]*a[2][2]*a[3][1]*a[5][0])/denom;
invA[0][5] = -(a[0][1]*a[1][2]*a[2][3]*a[3][4]*a[4][5] - a[0][1]*a[1][2]*a[2][3]*a[3][5]*a[4][4] - a[0][1]*a[1][2]*a[2][4]*a[3][3]*a[4][5] + a[0][1]*a[1][2]*a[2][4]*a[3][5]*a[4][3] + a[0][1]*a[1][2]*a[2][5]*a[3][3]*a[4][4] - a[0][1]*a[1][2]*a[2][5]*a[3][4]*a[4][3] - a[0][1]*a[1][3]*a[2][2]*a[3][4]*a[4][5] + a[0][1]*a[1][3]*a[2][2]*a[3][5]*a[4][4] + a[0][1]*a[1][3]*a[2][4]*a[3][2]*a[4][5] - a[0][1]*a[1][3]*a[2][4]*a[3][5]*a[4][2] - a[0][1]*a[1][3]*a[2][5]*a[3][2]*a[4][4] + a[0][1]*a[1][3]*a[2][5]*a[3][4]*a[4][2] + a[0][1]*a[1][4]*a[2][2]*a[3][3]*a[4][5] - a[0][1]*a[1][4]*a[2][2]*a[3][5]*a[4][3] - a[0][1]*a[1][4]*a[2][3]*a[3][2]*a[4][5] + a[0][1]*a[1][4]*a[2][3]*a[3][5]*a[4][2] + a[0][1]*a[1][4]*a[2][5]*a[3][2]*a[4][3] - a[0][1]*a[1][4]*a[2][5]*a[3][3]*a[4][2] - a[0][1]*a[1][5]*a[2][2]*a[3][3]*a[4][4] + a[0][1]*a[1][5]*a[2][2]*a[3][4]*a[4][3] + a[0][1]*a[1][5]*a[2][3]*a[3][2]*a[4][4] - a[0][1]*a[1][5]*a[2][3]*a[3][4]*a[4][2] - a[0][1]*a[1][5]*a[2][4]*a[3][2]*a[4][3] + a[0][1]*a[1][5]*a[2][4]*a[3][3]*a[4][2] - a[0][2]*a[1][1]*a[2][3]*a[3][4]*a[4][5] + a[0][2]*a[1][1]*a[2][3]*a[3][5]*a[4][4] + a[0][2]*a[1][1]*a[2][4]*a[3][3]*a[4][5] - a[0][2]*a[1][1]*a[2][4]*a[3][5]*a[4][3] - a[0][2]*a[1][1]*a[2][5]*a[3][3]*a[4][4] + a[0][2]*a[1][1]*a[2][5]*a[3][4]*a[4][3] + a[0][2]*a[1][3]*a[2][1]*a[3][4]*a[4][5] - a[0][2]*a[1][3]*a[2][1]*a[3][5]*a[4][4] - a[0][2]*a[1][3]*a[2][4]*a[3][1]*a[4][5] + a[0][2]*a[1][3]*a[2][4]*a[3][5]*a[4][1] + a[0][2]*a[1][3]*a[2][5]*a[3][1]*a[4][4] - a[0][2]*a[1][3]*a[2][5]*a[3][4]*a[4][1] - a[0][2]*a[1][4]*a[2][1]*a[3][3]*a[4][5] + a[0][2]*a[1][4]*a[2][1]*a[3][5]*a[4][3] + a[0][2]*a[1][4]*a[2][3]*a[3][1]*a[4][5] - a[0][2]*a[1][4]*a[2][3]*a[3][5]*a[4][1] - a[0][2]*a[1][4]*a[2][5]*a[3][1]*a[4][3] + a[0][2]*a[1][4]*a[2][5]*a[3][3]*a[4][1] + a[0][2]*a[1][5]*a[2][1]*a[3][3]*a[4][4] - a[0][2]*a[1][5]*a[2][1]*a[3][4]*a[4][3] - a[0][2]*a[1][5]*a[2][3]*a[3][1]*a[4][4] + a[0][2]*a[1][5]*a[2][3]*a[3][4]*a[4][1] + a[0][2]*a[1][5]*a[2][4]*a[3][1]*a[4][3] - a[0][2]*a[1][5]*a[2][4]*a[3][3]*a[4][1] + a[0][3]*a[1][1]*a[2][2]*a[3][4]*a[4][5] - a[0][3]*a[1][1]*a[2][2]*a[3][5]*a[4][4] - a[0][3]*a[1][1]*a[2][4]*a[3][2]*a[4][5] + a[0][3]*a[1][1]*a[2][4]*a[3][5]*a[4][2] + a[0][3]*a[1][1]*a[2][5]*a[3][2]*a[4][4] - a[0][3]*a[1][1]*a[2][5]*a[3][4]*a[4][2] - a[0][3]*a[1][2]*a[2][1]*a[3][4]*a[4][5] + a[0][3]*a[1][2]*a[2][1]*a[3][5]*a[4][4] + a[0][3]*a[1][2]*a[2][4]*a[3][1]*a[4][5] - a[0][3]*a[1][2]*a[2][4]*a[3][5]*a[4][1] - a[0][3]*a[1][2]*a[2][5]*a[3][1]*a[4][4] + a[0][3]*a[1][2]*a[2][5]*a[3][4]*a[4][1] + a[0][3]*a[1][4]*a[2][1]*a[3][2]*a[4][5] - a[0][3]*a[1][4]*a[2][1]*a[3][5]*a[4][2] - a[0][3]*a[1][4]*a[2][2]*a[3][1]*a[4][5] + a[0][3]*a[1][4]*a[2][2]*a[3][5]*a[4][1] + a[0][3]*a[1][4]*a[2][5]*a[3][1]*a[4][2] - a[0][3]*a[1][4]*a[2][5]*a[3][2]*a[4][1] - a[0][3]*a[1][5]*a[2][1]*a[3][2]*a[4][4] + a[0][3]*a[1][5]*a[2][1]*a[3][4]*a[4][2] + a[0][3]*a[1][5]*a[2][2]*a[3][1]*a[4][4] - a[0][3]*a[1][5]*a[2][2]*a[3][4]*a[4][1] - a[0][3]*a[1][5]*a[2][4]*a[3][1]*a[4][2] + a[0][3]*a[1][5]*a[2][4]*a[3][2]*a[4][1] - a[0][4]*a[1][1]*a[2][2]*a[3][3]*a[4][5] + a[0][4]*a[1][1]*a[2][2]*a[3][5]*a[4][3] + a[0][4]*a[1][1]*a[2][3]*a[3][2]*a[4][5] - a[0][4]*a[1][1]*a[2][3]*a[3][5]*a[4][2] - a[0][4]*a[1][1]*a[2][5]*a[3][2]*a[4][3] + a[0][4]*a[1][1]*a[2][5]*a[3][3]*a[4][2] + a[0][4]*a[1][2]*a[2][1]*a[3][3]*a[4][5] - a[0][4]*a[1][2]*a[2][1]*a[3][5]*a[4][3] - a[0][4]*a[1][2]*a[2][3]*a[3][1]*a[4][5] + a[0][4]*a[1][2]*a[2][3]*a[3][5]*a[4][1] + a[0][4]*a[1][2]*a[2][5]*a[3][1]*a[4][3] - a[0][4]*a[1][2]*a[2][5]*a[3][3]*a[4][1] - a[0][4]*a[1][3]*a[2][1]*a[3][2]*a[4][5] + a[0][4]*a[1][3]*a[2][1]*a[3][5]*a[4][2] + a[0][4]*a[1][3]*a[2][2]*a[3][1]*a[4][5] - a[0][4]*a[1][3]*a[2][2]*a[3][5]*a[4][1] - a[0][4]*a[1][3]*a[2][5]*a[3][1]*a[4][2] + a[0][4]*a[1][3]*a[2][5]*a[3][2]*a[4][1] + a[0][4]*a[1][5]*a[2][1]*a[3][2]*a[4][3] - a[0][4]*a[1][5]*a[2][1]*a[3][3]*a[4][2] - a[0][4]*a[1][5]*a[2][2]*a[3][1]*a[4][3] + a[0][4]*a[1][5]*a[2][2]*a[3][3]*a[4][1] + a[0][4]*a[1][5]*a[2][3]*a[3][1]*a[4][2] - a[0][4]*a[1][5]*a[2][3]*a[3][2]*a[4][1] + a[0][5]*a[1][1]*a[2][2]*a[3][3]*a[4][4] - a[0][5]*a[1][1]*a[2][2]*a[3][4]*a[4][3] - a[0][5]*a[1][1]*a[2][3]*a[3][2]*a[4][4] + a[0][5]*a[1][1]*a[2][3]*a[3][4]*a[4][2] + a[0][5]*a[1][1]*a[2][4]*a[3][2]*a[4][3] - a[0][5]*a[1][1]*a[2][4]*a[3][3]*a[4][2] - a[0][5]*a[1][2]*a[2][1]*a[3][3]*a[4][4] + a[0][5]*a[1][2]*a[2][1]*a[3][4]*a[4][3] + a[0][5]*a[1][2]*a[2][3]*a[3][1]*a[4][4] - a[0][5]*a[1][2]*a[2][3]*a[3][4]*a[4][1] - a[0][5]*a[1][2]*a[2][4]*a[3][1]*a[4][3] + a[0][5]*a[1][2]*a[2][4]*a[3][3]*a[4][1] + a[0][5]*a[1][3]*a[2][1]*a[3][2]*a[4][4] - a[0][5]*a[1][3]*a[2][1]*a[3][4]*a[4][2] - a[0][5]*a[1][3]*a[2][2]*a[3][1]*a[4][4] + a[0][5]*a[1][3]*a[2][2]*a[3][4]*a[4][1] + a[0][5]*a[1][3]*a[2][4]*a[3][1]*a[4][2] - a[0][5]*a[1][3]*a[2][4]*a[3][2]*a[4][1] - a[0][5]*a[1][4]*a[2][1]*a[3][2]*a[4][3] + a[0][5]*a[1][4]*a[2][1]*a[3][3]*a[4][2] + a[0][5]*a[1][4]*a[2][2]*a[3][1]*a[4][3] - a[0][5]*a[1][4]*a[2][2]*a[3][3]*a[4][1] - a[0][5]*a[1][4]*a[2][3]*a[3][1]*a[4][2] + a[0][5]*a[1][4]*a[2][3]*a[3][2]*a[4][1])/denom;
invA[1][5] = (a[0][0]*a[1][2]*a[2][3]*a[3][4]*a[4][5] - a[0][0]*a[1][2]*a[2][3]*a[3][5]*a[4][4] - a[0][0]*a[1][2]*a[2][4]*a[3][3]*a[4][5] + a[0][0]*a[1][2]*a[2][4]*a[3][5]*a[4][3] + a[0][0]*a[1][2]*a[2][5]*a[3][3]*a[4][4] - a[0][0]*a[1][2]*a[2][5]*a[3][4]*a[4][3] - a[0][0]*a[1][3]*a[2][2]*a[3][4]*a[4][5] + a[0][0]*a[1][3]*a[2][2]*a[3][5]*a[4][4] + a[0][0]*a[1][3]*a[2][4]*a[3][2]*a[4][5] - a[0][0]*a[1][3]*a[2][4]*a[3][5]*a[4][2] - a[0][0]*a[1][3]*a[2][5]*a[3][2]*a[4][4] + a[0][0]*a[1][3]*a[2][5]*a[3][4]*a[4][2] + a[0][0]*a[1][4]*a[2][2]*a[3][3]*a[4][5] - a[0][0]*a[1][4]*a[2][2]*a[3][5]*a[4][3] - a[0][0]*a[1][4]*a[2][3]*a[3][2]*a[4][5] + a[0][0]*a[1][4]*a[2][3]*a[3][5]*a[4][2] + a[0][0]*a[1][4]*a[2][5]*a[3][2]*a[4][3] - a[0][0]*a[1][4]*a[2][5]*a[3][3]*a[4][2] - a[0][0]*a[1][5]*a[2][2]*a[3][3]*a[4][4] + a[0][0]*a[1][5]*a[2][2]*a[3][4]*a[4][3] + a[0][0]*a[1][5]*a[2][3]*a[3][2]*a[4][4] - a[0][0]*a[1][5]*a[2][3]*a[3][4]*a[4][2] - a[0][0]*a[1][5]*a[2][4]*a[3][2]*a[4][3] + a[0][0]*a[1][5]*a[2][4]*a[3][3]*a[4][2] - a[0][2]*a[1][0]*a[2][3]*a[3][4]*a[4][5] + a[0][2]*a[1][0]*a[2][3]*a[3][5]*a[4][4] + a[0][2]*a[1][0]*a[2][4]*a[3][3]*a[4][5] - a[0][2]*a[1][0]*a[2][4]*a[3][5]*a[4][3] - a[0][2]*a[1][0]*a[2][5]*a[3][3]*a[4][4] + a[0][2]*a[1][0]*a[2][5]*a[3][4]*a[4][3] + a[0][2]*a[1][3]*a[2][0]*a[3][4]*a[4][5] - a[0][2]*a[1][3]*a[2][0]*a[3][5]*a[4][4] - a[0][2]*a[1][3]*a[2][4]*a[3][0]*a[4][5] + a[0][2]*a[1][3]*a[2][4]*a[3][5]*a[4][0] + a[0][2]*a[1][3]*a[2][5]*a[3][0]*a[4][4] - a[0][2]*a[1][3]*a[2][5]*a[3][4]*a[4][0] - a[0][2]*a[1][4]*a[2][0]*a[3][3]*a[4][5] + a[0][2]*a[1][4]*a[2][0]*a[3][5]*a[4][3] + a[0][2]*a[1][4]*a[2][3]*a[3][0]*a[4][5] - a[0][2]*a[1][4]*a[2][3]*a[3][5]*a[4][0] - a[0][2]*a[1][4]*a[2][5]*a[3][0]*a[4][3] + a[0][2]*a[1][4]*a[2][5]*a[3][3]*a[4][0] + a[0][2]*a[1][5]*a[2][0]*a[3][3]*a[4][4] - a[0][2]*a[1][5]*a[2][0]*a[3][4]*a[4][3] - a[0][2]*a[1][5]*a[2][3]*a[3][0]*a[4][4] + a[0][2]*a[1][5]*a[2][3]*a[3][4]*a[4][0] + a[0][2]*a[1][5]*a[2][4]*a[3][0]*a[4][3] - a[0][2]*a[1][5]*a[2][4]*a[3][3]*a[4][0] + a[0][3]*a[1][0]*a[2][2]*a[3][4]*a[4][5] - a[0][3]*a[1][0]*a[2][2]*a[3][5]*a[4][4] - a[0][3]*a[1][0]*a[2][4]*a[3][2]*a[4][5] + a[0][3]*a[1][0]*a[2][4]*a[3][5]*a[4][2] + a[0][3]*a[1][0]*a[2][5]*a[3][2]*a[4][4] - a[0][3]*a[1][0]*a[2][5]*a[3][4]*a[4][2] - a[0][3]*a[1][2]*a[2][0]*a[3][4]*a[4][5] + a[0][3]*a[1][2]*a[2][0]*a[3][5]*a[4][4] + a[0][3]*a[1][2]*a[2][4]*a[3][0]*a[4][5] - a[0][3]*a[1][2]*a[2][4]*a[3][5]*a[4][0] - a[0][3]*a[1][2]*a[2][5]*a[3][0]*a[4][4] + a[0][3]*a[1][2]*a[2][5]*a[3][4]*a[4][0] + a[0][3]*a[1][4]*a[2][0]*a[3][2]*a[4][5] - a[0][3]*a[1][4]*a[2][0]*a[3][5]*a[4][2] - a[0][3]*a[1][4]*a[2][2]*a[3][0]*a[4][5] + a[0][3]*a[1][4]*a[2][2]*a[3][5]*a[4][0] + a[0][3]*a[1][4]*a[2][5]*a[3][0]*a[4][2] - a[0][3]*a[1][4]*a[2][5]*a[3][2]*a[4][0] - a[0][3]*a[1][5]*a[2][0]*a[3][2]*a[4][4] + a[0][3]*a[1][5]*a[2][0]*a[3][4]*a[4][2] + a[0][3]*a[1][5]*a[2][2]*a[3][0]*a[4][4] - a[0][3]*a[1][5]*a[2][2]*a[3][4]*a[4][0] - a[0][3]*a[1][5]*a[2][4]*a[3][0]*a[4][2] + a[0][3]*a[1][5]*a[2][4]*a[3][2]*a[4][0] - a[0][4]*a[1][0]*a[2][2]*a[3][3]*a[4][5] + a[0][4]*a[1][0]*a[2][2]*a[3][5]*a[4][3] + a[0][4]*a[1][0]*a[2][3]*a[3][2]*a[4][5] - a[0][4]*a[1][0]*a[2][3]*a[3][5]*a[4][2] - a[0][4]*a[1][0]*a[2][5]*a[3][2]*a[4][3] + a[0][4]*a[1][0]*a[2][5]*a[3][3]*a[4][2] + a[0][4]*a[1][2]*a[2][0]*a[3][3]*a[4][5] - a[0][4]*a[1][2]*a[2][0]*a[3][5]*a[4][3] - a[0][4]*a[1][2]*a[2][3]*a[3][0]*a[4][5] + a[0][4]*a[1][2]*a[2][3]*a[3][5]*a[4][0] + a[0][4]*a[1][2]*a[2][5]*a[3][0]*a[4][3] - a[0][4]*a[1][2]*a[2][5]*a[3][3]*a[4][0] - a[0][4]*a[1][3]*a[2][0]*a[3][2]*a[4][5] + a[0][4]*a[1][3]*a[2][0]*a[3][5]*a[4][2] + a[0][4]*a[1][3]*a[2][2]*a[3][0]*a[4][5] - a[0][4]*a[1][3]*a[2][2]*a[3][5]*a[4][0] - a[0][4]*a[1][3]*a[2][5]*a[3][0]*a[4][2] + a[0][4]*a[1][3]*a[2][5]*a[3][2]*a[4][0] + a[0][4]*a[1][5]*a[2][0]*a[3][2]*a[4][3] - a[0][4]*a[1][5]*a[2][0]*a[3][3]*a[4][2] - a[0][4]*a[1][5]*a[2][2]*a[3][0]*a[4][3] + a[0][4]*a[1][5]*a[2][2]*a[3][3]*a[4][0] + a[0][4]*a[1][5]*a[2][3]*a[3][0]*a[4][2] - a[0][4]*a[1][5]*a[2][3]*a[3][2]*a[4][0] + a[0][5]*a[1][0]*a[2][2]*a[3][3]*a[4][4] - a[0][5]*a[1][0]*a[2][2]*a[3][4]*a[4][3] - a[0][5]*a[1][0]*a[2][3]*a[3][2]*a[4][4] + a[0][5]*a[1][0]*a[2][3]*a[3][4]*a[4][2] + a[0][5]*a[1][0]*a[2][4]*a[3][2]*a[4][3] - a[0][5]*a[1][0]*a[2][4]*a[3][3]*a[4][2] - a[0][5]*a[1][2]*a[2][0]*a[3][3]*a[4][4] + a[0][5]*a[1][2]*a[2][0]*a[3][4]*a[4][3] + a[0][5]*a[1][2]*a[2][3]*a[3][0]*a[4][4] - a[0][5]*a[1][2]*a[2][3]*a[3][4]*a[4][0] - a[0][5]*a[1][2]*a[2][4]*a[3][0]*a[4][3] + a[0][5]*a[1][2]*a[2][4]*a[3][3]*a[4][0] + a[0][5]*a[1][3]*a[2][0]*a[3][2]*a[4][4] - a[0][5]*a[1][3]*a[2][0]*a[3][4]*a[4][2] - a[0][5]*a[1][3]*a[2][2]*a[3][0]*a[4][4] + a[0][5]*a[1][3]*a[2][2]*a[3][4]*a[4][0] + a[0][5]*a[1][3]*a[2][4]*a[3][0]*a[4][2] - a[0][5]*a[1][3]*a[2][4]*a[3][2]*a[4][0] - a[0][5]*a[1][4]*a[2][0]*a[3][2]*a[4][3] + a[0][5]*a[1][4]*a[2][0]*a[3][3]*a[4][2] + a[0][5]*a[1][4]*a[2][2]*a[3][0]*a[4][3] - a[0][5]*a[1][4]*a[2][2]*a[3][3]*a[4][0] - a[0][5]*a[1][4]*a[2][3]*a[3][0]*a[4][2] + a[0][5]*a[1][4]*a[2][3]*a[3][2]*a[4][0])/denom;
invA[2][5] = -(a[0][0]*a[1][1]*a[2][3]*a[3][4]*a[4][5] - a[0][0]*a[1][1]*a[2][3]*a[3][5]*a[4][4] - a[0][0]*a[1][1]*a[2][4]*a[3][3]*a[4][5] + a[0][0]*a[1][1]*a[2][4]*a[3][5]*a[4][3] + a[0][0]*a[1][1]*a[2][5]*a[3][3]*a[4][4] - a[0][0]*a[1][1]*a[2][5]*a[3][4]*a[4][3] - a[0][0]*a[1][3]*a[2][1]*a[3][4]*a[4][5] + a[0][0]*a[1][3]*a[2][1]*a[3][5]*a[4][4] + a[0][0]*a[1][3]*a[2][4]*a[3][1]*a[4][5] - a[0][0]*a[1][3]*a[2][4]*a[3][5]*a[4][1] - a[0][0]*a[1][3]*a[2][5]*a[3][1]*a[4][4] + a[0][0]*a[1][3]*a[2][5]*a[3][4]*a[4][1] + a[0][0]*a[1][4]*a[2][1]*a[3][3]*a[4][5] - a[0][0]*a[1][4]*a[2][1]*a[3][5]*a[4][3] - a[0][0]*a[1][4]*a[2][3]*a[3][1]*a[4][5] + a[0][0]*a[1][4]*a[2][3]*a[3][5]*a[4][1] + a[0][0]*a[1][4]*a[2][5]*a[3][1]*a[4][3] - a[0][0]*a[1][4]*a[2][5]*a[3][3]*a[4][1] - a[0][0]*a[1][5]*a[2][1]*a[3][3]*a[4][4] + a[0][0]*a[1][5]*a[2][1]*a[3][4]*a[4][3] + a[0][0]*a[1][5]*a[2][3]*a[3][1]*a[4][4] - a[0][0]*a[1][5]*a[2][3]*a[3][4]*a[4][1] - a[0][0]*a[1][5]*a[2][4]*a[3][1]*a[4][3] + a[0][0]*a[1][5]*a[2][4]*a[3][3]*a[4][1] - a[0][1]*a[1][0]*a[2][3]*a[3][4]*a[4][5] + a[0][1]*a[1][0]*a[2][3]*a[3][5]*a[4][4] + a[0][1]*a[1][0]*a[2][4]*a[3][3]*a[4][5] - a[0][1]*a[1][0]*a[2][4]*a[3][5]*a[4][3] - a[0][1]*a[1][0]*a[2][5]*a[3][3]*a[4][4] + a[0][1]*a[1][0]*a[2][5]*a[3][4]*a[4][3] + a[0][1]*a[1][3]*a[2][0]*a[3][4]*a[4][5] - a[0][1]*a[1][3]*a[2][0]*a[3][5]*a[4][4] - a[0][1]*a[1][3]*a[2][4]*a[3][0]*a[4][5] + a[0][1]*a[1][3]*a[2][4]*a[3][5]*a[4][0] + a[0][1]*a[1][3]*a[2][5]*a[3][0]*a[4][4] - a[0][1]*a[1][3]*a[2][5]*a[3][4]*a[4][0] - a[0][1]*a[1][4]*a[2][0]*a[3][3]*a[4][5] + a[0][1]*a[1][4]*a[2][0]*a[3][5]*a[4][3] + a[0][1]*a[1][4]*a[2][3]*a[3][0]*a[4][5] - a[0][1]*a[1][4]*a[2][3]*a[3][5]*a[4][0] - a[0][1]*a[1][4]*a[2][5]*a[3][0]*a[4][3] + a[0][1]*a[1][4]*a[2][5]*a[3][3]*a[4][0] + a[0][1]*a[1][5]*a[2][0]*a[3][3]*a[4][4] - a[0][1]*a[1][5]*a[2][0]*a[3][4]*a[4][3] - a[0][1]*a[1][5]*a[2][3]*a[3][0]*a[4][4] + a[0][1]*a[1][5]*a[2][3]*a[3][4]*a[4][0] + a[0][1]*a[1][5]*a[2][4]*a[3][0]*a[4][3] - a[0][1]*a[1][5]*a[2][4]*a[3][3]*a[4][0] + a[0][3]*a[1][0]*a[2][1]*a[3][4]*a[4][5] - a[0][3]*a[1][0]*a[2][1]*a[3][5]*a[4][4] - a[0][3]*a[1][0]*a[2][4]*a[3][1]*a[4][5] + a[0][3]*a[1][0]*a[2][4]*a[3][5]*a[4][1] + a[0][3]*a[1][0]*a[2][5]*a[3][1]*a[4][4] - a[0][3]*a[1][0]*a[2][5]*a[3][4]*a[4][1] - a[0][3]*a[1][1]*a[2][0]*a[3][4]*a[4][5] + a[0][3]*a[1][1]*a[2][0]*a[3][5]*a[4][4] + a[0][3]*a[1][1]*a[2][4]*a[3][0]*a[4][5] - a[0][3]*a[1][1]*a[2][4]*a[3][5]*a[4][0] - a[0][3]*a[1][1]*a[2][5]*a[3][0]*a[4][4] + a[0][3]*a[1][1]*a[2][5]*a[3][4]*a[4][0] + a[0][3]*a[1][4]*a[2][0]*a[3][1]*a[4][5] - a[0][3]*a[1][4]*a[2][0]*a[3][5]*a[4][1] - a[0][3]*a[1][4]*a[2][1]*a[3][0]*a[4][5] + a[0][3]*a[1][4]*a[2][1]*a[3][5]*a[4][0] + a[0][3]*a[1][4]*a[2][5]*a[3][0]*a[4][1] - a[0][3]*a[1][4]*a[2][5]*a[3][1]*a[4][0] - a[0][3]*a[1][5]*a[2][0]*a[3][1]*a[4][4] + a[0][3]*a[1][5]*a[2][0]*a[3][4]*a[4][1] + a[0][3]*a[1][5]*a[2][1]*a[3][0]*a[4][4] - a[0][3]*a[1][5]*a[2][1]*a[3][4]*a[4][0] - a[0][3]*a[1][5]*a[2][4]*a[3][0]*a[4][1] + a[0][3]*a[1][5]*a[2][4]*a[3][1]*a[4][0] - a[0][4]*a[1][0]*a[2][1]*a[3][3]*a[4][5] + a[0][4]*a[1][0]*a[2][1]*a[3][5]*a[4][3] + a[0][4]*a[1][0]*a[2][3]*a[3][1]*a[4][5] - a[0][4]*a[1][0]*a[2][3]*a[3][5]*a[4][1] - a[0][4]*a[1][0]*a[2][5]*a[3][1]*a[4][3] + a[0][4]*a[1][0]*a[2][5]*a[3][3]*a[4][1] + a[0][4]*a[1][1]*a[2][0]*a[3][3]*a[4][5] - a[0][4]*a[1][1]*a[2][0]*a[3][5]*a[4][3] - a[0][4]*a[1][1]*a[2][3]*a[3][0]*a[4][5] + a[0][4]*a[1][1]*a[2][3]*a[3][5]*a[4][0] + a[0][4]*a[1][1]*a[2][5]*a[3][0]*a[4][3] - a[0][4]*a[1][1]*a[2][5]*a[3][3]*a[4][0] - a[0][4]*a[1][3]*a[2][0]*a[3][1]*a[4][5] + a[0][4]*a[1][3]*a[2][0]*a[3][5]*a[4][1] + a[0][4]*a[1][3]*a[2][1]*a[3][0]*a[4][5] - a[0][4]*a[1][3]*a[2][1]*a[3][5]*a[4][0] - a[0][4]*a[1][3]*a[2][5]*a[3][0]*a[4][1] + a[0][4]*a[1][3]*a[2][5]*a[3][1]*a[4][0] + a[0][4]*a[1][5]*a[2][0]*a[3][1]*a[4][3] - a[0][4]*a[1][5]*a[2][0]*a[3][3]*a[4][1] - a[0][4]*a[1][5]*a[2][1]*a[3][0]*a[4][3] + a[0][4]*a[1][5]*a[2][1]*a[3][3]*a[4][0] + a[0][4]*a[1][5]*a[2][3]*a[3][0]*a[4][1] - a[0][4]*a[1][5]*a[2][3]*a[3][1]*a[4][0] + a[0][5]*a[1][0]*a[2][1]*a[3][3]*a[4][4] - a[0][5]*a[1][0]*a[2][1]*a[3][4]*a[4][3] - a[0][5]*a[1][0]*a[2][3]*a[3][1]*a[4][4] + a[0][5]*a[1][0]*a[2][3]*a[3][4]*a[4][1] + a[0][5]*a[1][0]*a[2][4]*a[3][1]*a[4][3] - a[0][5]*a[1][0]*a[2][4]*a[3][3]*a[4][1] - a[0][5]*a[1][1]*a[2][0]*a[3][3]*a[4][4] + a[0][5]*a[1][1]*a[2][0]*a[3][4]*a[4][3] + a[0][5]*a[1][1]*a[2][3]*a[3][0]*a[4][4] - a[0][5]*a[1][1]*a[2][3]*a[3][4]*a[4][0] - a[0][5]*a[1][1]*a[2][4]*a[3][0]*a[4][3] + a[0][5]*a[1][1]*a[2][4]*a[3][3]*a[4][0] + a[0][5]*a[1][3]*a[2][0]*a[3][1]*a[4][4] - a[0][5]*a[1][3]*a[2][0]*a[3][4]*a[4][1] - a[0][5]*a[1][3]*a[2][1]*a[3][0]*a[4][4] + a[0][5]*a[1][3]*a[2][1]*a[3][4]*a[4][0] + a[0][5]*a[1][3]*a[2][4]*a[3][0]*a[4][1] - a[0][5]*a[1][3]*a[2][4]*a[3][1]*a[4][0] - a[0][5]*a[1][4]*a[2][0]*a[3][1]*a[4][3] + a[0][5]*a[1][4]*a[2][0]*a[3][3]*a[4][1] + a[0][5]*a[1][4]*a[2][1]*a[3][0]*a[4][3] - a[0][5]*a[1][4]*a[2][1]*a[3][3]*a[4][0] - a[0][5]*a[1][4]*a[2][3]*a[3][0]*a[4][1] + a[0][5]*a[1][4]*a[2][3]*a[3][1]*a[4][0])/denom;
invA[3][5] = (a[0][0]*a[1][1]*a[2][2]*a[3][4]*a[4][5] - a[0][0]*a[1][1]*a[2][2]*a[3][5]*a[4][4] - a[0][0]*a[1][1]*a[2][4]*a[3][2]*a[4][5] + a[0][0]*a[1][1]*a[2][4]*a[3][5]*a[4][2] + a[0][0]*a[1][1]*a[2][5]*a[3][2]*a[4][4] - a[0][0]*a[1][1]*a[2][5]*a[3][4]*a[4][2] - a[0][0]*a[1][2]*a[2][1]*a[3][4]*a[4][5] + a[0][0]*a[1][2]*a[2][1]*a[3][5]*a[4][4] + a[0][0]*a[1][2]*a[2][4]*a[3][1]*a[4][5] - a[0][0]*a[1][2]*a[2][4]*a[3][5]*a[4][1] - a[0][0]*a[1][2]*a[2][5]*a[3][1]*a[4][4] + a[0][0]*a[1][2]*a[2][5]*a[3][4]*a[4][1] + a[0][0]*a[1][4]*a[2][1]*a[3][2]*a[4][5] - a[0][0]*a[1][4]*a[2][1]*a[3][5]*a[4][2] - a[0][0]*a[1][4]*a[2][2]*a[3][1]*a[4][5] + a[0][0]*a[1][4]*a[2][2]*a[3][5]*a[4][1] + a[0][0]*a[1][4]*a[2][5]*a[3][1]*a[4][2] - a[0][0]*a[1][4]*a[2][5]*a[3][2]*a[4][1] - a[0][0]*a[1][5]*a[2][1]*a[3][2]*a[4][4] + a[0][0]*a[1][5]*a[2][1]*a[3][4]*a[4][2] + a[0][0]*a[1][5]*a[2][2]*a[3][1]*a[4][4] - a[0][0]*a[1][5]*a[2][2]*a[3][4]*a[4][1] - a[0][0]*a[1][5]*a[2][4]*a[3][1]*a[4][2] + a[0][0]*a[1][5]*a[2][4]*a[3][2]*a[4][1] - a[0][1]*a[1][0]*a[2][2]*a[3][4]*a[4][5] + a[0][1]*a[1][0]*a[2][2]*a[3][5]*a[4][4] + a[0][1]*a[1][0]*a[2][4]*a[3][2]*a[4][5] - a[0][1]*a[1][0]*a[2][4]*a[3][5]*a[4][2] - a[0][1]*a[1][0]*a[2][5]*a[3][2]*a[4][4] + a[0][1]*a[1][0]*a[2][5]*a[3][4]*a[4][2] + a[0][1]*a[1][2]*a[2][0]*a[3][4]*a[4][5] - a[0][1]*a[1][2]*a[2][0]*a[3][5]*a[4][4] - a[0][1]*a[1][2]*a[2][4]*a[3][0]*a[4][5] + a[0][1]*a[1][2]*a[2][4]*a[3][5]*a[4][0] + a[0][1]*a[1][2]*a[2][5]*a[3][0]*a[4][4] - a[0][1]*a[1][2]*a[2][5]*a[3][4]*a[4][0] - a[0][1]*a[1][4]*a[2][0]*a[3][2]*a[4][5] + a[0][1]*a[1][4]*a[2][0]*a[3][5]*a[4][2] + a[0][1]*a[1][4]*a[2][2]*a[3][0]*a[4][5] - a[0][1]*a[1][4]*a[2][2]*a[3][5]*a[4][0] - a[0][1]*a[1][4]*a[2][5]*a[3][0]*a[4][2] + a[0][1]*a[1][4]*a[2][5]*a[3][2]*a[4][0] + a[0][1]*a[1][5]*a[2][0]*a[3][2]*a[4][4] - a[0][1]*a[1][5]*a[2][0]*a[3][4]*a[4][2] - a[0][1]*a[1][5]*a[2][2]*a[3][0]*a[4][4] + a[0][1]*a[1][5]*a[2][2]*a[3][4]*a[4][0] + a[0][1]*a[1][5]*a[2][4]*a[3][0]*a[4][2] - a[0][1]*a[1][5]*a[2][4]*a[3][2]*a[4][0] + a[0][2]*a[1][0]*a[2][1]*a[3][4]*a[4][5] - a[0][2]*a[1][0]*a[2][1]*a[3][5]*a[4][4] - a[0][2]*a[1][0]*a[2][4]*a[3][1]*a[4][5] + a[0][2]*a[1][0]*a[2][4]*a[3][5]*a[4][1] + a[0][2]*a[1][0]*a[2][5]*a[3][1]*a[4][4] - a[0][2]*a[1][0]*a[2][5]*a[3][4]*a[4][1] - a[0][2]*a[1][1]*a[2][0]*a[3][4]*a[4][5] + a[0][2]*a[1][1]*a[2][0]*a[3][5]*a[4][4] + a[0][2]*a[1][1]*a[2][4]*a[3][0]*a[4][5] - a[0][2]*a[1][1]*a[2][4]*a[3][5]*a[4][0] - a[0][2]*a[1][1]*a[2][5]*a[3][0]*a[4][4] + a[0][2]*a[1][1]*a[2][5]*a[3][4]*a[4][0] + a[0][2]*a[1][4]*a[2][0]*a[3][1]*a[4][5] - a[0][2]*a[1][4]*a[2][0]*a[3][5]*a[4][1] - a[0][2]*a[1][4]*a[2][1]*a[3][0]*a[4][5] + a[0][2]*a[1][4]*a[2][1]*a[3][5]*a[4][0] + a[0][2]*a[1][4]*a[2][5]*a[3][0]*a[4][1] - a[0][2]*a[1][4]*a[2][5]*a[3][1]*a[4][0] - a[0][2]*a[1][5]*a[2][0]*a[3][1]*a[4][4] + a[0][2]*a[1][5]*a[2][0]*a[3][4]*a[4][1] + a[0][2]*a[1][5]*a[2][1]*a[3][0]*a[4][4] - a[0][2]*a[1][5]*a[2][1]*a[3][4]*a[4][0] - a[0][2]*a[1][5]*a[2][4]*a[3][0]*a[4][1] + a[0][2]*a[1][5]*a[2][4]*a[3][1]*a[4][0] - a[0][4]*a[1][0]*a[2][1]*a[3][2]*a[4][5] + a[0][4]*a[1][0]*a[2][1]*a[3][5]*a[4][2] + a[0][4]*a[1][0]*a[2][2]*a[3][1]*a[4][5] - a[0][4]*a[1][0]*a[2][2]*a[3][5]*a[4][1] - a[0][4]*a[1][0]*a[2][5]*a[3][1]*a[4][2] + a[0][4]*a[1][0]*a[2][5]*a[3][2]*a[4][1] + a[0][4]*a[1][1]*a[2][0]*a[3][2]*a[4][5] - a[0][4]*a[1][1]*a[2][0]*a[3][5]*a[4][2] - a[0][4]*a[1][1]*a[2][2]*a[3][0]*a[4][5] + a[0][4]*a[1][1]*a[2][2]*a[3][5]*a[4][0] + a[0][4]*a[1][1]*a[2][5]*a[3][0]*a[4][2] - a[0][4]*a[1][1]*a[2][5]*a[3][2]*a[4][0] - a[0][4]*a[1][2]*a[2][0]*a[3][1]*a[4][5] + a[0][4]*a[1][2]*a[2][0]*a[3][5]*a[4][1] + a[0][4]*a[1][2]*a[2][1]*a[3][0]*a[4][5] - a[0][4]*a[1][2]*a[2][1]*a[3][5]*a[4][0] - a[0][4]*a[1][2]*a[2][5]*a[3][0]*a[4][1] + a[0][4]*a[1][2]*a[2][5]*a[3][1]*a[4][0] + a[0][4]*a[1][5]*a[2][0]*a[3][1]*a[4][2] - a[0][4]*a[1][5]*a[2][0]*a[3][2]*a[4][1] - a[0][4]*a[1][5]*a[2][1]*a[3][0]*a[4][2] + a[0][4]*a[1][5]*a[2][1]*a[3][2]*a[4][0] + a[0][4]*a[1][5]*a[2][2]*a[3][0]*a[4][1] - a[0][4]*a[1][5]*a[2][2]*a[3][1]*a[4][0] + a[0][5]*a[1][0]*a[2][1]*a[3][2]*a[4][4] - a[0][5]*a[1][0]*a[2][1]*a[3][4]*a[4][2] - a[0][5]*a[1][0]*a[2][2]*a[3][1]*a[4][4] + a[0][5]*a[1][0]*a[2][2]*a[3][4]*a[4][1] + a[0][5]*a[1][0]*a[2][4]*a[3][1]*a[4][2] - a[0][5]*a[1][0]*a[2][4]*a[3][2]*a[4][1] - a[0][5]*a[1][1]*a[2][0]*a[3][2]*a[4][4] + a[0][5]*a[1][1]*a[2][0]*a[3][4]*a[4][2] + a[0][5]*a[1][1]*a[2][2]*a[3][0]*a[4][4] - a[0][5]*a[1][1]*a[2][2]*a[3][4]*a[4][0] - a[0][5]*a[1][1]*a[2][4]*a[3][0]*a[4][2] + a[0][5]*a[1][1]*a[2][4]*a[3][2]*a[4][0] + a[0][5]*a[1][2]*a[2][0]*a[3][1]*a[4][4] - a[0][5]*a[1][2]*a[2][0]*a[3][4]*a[4][1] - a[0][5]*a[1][2]*a[2][1]*a[3][0]*a[4][4] + a[0][5]*a[1][2]*a[2][1]*a[3][4]*a[4][0] + a[0][5]*a[1][2]*a[2][4]*a[3][0]*a[4][1] - a[0][5]*a[1][2]*a[2][4]*a[3][1]*a[4][0] - a[0][5]*a[1][4]*a[2][0]*a[3][1]*a[4][2] + a[0][5]*a[1][4]*a[2][0]*a[3][2]*a[4][1] + a[0][5]*a[1][4]*a[2][1]*a[3][0]*a[4][2] - a[0][5]*a[1][4]*a[2][1]*a[3][2]*a[4][0] - a[0][5]*a[1][4]*a[2][2]*a[3][0]*a[4][1] + a[0][5]*a[1][4]*a[2][2]*a[3][1]*a[4][0])/denom;
invA[4][5] = -(a[0][0]*a[1][1]*a[2][2]*a[3][3]*a[4][5] - a[0][0]*a[1][1]*a[2][2]*a[3][5]*a[4][3] - a[0][0]*a[1][1]*a[2][3]*a[3][2]*a[4][5] + a[0][0]*a[1][1]*a[2][3]*a[3][5]*a[4][2] + a[0][0]*a[1][1]*a[2][5]*a[3][2]*a[4][3] - a[0][0]*a[1][1]*a[2][5]*a[3][3]*a[4][2] - a[0][0]*a[1][2]*a[2][1]*a[3][3]*a[4][5] + a[0][0]*a[1][2]*a[2][1]*a[3][5]*a[4][3] + a[0][0]*a[1][2]*a[2][3]*a[3][1]*a[4][5] - a[0][0]*a[1][2]*a[2][3]*a[3][5]*a[4][1] - a[0][0]*a[1][2]*a[2][5]*a[3][1]*a[4][3] + a[0][0]*a[1][2]*a[2][5]*a[3][3]*a[4][1] + a[0][0]*a[1][3]*a[2][1]*a[3][2]*a[4][5] - a[0][0]*a[1][3]*a[2][1]*a[3][5]*a[4][2] - a[0][0]*a[1][3]*a[2][2]*a[3][1]*a[4][5] + a[0][0]*a[1][3]*a[2][2]*a[3][5]*a[4][1] + a[0][0]*a[1][3]*a[2][5]*a[3][1]*a[4][2] - a[0][0]*a[1][3]*a[2][5]*a[3][2]*a[4][1] - a[0][0]*a[1][5]*a[2][1]*a[3][2]*a[4][3] + a[0][0]*a[1][5]*a[2][1]*a[3][3]*a[4][2] + a[0][0]*a[1][5]*a[2][2]*a[3][1]*a[4][3] - a[0][0]*a[1][5]*a[2][2]*a[3][3]*a[4][1] - a[0][0]*a[1][5]*a[2][3]*a[3][1]*a[4][2] + a[0][0]*a[1][5]*a[2][3]*a[3][2]*a[4][1] - a[0][1]*a[1][0]*a[2][2]*a[3][3]*a[4][5] + a[0][1]*a[1][0]*a[2][2]*a[3][5]*a[4][3] + a[0][1]*a[1][0]*a[2][3]*a[3][2]*a[4][5] - a[0][1]*a[1][0]*a[2][3]*a[3][5]*a[4][2] - a[0][1]*a[1][0]*a[2][5]*a[3][2]*a[4][3] + a[0][1]*a[1][0]*a[2][5]*a[3][3]*a[4][2] + a[0][1]*a[1][2]*a[2][0]*a[3][3]*a[4][5] - a[0][1]*a[1][2]*a[2][0]*a[3][5]*a[4][3] - a[0][1]*a[1][2]*a[2][3]*a[3][0]*a[4][5] + a[0][1]*a[1][2]*a[2][3]*a[3][5]*a[4][0] + a[0][1]*a[1][2]*a[2][5]*a[3][0]*a[4][3] - a[0][1]*a[1][2]*a[2][5]*a[3][3]*a[4][0] - a[0][1]*a[1][3]*a[2][0]*a[3][2]*a[4][5] + a[0][1]*a[1][3]*a[2][0]*a[3][5]*a[4][2] + a[0][1]*a[1][3]*a[2][2]*a[3][0]*a[4][5] - a[0][1]*a[1][3]*a[2][2]*a[3][5]*a[4][0] - a[0][1]*a[1][3]*a[2][5]*a[3][0]*a[4][2] + a[0][1]*a[1][3]*a[2][5]*a[3][2]*a[4][0] + a[0][1]*a[1][5]*a[2][0]*a[3][2]*a[4][3] - a[0][1]*a[1][5]*a[2][0]*a[3][3]*a[4][2] - a[0][1]*a[1][5]*a[2][2]*a[3][0]*a[4][3] + a[0][1]*a[1][5]*a[2][2]*a[3][3]*a[4][0] + a[0][1]*a[1][5]*a[2][3]*a[3][0]*a[4][2] - a[0][1]*a[1][5]*a[2][3]*a[3][2]*a[4][0] + a[0][2]*a[1][0]*a[2][1]*a[3][3]*a[4][5] - a[0][2]*a[1][0]*a[2][1]*a[3][5]*a[4][3] - a[0][2]*a[1][0]*a[2][3]*a[3][1]*a[4][5] + a[0][2]*a[1][0]*a[2][3]*a[3][5]*a[4][1] + a[0][2]*a[1][0]*a[2][5]*a[3][1]*a[4][3] - a[0][2]*a[1][0]*a[2][5]*a[3][3]*a[4][1] - a[0][2]*a[1][1]*a[2][0]*a[3][3]*a[4][5] + a[0][2]*a[1][1]*a[2][0]*a[3][5]*a[4][3] + a[0][2]*a[1][1]*a[2][3]*a[3][0]*a[4][5] - a[0][2]*a[1][1]*a[2][3]*a[3][5]*a[4][0] - a[0][2]*a[1][1]*a[2][5]*a[3][0]*a[4][3] + a[0][2]*a[1][1]*a[2][5]*a[3][3]*a[4][0] + a[0][2]*a[1][3]*a[2][0]*a[3][1]*a[4][5] - a[0][2]*a[1][3]*a[2][0]*a[3][5]*a[4][1] - a[0][2]*a[1][3]*a[2][1]*a[3][0]*a[4][5] + a[0][2]*a[1][3]*a[2][1]*a[3][5]*a[4][0] + a[0][2]*a[1][3]*a[2][5]*a[3][0]*a[4][1] - a[0][2]*a[1][3]*a[2][5]*a[3][1]*a[4][0] - a[0][2]*a[1][5]*a[2][0]*a[3][1]*a[4][3] + a[0][2]*a[1][5]*a[2][0]*a[3][3]*a[4][1] + a[0][2]*a[1][5]*a[2][1]*a[3][0]*a[4][3] - a[0][2]*a[1][5]*a[2][1]*a[3][3]*a[4][0] - a[0][2]*a[1][5]*a[2][3]*a[3][0]*a[4][1] + a[0][2]*a[1][5]*a[2][3]*a[3][1]*a[4][0] - a[0][3]*a[1][0]*a[2][1]*a[3][2]*a[4][5] + a[0][3]*a[1][0]*a[2][1]*a[3][5]*a[4][2] + a[0][3]*a[1][0]*a[2][2]*a[3][1]*a[4][5] - a[0][3]*a[1][0]*a[2][2]*a[3][5]*a[4][1] - a[0][3]*a[1][0]*a[2][5]*a[3][1]*a[4][2] + a[0][3]*a[1][0]*a[2][5]*a[3][2]*a[4][1] + a[0][3]*a[1][1]*a[2][0]*a[3][2]*a[4][5] - a[0][3]*a[1][1]*a[2][0]*a[3][5]*a[4][2] - a[0][3]*a[1][1]*a[2][2]*a[3][0]*a[4][5] + a[0][3]*a[1][1]*a[2][2]*a[3][5]*a[4][0] + a[0][3]*a[1][1]*a[2][5]*a[3][0]*a[4][2] - a[0][3]*a[1][1]*a[2][5]*a[3][2]*a[4][0] - a[0][3]*a[1][2]*a[2][0]*a[3][1]*a[4][5] + a[0][3]*a[1][2]*a[2][0]*a[3][5]*a[4][1] + a[0][3]*a[1][2]*a[2][1]*a[3][0]*a[4][5] - a[0][3]*a[1][2]*a[2][1]*a[3][5]*a[4][0] - a[0][3]*a[1][2]*a[2][5]*a[3][0]*a[4][1] + a[0][3]*a[1][2]*a[2][5]*a[3][1]*a[4][0] + a[0][3]*a[1][5]*a[2][0]*a[3][1]*a[4][2] - a[0][3]*a[1][5]*a[2][0]*a[3][2]*a[4][1] - a[0][3]*a[1][5]*a[2][1]*a[3][0]*a[4][2] + a[0][3]*a[1][5]*a[2][1]*a[3][2]*a[4][0] + a[0][3]*a[1][5]*a[2][2]*a[3][0]*a[4][1] - a[0][3]*a[1][5]*a[2][2]*a[3][1]*a[4][0] + a[0][5]*a[1][0]*a[2][1]*a[3][2]*a[4][3] - a[0][5]*a[1][0]*a[2][1]*a[3][3]*a[4][2] - a[0][5]*a[1][0]*a[2][2]*a[3][1]*a[4][3] + a[0][5]*a[1][0]*a[2][2]*a[3][3]*a[4][1] + a[0][5]*a[1][0]*a[2][3]*a[3][1]*a[4][2] - a[0][5]*a[1][0]*a[2][3]*a[3][2]*a[4][1] - a[0][5]*a[1][1]*a[2][0]*a[3][2]*a[4][3] + a[0][5]*a[1][1]*a[2][0]*a[3][3]*a[4][2] + a[0][5]*a[1][1]*a[2][2]*a[3][0]*a[4][3] - a[0][5]*a[1][1]*a[2][2]*a[3][3]*a[4][0] - a[0][5]*a[1][1]*a[2][3]*a[3][0]*a[4][2] + a[0][5]*a[1][1]*a[2][3]*a[3][2]*a[4][0] + a[0][5]*a[1][2]*a[2][0]*a[3][1]*a[4][3] - a[0][5]*a[1][2]*a[2][0]*a[3][3]*a[4][1] - a[0][5]*a[1][2]*a[2][1]*a[3][0]*a[4][3] + a[0][5]*a[1][2]*a[2][1]*a[3][3]*a[4][0] + a[0][5]*a[1][2]*a[2][3]*a[3][0]*a[4][1] - a[0][5]*a[1][2]*a[2][3]*a[3][1]*a[4][0] - a[0][5]*a[1][3]*a[2][0]*a[3][1]*a[4][2] + a[0][5]*a[1][3]*a[2][0]*a[3][2]*a[4][1] + a[0][5]*a[1][3]*a[2][1]*a[3][0]*a[4][2] - a[0][5]*a[1][3]*a[2][1]*a[3][2]*a[4][0] - a[0][5]*a[1][3]*a[2][2]*a[3][0]*a[4][1] + a[0][5]*a[1][3]*a[2][2]*a[3][1]*a[4][0])/denom;
invA[5][5] = (a[0][0]*a[1][1]*a[2][2]*a[3][3]*a[4][4] - a[0][0]*a[1][1]*a[2][2]*a[3][4]*a[4][3] - a[0][0]*a[1][1]*a[2][3]*a[3][2]*a[4][4] + a[0][0]*a[1][1]*a[2][3]*a[3][4]*a[4][2] + a[0][0]*a[1][1]*a[2][4]*a[3][2]*a[4][3] - a[0][0]*a[1][1]*a[2][4]*a[3][3]*a[4][2] - a[0][0]*a[1][2]*a[2][1]*a[3][3]*a[4][4] + a[0][0]*a[1][2]*a[2][1]*a[3][4]*a[4][3] + a[0][0]*a[1][2]*a[2][3]*a[3][1]*a[4][4] - a[0][0]*a[1][2]*a[2][3]*a[3][4]*a[4][1] - a[0][0]*a[1][2]*a[2][4]*a[3][1]*a[4][3] + a[0][0]*a[1][2]*a[2][4]*a[3][3]*a[4][1] + a[0][0]*a[1][3]*a[2][1]*a[3][2]*a[4][4] - a[0][0]*a[1][3]*a[2][1]*a[3][4]*a[4][2] - a[0][0]*a[1][3]*a[2][2]*a[3][1]*a[4][4] + a[0][0]*a[1][3]*a[2][2]*a[3][4]*a[4][1] + a[0][0]*a[1][3]*a[2][4]*a[3][1]*a[4][2] - a[0][0]*a[1][3]*a[2][4]*a[3][2]*a[4][1] - a[0][0]*a[1][4]*a[2][1]*a[3][2]*a[4][3] + a[0][0]*a[1][4]*a[2][1]*a[3][3]*a[4][2] + a[0][0]*a[1][4]*a[2][2]*a[3][1]*a[4][3] - a[0][0]*a[1][4]*a[2][2]*a[3][3]*a[4][1] - a[0][0]*a[1][4]*a[2][3]*a[3][1]*a[4][2] + a[0][0]*a[1][4]*a[2][3]*a[3][2]*a[4][1] - a[0][1]*a[1][0]*a[2][2]*a[3][3]*a[4][4] + a[0][1]*a[1][0]*a[2][2]*a[3][4]*a[4][3] + a[0][1]*a[1][0]*a[2][3]*a[3][2]*a[4][4] - a[0][1]*a[1][0]*a[2][3]*a[3][4]*a[4][2] - a[0][1]*a[1][0]*a[2][4]*a[3][2]*a[4][3] + a[0][1]*a[1][0]*a[2][4]*a[3][3]*a[4][2] + a[0][1]*a[1][2]*a[2][0]*a[3][3]*a[4][4] - a[0][1]*a[1][2]*a[2][0]*a[3][4]*a[4][3] - a[0][1]*a[1][2]*a[2][3]*a[3][0]*a[4][4] + a[0][1]*a[1][2]*a[2][3]*a[3][4]*a[4][0] + a[0][1]*a[1][2]*a[2][4]*a[3][0]*a[4][3] - a[0][1]*a[1][2]*a[2][4]*a[3][3]*a[4][0] - a[0][1]*a[1][3]*a[2][0]*a[3][2]*a[4][4] + a[0][1]*a[1][3]*a[2][0]*a[3][4]*a[4][2] + a[0][1]*a[1][3]*a[2][2]*a[3][0]*a[4][4] - a[0][1]*a[1][3]*a[2][2]*a[3][4]*a[4][0] - a[0][1]*a[1][3]*a[2][4]*a[3][0]*a[4][2] + a[0][1]*a[1][3]*a[2][4]*a[3][2]*a[4][0] + a[0][1]*a[1][4]*a[2][0]*a[3][2]*a[4][3] - a[0][1]*a[1][4]*a[2][0]*a[3][3]*a[4][2] - a[0][1]*a[1][4]*a[2][2]*a[3][0]*a[4][3] + a[0][1]*a[1][4]*a[2][2]*a[3][3]*a[4][0] + a[0][1]*a[1][4]*a[2][3]*a[3][0]*a[4][2] - a[0][1]*a[1][4]*a[2][3]*a[3][2]*a[4][0] + a[0][2]*a[1][0]*a[2][1]*a[3][3]*a[4][4] - a[0][2]*a[1][0]*a[2][1]*a[3][4]*a[4][3] - a[0][2]*a[1][0]*a[2][3]*a[3][1]*a[4][4] + a[0][2]*a[1][0]*a[2][3]*a[3][4]*a[4][1] + a[0][2]*a[1][0]*a[2][4]*a[3][1]*a[4][3] - a[0][2]*a[1][0]*a[2][4]*a[3][3]*a[4][1] - a[0][2]*a[1][1]*a[2][0]*a[3][3]*a[4][4] + a[0][2]*a[1][1]*a[2][0]*a[3][4]*a[4][3] + a[0][2]*a[1][1]*a[2][3]*a[3][0]*a[4][4] - a[0][2]*a[1][1]*a[2][3]*a[3][4]*a[4][0] - a[0][2]*a[1][1]*a[2][4]*a[3][0]*a[4][3] + a[0][2]*a[1][1]*a[2][4]*a[3][3]*a[4][0] + a[0][2]*a[1][3]*a[2][0]*a[3][1]*a[4][4] - a[0][2]*a[1][3]*a[2][0]*a[3][4]*a[4][1] - a[0][2]*a[1][3]*a[2][1]*a[3][0]*a[4][4] + a[0][2]*a[1][3]*a[2][1]*a[3][4]*a[4][0] + a[0][2]*a[1][3]*a[2][4]*a[3][0]*a[4][1] - a[0][2]*a[1][3]*a[2][4]*a[3][1]*a[4][0] - a[0][2]*a[1][4]*a[2][0]*a[3][1]*a[4][3] + a[0][2]*a[1][4]*a[2][0]*a[3][3]*a[4][1] + a[0][2]*a[1][4]*a[2][1]*a[3][0]*a[4][3] - a[0][2]*a[1][4]*a[2][1]*a[3][3]*a[4][0] - a[0][2]*a[1][4]*a[2][3]*a[3][0]*a[4][1] + a[0][2]*a[1][4]*a[2][3]*a[3][1]*a[4][0] - a[0][3]*a[1][0]*a[2][1]*a[3][2]*a[4][4] + a[0][3]*a[1][0]*a[2][1]*a[3][4]*a[4][2] + a[0][3]*a[1][0]*a[2][2]*a[3][1]*a[4][4] - a[0][3]*a[1][0]*a[2][2]*a[3][4]*a[4][1] - a[0][3]*a[1][0]*a[2][4]*a[3][1]*a[4][2] + a[0][3]*a[1][0]*a[2][4]*a[3][2]*a[4][1] + a[0][3]*a[1][1]*a[2][0]*a[3][2]*a[4][4] - a[0][3]*a[1][1]*a[2][0]*a[3][4]*a[4][2] - a[0][3]*a[1][1]*a[2][2]*a[3][0]*a[4][4] + a[0][3]*a[1][1]*a[2][2]*a[3][4]*a[4][0] + a[0][3]*a[1][1]*a[2][4]*a[3][0]*a[4][2] - a[0][3]*a[1][1]*a[2][4]*a[3][2]*a[4][0] - a[0][3]*a[1][2]*a[2][0]*a[3][1]*a[4][4] + a[0][3]*a[1][2]*a[2][0]*a[3][4]*a[4][1] + a[0][3]*a[1][2]*a[2][1]*a[3][0]*a[4][4] - a[0][3]*a[1][2]*a[2][1]*a[3][4]*a[4][0] - a[0][3]*a[1][2]*a[2][4]*a[3][0]*a[4][1] + a[0][3]*a[1][2]*a[2][4]*a[3][1]*a[4][0] + a[0][3]*a[1][4]*a[2][0]*a[3][1]*a[4][2] - a[0][3]*a[1][4]*a[2][0]*a[3][2]*a[4][1] - a[0][3]*a[1][4]*a[2][1]*a[3][0]*a[4][2] + a[0][3]*a[1][4]*a[2][1]*a[3][2]*a[4][0] + a[0][3]*a[1][4]*a[2][2]*a[3][0]*a[4][1] - a[0][3]*a[1][4]*a[2][2]*a[3][1]*a[4][0] + a[0][4]*a[1][0]*a[2][1]*a[3][2]*a[4][3] - a[0][4]*a[1][0]*a[2][1]*a[3][3]*a[4][2] - a[0][4]*a[1][0]*a[2][2]*a[3][1]*a[4][3] + a[0][4]*a[1][0]*a[2][2]*a[3][3]*a[4][1] + a[0][4]*a[1][0]*a[2][3]*a[3][1]*a[4][2] - a[0][4]*a[1][0]*a[2][3]*a[3][2]*a[4][1] - a[0][4]*a[1][1]*a[2][0]*a[3][2]*a[4][3] + a[0][4]*a[1][1]*a[2][0]*a[3][3]*a[4][2] + a[0][4]*a[1][1]*a[2][2]*a[3][0]*a[4][3] - a[0][4]*a[1][1]*a[2][2]*a[3][3]*a[4][0] - a[0][4]*a[1][1]*a[2][3]*a[3][0]*a[4][2] + a[0][4]*a[1][1]*a[2][3]*a[3][2]*a[4][0] + a[0][4]*a[1][2]*a[2][0]*a[3][1]*a[4][3] - a[0][4]*a[1][2]*a[2][0]*a[3][3]*a[4][1] - a[0][4]*a[1][2]*a[2][1]*a[3][0]*a[4][3] + a[0][4]*a[1][2]*a[2][1]*a[3][3]*a[4][0] + a[0][4]*a[1][2]*a[2][3]*a[3][0]*a[4][1] - a[0][4]*a[1][2]*a[2][3]*a[3][1]*a[4][0] - a[0][4]*a[1][3]*a[2][0]*a[3][1]*a[4][2] + a[0][4]*a[1][3]*a[2][0]*a[3][2]*a[4][1] + a[0][4]*a[1][3]*a[2][1]*a[3][0]*a[4][2] - a[0][4]*a[1][3]*a[2][1]*a[3][2]*a[4][0] - a[0][4]*a[1][3]*a[2][2]*a[3][0]*a[4][1] + a[0][4]*a[1][3]*a[2][2]*a[3][1]*a[4][0])/denom;
// Then inv(A)*B
for (i=0; i<6; i++) {
X[i] = 0;
for (j = 0; j<6; j++) {
X[i] += invA[j][i]*B[j];
}
}
}
/* Compute Solution to X = inv(A)*B *******************************************/
void matrixJXleastSquares6by6(double A[][6], double B[6], double X[6])
{
// First Jordan Exchange to get invA
int i, I, j, J, m, n;
double c;
double invA[6][6];
for (i=0; i<6; i++) {
for (I=0; I<6; I++) {
// Precompute C
c = A[i][I]/A[i][i];
for (J=0; J<6; J++){
if (I == i && J == i) // Pivot
invA[i][i] = 1.00 / A[i][i];
else if (I == i && J != i) // Row
invA[J][i] = -A[J][i]/A[i][i];
else if (I != i && J == i) // Column
invA[i][I] = c;
else // Off-diag
invA[J][I] = A[J][I] - c * A[J][i];
}
}
// Copy result back to Aupper
// Note that this will mess /w A, so we can't use it in subsequent calculations
for (m=0; m<6; m++) {
for (n=0; n<6; n++) {
A[m][n] = invA[m][n];
}
}
}
// Then inv(A)*B
for (i=0; i<6; i++) {
X[i] = 0;
for (j = 0; j<6; j++) {
X[i] += invA[j][i]*B[j];
}
}
}
/* Sean's GeneralMatrixInverse for 6x6 ***************************************/
void matrixGeneralInverse6by6(double A[][6], double B[], double X[])
{
double invA[6][6];
double maxValue, pointValue, tmpPoint;
int pivot[6];
int i, j, a, p, k, ptmp, pivotPoint;
int size = 6;
for (i=0; i<size; i++) pivot[i] = i;
for (i=0; i<size; i++) {
for (j=0; j<size; j++) invA[i][j] = 0.00;
}
for (k=0; k<size-1; k++) {
p = k;
maxValue = fabs(A[k][k]);
// scan the lower part of this column
for (i=k; i<size; i++) {
pointValue = fabs(A[k][i]);
if (pointValue > maxValue) {
maxValue = pointValue;
p = i;
}
}
// swap rows if max value not in row k
if (p != k) {
for (a=0; a<size; a++) {
tmpPoint = A[a][p];
A[a][p] = A[a][k];
A[a][k] = tmpPoint;
}
ptmp = pivot[k];
pivot[k] = pivot[p];
pivot[p] = ptmp;
}
// divide the lower trianglar part of column by max
if (A[k][k] != 0) {
for (i=k+1; i<size; i++) A[k][i] = A[k][i] / A[k][k];
}
// subtract multiple of column from remaining columes
for (j=k+1; j<size; j++) {
for (i=k+1; i<size; i++) {
A[j][i] = A[j][i] - A[k][i]*A[j][k];
}
}
}
// now solve the inverse for each column
for (k=0; k<size; k++) {
pivotPoint = pivot[k];
invA[pivotPoint][k] = 1.00;
for (j=k; j<size; j++) {
if (invA[pivotPoint][j] != 0) {
for (i=j+1; i<size; i++) invA[pivotPoint][i] = invA[pivotPoint][i] - invA[pivotPoint][j]*A[j][i];
}
}
for (j=size-1; j>=0; j--) {
invA[pivotPoint][j] = invA[pivotPoint][j] / A[j][j];
if (invA[pivotPoint][j] != 0) {
for (i=0; i<j; i++) invA[pivotPoint][i] = invA[pivotPoint][i] - invA[pivotPoint][j]*A[j][i];
}
}
}
// Then inv(A)*B
for (i=0; i<6; i++) {
X[i] = 0;
for (j = 0; j<6; j++) {
X[i] += invA[j][i]*B[j];
}
}
}
#ifdef DEBUG_FLAG
/* DEBUG FUNCTION: Print out the contents of a 2x2 ***************************/
void debugPrint2by2(double A[][2])
{
mexPrintf("| %0.5f | %0.5f | \n", A[0][0], A[0][1]);
mexPrintf("| %0.5f | %0.5f | \n", A[1][0], A[1][1]);
}
/* DEBUG FUNCTION: Print out the contents of a 2x1 ***************************/
void debugPrint2by1(double A[])
{
mexPrintf("| %0.5f | \n", A[0]);
mexPrintf("| %0.5f | \n", A[1]);
}
/* DEBUG FUNCTION: Print out the contents of a 6x6 ***************************/
void debugPrint6by6(double A[][6])
{
mexPrintf("| %0.5f | %0.5f | %0.5f | %0.5f | %0.5f | %0.5f | \n", A[0][0], A[0][1], A[0][2], A[0][3], A[0][4], A[0][5]);
mexPrintf("| %0.5f | %0.5f | %0.5f | %0.5f | %0.5f | %0.5f | \n", A[1][0], A[1][1], A[1][2], A[1][3], A[1][4], A[1][5]);
mexPrintf("| %0.5f | %0.5f | %0.5f | %0.5f | %0.5f | %0.5f | \n", A[2][0], A[2][1], A[2][2], A[2][3], A[2][4], A[2][5]);
mexPrintf("| %0.5f | %0.5f | %0.5f | %0.5f | %0.5f | %0.5f | \n", A[3][0], A[3][1], A[3][2], A[3][3], A[3][4], A[3][5]);
mexPrintf("| %0.5f | %0.5f | %0.5f | %0.5f | %0.5f | %0.5f | \n", A[4][0], A[4][1], A[4][2], A[4][3], A[4][4], A[4][5]);
mexPrintf("| %0.5f | %0.5f | %0.5f | %0.5f | %0.5f | %0.5f | \n", A[5][0], A[5][1], A[5][2], A[5][3], A[5][4], A[5][5]);
}
/* DEBUG FUNCTION: Print out the contents of a 6x1 ***************************/
void debugPrint6by1(double A[])
{
mexPrintf("| %0.5f | \n", A[0]);
mexPrintf("| %0.5f | \n", A[1]);
mexPrintf("| %0.5f | \n", A[2]);
mexPrintf("| %0.5f | \n", A[3]);
mexPrintf("| %0.5f | \n", A[4]);
mexPrintf("| %0.5f | \n", A[5]);
}
#endif