0 Prolog
↳1 PrologToPrologProblemTransformerProof (⇐)
↳2 Prolog
↳3 PrologToPiTRSProof (⇐)
↳4 PiTRS
↳5 DependencyPairsProof (⇔)
↳6 PiDP
↳7 DependencyGraphProof (⇔)
↳8 AND
↳9 PiDP
↳10 UsableRulesProof (⇔)
↳11 PiDP
↳12 PiDPToQDPProof (⇐)
↳13 QDP
↳14 Narrowing (⇐)
↳15 QDP
↳16 NonTerminationProof (⇔)
↳17 NO
↳18 PiDP
↳19 UsableRulesProof (⇔)
↳20 PiDP
↳21 PiDPToQDPProof (⇐)
↳22 QDP
↳23 Narrowing (⇐)
↳24 QDP
↳25 NonTerminationProof (⇔)
↳26 NO
↳27 PrologToPiTRSProof (⇐)
↳28 PiTRS
↳29 DependencyPairsProof (⇔)
↳30 PiDP
↳31 DependencyGraphProof (⇔)
↳32 AND
↳33 PiDP
↳34 UsableRulesProof (⇔)
↳35 PiDP
↳36 PiDPToQDPProof (⇐)
↳37 QDP
↳38 Narrowing (⇐)
↳39 QDP
↳40 NonTerminationProof (⇔)
↳41 NO
↳42 PiDP
↳43 UsableRulesProof (⇔)
↳44 PiDP
↳45 PiDPToQDPProof (⇐)
↳46 QDP
↳47 Narrowing (⇐)
↳48 QDP
↳49 NonTerminationProof (⇔)
↳50 NO
balance1_in_ag(nil, nil) → balance1_out_ag(nil, nil)
balance1_in_ag(tree(T31, T33, T36), tree(T28, T29, T30)) → U10_ag(T31, T33, T36, T28, T29, T30, balance12_in_aaaaggagaaaaa(T31, T32, T33, X113, T28, T29, T35, T30, T34, X114, X115, X121, X116))
balance12_in_aaaaggagaaaaa(nil, .(T108, T109), T108, T109, T110, T111, T112, T113, T114, .(','(T110, -(.(T108, T109), .(T111, T112))), .(','(T113, -(T112, [])), T114)), T114, .(','(nil, -(X200, X200)), X201), X201) → balance12_out_aaaaggagaaaaa(nil, .(T108, T109), T108, T109, T110, T111, T112, T113, T114, .(','(T110, -(.(T108, T109), .(T111, T112))), .(','(T113, -(T112, [])), T114)), T114, .(','(nil, -(X200, X200)), X201), X201)
balance12_in_aaaaggagaaaaa(tree(T157, T159, T163), T158, T164, X276, tree(T148, T149, T150), T151, T161, T153, .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160)), X277, X278, X279, X280) → U7_aaaaggagaaaaa(T157, T159, T163, T158, T164, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, X279, X280, balance23_in_aaaaaaaaaa(T157, T158, T159, X272, .(','(T153, -(T161, [])), .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160))), T160, X273, X274, X279, X275))
balance23_in_aaaaaaaaaa(nil, .(T259, T260), T259, T260, T261, T262, T261, T262, .(','(nil, -(T263, T263)), T264), T264) → balance23_out_aaaaaaaaaa(nil, .(T259, T260), T259, T260, T261, T262, T261, T262, .(','(nil, -(T263, T263)), T264), T264)
balance23_in_aaaaaaaaaa(tree(T307, T309, T313), T308, T314, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436) → U1_aaaaaaaaaa(T307, T309, T313, T308, T314, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_in_aaaaaaaaaa(T307, T308, T309, X429, T310, T311, X430, X431, T312, X432))
balance23_in_aaaaaaaaaa(tree(T307, T309, T333), T308, T334, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436) → U2_aaaaaaaaaa(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_in_aaaaaaaaaa(T307, T308, T309, T329, T310, T311, T330, T331, T312, T332))
U2_aaaaaaaaaa(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_out_aaaaaaaaaa(T307, T308, T309, T329, T310, T311, T330, T331, T312, T332)) → U3_aaaaaaaaaa(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_in_aaaaaaaaaa(T333, T329, T334, X433, T330, T331, X434, X435, T332, X436))
U3_aaaaaaaaaa(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_out_aaaaaaaaaa(T333, T329, T334, X433, T330, T331, X434, X435, T332, X436)) → balance23_out_aaaaaaaaaa(tree(T307, T309, T333), T308, T334, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436)
U1_aaaaaaaaaa(T307, T309, T313, T308, T314, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_out_aaaaaaaaaa(T307, T308, T309, X429, T310, T311, X430, X431, T312, X432)) → balance23_out_aaaaaaaaaa(tree(T307, T309, T313), T308, T314, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436)
U7_aaaaggagaaaaa(T157, T159, T163, T158, T164, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, X279, X280, balance23_out_aaaaaaaaaa(T157, T158, T159, X272, .(','(T153, -(T161, [])), .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160))), T160, X273, X274, X279, X275)) → balance12_out_aaaaggagaaaaa(tree(T157, T159, T163), T158, T164, X276, tree(T148, T149, T150), T151, T161, T153, .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160)), X277, X278, X279, X280)
balance12_in_aaaaggagaaaaa(tree(T157, T159, T192), T158, T193, X276, tree(T148, T149, T150), T151, T161, T153, .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160)), X277, X278, T190, X280) → U8_aaaaggagaaaaa(T157, T159, T192, T158, T193, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, T190, X280, balance23_in_aaaaaaaaaa(T157, T158, T159, T187, .(','(T153, -(T161, [])), .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160))), T160, T188, T189, T190, T191))
U8_aaaaggagaaaaa(T157, T159, T192, T158, T193, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, T190, X280, balance23_out_aaaaaaaaaa(T157, T158, T159, T187, .(','(T153, -(T161, [])), .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160))), T160, T188, T189, T190, T191)) → U9_aaaaggagaaaaa(T157, T159, T192, T158, T193, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, T190, X280, balance23_in_aaaaaaaaaa(T192, T187, T193, X276, T188, T189, X277, X278, T191, X280))
U9_aaaaggagaaaaa(T157, T159, T192, T158, T193, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, T190, X280, balance23_out_aaaaaaaaaa(T192, T187, T193, X276, T188, T189, X277, X278, T191, X280)) → balance12_out_aaaaggagaaaaa(tree(T157, T159, T192), T158, T193, X276, tree(T148, T149, T150), T151, T161, T153, .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160)), X277, X278, T190, X280)
U10_ag(T31, T33, T36, T28, T29, T30, balance12_out_aaaaggagaaaaa(T31, T32, T33, X113, T28, T29, T35, T30, T34, X114, X115, X121, X116)) → balance1_out_ag(tree(T31, T33, T36), tree(T28, T29, T30))
balance1_in_ag(tree(T31, T33, T58), tree(T28, T29, T30)) → U11_ag(T31, T33, T58, T28, T29, T30, balance12_in_aaaaggagaaaaa(T31, T32, T33, T53, T28, T29, T35, T30, T34, T54, T55, T56, T57))
U11_ag(T31, T33, T58, T28, T29, T30, balance12_out_aaaaggagaaaaa(T31, T32, T33, T53, T28, T29, T35, T30, T34, T54, T55, T56, T57)) → U12_ag(T31, T33, T58, T28, T29, T30, balance13_in_aaaaaa(T58, T53, T54, T55, T56, T57))
balance13_in_aaaaaa(nil, [], T394, [], T394, .(','(nil, -(T396, T396)), [])) → balance13_out_aaaaaa(nil, [], T394, [], T394, .(','(nil, -(T396, T396)), []))
balance13_in_aaaaaa(tree(T440, T442, T446), T441, .(','(tree(T430, T431, T432), -(T433, T434)), T443), .(','(T430, -(T433, .(T431, T436))), .(','(T432, -(T436, T434)), T444)), T447, T445) → U4_aaaaaa(T440, T442, T446, T441, T430, T431, T432, T433, T434, T443, T436, T444, T447, T445, balance23_in_aaaaaaaaaa(T440, T441, T442, X579, T443, T444, X580, X581, T445, X582))
U4_aaaaaa(T440, T442, T446, T441, T430, T431, T432, T433, T434, T443, T436, T444, T447, T445, balance23_out_aaaaaaaaaa(T440, T441, T442, X579, T443, T444, X580, X581, T445, X582)) → balance13_out_aaaaaa(tree(T440, T442, T446), T441, .(','(tree(T430, T431, T432), -(T433, T434)), T443), .(','(T430, -(T433, .(T431, T436))), .(','(T432, -(T436, T434)), T444)), T447, T445)
balance13_in_aaaaaa(tree(T440, T442, T466), T441, .(','(tree(T430, T431, T432), -(T433, T434)), T443), .(','(T430, -(T433, .(T431, T436))), .(','(T432, -(T436, T434)), T444)), T467, T445) → U5_aaaaaa(T440, T442, T466, T441, T430, T431, T432, T433, T434, T443, T436, T444, T467, T445, balance23_in_aaaaaaaaaa(T440, T441, T442, T462, T443, T444, T463, T464, T445, T465))
U5_aaaaaa(T440, T442, T466, T441, T430, T431, T432, T433, T434, T443, T436, T444, T467, T445, balance23_out_aaaaaaaaaa(T440, T441, T442, T462, T443, T444, T463, T464, T445, T465)) → U6_aaaaaa(T440, T442, T466, T441, T430, T431, T432, T433, T434, T443, T436, T444, T467, T445, balance13_in_aaaaaa(T466, T462, T463, T464, T467, T465))
U6_aaaaaa(T440, T442, T466, T441, T430, T431, T432, T433, T434, T443, T436, T444, T467, T445, balance13_out_aaaaaa(T466, T462, T463, T464, T467, T465)) → balance13_out_aaaaaa(tree(T440, T442, T466), T441, .(','(tree(T430, T431, T432), -(T433, T434)), T443), .(','(T430, -(T433, .(T431, T436))), .(','(T432, -(T436, T434)), T444)), T467, T445)
U12_ag(T31, T33, T58, T28, T29, T30, balance13_out_aaaaaa(T58, T53, T54, T55, T56, T57)) → balance1_out_ag(tree(T31, T33, T58), tree(T28, T29, T30))
Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog
balance1_in_ag(nil, nil) → balance1_out_ag(nil, nil)
balance1_in_ag(tree(T31, T33, T36), tree(T28, T29, T30)) → U10_ag(T31, T33, T36, T28, T29, T30, balance12_in_aaaaggagaaaaa(T31, T32, T33, X113, T28, T29, T35, T30, T34, X114, X115, X121, X116))
balance12_in_aaaaggagaaaaa(nil, .(T108, T109), T108, T109, T110, T111, T112, T113, T114, .(','(T110, -(.(T108, T109), .(T111, T112))), .(','(T113, -(T112, [])), T114)), T114, .(','(nil, -(X200, X200)), X201), X201) → balance12_out_aaaaggagaaaaa(nil, .(T108, T109), T108, T109, T110, T111, T112, T113, T114, .(','(T110, -(.(T108, T109), .(T111, T112))), .(','(T113, -(T112, [])), T114)), T114, .(','(nil, -(X200, X200)), X201), X201)
balance12_in_aaaaggagaaaaa(tree(T157, T159, T163), T158, T164, X276, tree(T148, T149, T150), T151, T161, T153, .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160)), X277, X278, X279, X280) → U7_aaaaggagaaaaa(T157, T159, T163, T158, T164, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, X279, X280, balance23_in_aaaaaaaaaa(T157, T158, T159, X272, .(','(T153, -(T161, [])), .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160))), T160, X273, X274, X279, X275))
balance23_in_aaaaaaaaaa(nil, .(T259, T260), T259, T260, T261, T262, T261, T262, .(','(nil, -(T263, T263)), T264), T264) → balance23_out_aaaaaaaaaa(nil, .(T259, T260), T259, T260, T261, T262, T261, T262, .(','(nil, -(T263, T263)), T264), T264)
balance23_in_aaaaaaaaaa(tree(T307, T309, T313), T308, T314, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436) → U1_aaaaaaaaaa(T307, T309, T313, T308, T314, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_in_aaaaaaaaaa(T307, T308, T309, X429, T310, T311, X430, X431, T312, X432))
balance23_in_aaaaaaaaaa(tree(T307, T309, T333), T308, T334, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436) → U2_aaaaaaaaaa(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_in_aaaaaaaaaa(T307, T308, T309, T329, T310, T311, T330, T331, T312, T332))
U2_aaaaaaaaaa(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_out_aaaaaaaaaa(T307, T308, T309, T329, T310, T311, T330, T331, T312, T332)) → U3_aaaaaaaaaa(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_in_aaaaaaaaaa(T333, T329, T334, X433, T330, T331, X434, X435, T332, X436))
U3_aaaaaaaaaa(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_out_aaaaaaaaaa(T333, T329, T334, X433, T330, T331, X434, X435, T332, X436)) → balance23_out_aaaaaaaaaa(tree(T307, T309, T333), T308, T334, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436)
U1_aaaaaaaaaa(T307, T309, T313, T308, T314, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_out_aaaaaaaaaa(T307, T308, T309, X429, T310, T311, X430, X431, T312, X432)) → balance23_out_aaaaaaaaaa(tree(T307, T309, T313), T308, T314, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436)
U7_aaaaggagaaaaa(T157, T159, T163, T158, T164, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, X279, X280, balance23_out_aaaaaaaaaa(T157, T158, T159, X272, .(','(T153, -(T161, [])), .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160))), T160, X273, X274, X279, X275)) → balance12_out_aaaaggagaaaaa(tree(T157, T159, T163), T158, T164, X276, tree(T148, T149, T150), T151, T161, T153, .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160)), X277, X278, X279, X280)
balance12_in_aaaaggagaaaaa(tree(T157, T159, T192), T158, T193, X276, tree(T148, T149, T150), T151, T161, T153, .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160)), X277, X278, T190, X280) → U8_aaaaggagaaaaa(T157, T159, T192, T158, T193, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, T190, X280, balance23_in_aaaaaaaaaa(T157, T158, T159, T187, .(','(T153, -(T161, [])), .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160))), T160, T188, T189, T190, T191))
U8_aaaaggagaaaaa(T157, T159, T192, T158, T193, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, T190, X280, balance23_out_aaaaaaaaaa(T157, T158, T159, T187, .(','(T153, -(T161, [])), .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160))), T160, T188, T189, T190, T191)) → U9_aaaaggagaaaaa(T157, T159, T192, T158, T193, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, T190, X280, balance23_in_aaaaaaaaaa(T192, T187, T193, X276, T188, T189, X277, X278, T191, X280))
U9_aaaaggagaaaaa(T157, T159, T192, T158, T193, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, T190, X280, balance23_out_aaaaaaaaaa(T192, T187, T193, X276, T188, T189, X277, X278, T191, X280)) → balance12_out_aaaaggagaaaaa(tree(T157, T159, T192), T158, T193, X276, tree(T148, T149, T150), T151, T161, T153, .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160)), X277, X278, T190, X280)
U10_ag(T31, T33, T36, T28, T29, T30, balance12_out_aaaaggagaaaaa(T31, T32, T33, X113, T28, T29, T35, T30, T34, X114, X115, X121, X116)) → balance1_out_ag(tree(T31, T33, T36), tree(T28, T29, T30))
balance1_in_ag(tree(T31, T33, T58), tree(T28, T29, T30)) → U11_ag(T31, T33, T58, T28, T29, T30, balance12_in_aaaaggagaaaaa(T31, T32, T33, T53, T28, T29, T35, T30, T34, T54, T55, T56, T57))
U11_ag(T31, T33, T58, T28, T29, T30, balance12_out_aaaaggagaaaaa(T31, T32, T33, T53, T28, T29, T35, T30, T34, T54, T55, T56, T57)) → U12_ag(T31, T33, T58, T28, T29, T30, balance13_in_aaaaaa(T58, T53, T54, T55, T56, T57))
balance13_in_aaaaaa(nil, [], T394, [], T394, .(','(nil, -(T396, T396)), [])) → balance13_out_aaaaaa(nil, [], T394, [], T394, .(','(nil, -(T396, T396)), []))
balance13_in_aaaaaa(tree(T440, T442, T446), T441, .(','(tree(T430, T431, T432), -(T433, T434)), T443), .(','(T430, -(T433, .(T431, T436))), .(','(T432, -(T436, T434)), T444)), T447, T445) → U4_aaaaaa(T440, T442, T446, T441, T430, T431, T432, T433, T434, T443, T436, T444, T447, T445, balance23_in_aaaaaaaaaa(T440, T441, T442, X579, T443, T444, X580, X581, T445, X582))
U4_aaaaaa(T440, T442, T446, T441, T430, T431, T432, T433, T434, T443, T436, T444, T447, T445, balance23_out_aaaaaaaaaa(T440, T441, T442, X579, T443, T444, X580, X581, T445, X582)) → balance13_out_aaaaaa(tree(T440, T442, T446), T441, .(','(tree(T430, T431, T432), -(T433, T434)), T443), .(','(T430, -(T433, .(T431, T436))), .(','(T432, -(T436, T434)), T444)), T447, T445)
balance13_in_aaaaaa(tree(T440, T442, T466), T441, .(','(tree(T430, T431, T432), -(T433, T434)), T443), .(','(T430, -(T433, .(T431, T436))), .(','(T432, -(T436, T434)), T444)), T467, T445) → U5_aaaaaa(T440, T442, T466, T441, T430, T431, T432, T433, T434, T443, T436, T444, T467, T445, balance23_in_aaaaaaaaaa(T440, T441, T442, T462, T443, T444, T463, T464, T445, T465))
U5_aaaaaa(T440, T442, T466, T441, T430, T431, T432, T433, T434, T443, T436, T444, T467, T445, balance23_out_aaaaaaaaaa(T440, T441, T442, T462, T443, T444, T463, T464, T445, T465)) → U6_aaaaaa(T440, T442, T466, T441, T430, T431, T432, T433, T434, T443, T436, T444, T467, T445, balance13_in_aaaaaa(T466, T462, T463, T464, T467, T465))
U6_aaaaaa(T440, T442, T466, T441, T430, T431, T432, T433, T434, T443, T436, T444, T467, T445, balance13_out_aaaaaa(T466, T462, T463, T464, T467, T465)) → balance13_out_aaaaaa(tree(T440, T442, T466), T441, .(','(tree(T430, T431, T432), -(T433, T434)), T443), .(','(T430, -(T433, .(T431, T436))), .(','(T432, -(T436, T434)), T444)), T467, T445)
U12_ag(T31, T33, T58, T28, T29, T30, balance13_out_aaaaaa(T58, T53, T54, T55, T56, T57)) → balance1_out_ag(tree(T31, T33, T58), tree(T28, T29, T30))
BALANCE1_IN_AG(tree(T31, T33, T36), tree(T28, T29, T30)) → U10_AG(T31, T33, T36, T28, T29, T30, balance12_in_aaaaggagaaaaa(T31, T32, T33, X113, T28, T29, T35, T30, T34, X114, X115, X121, X116))
BALANCE1_IN_AG(tree(T31, T33, T36), tree(T28, T29, T30)) → BALANCE12_IN_AAAAGGAGAAAAA(T31, T32, T33, X113, T28, T29, T35, T30, T34, X114, X115, X121, X116)
BALANCE12_IN_AAAAGGAGAAAAA(tree(T157, T159, T163), T158, T164, X276, tree(T148, T149, T150), T151, T161, T153, .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160)), X277, X278, X279, X280) → U7_AAAAGGAGAAAAA(T157, T159, T163, T158, T164, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, X279, X280, balance23_in_aaaaaaaaaa(T157, T158, T159, X272, .(','(T153, -(T161, [])), .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160))), T160, X273, X274, X279, X275))
BALANCE12_IN_AAAAGGAGAAAAA(tree(T157, T159, T163), T158, T164, X276, tree(T148, T149, T150), T151, T161, T153, .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160)), X277, X278, X279, X280) → BALANCE23_IN_AAAAAAAAAA(T157, T158, T159, X272, .(','(T153, -(T161, [])), .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160))), T160, X273, X274, X279, X275)
BALANCE23_IN_AAAAAAAAAA(tree(T307, T309, T313), T308, T314, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436) → U1_AAAAAAAAAA(T307, T309, T313, T308, T314, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_in_aaaaaaaaaa(T307, T308, T309, X429, T310, T311, X430, X431, T312, X432))
BALANCE23_IN_AAAAAAAAAA(tree(T307, T309, T313), T308, T314, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436) → BALANCE23_IN_AAAAAAAAAA(T307, T308, T309, X429, T310, T311, X430, X431, T312, X432)
BALANCE23_IN_AAAAAAAAAA(tree(T307, T309, T333), T308, T334, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436) → U2_AAAAAAAAAA(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_in_aaaaaaaaaa(T307, T308, T309, T329, T310, T311, T330, T331, T312, T332))
U2_AAAAAAAAAA(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_out_aaaaaaaaaa(T307, T308, T309, T329, T310, T311, T330, T331, T312, T332)) → U3_AAAAAAAAAA(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_in_aaaaaaaaaa(T333, T329, T334, X433, T330, T331, X434, X435, T332, X436))
U2_AAAAAAAAAA(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_out_aaaaaaaaaa(T307, T308, T309, T329, T310, T311, T330, T331, T312, T332)) → BALANCE23_IN_AAAAAAAAAA(T333, T329, T334, X433, T330, T331, X434, X435, T332, X436)
BALANCE12_IN_AAAAGGAGAAAAA(tree(T157, T159, T192), T158, T193, X276, tree(T148, T149, T150), T151, T161, T153, .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160)), X277, X278, T190, X280) → U8_AAAAGGAGAAAAA(T157, T159, T192, T158, T193, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, T190, X280, balance23_in_aaaaaaaaaa(T157, T158, T159, T187, .(','(T153, -(T161, [])), .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160))), T160, T188, T189, T190, T191))
U8_AAAAGGAGAAAAA(T157, T159, T192, T158, T193, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, T190, X280, balance23_out_aaaaaaaaaa(T157, T158, T159, T187, .(','(T153, -(T161, [])), .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160))), T160, T188, T189, T190, T191)) → U9_AAAAGGAGAAAAA(T157, T159, T192, T158, T193, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, T190, X280, balance23_in_aaaaaaaaaa(T192, T187, T193, X276, T188, T189, X277, X278, T191, X280))
U8_AAAAGGAGAAAAA(T157, T159, T192, T158, T193, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, T190, X280, balance23_out_aaaaaaaaaa(T157, T158, T159, T187, .(','(T153, -(T161, [])), .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160))), T160, T188, T189, T190, T191)) → BALANCE23_IN_AAAAAAAAAA(T192, T187, T193, X276, T188, T189, X277, X278, T191, X280)
BALANCE1_IN_AG(tree(T31, T33, T58), tree(T28, T29, T30)) → U11_AG(T31, T33, T58, T28, T29, T30, balance12_in_aaaaggagaaaaa(T31, T32, T33, T53, T28, T29, T35, T30, T34, T54, T55, T56, T57))
U11_AG(T31, T33, T58, T28, T29, T30, balance12_out_aaaaggagaaaaa(T31, T32, T33, T53, T28, T29, T35, T30, T34, T54, T55, T56, T57)) → U12_AG(T31, T33, T58, T28, T29, T30, balance13_in_aaaaaa(T58, T53, T54, T55, T56, T57))
U11_AG(T31, T33, T58, T28, T29, T30, balance12_out_aaaaggagaaaaa(T31, T32, T33, T53, T28, T29, T35, T30, T34, T54, T55, T56, T57)) → BALANCE13_IN_AAAAAA(T58, T53, T54, T55, T56, T57)
BALANCE13_IN_AAAAAA(tree(T440, T442, T446), T441, .(','(tree(T430, T431, T432), -(T433, T434)), T443), .(','(T430, -(T433, .(T431, T436))), .(','(T432, -(T436, T434)), T444)), T447, T445) → U4_AAAAAA(T440, T442, T446, T441, T430, T431, T432, T433, T434, T443, T436, T444, T447, T445, balance23_in_aaaaaaaaaa(T440, T441, T442, X579, T443, T444, X580, X581, T445, X582))
BALANCE13_IN_AAAAAA(tree(T440, T442, T446), T441, .(','(tree(T430, T431, T432), -(T433, T434)), T443), .(','(T430, -(T433, .(T431, T436))), .(','(T432, -(T436, T434)), T444)), T447, T445) → BALANCE23_IN_AAAAAAAAAA(T440, T441, T442, X579, T443, T444, X580, X581, T445, X582)
BALANCE13_IN_AAAAAA(tree(T440, T442, T466), T441, .(','(tree(T430, T431, T432), -(T433, T434)), T443), .(','(T430, -(T433, .(T431, T436))), .(','(T432, -(T436, T434)), T444)), T467, T445) → U5_AAAAAA(T440, T442, T466, T441, T430, T431, T432, T433, T434, T443, T436, T444, T467, T445, balance23_in_aaaaaaaaaa(T440, T441, T442, T462, T443, T444, T463, T464, T445, T465))
U5_AAAAAA(T440, T442, T466, T441, T430, T431, T432, T433, T434, T443, T436, T444, T467, T445, balance23_out_aaaaaaaaaa(T440, T441, T442, T462, T443, T444, T463, T464, T445, T465)) → U6_AAAAAA(T440, T442, T466, T441, T430, T431, T432, T433, T434, T443, T436, T444, T467, T445, balance13_in_aaaaaa(T466, T462, T463, T464, T467, T465))
U5_AAAAAA(T440, T442, T466, T441, T430, T431, T432, T433, T434, T443, T436, T444, T467, T445, balance23_out_aaaaaaaaaa(T440, T441, T442, T462, T443, T444, T463, T464, T445, T465)) → BALANCE13_IN_AAAAAA(T466, T462, T463, T464, T467, T465)
balance1_in_ag(nil, nil) → balance1_out_ag(nil, nil)
balance1_in_ag(tree(T31, T33, T36), tree(T28, T29, T30)) → U10_ag(T31, T33, T36, T28, T29, T30, balance12_in_aaaaggagaaaaa(T31, T32, T33, X113, T28, T29, T35, T30, T34, X114, X115, X121, X116))
balance12_in_aaaaggagaaaaa(nil, .(T108, T109), T108, T109, T110, T111, T112, T113, T114, .(','(T110, -(.(T108, T109), .(T111, T112))), .(','(T113, -(T112, [])), T114)), T114, .(','(nil, -(X200, X200)), X201), X201) → balance12_out_aaaaggagaaaaa(nil, .(T108, T109), T108, T109, T110, T111, T112, T113, T114, .(','(T110, -(.(T108, T109), .(T111, T112))), .(','(T113, -(T112, [])), T114)), T114, .(','(nil, -(X200, X200)), X201), X201)
balance12_in_aaaaggagaaaaa(tree(T157, T159, T163), T158, T164, X276, tree(T148, T149, T150), T151, T161, T153, .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160)), X277, X278, X279, X280) → U7_aaaaggagaaaaa(T157, T159, T163, T158, T164, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, X279, X280, balance23_in_aaaaaaaaaa(T157, T158, T159, X272, .(','(T153, -(T161, [])), .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160))), T160, X273, X274, X279, X275))
balance23_in_aaaaaaaaaa(nil, .(T259, T260), T259, T260, T261, T262, T261, T262, .(','(nil, -(T263, T263)), T264), T264) → balance23_out_aaaaaaaaaa(nil, .(T259, T260), T259, T260, T261, T262, T261, T262, .(','(nil, -(T263, T263)), T264), T264)
balance23_in_aaaaaaaaaa(tree(T307, T309, T313), T308, T314, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436) → U1_aaaaaaaaaa(T307, T309, T313, T308, T314, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_in_aaaaaaaaaa(T307, T308, T309, X429, T310, T311, X430, X431, T312, X432))
balance23_in_aaaaaaaaaa(tree(T307, T309, T333), T308, T334, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436) → U2_aaaaaaaaaa(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_in_aaaaaaaaaa(T307, T308, T309, T329, T310, T311, T330, T331, T312, T332))
U2_aaaaaaaaaa(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_out_aaaaaaaaaa(T307, T308, T309, T329, T310, T311, T330, T331, T312, T332)) → U3_aaaaaaaaaa(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_in_aaaaaaaaaa(T333, T329, T334, X433, T330, T331, X434, X435, T332, X436))
U3_aaaaaaaaaa(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_out_aaaaaaaaaa(T333, T329, T334, X433, T330, T331, X434, X435, T332, X436)) → balance23_out_aaaaaaaaaa(tree(T307, T309, T333), T308, T334, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436)
U1_aaaaaaaaaa(T307, T309, T313, T308, T314, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_out_aaaaaaaaaa(T307, T308, T309, X429, T310, T311, X430, X431, T312, X432)) → balance23_out_aaaaaaaaaa(tree(T307, T309, T313), T308, T314, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436)
U7_aaaaggagaaaaa(T157, T159, T163, T158, T164, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, X279, X280, balance23_out_aaaaaaaaaa(T157, T158, T159, X272, .(','(T153, -(T161, [])), .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160))), T160, X273, X274, X279, X275)) → balance12_out_aaaaggagaaaaa(tree(T157, T159, T163), T158, T164, X276, tree(T148, T149, T150), T151, T161, T153, .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160)), X277, X278, X279, X280)
balance12_in_aaaaggagaaaaa(tree(T157, T159, T192), T158, T193, X276, tree(T148, T149, T150), T151, T161, T153, .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160)), X277, X278, T190, X280) → U8_aaaaggagaaaaa(T157, T159, T192, T158, T193, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, T190, X280, balance23_in_aaaaaaaaaa(T157, T158, T159, T187, .(','(T153, -(T161, [])), .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160))), T160, T188, T189, T190, T191))
U8_aaaaggagaaaaa(T157, T159, T192, T158, T193, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, T190, X280, balance23_out_aaaaaaaaaa(T157, T158, T159, T187, .(','(T153, -(T161, [])), .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160))), T160, T188, T189, T190, T191)) → U9_aaaaggagaaaaa(T157, T159, T192, T158, T193, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, T190, X280, balance23_in_aaaaaaaaaa(T192, T187, T193, X276, T188, T189, X277, X278, T191, X280))
U9_aaaaggagaaaaa(T157, T159, T192, T158, T193, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, T190, X280, balance23_out_aaaaaaaaaa(T192, T187, T193, X276, T188, T189, X277, X278, T191, X280)) → balance12_out_aaaaggagaaaaa(tree(T157, T159, T192), T158, T193, X276, tree(T148, T149, T150), T151, T161, T153, .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160)), X277, X278, T190, X280)
U10_ag(T31, T33, T36, T28, T29, T30, balance12_out_aaaaggagaaaaa(T31, T32, T33, X113, T28, T29, T35, T30, T34, X114, X115, X121, X116)) → balance1_out_ag(tree(T31, T33, T36), tree(T28, T29, T30))
balance1_in_ag(tree(T31, T33, T58), tree(T28, T29, T30)) → U11_ag(T31, T33, T58, T28, T29, T30, balance12_in_aaaaggagaaaaa(T31, T32, T33, T53, T28, T29, T35, T30, T34, T54, T55, T56, T57))
U11_ag(T31, T33, T58, T28, T29, T30, balance12_out_aaaaggagaaaaa(T31, T32, T33, T53, T28, T29, T35, T30, T34, T54, T55, T56, T57)) → U12_ag(T31, T33, T58, T28, T29, T30, balance13_in_aaaaaa(T58, T53, T54, T55, T56, T57))
balance13_in_aaaaaa(nil, [], T394, [], T394, .(','(nil, -(T396, T396)), [])) → balance13_out_aaaaaa(nil, [], T394, [], T394, .(','(nil, -(T396, T396)), []))
balance13_in_aaaaaa(tree(T440, T442, T446), T441, .(','(tree(T430, T431, T432), -(T433, T434)), T443), .(','(T430, -(T433, .(T431, T436))), .(','(T432, -(T436, T434)), T444)), T447, T445) → U4_aaaaaa(T440, T442, T446, T441, T430, T431, T432, T433, T434, T443, T436, T444, T447, T445, balance23_in_aaaaaaaaaa(T440, T441, T442, X579, T443, T444, X580, X581, T445, X582))
U4_aaaaaa(T440, T442, T446, T441, T430, T431, T432, T433, T434, T443, T436, T444, T447, T445, balance23_out_aaaaaaaaaa(T440, T441, T442, X579, T443, T444, X580, X581, T445, X582)) → balance13_out_aaaaaa(tree(T440, T442, T446), T441, .(','(tree(T430, T431, T432), -(T433, T434)), T443), .(','(T430, -(T433, .(T431, T436))), .(','(T432, -(T436, T434)), T444)), T447, T445)
balance13_in_aaaaaa(tree(T440, T442, T466), T441, .(','(tree(T430, T431, T432), -(T433, T434)), T443), .(','(T430, -(T433, .(T431, T436))), .(','(T432, -(T436, T434)), T444)), T467, T445) → U5_aaaaaa(T440, T442, T466, T441, T430, T431, T432, T433, T434, T443, T436, T444, T467, T445, balance23_in_aaaaaaaaaa(T440, T441, T442, T462, T443, T444, T463, T464, T445, T465))
U5_aaaaaa(T440, T442, T466, T441, T430, T431, T432, T433, T434, T443, T436, T444, T467, T445, balance23_out_aaaaaaaaaa(T440, T441, T442, T462, T443, T444, T463, T464, T445, T465)) → U6_aaaaaa(T440, T442, T466, T441, T430, T431, T432, T433, T434, T443, T436, T444, T467, T445, balance13_in_aaaaaa(T466, T462, T463, T464, T467, T465))
U6_aaaaaa(T440, T442, T466, T441, T430, T431, T432, T433, T434, T443, T436, T444, T467, T445, balance13_out_aaaaaa(T466, T462, T463, T464, T467, T465)) → balance13_out_aaaaaa(tree(T440, T442, T466), T441, .(','(tree(T430, T431, T432), -(T433, T434)), T443), .(','(T430, -(T433, .(T431, T436))), .(','(T432, -(T436, T434)), T444)), T467, T445)
U12_ag(T31, T33, T58, T28, T29, T30, balance13_out_aaaaaa(T58, T53, T54, T55, T56, T57)) → balance1_out_ag(tree(T31, T33, T58), tree(T28, T29, T30))
BALANCE1_IN_AG(tree(T31, T33, T36), tree(T28, T29, T30)) → U10_AG(T31, T33, T36, T28, T29, T30, balance12_in_aaaaggagaaaaa(T31, T32, T33, X113, T28, T29, T35, T30, T34, X114, X115, X121, X116))
BALANCE1_IN_AG(tree(T31, T33, T36), tree(T28, T29, T30)) → BALANCE12_IN_AAAAGGAGAAAAA(T31, T32, T33, X113, T28, T29, T35, T30, T34, X114, X115, X121, X116)
BALANCE12_IN_AAAAGGAGAAAAA(tree(T157, T159, T163), T158, T164, X276, tree(T148, T149, T150), T151, T161, T153, .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160)), X277, X278, X279, X280) → U7_AAAAGGAGAAAAA(T157, T159, T163, T158, T164, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, X279, X280, balance23_in_aaaaaaaaaa(T157, T158, T159, X272, .(','(T153, -(T161, [])), .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160))), T160, X273, X274, X279, X275))
BALANCE12_IN_AAAAGGAGAAAAA(tree(T157, T159, T163), T158, T164, X276, tree(T148, T149, T150), T151, T161, T153, .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160)), X277, X278, X279, X280) → BALANCE23_IN_AAAAAAAAAA(T157, T158, T159, X272, .(','(T153, -(T161, [])), .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160))), T160, X273, X274, X279, X275)
BALANCE23_IN_AAAAAAAAAA(tree(T307, T309, T313), T308, T314, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436) → U1_AAAAAAAAAA(T307, T309, T313, T308, T314, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_in_aaaaaaaaaa(T307, T308, T309, X429, T310, T311, X430, X431, T312, X432))
BALANCE23_IN_AAAAAAAAAA(tree(T307, T309, T313), T308, T314, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436) → BALANCE23_IN_AAAAAAAAAA(T307, T308, T309, X429, T310, T311, X430, X431, T312, X432)
BALANCE23_IN_AAAAAAAAAA(tree(T307, T309, T333), T308, T334, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436) → U2_AAAAAAAAAA(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_in_aaaaaaaaaa(T307, T308, T309, T329, T310, T311, T330, T331, T312, T332))
U2_AAAAAAAAAA(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_out_aaaaaaaaaa(T307, T308, T309, T329, T310, T311, T330, T331, T312, T332)) → U3_AAAAAAAAAA(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_in_aaaaaaaaaa(T333, T329, T334, X433, T330, T331, X434, X435, T332, X436))
U2_AAAAAAAAAA(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_out_aaaaaaaaaa(T307, T308, T309, T329, T310, T311, T330, T331, T312, T332)) → BALANCE23_IN_AAAAAAAAAA(T333, T329, T334, X433, T330, T331, X434, X435, T332, X436)
BALANCE12_IN_AAAAGGAGAAAAA(tree(T157, T159, T192), T158, T193, X276, tree(T148, T149, T150), T151, T161, T153, .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160)), X277, X278, T190, X280) → U8_AAAAGGAGAAAAA(T157, T159, T192, T158, T193, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, T190, X280, balance23_in_aaaaaaaaaa(T157, T158, T159, T187, .(','(T153, -(T161, [])), .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160))), T160, T188, T189, T190, T191))
U8_AAAAGGAGAAAAA(T157, T159, T192, T158, T193, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, T190, X280, balance23_out_aaaaaaaaaa(T157, T158, T159, T187, .(','(T153, -(T161, [])), .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160))), T160, T188, T189, T190, T191)) → U9_AAAAGGAGAAAAA(T157, T159, T192, T158, T193, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, T190, X280, balance23_in_aaaaaaaaaa(T192, T187, T193, X276, T188, T189, X277, X278, T191, X280))
U8_AAAAGGAGAAAAA(T157, T159, T192, T158, T193, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, T190, X280, balance23_out_aaaaaaaaaa(T157, T158, T159, T187, .(','(T153, -(T161, [])), .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160))), T160, T188, T189, T190, T191)) → BALANCE23_IN_AAAAAAAAAA(T192, T187, T193, X276, T188, T189, X277, X278, T191, X280)
BALANCE1_IN_AG(tree(T31, T33, T58), tree(T28, T29, T30)) → U11_AG(T31, T33, T58, T28, T29, T30, balance12_in_aaaaggagaaaaa(T31, T32, T33, T53, T28, T29, T35, T30, T34, T54, T55, T56, T57))
U11_AG(T31, T33, T58, T28, T29, T30, balance12_out_aaaaggagaaaaa(T31, T32, T33, T53, T28, T29, T35, T30, T34, T54, T55, T56, T57)) → U12_AG(T31, T33, T58, T28, T29, T30, balance13_in_aaaaaa(T58, T53, T54, T55, T56, T57))
U11_AG(T31, T33, T58, T28, T29, T30, balance12_out_aaaaggagaaaaa(T31, T32, T33, T53, T28, T29, T35, T30, T34, T54, T55, T56, T57)) → BALANCE13_IN_AAAAAA(T58, T53, T54, T55, T56, T57)
BALANCE13_IN_AAAAAA(tree(T440, T442, T446), T441, .(','(tree(T430, T431, T432), -(T433, T434)), T443), .(','(T430, -(T433, .(T431, T436))), .(','(T432, -(T436, T434)), T444)), T447, T445) → U4_AAAAAA(T440, T442, T446, T441, T430, T431, T432, T433, T434, T443, T436, T444, T447, T445, balance23_in_aaaaaaaaaa(T440, T441, T442, X579, T443, T444, X580, X581, T445, X582))
BALANCE13_IN_AAAAAA(tree(T440, T442, T446), T441, .(','(tree(T430, T431, T432), -(T433, T434)), T443), .(','(T430, -(T433, .(T431, T436))), .(','(T432, -(T436, T434)), T444)), T447, T445) → BALANCE23_IN_AAAAAAAAAA(T440, T441, T442, X579, T443, T444, X580, X581, T445, X582)
BALANCE13_IN_AAAAAA(tree(T440, T442, T466), T441, .(','(tree(T430, T431, T432), -(T433, T434)), T443), .(','(T430, -(T433, .(T431, T436))), .(','(T432, -(T436, T434)), T444)), T467, T445) → U5_AAAAAA(T440, T442, T466, T441, T430, T431, T432, T433, T434, T443, T436, T444, T467, T445, balance23_in_aaaaaaaaaa(T440, T441, T442, T462, T443, T444, T463, T464, T445, T465))
U5_AAAAAA(T440, T442, T466, T441, T430, T431, T432, T433, T434, T443, T436, T444, T467, T445, balance23_out_aaaaaaaaaa(T440, T441, T442, T462, T443, T444, T463, T464, T445, T465)) → U6_AAAAAA(T440, T442, T466, T441, T430, T431, T432, T433, T434, T443, T436, T444, T467, T445, balance13_in_aaaaaa(T466, T462, T463, T464, T467, T465))
U5_AAAAAA(T440, T442, T466, T441, T430, T431, T432, T433, T434, T443, T436, T444, T467, T445, balance23_out_aaaaaaaaaa(T440, T441, T442, T462, T443, T444, T463, T464, T445, T465)) → BALANCE13_IN_AAAAAA(T466, T462, T463, T464, T467, T465)
balance1_in_ag(nil, nil) → balance1_out_ag(nil, nil)
balance1_in_ag(tree(T31, T33, T36), tree(T28, T29, T30)) → U10_ag(T31, T33, T36, T28, T29, T30, balance12_in_aaaaggagaaaaa(T31, T32, T33, X113, T28, T29, T35, T30, T34, X114, X115, X121, X116))
balance12_in_aaaaggagaaaaa(nil, .(T108, T109), T108, T109, T110, T111, T112, T113, T114, .(','(T110, -(.(T108, T109), .(T111, T112))), .(','(T113, -(T112, [])), T114)), T114, .(','(nil, -(X200, X200)), X201), X201) → balance12_out_aaaaggagaaaaa(nil, .(T108, T109), T108, T109, T110, T111, T112, T113, T114, .(','(T110, -(.(T108, T109), .(T111, T112))), .(','(T113, -(T112, [])), T114)), T114, .(','(nil, -(X200, X200)), X201), X201)
balance12_in_aaaaggagaaaaa(tree(T157, T159, T163), T158, T164, X276, tree(T148, T149, T150), T151, T161, T153, .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160)), X277, X278, X279, X280) → U7_aaaaggagaaaaa(T157, T159, T163, T158, T164, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, X279, X280, balance23_in_aaaaaaaaaa(T157, T158, T159, X272, .(','(T153, -(T161, [])), .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160))), T160, X273, X274, X279, X275))
balance23_in_aaaaaaaaaa(nil, .(T259, T260), T259, T260, T261, T262, T261, T262, .(','(nil, -(T263, T263)), T264), T264) → balance23_out_aaaaaaaaaa(nil, .(T259, T260), T259, T260, T261, T262, T261, T262, .(','(nil, -(T263, T263)), T264), T264)
balance23_in_aaaaaaaaaa(tree(T307, T309, T313), T308, T314, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436) → U1_aaaaaaaaaa(T307, T309, T313, T308, T314, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_in_aaaaaaaaaa(T307, T308, T309, X429, T310, T311, X430, X431, T312, X432))
balance23_in_aaaaaaaaaa(tree(T307, T309, T333), T308, T334, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436) → U2_aaaaaaaaaa(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_in_aaaaaaaaaa(T307, T308, T309, T329, T310, T311, T330, T331, T312, T332))
U2_aaaaaaaaaa(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_out_aaaaaaaaaa(T307, T308, T309, T329, T310, T311, T330, T331, T312, T332)) → U3_aaaaaaaaaa(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_in_aaaaaaaaaa(T333, T329, T334, X433, T330, T331, X434, X435, T332, X436))
U3_aaaaaaaaaa(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_out_aaaaaaaaaa(T333, T329, T334, X433, T330, T331, X434, X435, T332, X436)) → balance23_out_aaaaaaaaaa(tree(T307, T309, T333), T308, T334, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436)
U1_aaaaaaaaaa(T307, T309, T313, T308, T314, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_out_aaaaaaaaaa(T307, T308, T309, X429, T310, T311, X430, X431, T312, X432)) → balance23_out_aaaaaaaaaa(tree(T307, T309, T313), T308, T314, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436)
U7_aaaaggagaaaaa(T157, T159, T163, T158, T164, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, X279, X280, balance23_out_aaaaaaaaaa(T157, T158, T159, X272, .(','(T153, -(T161, [])), .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160))), T160, X273, X274, X279, X275)) → balance12_out_aaaaggagaaaaa(tree(T157, T159, T163), T158, T164, X276, tree(T148, T149, T150), T151, T161, T153, .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160)), X277, X278, X279, X280)
balance12_in_aaaaggagaaaaa(tree(T157, T159, T192), T158, T193, X276, tree(T148, T149, T150), T151, T161, T153, .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160)), X277, X278, T190, X280) → U8_aaaaggagaaaaa(T157, T159, T192, T158, T193, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, T190, X280, balance23_in_aaaaaaaaaa(T157, T158, T159, T187, .(','(T153, -(T161, [])), .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160))), T160, T188, T189, T190, T191))
U8_aaaaggagaaaaa(T157, T159, T192, T158, T193, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, T190, X280, balance23_out_aaaaaaaaaa(T157, T158, T159, T187, .(','(T153, -(T161, [])), .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160))), T160, T188, T189, T190, T191)) → U9_aaaaggagaaaaa(T157, T159, T192, T158, T193, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, T190, X280, balance23_in_aaaaaaaaaa(T192, T187, T193, X276, T188, T189, X277, X278, T191, X280))
U9_aaaaggagaaaaa(T157, T159, T192, T158, T193, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, T190, X280, balance23_out_aaaaaaaaaa(T192, T187, T193, X276, T188, T189, X277, X278, T191, X280)) → balance12_out_aaaaggagaaaaa(tree(T157, T159, T192), T158, T193, X276, tree(T148, T149, T150), T151, T161, T153, .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160)), X277, X278, T190, X280)
U10_ag(T31, T33, T36, T28, T29, T30, balance12_out_aaaaggagaaaaa(T31, T32, T33, X113, T28, T29, T35, T30, T34, X114, X115, X121, X116)) → balance1_out_ag(tree(T31, T33, T36), tree(T28, T29, T30))
balance1_in_ag(tree(T31, T33, T58), tree(T28, T29, T30)) → U11_ag(T31, T33, T58, T28, T29, T30, balance12_in_aaaaggagaaaaa(T31, T32, T33, T53, T28, T29, T35, T30, T34, T54, T55, T56, T57))
U11_ag(T31, T33, T58, T28, T29, T30, balance12_out_aaaaggagaaaaa(T31, T32, T33, T53, T28, T29, T35, T30, T34, T54, T55, T56, T57)) → U12_ag(T31, T33, T58, T28, T29, T30, balance13_in_aaaaaa(T58, T53, T54, T55, T56, T57))
balance13_in_aaaaaa(nil, [], T394, [], T394, .(','(nil, -(T396, T396)), [])) → balance13_out_aaaaaa(nil, [], T394, [], T394, .(','(nil, -(T396, T396)), []))
balance13_in_aaaaaa(tree(T440, T442, T446), T441, .(','(tree(T430, T431, T432), -(T433, T434)), T443), .(','(T430, -(T433, .(T431, T436))), .(','(T432, -(T436, T434)), T444)), T447, T445) → U4_aaaaaa(T440, T442, T446, T441, T430, T431, T432, T433, T434, T443, T436, T444, T447, T445, balance23_in_aaaaaaaaaa(T440, T441, T442, X579, T443, T444, X580, X581, T445, X582))
U4_aaaaaa(T440, T442, T446, T441, T430, T431, T432, T433, T434, T443, T436, T444, T447, T445, balance23_out_aaaaaaaaaa(T440, T441, T442, X579, T443, T444, X580, X581, T445, X582)) → balance13_out_aaaaaa(tree(T440, T442, T446), T441, .(','(tree(T430, T431, T432), -(T433, T434)), T443), .(','(T430, -(T433, .(T431, T436))), .(','(T432, -(T436, T434)), T444)), T447, T445)
balance13_in_aaaaaa(tree(T440, T442, T466), T441, .(','(tree(T430, T431, T432), -(T433, T434)), T443), .(','(T430, -(T433, .(T431, T436))), .(','(T432, -(T436, T434)), T444)), T467, T445) → U5_aaaaaa(T440, T442, T466, T441, T430, T431, T432, T433, T434, T443, T436, T444, T467, T445, balance23_in_aaaaaaaaaa(T440, T441, T442, T462, T443, T444, T463, T464, T445, T465))
U5_aaaaaa(T440, T442, T466, T441, T430, T431, T432, T433, T434, T443, T436, T444, T467, T445, balance23_out_aaaaaaaaaa(T440, T441, T442, T462, T443, T444, T463, T464, T445, T465)) → U6_aaaaaa(T440, T442, T466, T441, T430, T431, T432, T433, T434, T443, T436, T444, T467, T445, balance13_in_aaaaaa(T466, T462, T463, T464, T467, T465))
U6_aaaaaa(T440, T442, T466, T441, T430, T431, T432, T433, T434, T443, T436, T444, T467, T445, balance13_out_aaaaaa(T466, T462, T463, T464, T467, T465)) → balance13_out_aaaaaa(tree(T440, T442, T466), T441, .(','(tree(T430, T431, T432), -(T433, T434)), T443), .(','(T430, -(T433, .(T431, T436))), .(','(T432, -(T436, T434)), T444)), T467, T445)
U12_ag(T31, T33, T58, T28, T29, T30, balance13_out_aaaaaa(T58, T53, T54, T55, T56, T57)) → balance1_out_ag(tree(T31, T33, T58), tree(T28, T29, T30))
BALANCE23_IN_AAAAAAAAAA(tree(T307, T309, T333), T308, T334, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436) → U2_AAAAAAAAAA(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_in_aaaaaaaaaa(T307, T308, T309, T329, T310, T311, T330, T331, T312, T332))
U2_AAAAAAAAAA(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_out_aaaaaaaaaa(T307, T308, T309, T329, T310, T311, T330, T331, T312, T332)) → BALANCE23_IN_AAAAAAAAAA(T333, T329, T334, X433, T330, T331, X434, X435, T332, X436)
BALANCE23_IN_AAAAAAAAAA(tree(T307, T309, T313), T308, T314, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436) → BALANCE23_IN_AAAAAAAAAA(T307, T308, T309, X429, T310, T311, X430, X431, T312, X432)
balance1_in_ag(nil, nil) → balance1_out_ag(nil, nil)
balance1_in_ag(tree(T31, T33, T36), tree(T28, T29, T30)) → U10_ag(T31, T33, T36, T28, T29, T30, balance12_in_aaaaggagaaaaa(T31, T32, T33, X113, T28, T29, T35, T30, T34, X114, X115, X121, X116))
balance12_in_aaaaggagaaaaa(nil, .(T108, T109), T108, T109, T110, T111, T112, T113, T114, .(','(T110, -(.(T108, T109), .(T111, T112))), .(','(T113, -(T112, [])), T114)), T114, .(','(nil, -(X200, X200)), X201), X201) → balance12_out_aaaaggagaaaaa(nil, .(T108, T109), T108, T109, T110, T111, T112, T113, T114, .(','(T110, -(.(T108, T109), .(T111, T112))), .(','(T113, -(T112, [])), T114)), T114, .(','(nil, -(X200, X200)), X201), X201)
balance12_in_aaaaggagaaaaa(tree(T157, T159, T163), T158, T164, X276, tree(T148, T149, T150), T151, T161, T153, .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160)), X277, X278, X279, X280) → U7_aaaaggagaaaaa(T157, T159, T163, T158, T164, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, X279, X280, balance23_in_aaaaaaaaaa(T157, T158, T159, X272, .(','(T153, -(T161, [])), .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160))), T160, X273, X274, X279, X275))
balance23_in_aaaaaaaaaa(nil, .(T259, T260), T259, T260, T261, T262, T261, T262, .(','(nil, -(T263, T263)), T264), T264) → balance23_out_aaaaaaaaaa(nil, .(T259, T260), T259, T260, T261, T262, T261, T262, .(','(nil, -(T263, T263)), T264), T264)
balance23_in_aaaaaaaaaa(tree(T307, T309, T313), T308, T314, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436) → U1_aaaaaaaaaa(T307, T309, T313, T308, T314, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_in_aaaaaaaaaa(T307, T308, T309, X429, T310, T311, X430, X431, T312, X432))
balance23_in_aaaaaaaaaa(tree(T307, T309, T333), T308, T334, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436) → U2_aaaaaaaaaa(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_in_aaaaaaaaaa(T307, T308, T309, T329, T310, T311, T330, T331, T312, T332))
U2_aaaaaaaaaa(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_out_aaaaaaaaaa(T307, T308, T309, T329, T310, T311, T330, T331, T312, T332)) → U3_aaaaaaaaaa(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_in_aaaaaaaaaa(T333, T329, T334, X433, T330, T331, X434, X435, T332, X436))
U3_aaaaaaaaaa(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_out_aaaaaaaaaa(T333, T329, T334, X433, T330, T331, X434, X435, T332, X436)) → balance23_out_aaaaaaaaaa(tree(T307, T309, T333), T308, T334, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436)
U1_aaaaaaaaaa(T307, T309, T313, T308, T314, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_out_aaaaaaaaaa(T307, T308, T309, X429, T310, T311, X430, X431, T312, X432)) → balance23_out_aaaaaaaaaa(tree(T307, T309, T313), T308, T314, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436)
U7_aaaaggagaaaaa(T157, T159, T163, T158, T164, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, X279, X280, balance23_out_aaaaaaaaaa(T157, T158, T159, X272, .(','(T153, -(T161, [])), .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160))), T160, X273, X274, X279, X275)) → balance12_out_aaaaggagaaaaa(tree(T157, T159, T163), T158, T164, X276, tree(T148, T149, T150), T151, T161, T153, .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160)), X277, X278, X279, X280)
balance12_in_aaaaggagaaaaa(tree(T157, T159, T192), T158, T193, X276, tree(T148, T149, T150), T151, T161, T153, .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160)), X277, X278, T190, X280) → U8_aaaaggagaaaaa(T157, T159, T192, T158, T193, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, T190, X280, balance23_in_aaaaaaaaaa(T157, T158, T159, T187, .(','(T153, -(T161, [])), .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160))), T160, T188, T189, T190, T191))
U8_aaaaggagaaaaa(T157, T159, T192, T158, T193, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, T190, X280, balance23_out_aaaaaaaaaa(T157, T158, T159, T187, .(','(T153, -(T161, [])), .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160))), T160, T188, T189, T190, T191)) → U9_aaaaggagaaaaa(T157, T159, T192, T158, T193, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, T190, X280, balance23_in_aaaaaaaaaa(T192, T187, T193, X276, T188, T189, X277, X278, T191, X280))
U9_aaaaggagaaaaa(T157, T159, T192, T158, T193, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, T190, X280, balance23_out_aaaaaaaaaa(T192, T187, T193, X276, T188, T189, X277, X278, T191, X280)) → balance12_out_aaaaggagaaaaa(tree(T157, T159, T192), T158, T193, X276, tree(T148, T149, T150), T151, T161, T153, .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160)), X277, X278, T190, X280)
U10_ag(T31, T33, T36, T28, T29, T30, balance12_out_aaaaggagaaaaa(T31, T32, T33, X113, T28, T29, T35, T30, T34, X114, X115, X121, X116)) → balance1_out_ag(tree(T31, T33, T36), tree(T28, T29, T30))
balance1_in_ag(tree(T31, T33, T58), tree(T28, T29, T30)) → U11_ag(T31, T33, T58, T28, T29, T30, balance12_in_aaaaggagaaaaa(T31, T32, T33, T53, T28, T29, T35, T30, T34, T54, T55, T56, T57))
U11_ag(T31, T33, T58, T28, T29, T30, balance12_out_aaaaggagaaaaa(T31, T32, T33, T53, T28, T29, T35, T30, T34, T54, T55, T56, T57)) → U12_ag(T31, T33, T58, T28, T29, T30, balance13_in_aaaaaa(T58, T53, T54, T55, T56, T57))
balance13_in_aaaaaa(nil, [], T394, [], T394, .(','(nil, -(T396, T396)), [])) → balance13_out_aaaaaa(nil, [], T394, [], T394, .(','(nil, -(T396, T396)), []))
balance13_in_aaaaaa(tree(T440, T442, T446), T441, .(','(tree(T430, T431, T432), -(T433, T434)), T443), .(','(T430, -(T433, .(T431, T436))), .(','(T432, -(T436, T434)), T444)), T447, T445) → U4_aaaaaa(T440, T442, T446, T441, T430, T431, T432, T433, T434, T443, T436, T444, T447, T445, balance23_in_aaaaaaaaaa(T440, T441, T442, X579, T443, T444, X580, X581, T445, X582))
U4_aaaaaa(T440, T442, T446, T441, T430, T431, T432, T433, T434, T443, T436, T444, T447, T445, balance23_out_aaaaaaaaaa(T440, T441, T442, X579, T443, T444, X580, X581, T445, X582)) → balance13_out_aaaaaa(tree(T440, T442, T446), T441, .(','(tree(T430, T431, T432), -(T433, T434)), T443), .(','(T430, -(T433, .(T431, T436))), .(','(T432, -(T436, T434)), T444)), T447, T445)
balance13_in_aaaaaa(tree(T440, T442, T466), T441, .(','(tree(T430, T431, T432), -(T433, T434)), T443), .(','(T430, -(T433, .(T431, T436))), .(','(T432, -(T436, T434)), T444)), T467, T445) → U5_aaaaaa(T440, T442, T466, T441, T430, T431, T432, T433, T434, T443, T436, T444, T467, T445, balance23_in_aaaaaaaaaa(T440, T441, T442, T462, T443, T444, T463, T464, T445, T465))
U5_aaaaaa(T440, T442, T466, T441, T430, T431, T432, T433, T434, T443, T436, T444, T467, T445, balance23_out_aaaaaaaaaa(T440, T441, T442, T462, T443, T444, T463, T464, T445, T465)) → U6_aaaaaa(T440, T442, T466, T441, T430, T431, T432, T433, T434, T443, T436, T444, T467, T445, balance13_in_aaaaaa(T466, T462, T463, T464, T467, T465))
U6_aaaaaa(T440, T442, T466, T441, T430, T431, T432, T433, T434, T443, T436, T444, T467, T445, balance13_out_aaaaaa(T466, T462, T463, T464, T467, T465)) → balance13_out_aaaaaa(tree(T440, T442, T466), T441, .(','(tree(T430, T431, T432), -(T433, T434)), T443), .(','(T430, -(T433, .(T431, T436))), .(','(T432, -(T436, T434)), T444)), T467, T445)
U12_ag(T31, T33, T58, T28, T29, T30, balance13_out_aaaaaa(T58, T53, T54, T55, T56, T57)) → balance1_out_ag(tree(T31, T33, T58), tree(T28, T29, T30))
BALANCE23_IN_AAAAAAAAAA(tree(T307, T309, T333), T308, T334, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436) → U2_AAAAAAAAAA(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_in_aaaaaaaaaa(T307, T308, T309, T329, T310, T311, T330, T331, T312, T332))
U2_AAAAAAAAAA(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_out_aaaaaaaaaa(T307, T308, T309, T329, T310, T311, T330, T331, T312, T332)) → BALANCE23_IN_AAAAAAAAAA(T333, T329, T334, X433, T330, T331, X434, X435, T332, X436)
BALANCE23_IN_AAAAAAAAAA(tree(T307, T309, T313), T308, T314, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436) → BALANCE23_IN_AAAAAAAAAA(T307, T308, T309, X429, T310, T311, X430, X431, T312, X432)
balance23_in_aaaaaaaaaa(nil, .(T259, T260), T259, T260, T261, T262, T261, T262, .(','(nil, -(T263, T263)), T264), T264) → balance23_out_aaaaaaaaaa(nil, .(T259, T260), T259, T260, T261, T262, T261, T262, .(','(nil, -(T263, T263)), T264), T264)
balance23_in_aaaaaaaaaa(tree(T307, T309, T313), T308, T314, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436) → U1_aaaaaaaaaa(T307, T309, T313, T308, T314, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_in_aaaaaaaaaa(T307, T308, T309, X429, T310, T311, X430, X431, T312, X432))
balance23_in_aaaaaaaaaa(tree(T307, T309, T333), T308, T334, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436) → U2_aaaaaaaaaa(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_in_aaaaaaaaaa(T307, T308, T309, T329, T310, T311, T330, T331, T312, T332))
U1_aaaaaaaaaa(T307, T309, T313, T308, T314, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_out_aaaaaaaaaa(T307, T308, T309, X429, T310, T311, X430, X431, T312, X432)) → balance23_out_aaaaaaaaaa(tree(T307, T309, T313), T308, T314, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436)
U2_aaaaaaaaaa(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_out_aaaaaaaaaa(T307, T308, T309, T329, T310, T311, T330, T331, T312, T332)) → U3_aaaaaaaaaa(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_in_aaaaaaaaaa(T333, T329, T334, X433, T330, T331, X434, X435, T332, X436))
U3_aaaaaaaaaa(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_out_aaaaaaaaaa(T333, T329, T334, X433, T330, T331, X434, X435, T332, X436)) → balance23_out_aaaaaaaaaa(tree(T307, T309, T333), T308, T334, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436)
BALANCE23_IN_AAAAAAAAAA → U2_AAAAAAAAAA(balance23_in_aaaaaaaaaa)
U2_AAAAAAAAAA(balance23_out_aaaaaaaaaa) → BALANCE23_IN_AAAAAAAAAA
BALANCE23_IN_AAAAAAAAAA → BALANCE23_IN_AAAAAAAAAA
balance23_in_aaaaaaaaaa → balance23_out_aaaaaaaaaa
balance23_in_aaaaaaaaaa → U1_aaaaaaaaaa(balance23_in_aaaaaaaaaa)
balance23_in_aaaaaaaaaa → U2_aaaaaaaaaa(balance23_in_aaaaaaaaaa)
U1_aaaaaaaaaa(balance23_out_aaaaaaaaaa) → balance23_out_aaaaaaaaaa
U2_aaaaaaaaaa(balance23_out_aaaaaaaaaa) → U3_aaaaaaaaaa(balance23_in_aaaaaaaaaa)
U3_aaaaaaaaaa(balance23_out_aaaaaaaaaa) → balance23_out_aaaaaaaaaa
balance23_in_aaaaaaaaaa
U1_aaaaaaaaaa(x0)
U2_aaaaaaaaaa(x0)
U3_aaaaaaaaaa(x0)
BALANCE23_IN_AAAAAAAAAA → U2_AAAAAAAAAA(balance23_out_aaaaaaaaaa)
BALANCE23_IN_AAAAAAAAAA → U2_AAAAAAAAAA(U1_aaaaaaaaaa(balance23_in_aaaaaaaaaa))
BALANCE23_IN_AAAAAAAAAA → U2_AAAAAAAAAA(U2_aaaaaaaaaa(balance23_in_aaaaaaaaaa))
U2_AAAAAAAAAA(balance23_out_aaaaaaaaaa) → BALANCE23_IN_AAAAAAAAAA
BALANCE23_IN_AAAAAAAAAA → BALANCE23_IN_AAAAAAAAAA
BALANCE23_IN_AAAAAAAAAA → U2_AAAAAAAAAA(balance23_out_aaaaaaaaaa)
BALANCE23_IN_AAAAAAAAAA → U2_AAAAAAAAAA(U1_aaaaaaaaaa(balance23_in_aaaaaaaaaa))
BALANCE23_IN_AAAAAAAAAA → U2_AAAAAAAAAA(U2_aaaaaaaaaa(balance23_in_aaaaaaaaaa))
balance23_in_aaaaaaaaaa → balance23_out_aaaaaaaaaa
balance23_in_aaaaaaaaaa → U1_aaaaaaaaaa(balance23_in_aaaaaaaaaa)
balance23_in_aaaaaaaaaa → U2_aaaaaaaaaa(balance23_in_aaaaaaaaaa)
U1_aaaaaaaaaa(balance23_out_aaaaaaaaaa) → balance23_out_aaaaaaaaaa
U2_aaaaaaaaaa(balance23_out_aaaaaaaaaa) → U3_aaaaaaaaaa(balance23_in_aaaaaaaaaa)
U3_aaaaaaaaaa(balance23_out_aaaaaaaaaa) → balance23_out_aaaaaaaaaa
balance23_in_aaaaaaaaaa
U1_aaaaaaaaaa(x0)
U2_aaaaaaaaaa(x0)
U3_aaaaaaaaaa(x0)
BALANCE13_IN_AAAAAA(tree(T440, T442, T466), T441, .(','(tree(T430, T431, T432), -(T433, T434)), T443), .(','(T430, -(T433, .(T431, T436))), .(','(T432, -(T436, T434)), T444)), T467, T445) → U5_AAAAAA(T440, T442, T466, T441, T430, T431, T432, T433, T434, T443, T436, T444, T467, T445, balance23_in_aaaaaaaaaa(T440, T441, T442, T462, T443, T444, T463, T464, T445, T465))
U5_AAAAAA(T440, T442, T466, T441, T430, T431, T432, T433, T434, T443, T436, T444, T467, T445, balance23_out_aaaaaaaaaa(T440, T441, T442, T462, T443, T444, T463, T464, T445, T465)) → BALANCE13_IN_AAAAAA(T466, T462, T463, T464, T467, T465)
balance1_in_ag(nil, nil) → balance1_out_ag(nil, nil)
balance1_in_ag(tree(T31, T33, T36), tree(T28, T29, T30)) → U10_ag(T31, T33, T36, T28, T29, T30, balance12_in_aaaaggagaaaaa(T31, T32, T33, X113, T28, T29, T35, T30, T34, X114, X115, X121, X116))
balance12_in_aaaaggagaaaaa(nil, .(T108, T109), T108, T109, T110, T111, T112, T113, T114, .(','(T110, -(.(T108, T109), .(T111, T112))), .(','(T113, -(T112, [])), T114)), T114, .(','(nil, -(X200, X200)), X201), X201) → balance12_out_aaaaggagaaaaa(nil, .(T108, T109), T108, T109, T110, T111, T112, T113, T114, .(','(T110, -(.(T108, T109), .(T111, T112))), .(','(T113, -(T112, [])), T114)), T114, .(','(nil, -(X200, X200)), X201), X201)
balance12_in_aaaaggagaaaaa(tree(T157, T159, T163), T158, T164, X276, tree(T148, T149, T150), T151, T161, T153, .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160)), X277, X278, X279, X280) → U7_aaaaggagaaaaa(T157, T159, T163, T158, T164, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, X279, X280, balance23_in_aaaaaaaaaa(T157, T158, T159, X272, .(','(T153, -(T161, [])), .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160))), T160, X273, X274, X279, X275))
balance23_in_aaaaaaaaaa(nil, .(T259, T260), T259, T260, T261, T262, T261, T262, .(','(nil, -(T263, T263)), T264), T264) → balance23_out_aaaaaaaaaa(nil, .(T259, T260), T259, T260, T261, T262, T261, T262, .(','(nil, -(T263, T263)), T264), T264)
balance23_in_aaaaaaaaaa(tree(T307, T309, T313), T308, T314, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436) → U1_aaaaaaaaaa(T307, T309, T313, T308, T314, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_in_aaaaaaaaaa(T307, T308, T309, X429, T310, T311, X430, X431, T312, X432))
balance23_in_aaaaaaaaaa(tree(T307, T309, T333), T308, T334, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436) → U2_aaaaaaaaaa(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_in_aaaaaaaaaa(T307, T308, T309, T329, T310, T311, T330, T331, T312, T332))
U2_aaaaaaaaaa(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_out_aaaaaaaaaa(T307, T308, T309, T329, T310, T311, T330, T331, T312, T332)) → U3_aaaaaaaaaa(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_in_aaaaaaaaaa(T333, T329, T334, X433, T330, T331, X434, X435, T332, X436))
U3_aaaaaaaaaa(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_out_aaaaaaaaaa(T333, T329, T334, X433, T330, T331, X434, X435, T332, X436)) → balance23_out_aaaaaaaaaa(tree(T307, T309, T333), T308, T334, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436)
U1_aaaaaaaaaa(T307, T309, T313, T308, T314, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_out_aaaaaaaaaa(T307, T308, T309, X429, T310, T311, X430, X431, T312, X432)) → balance23_out_aaaaaaaaaa(tree(T307, T309, T313), T308, T314, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436)
U7_aaaaggagaaaaa(T157, T159, T163, T158, T164, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, X279, X280, balance23_out_aaaaaaaaaa(T157, T158, T159, X272, .(','(T153, -(T161, [])), .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160))), T160, X273, X274, X279, X275)) → balance12_out_aaaaggagaaaaa(tree(T157, T159, T163), T158, T164, X276, tree(T148, T149, T150), T151, T161, T153, .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160)), X277, X278, X279, X280)
balance12_in_aaaaggagaaaaa(tree(T157, T159, T192), T158, T193, X276, tree(T148, T149, T150), T151, T161, T153, .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160)), X277, X278, T190, X280) → U8_aaaaggagaaaaa(T157, T159, T192, T158, T193, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, T190, X280, balance23_in_aaaaaaaaaa(T157, T158, T159, T187, .(','(T153, -(T161, [])), .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160))), T160, T188, T189, T190, T191))
U8_aaaaggagaaaaa(T157, T159, T192, T158, T193, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, T190, X280, balance23_out_aaaaaaaaaa(T157, T158, T159, T187, .(','(T153, -(T161, [])), .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160))), T160, T188, T189, T190, T191)) → U9_aaaaggagaaaaa(T157, T159, T192, T158, T193, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, T190, X280, balance23_in_aaaaaaaaaa(T192, T187, T193, X276, T188, T189, X277, X278, T191, X280))
U9_aaaaggagaaaaa(T157, T159, T192, T158, T193, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, T190, X280, balance23_out_aaaaaaaaaa(T192, T187, T193, X276, T188, T189, X277, X278, T191, X280)) → balance12_out_aaaaggagaaaaa(tree(T157, T159, T192), T158, T193, X276, tree(T148, T149, T150), T151, T161, T153, .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160)), X277, X278, T190, X280)
U10_ag(T31, T33, T36, T28, T29, T30, balance12_out_aaaaggagaaaaa(T31, T32, T33, X113, T28, T29, T35, T30, T34, X114, X115, X121, X116)) → balance1_out_ag(tree(T31, T33, T36), tree(T28, T29, T30))
balance1_in_ag(tree(T31, T33, T58), tree(T28, T29, T30)) → U11_ag(T31, T33, T58, T28, T29, T30, balance12_in_aaaaggagaaaaa(T31, T32, T33, T53, T28, T29, T35, T30, T34, T54, T55, T56, T57))
U11_ag(T31, T33, T58, T28, T29, T30, balance12_out_aaaaggagaaaaa(T31, T32, T33, T53, T28, T29, T35, T30, T34, T54, T55, T56, T57)) → U12_ag(T31, T33, T58, T28, T29, T30, balance13_in_aaaaaa(T58, T53, T54, T55, T56, T57))
balance13_in_aaaaaa(nil, [], T394, [], T394, .(','(nil, -(T396, T396)), [])) → balance13_out_aaaaaa(nil, [], T394, [], T394, .(','(nil, -(T396, T396)), []))
balance13_in_aaaaaa(tree(T440, T442, T446), T441, .(','(tree(T430, T431, T432), -(T433, T434)), T443), .(','(T430, -(T433, .(T431, T436))), .(','(T432, -(T436, T434)), T444)), T447, T445) → U4_aaaaaa(T440, T442, T446, T441, T430, T431, T432, T433, T434, T443, T436, T444, T447, T445, balance23_in_aaaaaaaaaa(T440, T441, T442, X579, T443, T444, X580, X581, T445, X582))
U4_aaaaaa(T440, T442, T446, T441, T430, T431, T432, T433, T434, T443, T436, T444, T447, T445, balance23_out_aaaaaaaaaa(T440, T441, T442, X579, T443, T444, X580, X581, T445, X582)) → balance13_out_aaaaaa(tree(T440, T442, T446), T441, .(','(tree(T430, T431, T432), -(T433, T434)), T443), .(','(T430, -(T433, .(T431, T436))), .(','(T432, -(T436, T434)), T444)), T447, T445)
balance13_in_aaaaaa(tree(T440, T442, T466), T441, .(','(tree(T430, T431, T432), -(T433, T434)), T443), .(','(T430, -(T433, .(T431, T436))), .(','(T432, -(T436, T434)), T444)), T467, T445) → U5_aaaaaa(T440, T442, T466, T441, T430, T431, T432, T433, T434, T443, T436, T444, T467, T445, balance23_in_aaaaaaaaaa(T440, T441, T442, T462, T443, T444, T463, T464, T445, T465))
U5_aaaaaa(T440, T442, T466, T441, T430, T431, T432, T433, T434, T443, T436, T444, T467, T445, balance23_out_aaaaaaaaaa(T440, T441, T442, T462, T443, T444, T463, T464, T445, T465)) → U6_aaaaaa(T440, T442, T466, T441, T430, T431, T432, T433, T434, T443, T436, T444, T467, T445, balance13_in_aaaaaa(T466, T462, T463, T464, T467, T465))
U6_aaaaaa(T440, T442, T466, T441, T430, T431, T432, T433, T434, T443, T436, T444, T467, T445, balance13_out_aaaaaa(T466, T462, T463, T464, T467, T465)) → balance13_out_aaaaaa(tree(T440, T442, T466), T441, .(','(tree(T430, T431, T432), -(T433, T434)), T443), .(','(T430, -(T433, .(T431, T436))), .(','(T432, -(T436, T434)), T444)), T467, T445)
U12_ag(T31, T33, T58, T28, T29, T30, balance13_out_aaaaaa(T58, T53, T54, T55, T56, T57)) → balance1_out_ag(tree(T31, T33, T58), tree(T28, T29, T30))
BALANCE13_IN_AAAAAA(tree(T440, T442, T466), T441, .(','(tree(T430, T431, T432), -(T433, T434)), T443), .(','(T430, -(T433, .(T431, T436))), .(','(T432, -(T436, T434)), T444)), T467, T445) → U5_AAAAAA(T440, T442, T466, T441, T430, T431, T432, T433, T434, T443, T436, T444, T467, T445, balance23_in_aaaaaaaaaa(T440, T441, T442, T462, T443, T444, T463, T464, T445, T465))
U5_AAAAAA(T440, T442, T466, T441, T430, T431, T432, T433, T434, T443, T436, T444, T467, T445, balance23_out_aaaaaaaaaa(T440, T441, T442, T462, T443, T444, T463, T464, T445, T465)) → BALANCE13_IN_AAAAAA(T466, T462, T463, T464, T467, T465)
balance23_in_aaaaaaaaaa(nil, .(T259, T260), T259, T260, T261, T262, T261, T262, .(','(nil, -(T263, T263)), T264), T264) → balance23_out_aaaaaaaaaa(nil, .(T259, T260), T259, T260, T261, T262, T261, T262, .(','(nil, -(T263, T263)), T264), T264)
balance23_in_aaaaaaaaaa(tree(T307, T309, T313), T308, T314, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436) → U1_aaaaaaaaaa(T307, T309, T313, T308, T314, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_in_aaaaaaaaaa(T307, T308, T309, X429, T310, T311, X430, X431, T312, X432))
balance23_in_aaaaaaaaaa(tree(T307, T309, T333), T308, T334, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436) → U2_aaaaaaaaaa(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_in_aaaaaaaaaa(T307, T308, T309, T329, T310, T311, T330, T331, T312, T332))
U1_aaaaaaaaaa(T307, T309, T313, T308, T314, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_out_aaaaaaaaaa(T307, T308, T309, X429, T310, T311, X430, X431, T312, X432)) → balance23_out_aaaaaaaaaa(tree(T307, T309, T313), T308, T314, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436)
U2_aaaaaaaaaa(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_out_aaaaaaaaaa(T307, T308, T309, T329, T310, T311, T330, T331, T312, T332)) → U3_aaaaaaaaaa(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_in_aaaaaaaaaa(T333, T329, T334, X433, T330, T331, X434, X435, T332, X436))
U3_aaaaaaaaaa(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_out_aaaaaaaaaa(T333, T329, T334, X433, T330, T331, X434, X435, T332, X436)) → balance23_out_aaaaaaaaaa(tree(T307, T309, T333), T308, T334, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436)
BALANCE13_IN_AAAAAA → U5_AAAAAA(balance23_in_aaaaaaaaaa)
U5_AAAAAA(balance23_out_aaaaaaaaaa) → BALANCE13_IN_AAAAAA
balance23_in_aaaaaaaaaa → balance23_out_aaaaaaaaaa
balance23_in_aaaaaaaaaa → U1_aaaaaaaaaa(balance23_in_aaaaaaaaaa)
balance23_in_aaaaaaaaaa → U2_aaaaaaaaaa(balance23_in_aaaaaaaaaa)
U1_aaaaaaaaaa(balance23_out_aaaaaaaaaa) → balance23_out_aaaaaaaaaa
U2_aaaaaaaaaa(balance23_out_aaaaaaaaaa) → U3_aaaaaaaaaa(balance23_in_aaaaaaaaaa)
U3_aaaaaaaaaa(balance23_out_aaaaaaaaaa) → balance23_out_aaaaaaaaaa
balance23_in_aaaaaaaaaa
U1_aaaaaaaaaa(x0)
U2_aaaaaaaaaa(x0)
U3_aaaaaaaaaa(x0)
BALANCE13_IN_AAAAAA → U5_AAAAAA(balance23_out_aaaaaaaaaa)
BALANCE13_IN_AAAAAA → U5_AAAAAA(U1_aaaaaaaaaa(balance23_in_aaaaaaaaaa))
BALANCE13_IN_AAAAAA → U5_AAAAAA(U2_aaaaaaaaaa(balance23_in_aaaaaaaaaa))
U5_AAAAAA(balance23_out_aaaaaaaaaa) → BALANCE13_IN_AAAAAA
BALANCE13_IN_AAAAAA → U5_AAAAAA(balance23_out_aaaaaaaaaa)
BALANCE13_IN_AAAAAA → U5_AAAAAA(U1_aaaaaaaaaa(balance23_in_aaaaaaaaaa))
BALANCE13_IN_AAAAAA → U5_AAAAAA(U2_aaaaaaaaaa(balance23_in_aaaaaaaaaa))
balance23_in_aaaaaaaaaa → balance23_out_aaaaaaaaaa
balance23_in_aaaaaaaaaa → U1_aaaaaaaaaa(balance23_in_aaaaaaaaaa)
balance23_in_aaaaaaaaaa → U2_aaaaaaaaaa(balance23_in_aaaaaaaaaa)
U1_aaaaaaaaaa(balance23_out_aaaaaaaaaa) → balance23_out_aaaaaaaaaa
U2_aaaaaaaaaa(balance23_out_aaaaaaaaaa) → U3_aaaaaaaaaa(balance23_in_aaaaaaaaaa)
U3_aaaaaaaaaa(balance23_out_aaaaaaaaaa) → balance23_out_aaaaaaaaaa
balance23_in_aaaaaaaaaa
U1_aaaaaaaaaa(x0)
U2_aaaaaaaaaa(x0)
U3_aaaaaaaaaa(x0)
balance1_in_ag(nil, nil) → balance1_out_ag(nil, nil)
balance1_in_ag(tree(T31, T33, T36), tree(T28, T29, T30)) → U10_ag(T31, T33, T36, T28, T29, T30, balance12_in_aaaaggagaaaaa(T31, T32, T33, X113, T28, T29, T35, T30, T34, X114, X115, X121, X116))
balance12_in_aaaaggagaaaaa(nil, .(T108, T109), T108, T109, T110, T111, T112, T113, T114, .(','(T110, -(.(T108, T109), .(T111, T112))), .(','(T113, -(T112, [])), T114)), T114, .(','(nil, -(X200, X200)), X201), X201) → balance12_out_aaaaggagaaaaa(nil, .(T108, T109), T108, T109, T110, T111, T112, T113, T114, .(','(T110, -(.(T108, T109), .(T111, T112))), .(','(T113, -(T112, [])), T114)), T114, .(','(nil, -(X200, X200)), X201), X201)
balance12_in_aaaaggagaaaaa(tree(T157, T159, T163), T158, T164, X276, tree(T148, T149, T150), T151, T161, T153, .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160)), X277, X278, X279, X280) → U7_aaaaggagaaaaa(T157, T159, T163, T158, T164, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, X279, X280, balance23_in_aaaaaaaaaa(T157, T158, T159, X272, .(','(T153, -(T161, [])), .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160))), T160, X273, X274, X279, X275))
balance23_in_aaaaaaaaaa(nil, .(T259, T260), T259, T260, T261, T262, T261, T262, .(','(nil, -(T263, T263)), T264), T264) → balance23_out_aaaaaaaaaa(nil, .(T259, T260), T259, T260, T261, T262, T261, T262, .(','(nil, -(T263, T263)), T264), T264)
balance23_in_aaaaaaaaaa(tree(T307, T309, T313), T308, T314, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436) → U1_aaaaaaaaaa(T307, T309, T313, T308, T314, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_in_aaaaaaaaaa(T307, T308, T309, X429, T310, T311, X430, X431, T312, X432))
balance23_in_aaaaaaaaaa(tree(T307, T309, T333), T308, T334, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436) → U2_aaaaaaaaaa(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_in_aaaaaaaaaa(T307, T308, T309, T329, T310, T311, T330, T331, T312, T332))
U2_aaaaaaaaaa(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_out_aaaaaaaaaa(T307, T308, T309, T329, T310, T311, T330, T331, T312, T332)) → U3_aaaaaaaaaa(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_in_aaaaaaaaaa(T333, T329, T334, X433, T330, T331, X434, X435, T332, X436))
U3_aaaaaaaaaa(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_out_aaaaaaaaaa(T333, T329, T334, X433, T330, T331, X434, X435, T332, X436)) → balance23_out_aaaaaaaaaa(tree(T307, T309, T333), T308, T334, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436)
U1_aaaaaaaaaa(T307, T309, T313, T308, T314, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_out_aaaaaaaaaa(T307, T308, T309, X429, T310, T311, X430, X431, T312, X432)) → balance23_out_aaaaaaaaaa(tree(T307, T309, T313), T308, T314, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436)
U7_aaaaggagaaaaa(T157, T159, T163, T158, T164, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, X279, X280, balance23_out_aaaaaaaaaa(T157, T158, T159, X272, .(','(T153, -(T161, [])), .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160))), T160, X273, X274, X279, X275)) → balance12_out_aaaaggagaaaaa(tree(T157, T159, T163), T158, T164, X276, tree(T148, T149, T150), T151, T161, T153, .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160)), X277, X278, X279, X280)
balance12_in_aaaaggagaaaaa(tree(T157, T159, T192), T158, T193, X276, tree(T148, T149, T150), T151, T161, T153, .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160)), X277, X278, T190, X280) → U8_aaaaggagaaaaa(T157, T159, T192, T158, T193, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, T190, X280, balance23_in_aaaaaaaaaa(T157, T158, T159, T187, .(','(T153, -(T161, [])), .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160))), T160, T188, T189, T190, T191))
U8_aaaaggagaaaaa(T157, T159, T192, T158, T193, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, T190, X280, balance23_out_aaaaaaaaaa(T157, T158, T159, T187, .(','(T153, -(T161, [])), .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160))), T160, T188, T189, T190, T191)) → U9_aaaaggagaaaaa(T157, T159, T192, T158, T193, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, T190, X280, balance23_in_aaaaaaaaaa(T192, T187, T193, X276, T188, T189, X277, X278, T191, X280))
U9_aaaaggagaaaaa(T157, T159, T192, T158, T193, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, T190, X280, balance23_out_aaaaaaaaaa(T192, T187, T193, X276, T188, T189, X277, X278, T191, X280)) → balance12_out_aaaaggagaaaaa(tree(T157, T159, T192), T158, T193, X276, tree(T148, T149, T150), T151, T161, T153, .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160)), X277, X278, T190, X280)
U10_ag(T31, T33, T36, T28, T29, T30, balance12_out_aaaaggagaaaaa(T31, T32, T33, X113, T28, T29, T35, T30, T34, X114, X115, X121, X116)) → balance1_out_ag(tree(T31, T33, T36), tree(T28, T29, T30))
balance1_in_ag(tree(T31, T33, T58), tree(T28, T29, T30)) → U11_ag(T31, T33, T58, T28, T29, T30, balance12_in_aaaaggagaaaaa(T31, T32, T33, T53, T28, T29, T35, T30, T34, T54, T55, T56, T57))
U11_ag(T31, T33, T58, T28, T29, T30, balance12_out_aaaaggagaaaaa(T31, T32, T33, T53, T28, T29, T35, T30, T34, T54, T55, T56, T57)) → U12_ag(T31, T33, T58, T28, T29, T30, balance13_in_aaaaaa(T58, T53, T54, T55, T56, T57))
balance13_in_aaaaaa(nil, [], T394, [], T394, .(','(nil, -(T396, T396)), [])) → balance13_out_aaaaaa(nil, [], T394, [], T394, .(','(nil, -(T396, T396)), []))
balance13_in_aaaaaa(tree(T440, T442, T446), T441, .(','(tree(T430, T431, T432), -(T433, T434)), T443), .(','(T430, -(T433, .(T431, T436))), .(','(T432, -(T436, T434)), T444)), T447, T445) → U4_aaaaaa(T440, T442, T446, T441, T430, T431, T432, T433, T434, T443, T436, T444, T447, T445, balance23_in_aaaaaaaaaa(T440, T441, T442, X579, T443, T444, X580, X581, T445, X582))
U4_aaaaaa(T440, T442, T446, T441, T430, T431, T432, T433, T434, T443, T436, T444, T447, T445, balance23_out_aaaaaaaaaa(T440, T441, T442, X579, T443, T444, X580, X581, T445, X582)) → balance13_out_aaaaaa(tree(T440, T442, T446), T441, .(','(tree(T430, T431, T432), -(T433, T434)), T443), .(','(T430, -(T433, .(T431, T436))), .(','(T432, -(T436, T434)), T444)), T447, T445)
balance13_in_aaaaaa(tree(T440, T442, T466), T441, .(','(tree(T430, T431, T432), -(T433, T434)), T443), .(','(T430, -(T433, .(T431, T436))), .(','(T432, -(T436, T434)), T444)), T467, T445) → U5_aaaaaa(T440, T442, T466, T441, T430, T431, T432, T433, T434, T443, T436, T444, T467, T445, balance23_in_aaaaaaaaaa(T440, T441, T442, T462, T443, T444, T463, T464, T445, T465))
U5_aaaaaa(T440, T442, T466, T441, T430, T431, T432, T433, T434, T443, T436, T444, T467, T445, balance23_out_aaaaaaaaaa(T440, T441, T442, T462, T443, T444, T463, T464, T445, T465)) → U6_aaaaaa(T440, T442, T466, T441, T430, T431, T432, T433, T434, T443, T436, T444, T467, T445, balance13_in_aaaaaa(T466, T462, T463, T464, T467, T465))
U6_aaaaaa(T440, T442, T466, T441, T430, T431, T432, T433, T434, T443, T436, T444, T467, T445, balance13_out_aaaaaa(T466, T462, T463, T464, T467, T465)) → balance13_out_aaaaaa(tree(T440, T442, T466), T441, .(','(tree(T430, T431, T432), -(T433, T434)), T443), .(','(T430, -(T433, .(T431, T436))), .(','(T432, -(T436, T434)), T444)), T467, T445)
U12_ag(T31, T33, T58, T28, T29, T30, balance13_out_aaaaaa(T58, T53, T54, T55, T56, T57)) → balance1_out_ag(tree(T31, T33, T58), tree(T28, T29, T30))
Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog
balance1_in_ag(nil, nil) → balance1_out_ag(nil, nil)
balance1_in_ag(tree(T31, T33, T36), tree(T28, T29, T30)) → U10_ag(T31, T33, T36, T28, T29, T30, balance12_in_aaaaggagaaaaa(T31, T32, T33, X113, T28, T29, T35, T30, T34, X114, X115, X121, X116))
balance12_in_aaaaggagaaaaa(nil, .(T108, T109), T108, T109, T110, T111, T112, T113, T114, .(','(T110, -(.(T108, T109), .(T111, T112))), .(','(T113, -(T112, [])), T114)), T114, .(','(nil, -(X200, X200)), X201), X201) → balance12_out_aaaaggagaaaaa(nil, .(T108, T109), T108, T109, T110, T111, T112, T113, T114, .(','(T110, -(.(T108, T109), .(T111, T112))), .(','(T113, -(T112, [])), T114)), T114, .(','(nil, -(X200, X200)), X201), X201)
balance12_in_aaaaggagaaaaa(tree(T157, T159, T163), T158, T164, X276, tree(T148, T149, T150), T151, T161, T153, .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160)), X277, X278, X279, X280) → U7_aaaaggagaaaaa(T157, T159, T163, T158, T164, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, X279, X280, balance23_in_aaaaaaaaaa(T157, T158, T159, X272, .(','(T153, -(T161, [])), .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160))), T160, X273, X274, X279, X275))
balance23_in_aaaaaaaaaa(nil, .(T259, T260), T259, T260, T261, T262, T261, T262, .(','(nil, -(T263, T263)), T264), T264) → balance23_out_aaaaaaaaaa(nil, .(T259, T260), T259, T260, T261, T262, T261, T262, .(','(nil, -(T263, T263)), T264), T264)
balance23_in_aaaaaaaaaa(tree(T307, T309, T313), T308, T314, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436) → U1_aaaaaaaaaa(T307, T309, T313, T308, T314, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_in_aaaaaaaaaa(T307, T308, T309, X429, T310, T311, X430, X431, T312, X432))
balance23_in_aaaaaaaaaa(tree(T307, T309, T333), T308, T334, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436) → U2_aaaaaaaaaa(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_in_aaaaaaaaaa(T307, T308, T309, T329, T310, T311, T330, T331, T312, T332))
U2_aaaaaaaaaa(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_out_aaaaaaaaaa(T307, T308, T309, T329, T310, T311, T330, T331, T312, T332)) → U3_aaaaaaaaaa(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_in_aaaaaaaaaa(T333, T329, T334, X433, T330, T331, X434, X435, T332, X436))
U3_aaaaaaaaaa(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_out_aaaaaaaaaa(T333, T329, T334, X433, T330, T331, X434, X435, T332, X436)) → balance23_out_aaaaaaaaaa(tree(T307, T309, T333), T308, T334, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436)
U1_aaaaaaaaaa(T307, T309, T313, T308, T314, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_out_aaaaaaaaaa(T307, T308, T309, X429, T310, T311, X430, X431, T312, X432)) → balance23_out_aaaaaaaaaa(tree(T307, T309, T313), T308, T314, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436)
U7_aaaaggagaaaaa(T157, T159, T163, T158, T164, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, X279, X280, balance23_out_aaaaaaaaaa(T157, T158, T159, X272, .(','(T153, -(T161, [])), .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160))), T160, X273, X274, X279, X275)) → balance12_out_aaaaggagaaaaa(tree(T157, T159, T163), T158, T164, X276, tree(T148, T149, T150), T151, T161, T153, .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160)), X277, X278, X279, X280)
balance12_in_aaaaggagaaaaa(tree(T157, T159, T192), T158, T193, X276, tree(T148, T149, T150), T151, T161, T153, .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160)), X277, X278, T190, X280) → U8_aaaaggagaaaaa(T157, T159, T192, T158, T193, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, T190, X280, balance23_in_aaaaaaaaaa(T157, T158, T159, T187, .(','(T153, -(T161, [])), .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160))), T160, T188, T189, T190, T191))
U8_aaaaggagaaaaa(T157, T159, T192, T158, T193, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, T190, X280, balance23_out_aaaaaaaaaa(T157, T158, T159, T187, .(','(T153, -(T161, [])), .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160))), T160, T188, T189, T190, T191)) → U9_aaaaggagaaaaa(T157, T159, T192, T158, T193, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, T190, X280, balance23_in_aaaaaaaaaa(T192, T187, T193, X276, T188, T189, X277, X278, T191, X280))
U9_aaaaggagaaaaa(T157, T159, T192, T158, T193, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, T190, X280, balance23_out_aaaaaaaaaa(T192, T187, T193, X276, T188, T189, X277, X278, T191, X280)) → balance12_out_aaaaggagaaaaa(tree(T157, T159, T192), T158, T193, X276, tree(T148, T149, T150), T151, T161, T153, .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160)), X277, X278, T190, X280)
U10_ag(T31, T33, T36, T28, T29, T30, balance12_out_aaaaggagaaaaa(T31, T32, T33, X113, T28, T29, T35, T30, T34, X114, X115, X121, X116)) → balance1_out_ag(tree(T31, T33, T36), tree(T28, T29, T30))
balance1_in_ag(tree(T31, T33, T58), tree(T28, T29, T30)) → U11_ag(T31, T33, T58, T28, T29, T30, balance12_in_aaaaggagaaaaa(T31, T32, T33, T53, T28, T29, T35, T30, T34, T54, T55, T56, T57))
U11_ag(T31, T33, T58, T28, T29, T30, balance12_out_aaaaggagaaaaa(T31, T32, T33, T53, T28, T29, T35, T30, T34, T54, T55, T56, T57)) → U12_ag(T31, T33, T58, T28, T29, T30, balance13_in_aaaaaa(T58, T53, T54, T55, T56, T57))
balance13_in_aaaaaa(nil, [], T394, [], T394, .(','(nil, -(T396, T396)), [])) → balance13_out_aaaaaa(nil, [], T394, [], T394, .(','(nil, -(T396, T396)), []))
balance13_in_aaaaaa(tree(T440, T442, T446), T441, .(','(tree(T430, T431, T432), -(T433, T434)), T443), .(','(T430, -(T433, .(T431, T436))), .(','(T432, -(T436, T434)), T444)), T447, T445) → U4_aaaaaa(T440, T442, T446, T441, T430, T431, T432, T433, T434, T443, T436, T444, T447, T445, balance23_in_aaaaaaaaaa(T440, T441, T442, X579, T443, T444, X580, X581, T445, X582))
U4_aaaaaa(T440, T442, T446, T441, T430, T431, T432, T433, T434, T443, T436, T444, T447, T445, balance23_out_aaaaaaaaaa(T440, T441, T442, X579, T443, T444, X580, X581, T445, X582)) → balance13_out_aaaaaa(tree(T440, T442, T446), T441, .(','(tree(T430, T431, T432), -(T433, T434)), T443), .(','(T430, -(T433, .(T431, T436))), .(','(T432, -(T436, T434)), T444)), T447, T445)
balance13_in_aaaaaa(tree(T440, T442, T466), T441, .(','(tree(T430, T431, T432), -(T433, T434)), T443), .(','(T430, -(T433, .(T431, T436))), .(','(T432, -(T436, T434)), T444)), T467, T445) → U5_aaaaaa(T440, T442, T466, T441, T430, T431, T432, T433, T434, T443, T436, T444, T467, T445, balance23_in_aaaaaaaaaa(T440, T441, T442, T462, T443, T444, T463, T464, T445, T465))
U5_aaaaaa(T440, T442, T466, T441, T430, T431, T432, T433, T434, T443, T436, T444, T467, T445, balance23_out_aaaaaaaaaa(T440, T441, T442, T462, T443, T444, T463, T464, T445, T465)) → U6_aaaaaa(T440, T442, T466, T441, T430, T431, T432, T433, T434, T443, T436, T444, T467, T445, balance13_in_aaaaaa(T466, T462, T463, T464, T467, T465))
U6_aaaaaa(T440, T442, T466, T441, T430, T431, T432, T433, T434, T443, T436, T444, T467, T445, balance13_out_aaaaaa(T466, T462, T463, T464, T467, T465)) → balance13_out_aaaaaa(tree(T440, T442, T466), T441, .(','(tree(T430, T431, T432), -(T433, T434)), T443), .(','(T430, -(T433, .(T431, T436))), .(','(T432, -(T436, T434)), T444)), T467, T445)
U12_ag(T31, T33, T58, T28, T29, T30, balance13_out_aaaaaa(T58, T53, T54, T55, T56, T57)) → balance1_out_ag(tree(T31, T33, T58), tree(T28, T29, T30))
BALANCE1_IN_AG(tree(T31, T33, T36), tree(T28, T29, T30)) → U10_AG(T31, T33, T36, T28, T29, T30, balance12_in_aaaaggagaaaaa(T31, T32, T33, X113, T28, T29, T35, T30, T34, X114, X115, X121, X116))
BALANCE1_IN_AG(tree(T31, T33, T36), tree(T28, T29, T30)) → BALANCE12_IN_AAAAGGAGAAAAA(T31, T32, T33, X113, T28, T29, T35, T30, T34, X114, X115, X121, X116)
BALANCE12_IN_AAAAGGAGAAAAA(tree(T157, T159, T163), T158, T164, X276, tree(T148, T149, T150), T151, T161, T153, .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160)), X277, X278, X279, X280) → U7_AAAAGGAGAAAAA(T157, T159, T163, T158, T164, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, X279, X280, balance23_in_aaaaaaaaaa(T157, T158, T159, X272, .(','(T153, -(T161, [])), .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160))), T160, X273, X274, X279, X275))
BALANCE12_IN_AAAAGGAGAAAAA(tree(T157, T159, T163), T158, T164, X276, tree(T148, T149, T150), T151, T161, T153, .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160)), X277, X278, X279, X280) → BALANCE23_IN_AAAAAAAAAA(T157, T158, T159, X272, .(','(T153, -(T161, [])), .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160))), T160, X273, X274, X279, X275)
BALANCE23_IN_AAAAAAAAAA(tree(T307, T309, T313), T308, T314, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436) → U1_AAAAAAAAAA(T307, T309, T313, T308, T314, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_in_aaaaaaaaaa(T307, T308, T309, X429, T310, T311, X430, X431, T312, X432))
BALANCE23_IN_AAAAAAAAAA(tree(T307, T309, T313), T308, T314, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436) → BALANCE23_IN_AAAAAAAAAA(T307, T308, T309, X429, T310, T311, X430, X431, T312, X432)
BALANCE23_IN_AAAAAAAAAA(tree(T307, T309, T333), T308, T334, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436) → U2_AAAAAAAAAA(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_in_aaaaaaaaaa(T307, T308, T309, T329, T310, T311, T330, T331, T312, T332))
U2_AAAAAAAAAA(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_out_aaaaaaaaaa(T307, T308, T309, T329, T310, T311, T330, T331, T312, T332)) → U3_AAAAAAAAAA(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_in_aaaaaaaaaa(T333, T329, T334, X433, T330, T331, X434, X435, T332, X436))
U2_AAAAAAAAAA(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_out_aaaaaaaaaa(T307, T308, T309, T329, T310, T311, T330, T331, T312, T332)) → BALANCE23_IN_AAAAAAAAAA(T333, T329, T334, X433, T330, T331, X434, X435, T332, X436)
BALANCE12_IN_AAAAGGAGAAAAA(tree(T157, T159, T192), T158, T193, X276, tree(T148, T149, T150), T151, T161, T153, .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160)), X277, X278, T190, X280) → U8_AAAAGGAGAAAAA(T157, T159, T192, T158, T193, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, T190, X280, balance23_in_aaaaaaaaaa(T157, T158, T159, T187, .(','(T153, -(T161, [])), .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160))), T160, T188, T189, T190, T191))
U8_AAAAGGAGAAAAA(T157, T159, T192, T158, T193, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, T190, X280, balance23_out_aaaaaaaaaa(T157, T158, T159, T187, .(','(T153, -(T161, [])), .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160))), T160, T188, T189, T190, T191)) → U9_AAAAGGAGAAAAA(T157, T159, T192, T158, T193, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, T190, X280, balance23_in_aaaaaaaaaa(T192, T187, T193, X276, T188, T189, X277, X278, T191, X280))
U8_AAAAGGAGAAAAA(T157, T159, T192, T158, T193, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, T190, X280, balance23_out_aaaaaaaaaa(T157, T158, T159, T187, .(','(T153, -(T161, [])), .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160))), T160, T188, T189, T190, T191)) → BALANCE23_IN_AAAAAAAAAA(T192, T187, T193, X276, T188, T189, X277, X278, T191, X280)
BALANCE1_IN_AG(tree(T31, T33, T58), tree(T28, T29, T30)) → U11_AG(T31, T33, T58, T28, T29, T30, balance12_in_aaaaggagaaaaa(T31, T32, T33, T53, T28, T29, T35, T30, T34, T54, T55, T56, T57))
U11_AG(T31, T33, T58, T28, T29, T30, balance12_out_aaaaggagaaaaa(T31, T32, T33, T53, T28, T29, T35, T30, T34, T54, T55, T56, T57)) → U12_AG(T31, T33, T58, T28, T29, T30, balance13_in_aaaaaa(T58, T53, T54, T55, T56, T57))
U11_AG(T31, T33, T58, T28, T29, T30, balance12_out_aaaaggagaaaaa(T31, T32, T33, T53, T28, T29, T35, T30, T34, T54, T55, T56, T57)) → BALANCE13_IN_AAAAAA(T58, T53, T54, T55, T56, T57)
BALANCE13_IN_AAAAAA(tree(T440, T442, T446), T441, .(','(tree(T430, T431, T432), -(T433, T434)), T443), .(','(T430, -(T433, .(T431, T436))), .(','(T432, -(T436, T434)), T444)), T447, T445) → U4_AAAAAA(T440, T442, T446, T441, T430, T431, T432, T433, T434, T443, T436, T444, T447, T445, balance23_in_aaaaaaaaaa(T440, T441, T442, X579, T443, T444, X580, X581, T445, X582))
BALANCE13_IN_AAAAAA(tree(T440, T442, T446), T441, .(','(tree(T430, T431, T432), -(T433, T434)), T443), .(','(T430, -(T433, .(T431, T436))), .(','(T432, -(T436, T434)), T444)), T447, T445) → BALANCE23_IN_AAAAAAAAAA(T440, T441, T442, X579, T443, T444, X580, X581, T445, X582)
BALANCE13_IN_AAAAAA(tree(T440, T442, T466), T441, .(','(tree(T430, T431, T432), -(T433, T434)), T443), .(','(T430, -(T433, .(T431, T436))), .(','(T432, -(T436, T434)), T444)), T467, T445) → U5_AAAAAA(T440, T442, T466, T441, T430, T431, T432, T433, T434, T443, T436, T444, T467, T445, balance23_in_aaaaaaaaaa(T440, T441, T442, T462, T443, T444, T463, T464, T445, T465))
U5_AAAAAA(T440, T442, T466, T441, T430, T431, T432, T433, T434, T443, T436, T444, T467, T445, balance23_out_aaaaaaaaaa(T440, T441, T442, T462, T443, T444, T463, T464, T445, T465)) → U6_AAAAAA(T440, T442, T466, T441, T430, T431, T432, T433, T434, T443, T436, T444, T467, T445, balance13_in_aaaaaa(T466, T462, T463, T464, T467, T465))
U5_AAAAAA(T440, T442, T466, T441, T430, T431, T432, T433, T434, T443, T436, T444, T467, T445, balance23_out_aaaaaaaaaa(T440, T441, T442, T462, T443, T444, T463, T464, T445, T465)) → BALANCE13_IN_AAAAAA(T466, T462, T463, T464, T467, T465)
balance1_in_ag(nil, nil) → balance1_out_ag(nil, nil)
balance1_in_ag(tree(T31, T33, T36), tree(T28, T29, T30)) → U10_ag(T31, T33, T36, T28, T29, T30, balance12_in_aaaaggagaaaaa(T31, T32, T33, X113, T28, T29, T35, T30, T34, X114, X115, X121, X116))
balance12_in_aaaaggagaaaaa(nil, .(T108, T109), T108, T109, T110, T111, T112, T113, T114, .(','(T110, -(.(T108, T109), .(T111, T112))), .(','(T113, -(T112, [])), T114)), T114, .(','(nil, -(X200, X200)), X201), X201) → balance12_out_aaaaggagaaaaa(nil, .(T108, T109), T108, T109, T110, T111, T112, T113, T114, .(','(T110, -(.(T108, T109), .(T111, T112))), .(','(T113, -(T112, [])), T114)), T114, .(','(nil, -(X200, X200)), X201), X201)
balance12_in_aaaaggagaaaaa(tree(T157, T159, T163), T158, T164, X276, tree(T148, T149, T150), T151, T161, T153, .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160)), X277, X278, X279, X280) → U7_aaaaggagaaaaa(T157, T159, T163, T158, T164, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, X279, X280, balance23_in_aaaaaaaaaa(T157, T158, T159, X272, .(','(T153, -(T161, [])), .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160))), T160, X273, X274, X279, X275))
balance23_in_aaaaaaaaaa(nil, .(T259, T260), T259, T260, T261, T262, T261, T262, .(','(nil, -(T263, T263)), T264), T264) → balance23_out_aaaaaaaaaa(nil, .(T259, T260), T259, T260, T261, T262, T261, T262, .(','(nil, -(T263, T263)), T264), T264)
balance23_in_aaaaaaaaaa(tree(T307, T309, T313), T308, T314, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436) → U1_aaaaaaaaaa(T307, T309, T313, T308, T314, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_in_aaaaaaaaaa(T307, T308, T309, X429, T310, T311, X430, X431, T312, X432))
balance23_in_aaaaaaaaaa(tree(T307, T309, T333), T308, T334, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436) → U2_aaaaaaaaaa(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_in_aaaaaaaaaa(T307, T308, T309, T329, T310, T311, T330, T331, T312, T332))
U2_aaaaaaaaaa(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_out_aaaaaaaaaa(T307, T308, T309, T329, T310, T311, T330, T331, T312, T332)) → U3_aaaaaaaaaa(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_in_aaaaaaaaaa(T333, T329, T334, X433, T330, T331, X434, X435, T332, X436))
U3_aaaaaaaaaa(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_out_aaaaaaaaaa(T333, T329, T334, X433, T330, T331, X434, X435, T332, X436)) → balance23_out_aaaaaaaaaa(tree(T307, T309, T333), T308, T334, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436)
U1_aaaaaaaaaa(T307, T309, T313, T308, T314, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_out_aaaaaaaaaa(T307, T308, T309, X429, T310, T311, X430, X431, T312, X432)) → balance23_out_aaaaaaaaaa(tree(T307, T309, T313), T308, T314, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436)
U7_aaaaggagaaaaa(T157, T159, T163, T158, T164, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, X279, X280, balance23_out_aaaaaaaaaa(T157, T158, T159, X272, .(','(T153, -(T161, [])), .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160))), T160, X273, X274, X279, X275)) → balance12_out_aaaaggagaaaaa(tree(T157, T159, T163), T158, T164, X276, tree(T148, T149, T150), T151, T161, T153, .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160)), X277, X278, X279, X280)
balance12_in_aaaaggagaaaaa(tree(T157, T159, T192), T158, T193, X276, tree(T148, T149, T150), T151, T161, T153, .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160)), X277, X278, T190, X280) → U8_aaaaggagaaaaa(T157, T159, T192, T158, T193, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, T190, X280, balance23_in_aaaaaaaaaa(T157, T158, T159, T187, .(','(T153, -(T161, [])), .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160))), T160, T188, T189, T190, T191))
U8_aaaaggagaaaaa(T157, T159, T192, T158, T193, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, T190, X280, balance23_out_aaaaaaaaaa(T157, T158, T159, T187, .(','(T153, -(T161, [])), .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160))), T160, T188, T189, T190, T191)) → U9_aaaaggagaaaaa(T157, T159, T192, T158, T193, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, T190, X280, balance23_in_aaaaaaaaaa(T192, T187, T193, X276, T188, T189, X277, X278, T191, X280))
U9_aaaaggagaaaaa(T157, T159, T192, T158, T193, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, T190, X280, balance23_out_aaaaaaaaaa(T192, T187, T193, X276, T188, T189, X277, X278, T191, X280)) → balance12_out_aaaaggagaaaaa(tree(T157, T159, T192), T158, T193, X276, tree(T148, T149, T150), T151, T161, T153, .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160)), X277, X278, T190, X280)
U10_ag(T31, T33, T36, T28, T29, T30, balance12_out_aaaaggagaaaaa(T31, T32, T33, X113, T28, T29, T35, T30, T34, X114, X115, X121, X116)) → balance1_out_ag(tree(T31, T33, T36), tree(T28, T29, T30))
balance1_in_ag(tree(T31, T33, T58), tree(T28, T29, T30)) → U11_ag(T31, T33, T58, T28, T29, T30, balance12_in_aaaaggagaaaaa(T31, T32, T33, T53, T28, T29, T35, T30, T34, T54, T55, T56, T57))
U11_ag(T31, T33, T58, T28, T29, T30, balance12_out_aaaaggagaaaaa(T31, T32, T33, T53, T28, T29, T35, T30, T34, T54, T55, T56, T57)) → U12_ag(T31, T33, T58, T28, T29, T30, balance13_in_aaaaaa(T58, T53, T54, T55, T56, T57))
balance13_in_aaaaaa(nil, [], T394, [], T394, .(','(nil, -(T396, T396)), [])) → balance13_out_aaaaaa(nil, [], T394, [], T394, .(','(nil, -(T396, T396)), []))
balance13_in_aaaaaa(tree(T440, T442, T446), T441, .(','(tree(T430, T431, T432), -(T433, T434)), T443), .(','(T430, -(T433, .(T431, T436))), .(','(T432, -(T436, T434)), T444)), T447, T445) → U4_aaaaaa(T440, T442, T446, T441, T430, T431, T432, T433, T434, T443, T436, T444, T447, T445, balance23_in_aaaaaaaaaa(T440, T441, T442, X579, T443, T444, X580, X581, T445, X582))
U4_aaaaaa(T440, T442, T446, T441, T430, T431, T432, T433, T434, T443, T436, T444, T447, T445, balance23_out_aaaaaaaaaa(T440, T441, T442, X579, T443, T444, X580, X581, T445, X582)) → balance13_out_aaaaaa(tree(T440, T442, T446), T441, .(','(tree(T430, T431, T432), -(T433, T434)), T443), .(','(T430, -(T433, .(T431, T436))), .(','(T432, -(T436, T434)), T444)), T447, T445)
balance13_in_aaaaaa(tree(T440, T442, T466), T441, .(','(tree(T430, T431, T432), -(T433, T434)), T443), .(','(T430, -(T433, .(T431, T436))), .(','(T432, -(T436, T434)), T444)), T467, T445) → U5_aaaaaa(T440, T442, T466, T441, T430, T431, T432, T433, T434, T443, T436, T444, T467, T445, balance23_in_aaaaaaaaaa(T440, T441, T442, T462, T443, T444, T463, T464, T445, T465))
U5_aaaaaa(T440, T442, T466, T441, T430, T431, T432, T433, T434, T443, T436, T444, T467, T445, balance23_out_aaaaaaaaaa(T440, T441, T442, T462, T443, T444, T463, T464, T445, T465)) → U6_aaaaaa(T440, T442, T466, T441, T430, T431, T432, T433, T434, T443, T436, T444, T467, T445, balance13_in_aaaaaa(T466, T462, T463, T464, T467, T465))
U6_aaaaaa(T440, T442, T466, T441, T430, T431, T432, T433, T434, T443, T436, T444, T467, T445, balance13_out_aaaaaa(T466, T462, T463, T464, T467, T465)) → balance13_out_aaaaaa(tree(T440, T442, T466), T441, .(','(tree(T430, T431, T432), -(T433, T434)), T443), .(','(T430, -(T433, .(T431, T436))), .(','(T432, -(T436, T434)), T444)), T467, T445)
U12_ag(T31, T33, T58, T28, T29, T30, balance13_out_aaaaaa(T58, T53, T54, T55, T56, T57)) → balance1_out_ag(tree(T31, T33, T58), tree(T28, T29, T30))
BALANCE1_IN_AG(tree(T31, T33, T36), tree(T28, T29, T30)) → U10_AG(T31, T33, T36, T28, T29, T30, balance12_in_aaaaggagaaaaa(T31, T32, T33, X113, T28, T29, T35, T30, T34, X114, X115, X121, X116))
BALANCE1_IN_AG(tree(T31, T33, T36), tree(T28, T29, T30)) → BALANCE12_IN_AAAAGGAGAAAAA(T31, T32, T33, X113, T28, T29, T35, T30, T34, X114, X115, X121, X116)
BALANCE12_IN_AAAAGGAGAAAAA(tree(T157, T159, T163), T158, T164, X276, tree(T148, T149, T150), T151, T161, T153, .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160)), X277, X278, X279, X280) → U7_AAAAGGAGAAAAA(T157, T159, T163, T158, T164, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, X279, X280, balance23_in_aaaaaaaaaa(T157, T158, T159, X272, .(','(T153, -(T161, [])), .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160))), T160, X273, X274, X279, X275))
BALANCE12_IN_AAAAGGAGAAAAA(tree(T157, T159, T163), T158, T164, X276, tree(T148, T149, T150), T151, T161, T153, .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160)), X277, X278, X279, X280) → BALANCE23_IN_AAAAAAAAAA(T157, T158, T159, X272, .(','(T153, -(T161, [])), .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160))), T160, X273, X274, X279, X275)
BALANCE23_IN_AAAAAAAAAA(tree(T307, T309, T313), T308, T314, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436) → U1_AAAAAAAAAA(T307, T309, T313, T308, T314, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_in_aaaaaaaaaa(T307, T308, T309, X429, T310, T311, X430, X431, T312, X432))
BALANCE23_IN_AAAAAAAAAA(tree(T307, T309, T313), T308, T314, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436) → BALANCE23_IN_AAAAAAAAAA(T307, T308, T309, X429, T310, T311, X430, X431, T312, X432)
BALANCE23_IN_AAAAAAAAAA(tree(T307, T309, T333), T308, T334, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436) → U2_AAAAAAAAAA(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_in_aaaaaaaaaa(T307, T308, T309, T329, T310, T311, T330, T331, T312, T332))
U2_AAAAAAAAAA(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_out_aaaaaaaaaa(T307, T308, T309, T329, T310, T311, T330, T331, T312, T332)) → U3_AAAAAAAAAA(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_in_aaaaaaaaaa(T333, T329, T334, X433, T330, T331, X434, X435, T332, X436))
U2_AAAAAAAAAA(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_out_aaaaaaaaaa(T307, T308, T309, T329, T310, T311, T330, T331, T312, T332)) → BALANCE23_IN_AAAAAAAAAA(T333, T329, T334, X433, T330, T331, X434, X435, T332, X436)
BALANCE12_IN_AAAAGGAGAAAAA(tree(T157, T159, T192), T158, T193, X276, tree(T148, T149, T150), T151, T161, T153, .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160)), X277, X278, T190, X280) → U8_AAAAGGAGAAAAA(T157, T159, T192, T158, T193, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, T190, X280, balance23_in_aaaaaaaaaa(T157, T158, T159, T187, .(','(T153, -(T161, [])), .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160))), T160, T188, T189, T190, T191))
U8_AAAAGGAGAAAAA(T157, T159, T192, T158, T193, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, T190, X280, balance23_out_aaaaaaaaaa(T157, T158, T159, T187, .(','(T153, -(T161, [])), .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160))), T160, T188, T189, T190, T191)) → U9_AAAAGGAGAAAAA(T157, T159, T192, T158, T193, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, T190, X280, balance23_in_aaaaaaaaaa(T192, T187, T193, X276, T188, T189, X277, X278, T191, X280))
U8_AAAAGGAGAAAAA(T157, T159, T192, T158, T193, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, T190, X280, balance23_out_aaaaaaaaaa(T157, T158, T159, T187, .(','(T153, -(T161, [])), .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160))), T160, T188, T189, T190, T191)) → BALANCE23_IN_AAAAAAAAAA(T192, T187, T193, X276, T188, T189, X277, X278, T191, X280)
BALANCE1_IN_AG(tree(T31, T33, T58), tree(T28, T29, T30)) → U11_AG(T31, T33, T58, T28, T29, T30, balance12_in_aaaaggagaaaaa(T31, T32, T33, T53, T28, T29, T35, T30, T34, T54, T55, T56, T57))
U11_AG(T31, T33, T58, T28, T29, T30, balance12_out_aaaaggagaaaaa(T31, T32, T33, T53, T28, T29, T35, T30, T34, T54, T55, T56, T57)) → U12_AG(T31, T33, T58, T28, T29, T30, balance13_in_aaaaaa(T58, T53, T54, T55, T56, T57))
U11_AG(T31, T33, T58, T28, T29, T30, balance12_out_aaaaggagaaaaa(T31, T32, T33, T53, T28, T29, T35, T30, T34, T54, T55, T56, T57)) → BALANCE13_IN_AAAAAA(T58, T53, T54, T55, T56, T57)
BALANCE13_IN_AAAAAA(tree(T440, T442, T446), T441, .(','(tree(T430, T431, T432), -(T433, T434)), T443), .(','(T430, -(T433, .(T431, T436))), .(','(T432, -(T436, T434)), T444)), T447, T445) → U4_AAAAAA(T440, T442, T446, T441, T430, T431, T432, T433, T434, T443, T436, T444, T447, T445, balance23_in_aaaaaaaaaa(T440, T441, T442, X579, T443, T444, X580, X581, T445, X582))
BALANCE13_IN_AAAAAA(tree(T440, T442, T446), T441, .(','(tree(T430, T431, T432), -(T433, T434)), T443), .(','(T430, -(T433, .(T431, T436))), .(','(T432, -(T436, T434)), T444)), T447, T445) → BALANCE23_IN_AAAAAAAAAA(T440, T441, T442, X579, T443, T444, X580, X581, T445, X582)
BALANCE13_IN_AAAAAA(tree(T440, T442, T466), T441, .(','(tree(T430, T431, T432), -(T433, T434)), T443), .(','(T430, -(T433, .(T431, T436))), .(','(T432, -(T436, T434)), T444)), T467, T445) → U5_AAAAAA(T440, T442, T466, T441, T430, T431, T432, T433, T434, T443, T436, T444, T467, T445, balance23_in_aaaaaaaaaa(T440, T441, T442, T462, T443, T444, T463, T464, T445, T465))
U5_AAAAAA(T440, T442, T466, T441, T430, T431, T432, T433, T434, T443, T436, T444, T467, T445, balance23_out_aaaaaaaaaa(T440, T441, T442, T462, T443, T444, T463, T464, T445, T465)) → U6_AAAAAA(T440, T442, T466, T441, T430, T431, T432, T433, T434, T443, T436, T444, T467, T445, balance13_in_aaaaaa(T466, T462, T463, T464, T467, T465))
U5_AAAAAA(T440, T442, T466, T441, T430, T431, T432, T433, T434, T443, T436, T444, T467, T445, balance23_out_aaaaaaaaaa(T440, T441, T442, T462, T443, T444, T463, T464, T445, T465)) → BALANCE13_IN_AAAAAA(T466, T462, T463, T464, T467, T465)
balance1_in_ag(nil, nil) → balance1_out_ag(nil, nil)
balance1_in_ag(tree(T31, T33, T36), tree(T28, T29, T30)) → U10_ag(T31, T33, T36, T28, T29, T30, balance12_in_aaaaggagaaaaa(T31, T32, T33, X113, T28, T29, T35, T30, T34, X114, X115, X121, X116))
balance12_in_aaaaggagaaaaa(nil, .(T108, T109), T108, T109, T110, T111, T112, T113, T114, .(','(T110, -(.(T108, T109), .(T111, T112))), .(','(T113, -(T112, [])), T114)), T114, .(','(nil, -(X200, X200)), X201), X201) → balance12_out_aaaaggagaaaaa(nil, .(T108, T109), T108, T109, T110, T111, T112, T113, T114, .(','(T110, -(.(T108, T109), .(T111, T112))), .(','(T113, -(T112, [])), T114)), T114, .(','(nil, -(X200, X200)), X201), X201)
balance12_in_aaaaggagaaaaa(tree(T157, T159, T163), T158, T164, X276, tree(T148, T149, T150), T151, T161, T153, .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160)), X277, X278, X279, X280) → U7_aaaaggagaaaaa(T157, T159, T163, T158, T164, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, X279, X280, balance23_in_aaaaaaaaaa(T157, T158, T159, X272, .(','(T153, -(T161, [])), .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160))), T160, X273, X274, X279, X275))
balance23_in_aaaaaaaaaa(nil, .(T259, T260), T259, T260, T261, T262, T261, T262, .(','(nil, -(T263, T263)), T264), T264) → balance23_out_aaaaaaaaaa(nil, .(T259, T260), T259, T260, T261, T262, T261, T262, .(','(nil, -(T263, T263)), T264), T264)
balance23_in_aaaaaaaaaa(tree(T307, T309, T313), T308, T314, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436) → U1_aaaaaaaaaa(T307, T309, T313, T308, T314, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_in_aaaaaaaaaa(T307, T308, T309, X429, T310, T311, X430, X431, T312, X432))
balance23_in_aaaaaaaaaa(tree(T307, T309, T333), T308, T334, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436) → U2_aaaaaaaaaa(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_in_aaaaaaaaaa(T307, T308, T309, T329, T310, T311, T330, T331, T312, T332))
U2_aaaaaaaaaa(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_out_aaaaaaaaaa(T307, T308, T309, T329, T310, T311, T330, T331, T312, T332)) → U3_aaaaaaaaaa(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_in_aaaaaaaaaa(T333, T329, T334, X433, T330, T331, X434, X435, T332, X436))
U3_aaaaaaaaaa(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_out_aaaaaaaaaa(T333, T329, T334, X433, T330, T331, X434, X435, T332, X436)) → balance23_out_aaaaaaaaaa(tree(T307, T309, T333), T308, T334, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436)
U1_aaaaaaaaaa(T307, T309, T313, T308, T314, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_out_aaaaaaaaaa(T307, T308, T309, X429, T310, T311, X430, X431, T312, X432)) → balance23_out_aaaaaaaaaa(tree(T307, T309, T313), T308, T314, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436)
U7_aaaaggagaaaaa(T157, T159, T163, T158, T164, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, X279, X280, balance23_out_aaaaaaaaaa(T157, T158, T159, X272, .(','(T153, -(T161, [])), .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160))), T160, X273, X274, X279, X275)) → balance12_out_aaaaggagaaaaa(tree(T157, T159, T163), T158, T164, X276, tree(T148, T149, T150), T151, T161, T153, .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160)), X277, X278, X279, X280)
balance12_in_aaaaggagaaaaa(tree(T157, T159, T192), T158, T193, X276, tree(T148, T149, T150), T151, T161, T153, .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160)), X277, X278, T190, X280) → U8_aaaaggagaaaaa(T157, T159, T192, T158, T193, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, T190, X280, balance23_in_aaaaaaaaaa(T157, T158, T159, T187, .(','(T153, -(T161, [])), .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160))), T160, T188, T189, T190, T191))
U8_aaaaggagaaaaa(T157, T159, T192, T158, T193, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, T190, X280, balance23_out_aaaaaaaaaa(T157, T158, T159, T187, .(','(T153, -(T161, [])), .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160))), T160, T188, T189, T190, T191)) → U9_aaaaggagaaaaa(T157, T159, T192, T158, T193, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, T190, X280, balance23_in_aaaaaaaaaa(T192, T187, T193, X276, T188, T189, X277, X278, T191, X280))
U9_aaaaggagaaaaa(T157, T159, T192, T158, T193, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, T190, X280, balance23_out_aaaaaaaaaa(T192, T187, T193, X276, T188, T189, X277, X278, T191, X280)) → balance12_out_aaaaggagaaaaa(tree(T157, T159, T192), T158, T193, X276, tree(T148, T149, T150), T151, T161, T153, .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160)), X277, X278, T190, X280)
U10_ag(T31, T33, T36, T28, T29, T30, balance12_out_aaaaggagaaaaa(T31, T32, T33, X113, T28, T29, T35, T30, T34, X114, X115, X121, X116)) → balance1_out_ag(tree(T31, T33, T36), tree(T28, T29, T30))
balance1_in_ag(tree(T31, T33, T58), tree(T28, T29, T30)) → U11_ag(T31, T33, T58, T28, T29, T30, balance12_in_aaaaggagaaaaa(T31, T32, T33, T53, T28, T29, T35, T30, T34, T54, T55, T56, T57))
U11_ag(T31, T33, T58, T28, T29, T30, balance12_out_aaaaggagaaaaa(T31, T32, T33, T53, T28, T29, T35, T30, T34, T54, T55, T56, T57)) → U12_ag(T31, T33, T58, T28, T29, T30, balance13_in_aaaaaa(T58, T53, T54, T55, T56, T57))
balance13_in_aaaaaa(nil, [], T394, [], T394, .(','(nil, -(T396, T396)), [])) → balance13_out_aaaaaa(nil, [], T394, [], T394, .(','(nil, -(T396, T396)), []))
balance13_in_aaaaaa(tree(T440, T442, T446), T441, .(','(tree(T430, T431, T432), -(T433, T434)), T443), .(','(T430, -(T433, .(T431, T436))), .(','(T432, -(T436, T434)), T444)), T447, T445) → U4_aaaaaa(T440, T442, T446, T441, T430, T431, T432, T433, T434, T443, T436, T444, T447, T445, balance23_in_aaaaaaaaaa(T440, T441, T442, X579, T443, T444, X580, X581, T445, X582))
U4_aaaaaa(T440, T442, T446, T441, T430, T431, T432, T433, T434, T443, T436, T444, T447, T445, balance23_out_aaaaaaaaaa(T440, T441, T442, X579, T443, T444, X580, X581, T445, X582)) → balance13_out_aaaaaa(tree(T440, T442, T446), T441, .(','(tree(T430, T431, T432), -(T433, T434)), T443), .(','(T430, -(T433, .(T431, T436))), .(','(T432, -(T436, T434)), T444)), T447, T445)
balance13_in_aaaaaa(tree(T440, T442, T466), T441, .(','(tree(T430, T431, T432), -(T433, T434)), T443), .(','(T430, -(T433, .(T431, T436))), .(','(T432, -(T436, T434)), T444)), T467, T445) → U5_aaaaaa(T440, T442, T466, T441, T430, T431, T432, T433, T434, T443, T436, T444, T467, T445, balance23_in_aaaaaaaaaa(T440, T441, T442, T462, T443, T444, T463, T464, T445, T465))
U5_aaaaaa(T440, T442, T466, T441, T430, T431, T432, T433, T434, T443, T436, T444, T467, T445, balance23_out_aaaaaaaaaa(T440, T441, T442, T462, T443, T444, T463, T464, T445, T465)) → U6_aaaaaa(T440, T442, T466, T441, T430, T431, T432, T433, T434, T443, T436, T444, T467, T445, balance13_in_aaaaaa(T466, T462, T463, T464, T467, T465))
U6_aaaaaa(T440, T442, T466, T441, T430, T431, T432, T433, T434, T443, T436, T444, T467, T445, balance13_out_aaaaaa(T466, T462, T463, T464, T467, T465)) → balance13_out_aaaaaa(tree(T440, T442, T466), T441, .(','(tree(T430, T431, T432), -(T433, T434)), T443), .(','(T430, -(T433, .(T431, T436))), .(','(T432, -(T436, T434)), T444)), T467, T445)
U12_ag(T31, T33, T58, T28, T29, T30, balance13_out_aaaaaa(T58, T53, T54, T55, T56, T57)) → balance1_out_ag(tree(T31, T33, T58), tree(T28, T29, T30))
BALANCE23_IN_AAAAAAAAAA(tree(T307, T309, T333), T308, T334, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436) → U2_AAAAAAAAAA(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_in_aaaaaaaaaa(T307, T308, T309, T329, T310, T311, T330, T331, T312, T332))
U2_AAAAAAAAAA(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_out_aaaaaaaaaa(T307, T308, T309, T329, T310, T311, T330, T331, T312, T332)) → BALANCE23_IN_AAAAAAAAAA(T333, T329, T334, X433, T330, T331, X434, X435, T332, X436)
BALANCE23_IN_AAAAAAAAAA(tree(T307, T309, T313), T308, T314, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436) → BALANCE23_IN_AAAAAAAAAA(T307, T308, T309, X429, T310, T311, X430, X431, T312, X432)
balance1_in_ag(nil, nil) → balance1_out_ag(nil, nil)
balance1_in_ag(tree(T31, T33, T36), tree(T28, T29, T30)) → U10_ag(T31, T33, T36, T28, T29, T30, balance12_in_aaaaggagaaaaa(T31, T32, T33, X113, T28, T29, T35, T30, T34, X114, X115, X121, X116))
balance12_in_aaaaggagaaaaa(nil, .(T108, T109), T108, T109, T110, T111, T112, T113, T114, .(','(T110, -(.(T108, T109), .(T111, T112))), .(','(T113, -(T112, [])), T114)), T114, .(','(nil, -(X200, X200)), X201), X201) → balance12_out_aaaaggagaaaaa(nil, .(T108, T109), T108, T109, T110, T111, T112, T113, T114, .(','(T110, -(.(T108, T109), .(T111, T112))), .(','(T113, -(T112, [])), T114)), T114, .(','(nil, -(X200, X200)), X201), X201)
balance12_in_aaaaggagaaaaa(tree(T157, T159, T163), T158, T164, X276, tree(T148, T149, T150), T151, T161, T153, .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160)), X277, X278, X279, X280) → U7_aaaaggagaaaaa(T157, T159, T163, T158, T164, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, X279, X280, balance23_in_aaaaaaaaaa(T157, T158, T159, X272, .(','(T153, -(T161, [])), .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160))), T160, X273, X274, X279, X275))
balance23_in_aaaaaaaaaa(nil, .(T259, T260), T259, T260, T261, T262, T261, T262, .(','(nil, -(T263, T263)), T264), T264) → balance23_out_aaaaaaaaaa(nil, .(T259, T260), T259, T260, T261, T262, T261, T262, .(','(nil, -(T263, T263)), T264), T264)
balance23_in_aaaaaaaaaa(tree(T307, T309, T313), T308, T314, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436) → U1_aaaaaaaaaa(T307, T309, T313, T308, T314, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_in_aaaaaaaaaa(T307, T308, T309, X429, T310, T311, X430, X431, T312, X432))
balance23_in_aaaaaaaaaa(tree(T307, T309, T333), T308, T334, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436) → U2_aaaaaaaaaa(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_in_aaaaaaaaaa(T307, T308, T309, T329, T310, T311, T330, T331, T312, T332))
U2_aaaaaaaaaa(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_out_aaaaaaaaaa(T307, T308, T309, T329, T310, T311, T330, T331, T312, T332)) → U3_aaaaaaaaaa(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_in_aaaaaaaaaa(T333, T329, T334, X433, T330, T331, X434, X435, T332, X436))
U3_aaaaaaaaaa(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_out_aaaaaaaaaa(T333, T329, T334, X433, T330, T331, X434, X435, T332, X436)) → balance23_out_aaaaaaaaaa(tree(T307, T309, T333), T308, T334, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436)
U1_aaaaaaaaaa(T307, T309, T313, T308, T314, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_out_aaaaaaaaaa(T307, T308, T309, X429, T310, T311, X430, X431, T312, X432)) → balance23_out_aaaaaaaaaa(tree(T307, T309, T313), T308, T314, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436)
U7_aaaaggagaaaaa(T157, T159, T163, T158, T164, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, X279, X280, balance23_out_aaaaaaaaaa(T157, T158, T159, X272, .(','(T153, -(T161, [])), .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160))), T160, X273, X274, X279, X275)) → balance12_out_aaaaggagaaaaa(tree(T157, T159, T163), T158, T164, X276, tree(T148, T149, T150), T151, T161, T153, .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160)), X277, X278, X279, X280)
balance12_in_aaaaggagaaaaa(tree(T157, T159, T192), T158, T193, X276, tree(T148, T149, T150), T151, T161, T153, .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160)), X277, X278, T190, X280) → U8_aaaaggagaaaaa(T157, T159, T192, T158, T193, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, T190, X280, balance23_in_aaaaaaaaaa(T157, T158, T159, T187, .(','(T153, -(T161, [])), .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160))), T160, T188, T189, T190, T191))
U8_aaaaggagaaaaa(T157, T159, T192, T158, T193, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, T190, X280, balance23_out_aaaaaaaaaa(T157, T158, T159, T187, .(','(T153, -(T161, [])), .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160))), T160, T188, T189, T190, T191)) → U9_aaaaggagaaaaa(T157, T159, T192, T158, T193, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, T190, X280, balance23_in_aaaaaaaaaa(T192, T187, T193, X276, T188, T189, X277, X278, T191, X280))
U9_aaaaggagaaaaa(T157, T159, T192, T158, T193, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, T190, X280, balance23_out_aaaaaaaaaa(T192, T187, T193, X276, T188, T189, X277, X278, T191, X280)) → balance12_out_aaaaggagaaaaa(tree(T157, T159, T192), T158, T193, X276, tree(T148, T149, T150), T151, T161, T153, .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160)), X277, X278, T190, X280)
U10_ag(T31, T33, T36, T28, T29, T30, balance12_out_aaaaggagaaaaa(T31, T32, T33, X113, T28, T29, T35, T30, T34, X114, X115, X121, X116)) → balance1_out_ag(tree(T31, T33, T36), tree(T28, T29, T30))
balance1_in_ag(tree(T31, T33, T58), tree(T28, T29, T30)) → U11_ag(T31, T33, T58, T28, T29, T30, balance12_in_aaaaggagaaaaa(T31, T32, T33, T53, T28, T29, T35, T30, T34, T54, T55, T56, T57))
U11_ag(T31, T33, T58, T28, T29, T30, balance12_out_aaaaggagaaaaa(T31, T32, T33, T53, T28, T29, T35, T30, T34, T54, T55, T56, T57)) → U12_ag(T31, T33, T58, T28, T29, T30, balance13_in_aaaaaa(T58, T53, T54, T55, T56, T57))
balance13_in_aaaaaa(nil, [], T394, [], T394, .(','(nil, -(T396, T396)), [])) → balance13_out_aaaaaa(nil, [], T394, [], T394, .(','(nil, -(T396, T396)), []))
balance13_in_aaaaaa(tree(T440, T442, T446), T441, .(','(tree(T430, T431, T432), -(T433, T434)), T443), .(','(T430, -(T433, .(T431, T436))), .(','(T432, -(T436, T434)), T444)), T447, T445) → U4_aaaaaa(T440, T442, T446, T441, T430, T431, T432, T433, T434, T443, T436, T444, T447, T445, balance23_in_aaaaaaaaaa(T440, T441, T442, X579, T443, T444, X580, X581, T445, X582))
U4_aaaaaa(T440, T442, T446, T441, T430, T431, T432, T433, T434, T443, T436, T444, T447, T445, balance23_out_aaaaaaaaaa(T440, T441, T442, X579, T443, T444, X580, X581, T445, X582)) → balance13_out_aaaaaa(tree(T440, T442, T446), T441, .(','(tree(T430, T431, T432), -(T433, T434)), T443), .(','(T430, -(T433, .(T431, T436))), .(','(T432, -(T436, T434)), T444)), T447, T445)
balance13_in_aaaaaa(tree(T440, T442, T466), T441, .(','(tree(T430, T431, T432), -(T433, T434)), T443), .(','(T430, -(T433, .(T431, T436))), .(','(T432, -(T436, T434)), T444)), T467, T445) → U5_aaaaaa(T440, T442, T466, T441, T430, T431, T432, T433, T434, T443, T436, T444, T467, T445, balance23_in_aaaaaaaaaa(T440, T441, T442, T462, T443, T444, T463, T464, T445, T465))
U5_aaaaaa(T440, T442, T466, T441, T430, T431, T432, T433, T434, T443, T436, T444, T467, T445, balance23_out_aaaaaaaaaa(T440, T441, T442, T462, T443, T444, T463, T464, T445, T465)) → U6_aaaaaa(T440, T442, T466, T441, T430, T431, T432, T433, T434, T443, T436, T444, T467, T445, balance13_in_aaaaaa(T466, T462, T463, T464, T467, T465))
U6_aaaaaa(T440, T442, T466, T441, T430, T431, T432, T433, T434, T443, T436, T444, T467, T445, balance13_out_aaaaaa(T466, T462, T463, T464, T467, T465)) → balance13_out_aaaaaa(tree(T440, T442, T466), T441, .(','(tree(T430, T431, T432), -(T433, T434)), T443), .(','(T430, -(T433, .(T431, T436))), .(','(T432, -(T436, T434)), T444)), T467, T445)
U12_ag(T31, T33, T58, T28, T29, T30, balance13_out_aaaaaa(T58, T53, T54, T55, T56, T57)) → balance1_out_ag(tree(T31, T33, T58), tree(T28, T29, T30))
BALANCE23_IN_AAAAAAAAAA(tree(T307, T309, T333), T308, T334, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436) → U2_AAAAAAAAAA(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_in_aaaaaaaaaa(T307, T308, T309, T329, T310, T311, T330, T331, T312, T332))
U2_AAAAAAAAAA(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_out_aaaaaaaaaa(T307, T308, T309, T329, T310, T311, T330, T331, T312, T332)) → BALANCE23_IN_AAAAAAAAAA(T333, T329, T334, X433, T330, T331, X434, X435, T332, X436)
BALANCE23_IN_AAAAAAAAAA(tree(T307, T309, T313), T308, T314, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436) → BALANCE23_IN_AAAAAAAAAA(T307, T308, T309, X429, T310, T311, X430, X431, T312, X432)
balance23_in_aaaaaaaaaa(nil, .(T259, T260), T259, T260, T261, T262, T261, T262, .(','(nil, -(T263, T263)), T264), T264) → balance23_out_aaaaaaaaaa(nil, .(T259, T260), T259, T260, T261, T262, T261, T262, .(','(nil, -(T263, T263)), T264), T264)
balance23_in_aaaaaaaaaa(tree(T307, T309, T313), T308, T314, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436) → U1_aaaaaaaaaa(T307, T309, T313, T308, T314, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_in_aaaaaaaaaa(T307, T308, T309, X429, T310, T311, X430, X431, T312, X432))
balance23_in_aaaaaaaaaa(tree(T307, T309, T333), T308, T334, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436) → U2_aaaaaaaaaa(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_in_aaaaaaaaaa(T307, T308, T309, T329, T310, T311, T330, T331, T312, T332))
U1_aaaaaaaaaa(T307, T309, T313, T308, T314, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_out_aaaaaaaaaa(T307, T308, T309, X429, T310, T311, X430, X431, T312, X432)) → balance23_out_aaaaaaaaaa(tree(T307, T309, T313), T308, T314, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436)
U2_aaaaaaaaaa(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_out_aaaaaaaaaa(T307, T308, T309, T329, T310, T311, T330, T331, T312, T332)) → U3_aaaaaaaaaa(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_in_aaaaaaaaaa(T333, T329, T334, X433, T330, T331, X434, X435, T332, X436))
U3_aaaaaaaaaa(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_out_aaaaaaaaaa(T333, T329, T334, X433, T330, T331, X434, X435, T332, X436)) → balance23_out_aaaaaaaaaa(tree(T307, T309, T333), T308, T334, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436)
BALANCE23_IN_AAAAAAAAAA → U2_AAAAAAAAAA(balance23_in_aaaaaaaaaa)
U2_AAAAAAAAAA(balance23_out_aaaaaaaaaa) → BALANCE23_IN_AAAAAAAAAA
BALANCE23_IN_AAAAAAAAAA → BALANCE23_IN_AAAAAAAAAA
balance23_in_aaaaaaaaaa → balance23_out_aaaaaaaaaa
balance23_in_aaaaaaaaaa → U1_aaaaaaaaaa(balance23_in_aaaaaaaaaa)
balance23_in_aaaaaaaaaa → U2_aaaaaaaaaa(balance23_in_aaaaaaaaaa)
U1_aaaaaaaaaa(balance23_out_aaaaaaaaaa) → balance23_out_aaaaaaaaaa
U2_aaaaaaaaaa(balance23_out_aaaaaaaaaa) → U3_aaaaaaaaaa(balance23_in_aaaaaaaaaa)
U3_aaaaaaaaaa(balance23_out_aaaaaaaaaa) → balance23_out_aaaaaaaaaa
balance23_in_aaaaaaaaaa
U1_aaaaaaaaaa(x0)
U2_aaaaaaaaaa(x0)
U3_aaaaaaaaaa(x0)
BALANCE23_IN_AAAAAAAAAA → U2_AAAAAAAAAA(balance23_out_aaaaaaaaaa)
BALANCE23_IN_AAAAAAAAAA → U2_AAAAAAAAAA(U1_aaaaaaaaaa(balance23_in_aaaaaaaaaa))
BALANCE23_IN_AAAAAAAAAA → U2_AAAAAAAAAA(U2_aaaaaaaaaa(balance23_in_aaaaaaaaaa))
U2_AAAAAAAAAA(balance23_out_aaaaaaaaaa) → BALANCE23_IN_AAAAAAAAAA
BALANCE23_IN_AAAAAAAAAA → BALANCE23_IN_AAAAAAAAAA
BALANCE23_IN_AAAAAAAAAA → U2_AAAAAAAAAA(balance23_out_aaaaaaaaaa)
BALANCE23_IN_AAAAAAAAAA → U2_AAAAAAAAAA(U1_aaaaaaaaaa(balance23_in_aaaaaaaaaa))
BALANCE23_IN_AAAAAAAAAA → U2_AAAAAAAAAA(U2_aaaaaaaaaa(balance23_in_aaaaaaaaaa))
balance23_in_aaaaaaaaaa → balance23_out_aaaaaaaaaa
balance23_in_aaaaaaaaaa → U1_aaaaaaaaaa(balance23_in_aaaaaaaaaa)
balance23_in_aaaaaaaaaa → U2_aaaaaaaaaa(balance23_in_aaaaaaaaaa)
U1_aaaaaaaaaa(balance23_out_aaaaaaaaaa) → balance23_out_aaaaaaaaaa
U2_aaaaaaaaaa(balance23_out_aaaaaaaaaa) → U3_aaaaaaaaaa(balance23_in_aaaaaaaaaa)
U3_aaaaaaaaaa(balance23_out_aaaaaaaaaa) → balance23_out_aaaaaaaaaa
balance23_in_aaaaaaaaaa
U1_aaaaaaaaaa(x0)
U2_aaaaaaaaaa(x0)
U3_aaaaaaaaaa(x0)
BALANCE13_IN_AAAAAA(tree(T440, T442, T466), T441, .(','(tree(T430, T431, T432), -(T433, T434)), T443), .(','(T430, -(T433, .(T431, T436))), .(','(T432, -(T436, T434)), T444)), T467, T445) → U5_AAAAAA(T440, T442, T466, T441, T430, T431, T432, T433, T434, T443, T436, T444, T467, T445, balance23_in_aaaaaaaaaa(T440, T441, T442, T462, T443, T444, T463, T464, T445, T465))
U5_AAAAAA(T440, T442, T466, T441, T430, T431, T432, T433, T434, T443, T436, T444, T467, T445, balance23_out_aaaaaaaaaa(T440, T441, T442, T462, T443, T444, T463, T464, T445, T465)) → BALANCE13_IN_AAAAAA(T466, T462, T463, T464, T467, T465)
balance1_in_ag(nil, nil) → balance1_out_ag(nil, nil)
balance1_in_ag(tree(T31, T33, T36), tree(T28, T29, T30)) → U10_ag(T31, T33, T36, T28, T29, T30, balance12_in_aaaaggagaaaaa(T31, T32, T33, X113, T28, T29, T35, T30, T34, X114, X115, X121, X116))
balance12_in_aaaaggagaaaaa(nil, .(T108, T109), T108, T109, T110, T111, T112, T113, T114, .(','(T110, -(.(T108, T109), .(T111, T112))), .(','(T113, -(T112, [])), T114)), T114, .(','(nil, -(X200, X200)), X201), X201) → balance12_out_aaaaggagaaaaa(nil, .(T108, T109), T108, T109, T110, T111, T112, T113, T114, .(','(T110, -(.(T108, T109), .(T111, T112))), .(','(T113, -(T112, [])), T114)), T114, .(','(nil, -(X200, X200)), X201), X201)
balance12_in_aaaaggagaaaaa(tree(T157, T159, T163), T158, T164, X276, tree(T148, T149, T150), T151, T161, T153, .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160)), X277, X278, X279, X280) → U7_aaaaggagaaaaa(T157, T159, T163, T158, T164, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, X279, X280, balance23_in_aaaaaaaaaa(T157, T158, T159, X272, .(','(T153, -(T161, [])), .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160))), T160, X273, X274, X279, X275))
balance23_in_aaaaaaaaaa(nil, .(T259, T260), T259, T260, T261, T262, T261, T262, .(','(nil, -(T263, T263)), T264), T264) → balance23_out_aaaaaaaaaa(nil, .(T259, T260), T259, T260, T261, T262, T261, T262, .(','(nil, -(T263, T263)), T264), T264)
balance23_in_aaaaaaaaaa(tree(T307, T309, T313), T308, T314, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436) → U1_aaaaaaaaaa(T307, T309, T313, T308, T314, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_in_aaaaaaaaaa(T307, T308, T309, X429, T310, T311, X430, X431, T312, X432))
balance23_in_aaaaaaaaaa(tree(T307, T309, T333), T308, T334, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436) → U2_aaaaaaaaaa(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_in_aaaaaaaaaa(T307, T308, T309, T329, T310, T311, T330, T331, T312, T332))
U2_aaaaaaaaaa(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_out_aaaaaaaaaa(T307, T308, T309, T329, T310, T311, T330, T331, T312, T332)) → U3_aaaaaaaaaa(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_in_aaaaaaaaaa(T333, T329, T334, X433, T330, T331, X434, X435, T332, X436))
U3_aaaaaaaaaa(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_out_aaaaaaaaaa(T333, T329, T334, X433, T330, T331, X434, X435, T332, X436)) → balance23_out_aaaaaaaaaa(tree(T307, T309, T333), T308, T334, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436)
U1_aaaaaaaaaa(T307, T309, T313, T308, T314, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_out_aaaaaaaaaa(T307, T308, T309, X429, T310, T311, X430, X431, T312, X432)) → balance23_out_aaaaaaaaaa(tree(T307, T309, T313), T308, T314, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436)
U7_aaaaggagaaaaa(T157, T159, T163, T158, T164, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, X279, X280, balance23_out_aaaaaaaaaa(T157, T158, T159, X272, .(','(T153, -(T161, [])), .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160))), T160, X273, X274, X279, X275)) → balance12_out_aaaaggagaaaaa(tree(T157, T159, T163), T158, T164, X276, tree(T148, T149, T150), T151, T161, T153, .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160)), X277, X278, X279, X280)
balance12_in_aaaaggagaaaaa(tree(T157, T159, T192), T158, T193, X276, tree(T148, T149, T150), T151, T161, T153, .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160)), X277, X278, T190, X280) → U8_aaaaggagaaaaa(T157, T159, T192, T158, T193, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, T190, X280, balance23_in_aaaaaaaaaa(T157, T158, T159, T187, .(','(T153, -(T161, [])), .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160))), T160, T188, T189, T190, T191))
U8_aaaaggagaaaaa(T157, T159, T192, T158, T193, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, T190, X280, balance23_out_aaaaaaaaaa(T157, T158, T159, T187, .(','(T153, -(T161, [])), .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160))), T160, T188, T189, T190, T191)) → U9_aaaaggagaaaaa(T157, T159, T192, T158, T193, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, T190, X280, balance23_in_aaaaaaaaaa(T192, T187, T193, X276, T188, T189, X277, X278, T191, X280))
U9_aaaaggagaaaaa(T157, T159, T192, T158, T193, X276, T148, T149, T150, T151, T161, T153, T162, T160, X277, X278, T190, X280, balance23_out_aaaaaaaaaa(T192, T187, T193, X276, T188, T189, X277, X278, T191, X280)) → balance12_out_aaaaggagaaaaa(tree(T157, T159, T192), T158, T193, X276, tree(T148, T149, T150), T151, T161, T153, .(','(T148, -(T158, .(T149, T162))), .(','(T150, -(T162, .(T151, T161))), T160)), X277, X278, T190, X280)
U10_ag(T31, T33, T36, T28, T29, T30, balance12_out_aaaaggagaaaaa(T31, T32, T33, X113, T28, T29, T35, T30, T34, X114, X115, X121, X116)) → balance1_out_ag(tree(T31, T33, T36), tree(T28, T29, T30))
balance1_in_ag(tree(T31, T33, T58), tree(T28, T29, T30)) → U11_ag(T31, T33, T58, T28, T29, T30, balance12_in_aaaaggagaaaaa(T31, T32, T33, T53, T28, T29, T35, T30, T34, T54, T55, T56, T57))
U11_ag(T31, T33, T58, T28, T29, T30, balance12_out_aaaaggagaaaaa(T31, T32, T33, T53, T28, T29, T35, T30, T34, T54, T55, T56, T57)) → U12_ag(T31, T33, T58, T28, T29, T30, balance13_in_aaaaaa(T58, T53, T54, T55, T56, T57))
balance13_in_aaaaaa(nil, [], T394, [], T394, .(','(nil, -(T396, T396)), [])) → balance13_out_aaaaaa(nil, [], T394, [], T394, .(','(nil, -(T396, T396)), []))
balance13_in_aaaaaa(tree(T440, T442, T446), T441, .(','(tree(T430, T431, T432), -(T433, T434)), T443), .(','(T430, -(T433, .(T431, T436))), .(','(T432, -(T436, T434)), T444)), T447, T445) → U4_aaaaaa(T440, T442, T446, T441, T430, T431, T432, T433, T434, T443, T436, T444, T447, T445, balance23_in_aaaaaaaaaa(T440, T441, T442, X579, T443, T444, X580, X581, T445, X582))
U4_aaaaaa(T440, T442, T446, T441, T430, T431, T432, T433, T434, T443, T436, T444, T447, T445, balance23_out_aaaaaaaaaa(T440, T441, T442, X579, T443, T444, X580, X581, T445, X582)) → balance13_out_aaaaaa(tree(T440, T442, T446), T441, .(','(tree(T430, T431, T432), -(T433, T434)), T443), .(','(T430, -(T433, .(T431, T436))), .(','(T432, -(T436, T434)), T444)), T447, T445)
balance13_in_aaaaaa(tree(T440, T442, T466), T441, .(','(tree(T430, T431, T432), -(T433, T434)), T443), .(','(T430, -(T433, .(T431, T436))), .(','(T432, -(T436, T434)), T444)), T467, T445) → U5_aaaaaa(T440, T442, T466, T441, T430, T431, T432, T433, T434, T443, T436, T444, T467, T445, balance23_in_aaaaaaaaaa(T440, T441, T442, T462, T443, T444, T463, T464, T445, T465))
U5_aaaaaa(T440, T442, T466, T441, T430, T431, T432, T433, T434, T443, T436, T444, T467, T445, balance23_out_aaaaaaaaaa(T440, T441, T442, T462, T443, T444, T463, T464, T445, T465)) → U6_aaaaaa(T440, T442, T466, T441, T430, T431, T432, T433, T434, T443, T436, T444, T467, T445, balance13_in_aaaaaa(T466, T462, T463, T464, T467, T465))
U6_aaaaaa(T440, T442, T466, T441, T430, T431, T432, T433, T434, T443, T436, T444, T467, T445, balance13_out_aaaaaa(T466, T462, T463, T464, T467, T465)) → balance13_out_aaaaaa(tree(T440, T442, T466), T441, .(','(tree(T430, T431, T432), -(T433, T434)), T443), .(','(T430, -(T433, .(T431, T436))), .(','(T432, -(T436, T434)), T444)), T467, T445)
U12_ag(T31, T33, T58, T28, T29, T30, balance13_out_aaaaaa(T58, T53, T54, T55, T56, T57)) → balance1_out_ag(tree(T31, T33, T58), tree(T28, T29, T30))
BALANCE13_IN_AAAAAA(tree(T440, T442, T466), T441, .(','(tree(T430, T431, T432), -(T433, T434)), T443), .(','(T430, -(T433, .(T431, T436))), .(','(T432, -(T436, T434)), T444)), T467, T445) → U5_AAAAAA(T440, T442, T466, T441, T430, T431, T432, T433, T434, T443, T436, T444, T467, T445, balance23_in_aaaaaaaaaa(T440, T441, T442, T462, T443, T444, T463, T464, T445, T465))
U5_AAAAAA(T440, T442, T466, T441, T430, T431, T432, T433, T434, T443, T436, T444, T467, T445, balance23_out_aaaaaaaaaa(T440, T441, T442, T462, T443, T444, T463, T464, T445, T465)) → BALANCE13_IN_AAAAAA(T466, T462, T463, T464, T467, T465)
balance23_in_aaaaaaaaaa(nil, .(T259, T260), T259, T260, T261, T262, T261, T262, .(','(nil, -(T263, T263)), T264), T264) → balance23_out_aaaaaaaaaa(nil, .(T259, T260), T259, T260, T261, T262, T261, T262, .(','(nil, -(T263, T263)), T264), T264)
balance23_in_aaaaaaaaaa(tree(T307, T309, T313), T308, T314, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436) → U1_aaaaaaaaaa(T307, T309, T313, T308, T314, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_in_aaaaaaaaaa(T307, T308, T309, X429, T310, T311, X430, X431, T312, X432))
balance23_in_aaaaaaaaaa(tree(T307, T309, T333), T308, T334, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436) → U2_aaaaaaaaaa(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_in_aaaaaaaaaa(T307, T308, T309, T329, T310, T311, T330, T331, T312, T332))
U1_aaaaaaaaaa(T307, T309, T313, T308, T314, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_out_aaaaaaaaaa(T307, T308, T309, X429, T310, T311, X430, X431, T312, X432)) → balance23_out_aaaaaaaaaa(tree(T307, T309, T313), T308, T314, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436)
U2_aaaaaaaaaa(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_out_aaaaaaaaaa(T307, T308, T309, T329, T310, T311, T330, T331, T312, T332)) → U3_aaaaaaaaaa(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_in_aaaaaaaaaa(T333, T329, T334, X433, T330, T331, X434, X435, T332, X436))
U3_aaaaaaaaaa(T307, T309, T333, T308, T334, X433, T298, T299, T300, T301, T302, T310, T304, T311, X434, X435, T312, X436, balance23_out_aaaaaaaaaa(T333, T329, T334, X433, T330, T331, X434, X435, T332, X436)) → balance23_out_aaaaaaaaaa(tree(T307, T309, T333), T308, T334, X433, .(','(tree(T298, T299, T300), -(T301, T302)), T310), .(','(T298, -(T301, .(T299, T304))), .(','(T300, -(T304, T302)), T311)), X434, X435, T312, X436)
BALANCE13_IN_AAAAAA → U5_AAAAAA(balance23_in_aaaaaaaaaa)
U5_AAAAAA(balance23_out_aaaaaaaaaa) → BALANCE13_IN_AAAAAA
balance23_in_aaaaaaaaaa → balance23_out_aaaaaaaaaa
balance23_in_aaaaaaaaaa → U1_aaaaaaaaaa(balance23_in_aaaaaaaaaa)
balance23_in_aaaaaaaaaa → U2_aaaaaaaaaa(balance23_in_aaaaaaaaaa)
U1_aaaaaaaaaa(balance23_out_aaaaaaaaaa) → balance23_out_aaaaaaaaaa
U2_aaaaaaaaaa(balance23_out_aaaaaaaaaa) → U3_aaaaaaaaaa(balance23_in_aaaaaaaaaa)
U3_aaaaaaaaaa(balance23_out_aaaaaaaaaa) → balance23_out_aaaaaaaaaa
balance23_in_aaaaaaaaaa
U1_aaaaaaaaaa(x0)
U2_aaaaaaaaaa(x0)
U3_aaaaaaaaaa(x0)
BALANCE13_IN_AAAAAA → U5_AAAAAA(balance23_out_aaaaaaaaaa)
BALANCE13_IN_AAAAAA → U5_AAAAAA(U1_aaaaaaaaaa(balance23_in_aaaaaaaaaa))
BALANCE13_IN_AAAAAA → U5_AAAAAA(U2_aaaaaaaaaa(balance23_in_aaaaaaaaaa))
U5_AAAAAA(balance23_out_aaaaaaaaaa) → BALANCE13_IN_AAAAAA
BALANCE13_IN_AAAAAA → U5_AAAAAA(balance23_out_aaaaaaaaaa)
BALANCE13_IN_AAAAAA → U5_AAAAAA(U1_aaaaaaaaaa(balance23_in_aaaaaaaaaa))
BALANCE13_IN_AAAAAA → U5_AAAAAA(U2_aaaaaaaaaa(balance23_in_aaaaaaaaaa))
balance23_in_aaaaaaaaaa → balance23_out_aaaaaaaaaa
balance23_in_aaaaaaaaaa → U1_aaaaaaaaaa(balance23_in_aaaaaaaaaa)
balance23_in_aaaaaaaaaa → U2_aaaaaaaaaa(balance23_in_aaaaaaaaaa)
U1_aaaaaaaaaa(balance23_out_aaaaaaaaaa) → balance23_out_aaaaaaaaaa
U2_aaaaaaaaaa(balance23_out_aaaaaaaaaa) → U3_aaaaaaaaaa(balance23_in_aaaaaaaaaa)
U3_aaaaaaaaaa(balance23_out_aaaaaaaaaa) → balance23_out_aaaaaaaaaa
balance23_in_aaaaaaaaaa
U1_aaaaaaaaaa(x0)
U2_aaaaaaaaaa(x0)
U3_aaaaaaaaaa(x0)