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 QDPSizeChangeProof (⇔)
↳15 TRUE
↳16 PiDP
↳17 UsableRulesProof (⇔)
↳18 PiDP
↳19 PiDPToQDPProof (⇐)
↳20 QDP
↳21 QDPSizeChangeProof (⇔)
↳22 TRUE
↳23 PiDP
↳24 UsableRulesProof (⇔)
↳25 PiDP
↳26 PiDPToQDPProof (⇔)
↳27 QDP
↳28 QDPSizeChangeProof (⇔)
↳29 TRUE
↳30 PiDP
↳31 UsableRulesProof (⇔)
↳32 PiDP
↳33 PiDPToQDPProof (⇐)
↳34 QDP
↳35 QDPOrderProof (⇔)
↳36 QDP
↳37 DependencyGraphProof (⇔)
↳38 TRUE
max_valued1_in_ga(.(T7, []), T7) → max_valued1_out_ga(.(T7, []), T7)
max_valued1_in_ga(.(0, .(T15, T9)), T12) → U39_ga(T15, T9, T12, max_valued3_in_gga(T9, T15, T12))
max_valued3_in_gga([], T7, T7) → max_valued3_out_gga([], T7, T7)
max_valued3_in_gga(.(T15, T9), 0, T12) → U1_gga(T15, T9, T12, max_valued3_in_gga(T9, T15, T12))
max_valued3_in_gga(.(s(T18), T9), s(0), T12) → U2_gga(T18, T9, T12, max_valued3_in_gga(T9, s(T18), T12))
max_valued3_in_gga(.(s(s(T21)), T9), s(s(0)), T12) → U3_gga(T21, T9, T12, max_valued3_in_gga(T9, s(s(T21)), T12))
max_valued3_in_gga(.(s(s(s(T24))), T9), s(s(s(0))), T12) → U4_gga(T24, T9, T12, max_valued3_in_gga(T9, s(s(s(T24))), T12))
max_valued3_in_gga(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12) → U5_gga(T27, T9, T12, max_valued3_in_gga(T9, s(s(s(s(T27)))), T12))
max_valued3_in_gga(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12) → U6_gga(T30, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(T30))))), T12))
max_valued3_in_gga(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12) → U7_gga(T33, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(T33)))))), T12))
max_valued3_in_gga(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12) → U8_gga(T36, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(s(T36))))))), T12))
max_valued3_in_gga(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12) → U9_gga(T37, T9, T38, T12, greater64_in_gg(T37, T38))
greater64_in_gg(s(T40), 0) → greater64_out_gg(s(T40), 0)
greater64_in_gg(s(T41), s(T42)) → U29_gg(T41, T42, greater64_in_gg(T41, T42))
U29_gg(T41, T42, greater64_out_gg(T41, T42)) → greater64_out_gg(s(T41), s(T42))
U9_gga(T37, T9, T38, T12, greater64_out_gg(T37, T38)) → max_valued3_out_gga(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12)
U9_gga(T37, T9, T38, T12, greater64_out_gg(T37, T38)) → U10_gga(T37, T9, T38, T12, max_valued3_in_gaa(T9, s(T39), T12))
max_valued3_in_gaa([], T7, T7) → max_valued3_out_gaa([], T7, T7)
max_valued3_in_gaa(.(T15, T9), 0, T12) → U1_gaa(T15, T9, T12, max_valued3_in_gga(T9, T15, T12))
max_valued3_in_gga(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47) → U11_gga(T43, T44, T45, T47, higher_valued77_in_ag(T48, T43))
higher_valued77_in_ag(T50, T51) → U30_ag(T50, T51, greater64_in_ag(s(s(T50)), s(s(s(s(s(s(T51))))))))
greater64_in_ag(s(T40), 0) → greater64_out_ag(s(T40), 0)
greater64_in_ag(s(T41), s(T42)) → U29_ag(T41, T42, greater64_in_ag(T41, T42))
U29_ag(T41, T42, greater64_out_ag(T41, T42)) → greater64_out_ag(s(T41), s(T42))
U30_ag(T50, T51, greater64_out_ag(s(s(T50)), s(s(s(s(s(s(T51)))))))) → higher_valued77_out_ag(T50, T51)
U11_gga(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → max_valued3_out_gga(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47)
U11_gga(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → U12_gga(T43, T44, T45, T47, max_valued3_in_gaa(T44, s(T49), T47))
max_valued3_in_gaa(.(s(T18), T9), s(0), T12) → U2_gaa(T18, T9, T12, max_valued3_in_gga(T9, s(T18), T12))
max_valued3_in_gga(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56) → U13_gga(T52, T53, T54, T56, higher_valued82_in_gg(T54, T52))
higher_valued82_in_gg(T57, T58) → U31_gg(T57, T58, greater64_in_gg(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58)))))))
U31_gg(T57, T58, greater64_out_gg(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58))))))) → higher_valued82_out_gg(T57, T58)
U13_gga(T52, T53, T54, T56, higher_valued82_out_gg(T54, T52)) → max_valued3_out_gga(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56)
U13_gga(T52, T53, T54, T56, higher_valued82_out_gg(T54, T52)) → U14_gga(T52, T53, T54, T56, max_valued3_in_gga(T53, s(s(s(s(s(s(T54)))))), T56))
max_valued3_in_gga(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63) → U15_gga(T59, T60, T61, T63, higher_valued87_in_gg(T61, T59))
higher_valued87_in_gg(T64, T65) → U32_gg(T64, T65, greater64_in_gg(s(s(s(s(s(s(T64)))))), s(s(s(s(T65))))))
U32_gg(T64, T65, greater64_out_gg(s(s(s(s(s(s(T64)))))), s(s(s(s(T65)))))) → higher_valued87_out_gg(T64, T65)
U15_gga(T59, T60, T61, T63, higher_valued87_out_gg(T61, T59)) → max_valued3_out_gga(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63)
U15_gga(T59, T60, T61, T63, higher_valued87_out_gg(T61, T59)) → U16_gga(T59, T60, T61, T63, max_valued3_in_gga(T60, s(s(s(s(s(T61))))), T63))
max_valued3_in_gga(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70) → U17_gga(T66, T67, T68, T70, higher_valued92_in_gg(T68, T66))
higher_valued92_in_gg(T71, T72) → U33_gg(T71, T72, greater64_in_gg(s(s(s(s(s(T71))))), s(s(s(T72)))))
U33_gg(T71, T72, greater64_out_gg(s(s(s(s(s(T71))))), s(s(s(T72))))) → higher_valued92_out_gg(T71, T72)
U17_gga(T66, T67, T68, T70, higher_valued92_out_gg(T68, T66)) → max_valued3_out_gga(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70)
U17_gga(T66, T67, T68, T70, higher_valued92_out_gg(T68, T66)) → U18_gga(T66, T67, T68, T70, max_valued3_in_gga(T67, s(s(s(s(T68)))), T70))
max_valued3_in_gga(.(s(s(T73)), T74), s(s(s(T75))), T77) → U19_gga(T73, T74, T75, T77, higher_valued97_in_gg(T75, T73))
higher_valued97_in_gg(T78, T79) → U34_gg(T78, T79, greater64_in_gg(s(s(s(s(T78)))), s(s(T79))))
U34_gg(T78, T79, greater64_out_gg(s(s(s(s(T78)))), s(s(T79)))) → higher_valued97_out_gg(T78, T79)
U19_gga(T73, T74, T75, T77, higher_valued97_out_gg(T75, T73)) → max_valued3_out_gga(.(s(s(T73)), T74), s(s(s(T75))), T77)
U19_gga(T73, T74, T75, T77, higher_valued97_out_gg(T75, T73)) → U20_gga(T73, T74, T75, T77, max_valued3_in_gga(T74, s(s(s(T75))), T77))
max_valued3_in_gga(.(s(T80), T81), s(s(T82)), T84) → U21_gga(T80, T81, T82, T84, higher_valued102_in_gg(T82, T80))
higher_valued102_in_gg(T85, T86) → U35_gg(T85, T86, greater64_in_gg(s(s(s(T85))), s(T86)))
U35_gg(T85, T86, greater64_out_gg(s(s(s(T85))), s(T86))) → higher_valued102_out_gg(T85, T86)
U21_gga(T80, T81, T82, T84, higher_valued102_out_gg(T82, T80)) → max_valued3_out_gga(.(s(T80), T81), s(s(T82)), T84)
U21_gga(T80, T81, T82, T84, higher_valued102_out_gg(T82, T80)) → U22_gga(T80, T81, T82, T84, max_valued3_in_gga(T81, s(s(T82)), T84))
max_valued3_in_gga(.(T87, T88), s(T89), T91) → U23_gga(T87, T88, T89, T91, higher_valued107_in_gg(T89, T87))
higher_valued107_in_gg(T92, T93) → U36_gg(T92, T93, greater64_in_gg(s(s(T92)), T93))
U36_gg(T92, T93, greater64_out_gg(s(s(T92)), T93)) → higher_valued107_out_gg(T92, T93)
U23_gga(T87, T88, T89, T91, higher_valued107_out_gg(T89, T87)) → max_valued3_out_gga(.(T87, T88), s(T89), T91)
U23_gga(T87, T88, T89, T91, higher_valued107_out_gg(T89, T87)) → U24_gga(T87, T88, T89, T91, max_valued3_in_gga(T88, s(T89), T91))
max_valued3_in_gga(.(T94, T95), T96, T98) → U25_gga(T94, T95, T96, T98, higher_valued112_in_gg(T96, T94))
higher_valued112_in_gg(T99, T100) → U37_gg(T99, T100, greater64_in_gg(s(T99), T100))
U37_gg(T99, T100, greater64_out_gg(s(T99), T100)) → higher_valued112_out_gg(T99, T100)
U25_gga(T94, T95, T96, T98, higher_valued112_out_gg(T96, T94)) → max_valued3_out_gga(.(T94, T95), T96, T98)
U25_gga(T94, T95, T96, T98, higher_valued112_out_gg(T96, T94)) → U26_gga(T94, T95, T96, T98, max_valued3_in_gga(T95, T96, T98))
max_valued3_in_gga(.(T101, T102), T103, T105) → U27_gga(T101, T102, T103, T105, higher_valued118_in_gg(T103, T101))
higher_valued118_in_gg(T106, T107) → U38_gg(T106, T107, greater64_in_gg(s(T106), T107))
U38_gg(T106, T107, greater64_out_gg(s(T106), T107)) → higher_valued118_out_gg(T106, T107)
U27_gga(T101, T102, T103, T105, higher_valued118_out_gg(T103, T101)) → max_valued3_out_gga(.(T101, T102), T103, T105)
U27_gga(T101, T102, T103, T105, higher_valued118_out_gg(T103, T101)) → U28_gga(T101, T102, T103, T105, max_valued3_in_gga(T102, T103, T105))
U28_gga(T101, T102, T103, T105, max_valued3_out_gga(T102, T103, T105)) → max_valued3_out_gga(.(T101, T102), T103, T105)
U26_gga(T94, T95, T96, T98, max_valued3_out_gga(T95, T96, T98)) → max_valued3_out_gga(.(T94, T95), T96, T98)
U24_gga(T87, T88, T89, T91, max_valued3_out_gga(T88, s(T89), T91)) → max_valued3_out_gga(.(T87, T88), s(T89), T91)
U22_gga(T80, T81, T82, T84, max_valued3_out_gga(T81, s(s(T82)), T84)) → max_valued3_out_gga(.(s(T80), T81), s(s(T82)), T84)
U20_gga(T73, T74, T75, T77, max_valued3_out_gga(T74, s(s(s(T75))), T77)) → max_valued3_out_gga(.(s(s(T73)), T74), s(s(s(T75))), T77)
U18_gga(T66, T67, T68, T70, max_valued3_out_gga(T67, s(s(s(s(T68)))), T70)) → max_valued3_out_gga(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70)
U16_gga(T59, T60, T61, T63, max_valued3_out_gga(T60, s(s(s(s(s(T61))))), T63)) → max_valued3_out_gga(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63)
U14_gga(T52, T53, T54, T56, max_valued3_out_gga(T53, s(s(s(s(s(s(T54)))))), T56)) → max_valued3_out_gga(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56)
U2_gaa(T18, T9, T12, max_valued3_out_gga(T9, s(T18), T12)) → max_valued3_out_gaa(.(s(T18), T9), s(0), T12)
max_valued3_in_gaa(.(s(s(T21)), T9), s(s(0)), T12) → U3_gaa(T21, T9, T12, max_valued3_in_gga(T9, s(s(T21)), T12))
U3_gaa(T21, T9, T12, max_valued3_out_gga(T9, s(s(T21)), T12)) → max_valued3_out_gaa(.(s(s(T21)), T9), s(s(0)), T12)
max_valued3_in_gaa(.(s(s(s(T24))), T9), s(s(s(0))), T12) → U4_gaa(T24, T9, T12, max_valued3_in_gga(T9, s(s(s(T24))), T12))
U4_gaa(T24, T9, T12, max_valued3_out_gga(T9, s(s(s(T24))), T12)) → max_valued3_out_gaa(.(s(s(s(T24))), T9), s(s(s(0))), T12)
max_valued3_in_gaa(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12) → U5_gaa(T27, T9, T12, max_valued3_in_gga(T9, s(s(s(s(T27)))), T12))
U5_gaa(T27, T9, T12, max_valued3_out_gga(T9, s(s(s(s(T27)))), T12)) → max_valued3_out_gaa(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12)
max_valued3_in_gaa(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12) → U6_gaa(T30, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(T30))))), T12))
U6_gaa(T30, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(T30))))), T12)) → max_valued3_out_gaa(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12)
max_valued3_in_gaa(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12) → U7_gaa(T33, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(T33)))))), T12))
U7_gaa(T33, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(T33)))))), T12)) → max_valued3_out_gaa(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12)
max_valued3_in_gaa(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12) → U8_gaa(T36, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(s(T36))))))), T12))
U8_gaa(T36, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(s(T36))))))), T12)) → max_valued3_out_gaa(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12)
max_valued3_in_gaa(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12) → U9_gaa(T37, T9, T38, T12, greater64_in_ga(T37, T38))
greater64_in_ga(s(T40), 0) → greater64_out_ga(s(T40), 0)
greater64_in_ga(s(T41), s(T42)) → U29_ga(T41, T42, greater64_in_ga(T41, T42))
U29_ga(T41, T42, greater64_out_ga(T41, T42)) → greater64_out_ga(s(T41), s(T42))
U9_gaa(T37, T9, T38, T12, greater64_out_ga(T37, T38)) → max_valued3_out_gaa(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12)
U9_gaa(T37, T9, T38, T12, greater64_out_ga(T37, T38)) → U10_gaa(T37, T9, T38, T12, max_valued3_in_gaa(T9, s(T39), T12))
max_valued3_in_gaa(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47) → U11_gaa(T43, T44, T45, T47, higher_valued77_in_ag(T48, T43))
U11_gaa(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → max_valued3_out_gaa(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47)
U11_gaa(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → U12_gaa(T43, T44, T45, T47, max_valued3_in_gaa(T44, s(T49), T47))
max_valued3_in_gaa(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56) → U13_gaa(T52, T53, T54, T56, higher_valued82_in_ag(T54, T52))
higher_valued82_in_ag(T57, T58) → U31_ag(T57, T58, greater64_in_ag(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58)))))))
U31_ag(T57, T58, greater64_out_ag(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58))))))) → higher_valued82_out_ag(T57, T58)
U13_gaa(T52, T53, T54, T56, higher_valued82_out_ag(T54, T52)) → max_valued3_out_gaa(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56)
U13_gaa(T52, T53, T54, T56, higher_valued82_out_ag(T54, T52)) → U14_gaa(T52, T53, T54, T56, max_valued3_in_gaa(T53, s(s(s(s(s(s(T54)))))), T56))
max_valued3_in_gaa(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63) → U15_gaa(T59, T60, T61, T63, higher_valued87_in_ag(T61, T59))
higher_valued87_in_ag(T64, T65) → U32_ag(T64, T65, greater64_in_ag(s(s(s(s(s(s(T64)))))), s(s(s(s(T65))))))
U32_ag(T64, T65, greater64_out_ag(s(s(s(s(s(s(T64)))))), s(s(s(s(T65)))))) → higher_valued87_out_ag(T64, T65)
U15_gaa(T59, T60, T61, T63, higher_valued87_out_ag(T61, T59)) → max_valued3_out_gaa(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63)
U15_gaa(T59, T60, T61, T63, higher_valued87_out_ag(T61, T59)) → U16_gaa(T59, T60, T61, T63, max_valued3_in_gaa(T60, s(s(s(s(s(T61))))), T63))
max_valued3_in_gaa(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70) → U17_gaa(T66, T67, T68, T70, higher_valued92_in_ag(T68, T66))
higher_valued92_in_ag(T71, T72) → U33_ag(T71, T72, greater64_in_ag(s(s(s(s(s(T71))))), s(s(s(T72)))))
U33_ag(T71, T72, greater64_out_ag(s(s(s(s(s(T71))))), s(s(s(T72))))) → higher_valued92_out_ag(T71, T72)
U17_gaa(T66, T67, T68, T70, higher_valued92_out_ag(T68, T66)) → max_valued3_out_gaa(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70)
U17_gaa(T66, T67, T68, T70, higher_valued92_out_ag(T68, T66)) → U18_gaa(T66, T67, T68, T70, max_valued3_in_gaa(T67, s(s(s(s(T68)))), T70))
max_valued3_in_gaa(.(s(s(T73)), T74), s(s(s(T75))), T77) → U19_gaa(T73, T74, T75, T77, higher_valued97_in_ag(T75, T73))
higher_valued97_in_ag(T78, T79) → U34_ag(T78, T79, greater64_in_ag(s(s(s(s(T78)))), s(s(T79))))
U34_ag(T78, T79, greater64_out_ag(s(s(s(s(T78)))), s(s(T79)))) → higher_valued97_out_ag(T78, T79)
U19_gaa(T73, T74, T75, T77, higher_valued97_out_ag(T75, T73)) → max_valued3_out_gaa(.(s(s(T73)), T74), s(s(s(T75))), T77)
U19_gaa(T73, T74, T75, T77, higher_valued97_out_ag(T75, T73)) → U20_gaa(T73, T74, T75, T77, max_valued3_in_gaa(T74, s(s(s(T75))), T77))
max_valued3_in_gaa(.(s(T80), T81), s(s(T82)), T84) → U21_gaa(T80, T81, T82, T84, higher_valued102_in_ag(T82, T80))
higher_valued102_in_ag(T85, T86) → U35_ag(T85, T86, greater64_in_ag(s(s(s(T85))), s(T86)))
U35_ag(T85, T86, greater64_out_ag(s(s(s(T85))), s(T86))) → higher_valued102_out_ag(T85, T86)
U21_gaa(T80, T81, T82, T84, higher_valued102_out_ag(T82, T80)) → max_valued3_out_gaa(.(s(T80), T81), s(s(T82)), T84)
U21_gaa(T80, T81, T82, T84, higher_valued102_out_ag(T82, T80)) → U22_gaa(T80, T81, T82, T84, max_valued3_in_gaa(T81, s(s(T82)), T84))
max_valued3_in_gaa(.(T87, T88), s(T89), T91) → U23_gaa(T87, T88, T89, T91, higher_valued107_in_ag(T89, T87))
higher_valued107_in_ag(T92, T93) → U36_ag(T92, T93, greater64_in_ag(s(s(T92)), T93))
U36_ag(T92, T93, greater64_out_ag(s(s(T92)), T93)) → higher_valued107_out_ag(T92, T93)
U23_gaa(T87, T88, T89, T91, higher_valued107_out_ag(T89, T87)) → max_valued3_out_gaa(.(T87, T88), s(T89), T91)
U23_gaa(T87, T88, T89, T91, higher_valued107_out_ag(T89, T87)) → U24_gaa(T87, T88, T89, T91, max_valued3_in_gaa(T88, s(T89), T91))
max_valued3_in_gaa(.(T94, T95), T96, T98) → U25_gaa(T94, T95, T96, T98, higher_valued112_in_ag(T96, T94))
higher_valued112_in_ag(T99, T100) → U37_ag(T99, T100, greater64_in_ag(s(T99), T100))
U37_ag(T99, T100, greater64_out_ag(s(T99), T100)) → higher_valued112_out_ag(T99, T100)
U25_gaa(T94, T95, T96, T98, higher_valued112_out_ag(T96, T94)) → max_valued3_out_gaa(.(T94, T95), T96, T98)
U25_gaa(T94, T95, T96, T98, higher_valued112_out_ag(T96, T94)) → U26_gaa(T94, T95, T96, T98, max_valued3_in_gaa(T95, T96, T98))
max_valued3_in_gaa(.(T101, T102), T103, T105) → U27_gaa(T101, T102, T103, T105, higher_valued118_in_ag(T103, T101))
higher_valued118_in_ag(T106, T107) → U38_ag(T106, T107, greater64_in_ag(s(T106), T107))
U38_ag(T106, T107, greater64_out_ag(s(T106), T107)) → higher_valued118_out_ag(T106, T107)
U27_gaa(T101, T102, T103, T105, higher_valued118_out_ag(T103, T101)) → max_valued3_out_gaa(.(T101, T102), T103, T105)
U27_gaa(T101, T102, T103, T105, higher_valued118_out_ag(T103, T101)) → U28_gaa(T101, T102, T103, T105, max_valued3_in_gaa(T102, T103, T105))
U28_gaa(T101, T102, T103, T105, max_valued3_out_gaa(T102, T103, T105)) → max_valued3_out_gaa(.(T101, T102), T103, T105)
U26_gaa(T94, T95, T96, T98, max_valued3_out_gaa(T95, T96, T98)) → max_valued3_out_gaa(.(T94, T95), T96, T98)
U24_gaa(T87, T88, T89, T91, max_valued3_out_gaa(T88, s(T89), T91)) → max_valued3_out_gaa(.(T87, T88), s(T89), T91)
U22_gaa(T80, T81, T82, T84, max_valued3_out_gaa(T81, s(s(T82)), T84)) → max_valued3_out_gaa(.(s(T80), T81), s(s(T82)), T84)
U20_gaa(T73, T74, T75, T77, max_valued3_out_gaa(T74, s(s(s(T75))), T77)) → max_valued3_out_gaa(.(s(s(T73)), T74), s(s(s(T75))), T77)
U18_gaa(T66, T67, T68, T70, max_valued3_out_gaa(T67, s(s(s(s(T68)))), T70)) → max_valued3_out_gaa(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70)
U16_gaa(T59, T60, T61, T63, max_valued3_out_gaa(T60, s(s(s(s(s(T61))))), T63)) → max_valued3_out_gaa(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63)
U14_gaa(T52, T53, T54, T56, max_valued3_out_gaa(T53, s(s(s(s(s(s(T54)))))), T56)) → max_valued3_out_gaa(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56)
U12_gaa(T43, T44, T45, T47, max_valued3_out_gaa(T44, s(T49), T47)) → max_valued3_out_gaa(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47)
U10_gaa(T37, T9, T38, T12, max_valued3_out_gaa(T9, s(T39), T12)) → max_valued3_out_gaa(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12)
U12_gga(T43, T44, T45, T47, max_valued3_out_gaa(T44, s(T49), T47)) → max_valued3_out_gga(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47)
U1_gaa(T15, T9, T12, max_valued3_out_gga(T9, T15, T12)) → max_valued3_out_gaa(.(T15, T9), 0, T12)
U10_gga(T37, T9, T38, T12, max_valued3_out_gaa(T9, s(T39), T12)) → max_valued3_out_gga(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12)
U8_gga(T36, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(s(T36))))))), T12)) → max_valued3_out_gga(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12)
U7_gga(T33, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(T33)))))), T12)) → max_valued3_out_gga(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12)
U6_gga(T30, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(T30))))), T12)) → max_valued3_out_gga(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12)
U5_gga(T27, T9, T12, max_valued3_out_gga(T9, s(s(s(s(T27)))), T12)) → max_valued3_out_gga(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12)
U4_gga(T24, T9, T12, max_valued3_out_gga(T9, s(s(s(T24))), T12)) → max_valued3_out_gga(.(s(s(s(T24))), T9), s(s(s(0))), T12)
U3_gga(T21, T9, T12, max_valued3_out_gga(T9, s(s(T21)), T12)) → max_valued3_out_gga(.(s(s(T21)), T9), s(s(0)), T12)
U2_gga(T18, T9, T12, max_valued3_out_gga(T9, s(T18), T12)) → max_valued3_out_gga(.(s(T18), T9), s(0), T12)
U1_gga(T15, T9, T12, max_valued3_out_gga(T9, T15, T12)) → max_valued3_out_gga(.(T15, T9), 0, T12)
U39_ga(T15, T9, T12, max_valued3_out_gga(T9, T15, T12)) → max_valued1_out_ga(.(0, .(T15, T9)), T12)
max_valued1_in_ga(.(s(0), .(s(T18), T9)), T12) → U40_ga(T18, T9, T12, max_valued3_in_gga(T9, s(T18), T12))
U40_ga(T18, T9, T12, max_valued3_out_gga(T9, s(T18), T12)) → max_valued1_out_ga(.(s(0), .(s(T18), T9)), T12)
max_valued1_in_ga(.(s(s(0)), .(s(s(T21)), T9)), T12) → U41_ga(T21, T9, T12, max_valued3_in_gga(T9, s(s(T21)), T12))
U41_ga(T21, T9, T12, max_valued3_out_gga(T9, s(s(T21)), T12)) → max_valued1_out_ga(.(s(s(0)), .(s(s(T21)), T9)), T12)
max_valued1_in_ga(.(s(s(s(0))), .(s(s(s(T24))), T9)), T12) → U42_ga(T24, T9, T12, max_valued3_in_gga(T9, s(s(s(T24))), T12))
U42_ga(T24, T9, T12, max_valued3_out_gga(T9, s(s(s(T24))), T12)) → max_valued1_out_ga(.(s(s(s(0))), .(s(s(s(T24))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(0)))), .(s(s(s(s(T27)))), T9)), T12) → U43_ga(T27, T9, T12, max_valued3_in_gga(T9, s(s(s(s(T27)))), T12))
U43_ga(T27, T9, T12, max_valued3_out_gga(T9, s(s(s(s(T27)))), T12)) → max_valued1_out_ga(.(s(s(s(s(0)))), .(s(s(s(s(T27)))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(0))))), .(s(s(s(s(s(T30))))), T9)), T12) → U44_ga(T30, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(T30))))), T12))
U44_ga(T30, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(T30))))), T12)) → max_valued1_out_ga(.(s(s(s(s(s(0))))), .(s(s(s(s(s(T30))))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(s(0)))))), .(s(s(s(s(s(s(T33)))))), T9)), T12) → U45_ga(T33, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(T33)))))), T12))
U45_ga(T33, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(T33)))))), T12)) → max_valued1_out_ga(.(s(s(s(s(s(s(0)))))), .(s(s(s(s(s(s(T33)))))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(s(s(0))))))), .(s(s(s(s(s(s(s(T36))))))), T9)), T12) → U46_ga(T36, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(s(T36))))))), T12))
U46_ga(T36, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(s(T36))))))), T12)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(0))))))), .(s(s(s(s(s(s(s(T36))))))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(s(s(s(T38)))))))), .(s(s(s(s(s(s(s(T37))))))), T9)), T12) → U47_ga(T38, T37, T9, T12, greater64_in_gg(T37, T38))
U47_ga(T38, T37, T9, T12, greater64_out_gg(T37, T38)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(s(T38)))))))), .(s(s(s(s(s(s(s(T37))))))), T9)), T12)
U47_ga(T38, T37, T9, T12, greater64_out_gg(T37, T38)) → U48_ga(T38, T37, T9, T12, max_valued3_in_gaa(T9, s(T39), T12))
U48_ga(T38, T37, T9, T12, max_valued3_out_gaa(T9, s(T39), T12)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(s(T38)))))))), .(s(s(s(s(s(s(s(T37))))))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(s(s(T45))))))), .(s(s(s(s(s(s(T43)))))), T44)), T47) → U49_ga(T45, T43, T44, T47, higher_valued77_in_ag(T48, T43))
U49_ga(T45, T43, T44, T47, higher_valued77_out_ag(T48, T43)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(T45))))))), .(s(s(s(s(s(s(T43)))))), T44)), T47)
U49_ga(T45, T43, T44, T47, higher_valued77_out_ag(T48, T43)) → U50_ga(T45, T43, T44, T47, max_valued3_in_gaa(T44, s(T49), T47))
U50_ga(T45, T43, T44, T47, max_valued3_out_gaa(T44, s(T49), T47)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(T45))))))), .(s(s(s(s(s(s(T43)))))), T44)), T47)
max_valued1_in_ga(.(s(s(s(s(s(s(T54)))))), .(s(s(s(s(s(T52))))), T53)), T56) → U51_ga(T54, T52, T53, T56, higher_valued82_in_gg(T54, T52))
U51_ga(T54, T52, T53, T56, higher_valued82_out_gg(T54, T52)) → max_valued1_out_ga(.(s(s(s(s(s(s(T54)))))), .(s(s(s(s(s(T52))))), T53)), T56)
U51_ga(T54, T52, T53, T56, higher_valued82_out_gg(T54, T52)) → U52_ga(T54, T52, T53, T56, max_valued3_in_gga(T53, s(s(s(s(s(s(T54)))))), T56))
U52_ga(T54, T52, T53, T56, max_valued3_out_gga(T53, s(s(s(s(s(s(T54)))))), T56)) → max_valued1_out_ga(.(s(s(s(s(s(s(T54)))))), .(s(s(s(s(s(T52))))), T53)), T56)
max_valued1_in_ga(.(s(s(s(s(s(T61))))), .(s(s(s(s(T59)))), T60)), T63) → U53_ga(T61, T59, T60, T63, higher_valued87_in_gg(T61, T59))
U53_ga(T61, T59, T60, T63, higher_valued87_out_gg(T61, T59)) → max_valued1_out_ga(.(s(s(s(s(s(T61))))), .(s(s(s(s(T59)))), T60)), T63)
U53_ga(T61, T59, T60, T63, higher_valued87_out_gg(T61, T59)) → U54_ga(T61, T59, T60, T63, max_valued3_in_gga(T60, s(s(s(s(s(T61))))), T63))
U54_ga(T61, T59, T60, T63, max_valued3_out_gga(T60, s(s(s(s(s(T61))))), T63)) → max_valued1_out_ga(.(s(s(s(s(s(T61))))), .(s(s(s(s(T59)))), T60)), T63)
max_valued1_in_ga(.(s(s(s(s(T68)))), .(s(s(s(T66))), T67)), T70) → U55_ga(T68, T66, T67, T70, higher_valued92_in_gg(T68, T66))
U55_ga(T68, T66, T67, T70, higher_valued92_out_gg(T68, T66)) → max_valued1_out_ga(.(s(s(s(s(T68)))), .(s(s(s(T66))), T67)), T70)
U55_ga(T68, T66, T67, T70, higher_valued92_out_gg(T68, T66)) → U56_ga(T68, T66, T67, T70, max_valued3_in_gga(T67, s(s(s(s(T68)))), T70))
U56_ga(T68, T66, T67, T70, max_valued3_out_gga(T67, s(s(s(s(T68)))), T70)) → max_valued1_out_ga(.(s(s(s(s(T68)))), .(s(s(s(T66))), T67)), T70)
max_valued1_in_ga(.(s(s(s(T75))), .(s(s(T73)), T74)), T77) → U57_ga(T75, T73, T74, T77, higher_valued97_in_gg(T75, T73))
U57_ga(T75, T73, T74, T77, higher_valued97_out_gg(T75, T73)) → max_valued1_out_ga(.(s(s(s(T75))), .(s(s(T73)), T74)), T77)
U57_ga(T75, T73, T74, T77, higher_valued97_out_gg(T75, T73)) → U58_ga(T75, T73, T74, T77, max_valued3_in_gga(T74, s(s(s(T75))), T77))
U58_ga(T75, T73, T74, T77, max_valued3_out_gga(T74, s(s(s(T75))), T77)) → max_valued1_out_ga(.(s(s(s(T75))), .(s(s(T73)), T74)), T77)
max_valued1_in_ga(.(s(s(T82)), .(s(T80), T81)), T84) → U59_ga(T82, T80, T81, T84, higher_valued102_in_gg(T82, T80))
U59_ga(T82, T80, T81, T84, higher_valued102_out_gg(T82, T80)) → max_valued1_out_ga(.(s(s(T82)), .(s(T80), T81)), T84)
U59_ga(T82, T80, T81, T84, higher_valued102_out_gg(T82, T80)) → U60_ga(T82, T80, T81, T84, max_valued3_in_gga(T81, s(s(T82)), T84))
U60_ga(T82, T80, T81, T84, max_valued3_out_gga(T81, s(s(T82)), T84)) → max_valued1_out_ga(.(s(s(T82)), .(s(T80), T81)), T84)
max_valued1_in_ga(.(s(T89), .(T87, T88)), T91) → U61_ga(T89, T87, T88, T91, higher_valued107_in_gg(T89, T87))
U61_ga(T89, T87, T88, T91, higher_valued107_out_gg(T89, T87)) → max_valued1_out_ga(.(s(T89), .(T87, T88)), T91)
U61_ga(T89, T87, T88, T91, higher_valued107_out_gg(T89, T87)) → U62_ga(T89, T87, T88, T91, max_valued3_in_gga(T88, s(T89), T91))
U62_ga(T89, T87, T88, T91, max_valued3_out_gga(T88, s(T89), T91)) → max_valued1_out_ga(.(s(T89), .(T87, T88)), T91)
max_valued1_in_ga(.(T96, .(T94, T95)), T98) → U63_ga(T96, T94, T95, T98, higher_valued112_in_gg(T96, T94))
U63_ga(T96, T94, T95, T98, higher_valued112_out_gg(T96, T94)) → max_valued1_out_ga(.(T96, .(T94, T95)), T98)
U63_ga(T96, T94, T95, T98, higher_valued112_out_gg(T96, T94)) → U64_ga(T96, T94, T95, T98, max_valued3_in_gga(T95, T96, T98))
U64_ga(T96, T94, T95, T98, max_valued3_out_gga(T95, T96, T98)) → max_valued1_out_ga(.(T96, .(T94, T95)), T98)
max_valued1_in_ga(.(T103, .(T101, T102)), T105) → U65_ga(T103, T101, T102, T105, higher_valued118_in_gg(T103, T101))
U65_ga(T103, T101, T102, T105, higher_valued118_out_gg(T103, T101)) → max_valued1_out_ga(.(T103, .(T101, T102)), T105)
U65_ga(T103, T101, T102, T105, higher_valued118_out_gg(T103, T101)) → U66_ga(T103, T101, T102, T105, max_valued3_in_gga(T102, T103, T105))
U66_ga(T103, T101, T102, T105, max_valued3_out_gga(T102, T103, T105)) → max_valued1_out_ga(.(T103, .(T101, T102)), T105)
Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog
max_valued1_in_ga(.(T7, []), T7) → max_valued1_out_ga(.(T7, []), T7)
max_valued1_in_ga(.(0, .(T15, T9)), T12) → U39_ga(T15, T9, T12, max_valued3_in_gga(T9, T15, T12))
max_valued3_in_gga([], T7, T7) → max_valued3_out_gga([], T7, T7)
max_valued3_in_gga(.(T15, T9), 0, T12) → U1_gga(T15, T9, T12, max_valued3_in_gga(T9, T15, T12))
max_valued3_in_gga(.(s(T18), T9), s(0), T12) → U2_gga(T18, T9, T12, max_valued3_in_gga(T9, s(T18), T12))
max_valued3_in_gga(.(s(s(T21)), T9), s(s(0)), T12) → U3_gga(T21, T9, T12, max_valued3_in_gga(T9, s(s(T21)), T12))
max_valued3_in_gga(.(s(s(s(T24))), T9), s(s(s(0))), T12) → U4_gga(T24, T9, T12, max_valued3_in_gga(T9, s(s(s(T24))), T12))
max_valued3_in_gga(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12) → U5_gga(T27, T9, T12, max_valued3_in_gga(T9, s(s(s(s(T27)))), T12))
max_valued3_in_gga(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12) → U6_gga(T30, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(T30))))), T12))
max_valued3_in_gga(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12) → U7_gga(T33, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(T33)))))), T12))
max_valued3_in_gga(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12) → U8_gga(T36, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(s(T36))))))), T12))
max_valued3_in_gga(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12) → U9_gga(T37, T9, T38, T12, greater64_in_gg(T37, T38))
greater64_in_gg(s(T40), 0) → greater64_out_gg(s(T40), 0)
greater64_in_gg(s(T41), s(T42)) → U29_gg(T41, T42, greater64_in_gg(T41, T42))
U29_gg(T41, T42, greater64_out_gg(T41, T42)) → greater64_out_gg(s(T41), s(T42))
U9_gga(T37, T9, T38, T12, greater64_out_gg(T37, T38)) → max_valued3_out_gga(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12)
U9_gga(T37, T9, T38, T12, greater64_out_gg(T37, T38)) → U10_gga(T37, T9, T38, T12, max_valued3_in_gaa(T9, s(T39), T12))
max_valued3_in_gaa([], T7, T7) → max_valued3_out_gaa([], T7, T7)
max_valued3_in_gaa(.(T15, T9), 0, T12) → U1_gaa(T15, T9, T12, max_valued3_in_gga(T9, T15, T12))
max_valued3_in_gga(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47) → U11_gga(T43, T44, T45, T47, higher_valued77_in_ag(T48, T43))
higher_valued77_in_ag(T50, T51) → U30_ag(T50, T51, greater64_in_ag(s(s(T50)), s(s(s(s(s(s(T51))))))))
greater64_in_ag(s(T40), 0) → greater64_out_ag(s(T40), 0)
greater64_in_ag(s(T41), s(T42)) → U29_ag(T41, T42, greater64_in_ag(T41, T42))
U29_ag(T41, T42, greater64_out_ag(T41, T42)) → greater64_out_ag(s(T41), s(T42))
U30_ag(T50, T51, greater64_out_ag(s(s(T50)), s(s(s(s(s(s(T51)))))))) → higher_valued77_out_ag(T50, T51)
U11_gga(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → max_valued3_out_gga(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47)
U11_gga(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → U12_gga(T43, T44, T45, T47, max_valued3_in_gaa(T44, s(T49), T47))
max_valued3_in_gaa(.(s(T18), T9), s(0), T12) → U2_gaa(T18, T9, T12, max_valued3_in_gga(T9, s(T18), T12))
max_valued3_in_gga(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56) → U13_gga(T52, T53, T54, T56, higher_valued82_in_gg(T54, T52))
higher_valued82_in_gg(T57, T58) → U31_gg(T57, T58, greater64_in_gg(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58)))))))
U31_gg(T57, T58, greater64_out_gg(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58))))))) → higher_valued82_out_gg(T57, T58)
U13_gga(T52, T53, T54, T56, higher_valued82_out_gg(T54, T52)) → max_valued3_out_gga(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56)
U13_gga(T52, T53, T54, T56, higher_valued82_out_gg(T54, T52)) → U14_gga(T52, T53, T54, T56, max_valued3_in_gga(T53, s(s(s(s(s(s(T54)))))), T56))
max_valued3_in_gga(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63) → U15_gga(T59, T60, T61, T63, higher_valued87_in_gg(T61, T59))
higher_valued87_in_gg(T64, T65) → U32_gg(T64, T65, greater64_in_gg(s(s(s(s(s(s(T64)))))), s(s(s(s(T65))))))
U32_gg(T64, T65, greater64_out_gg(s(s(s(s(s(s(T64)))))), s(s(s(s(T65)))))) → higher_valued87_out_gg(T64, T65)
U15_gga(T59, T60, T61, T63, higher_valued87_out_gg(T61, T59)) → max_valued3_out_gga(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63)
U15_gga(T59, T60, T61, T63, higher_valued87_out_gg(T61, T59)) → U16_gga(T59, T60, T61, T63, max_valued3_in_gga(T60, s(s(s(s(s(T61))))), T63))
max_valued3_in_gga(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70) → U17_gga(T66, T67, T68, T70, higher_valued92_in_gg(T68, T66))
higher_valued92_in_gg(T71, T72) → U33_gg(T71, T72, greater64_in_gg(s(s(s(s(s(T71))))), s(s(s(T72)))))
U33_gg(T71, T72, greater64_out_gg(s(s(s(s(s(T71))))), s(s(s(T72))))) → higher_valued92_out_gg(T71, T72)
U17_gga(T66, T67, T68, T70, higher_valued92_out_gg(T68, T66)) → max_valued3_out_gga(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70)
U17_gga(T66, T67, T68, T70, higher_valued92_out_gg(T68, T66)) → U18_gga(T66, T67, T68, T70, max_valued3_in_gga(T67, s(s(s(s(T68)))), T70))
max_valued3_in_gga(.(s(s(T73)), T74), s(s(s(T75))), T77) → U19_gga(T73, T74, T75, T77, higher_valued97_in_gg(T75, T73))
higher_valued97_in_gg(T78, T79) → U34_gg(T78, T79, greater64_in_gg(s(s(s(s(T78)))), s(s(T79))))
U34_gg(T78, T79, greater64_out_gg(s(s(s(s(T78)))), s(s(T79)))) → higher_valued97_out_gg(T78, T79)
U19_gga(T73, T74, T75, T77, higher_valued97_out_gg(T75, T73)) → max_valued3_out_gga(.(s(s(T73)), T74), s(s(s(T75))), T77)
U19_gga(T73, T74, T75, T77, higher_valued97_out_gg(T75, T73)) → U20_gga(T73, T74, T75, T77, max_valued3_in_gga(T74, s(s(s(T75))), T77))
max_valued3_in_gga(.(s(T80), T81), s(s(T82)), T84) → U21_gga(T80, T81, T82, T84, higher_valued102_in_gg(T82, T80))
higher_valued102_in_gg(T85, T86) → U35_gg(T85, T86, greater64_in_gg(s(s(s(T85))), s(T86)))
U35_gg(T85, T86, greater64_out_gg(s(s(s(T85))), s(T86))) → higher_valued102_out_gg(T85, T86)
U21_gga(T80, T81, T82, T84, higher_valued102_out_gg(T82, T80)) → max_valued3_out_gga(.(s(T80), T81), s(s(T82)), T84)
U21_gga(T80, T81, T82, T84, higher_valued102_out_gg(T82, T80)) → U22_gga(T80, T81, T82, T84, max_valued3_in_gga(T81, s(s(T82)), T84))
max_valued3_in_gga(.(T87, T88), s(T89), T91) → U23_gga(T87, T88, T89, T91, higher_valued107_in_gg(T89, T87))
higher_valued107_in_gg(T92, T93) → U36_gg(T92, T93, greater64_in_gg(s(s(T92)), T93))
U36_gg(T92, T93, greater64_out_gg(s(s(T92)), T93)) → higher_valued107_out_gg(T92, T93)
U23_gga(T87, T88, T89, T91, higher_valued107_out_gg(T89, T87)) → max_valued3_out_gga(.(T87, T88), s(T89), T91)
U23_gga(T87, T88, T89, T91, higher_valued107_out_gg(T89, T87)) → U24_gga(T87, T88, T89, T91, max_valued3_in_gga(T88, s(T89), T91))
max_valued3_in_gga(.(T94, T95), T96, T98) → U25_gga(T94, T95, T96, T98, higher_valued112_in_gg(T96, T94))
higher_valued112_in_gg(T99, T100) → U37_gg(T99, T100, greater64_in_gg(s(T99), T100))
U37_gg(T99, T100, greater64_out_gg(s(T99), T100)) → higher_valued112_out_gg(T99, T100)
U25_gga(T94, T95, T96, T98, higher_valued112_out_gg(T96, T94)) → max_valued3_out_gga(.(T94, T95), T96, T98)
U25_gga(T94, T95, T96, T98, higher_valued112_out_gg(T96, T94)) → U26_gga(T94, T95, T96, T98, max_valued3_in_gga(T95, T96, T98))
max_valued3_in_gga(.(T101, T102), T103, T105) → U27_gga(T101, T102, T103, T105, higher_valued118_in_gg(T103, T101))
higher_valued118_in_gg(T106, T107) → U38_gg(T106, T107, greater64_in_gg(s(T106), T107))
U38_gg(T106, T107, greater64_out_gg(s(T106), T107)) → higher_valued118_out_gg(T106, T107)
U27_gga(T101, T102, T103, T105, higher_valued118_out_gg(T103, T101)) → max_valued3_out_gga(.(T101, T102), T103, T105)
U27_gga(T101, T102, T103, T105, higher_valued118_out_gg(T103, T101)) → U28_gga(T101, T102, T103, T105, max_valued3_in_gga(T102, T103, T105))
U28_gga(T101, T102, T103, T105, max_valued3_out_gga(T102, T103, T105)) → max_valued3_out_gga(.(T101, T102), T103, T105)
U26_gga(T94, T95, T96, T98, max_valued3_out_gga(T95, T96, T98)) → max_valued3_out_gga(.(T94, T95), T96, T98)
U24_gga(T87, T88, T89, T91, max_valued3_out_gga(T88, s(T89), T91)) → max_valued3_out_gga(.(T87, T88), s(T89), T91)
U22_gga(T80, T81, T82, T84, max_valued3_out_gga(T81, s(s(T82)), T84)) → max_valued3_out_gga(.(s(T80), T81), s(s(T82)), T84)
U20_gga(T73, T74, T75, T77, max_valued3_out_gga(T74, s(s(s(T75))), T77)) → max_valued3_out_gga(.(s(s(T73)), T74), s(s(s(T75))), T77)
U18_gga(T66, T67, T68, T70, max_valued3_out_gga(T67, s(s(s(s(T68)))), T70)) → max_valued3_out_gga(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70)
U16_gga(T59, T60, T61, T63, max_valued3_out_gga(T60, s(s(s(s(s(T61))))), T63)) → max_valued3_out_gga(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63)
U14_gga(T52, T53, T54, T56, max_valued3_out_gga(T53, s(s(s(s(s(s(T54)))))), T56)) → max_valued3_out_gga(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56)
U2_gaa(T18, T9, T12, max_valued3_out_gga(T9, s(T18), T12)) → max_valued3_out_gaa(.(s(T18), T9), s(0), T12)
max_valued3_in_gaa(.(s(s(T21)), T9), s(s(0)), T12) → U3_gaa(T21, T9, T12, max_valued3_in_gga(T9, s(s(T21)), T12))
U3_gaa(T21, T9, T12, max_valued3_out_gga(T9, s(s(T21)), T12)) → max_valued3_out_gaa(.(s(s(T21)), T9), s(s(0)), T12)
max_valued3_in_gaa(.(s(s(s(T24))), T9), s(s(s(0))), T12) → U4_gaa(T24, T9, T12, max_valued3_in_gga(T9, s(s(s(T24))), T12))
U4_gaa(T24, T9, T12, max_valued3_out_gga(T9, s(s(s(T24))), T12)) → max_valued3_out_gaa(.(s(s(s(T24))), T9), s(s(s(0))), T12)
max_valued3_in_gaa(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12) → U5_gaa(T27, T9, T12, max_valued3_in_gga(T9, s(s(s(s(T27)))), T12))
U5_gaa(T27, T9, T12, max_valued3_out_gga(T9, s(s(s(s(T27)))), T12)) → max_valued3_out_gaa(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12)
max_valued3_in_gaa(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12) → U6_gaa(T30, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(T30))))), T12))
U6_gaa(T30, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(T30))))), T12)) → max_valued3_out_gaa(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12)
max_valued3_in_gaa(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12) → U7_gaa(T33, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(T33)))))), T12))
U7_gaa(T33, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(T33)))))), T12)) → max_valued3_out_gaa(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12)
max_valued3_in_gaa(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12) → U8_gaa(T36, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(s(T36))))))), T12))
U8_gaa(T36, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(s(T36))))))), T12)) → max_valued3_out_gaa(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12)
max_valued3_in_gaa(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12) → U9_gaa(T37, T9, T38, T12, greater64_in_ga(T37, T38))
greater64_in_ga(s(T40), 0) → greater64_out_ga(s(T40), 0)
greater64_in_ga(s(T41), s(T42)) → U29_ga(T41, T42, greater64_in_ga(T41, T42))
U29_ga(T41, T42, greater64_out_ga(T41, T42)) → greater64_out_ga(s(T41), s(T42))
U9_gaa(T37, T9, T38, T12, greater64_out_ga(T37, T38)) → max_valued3_out_gaa(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12)
U9_gaa(T37, T9, T38, T12, greater64_out_ga(T37, T38)) → U10_gaa(T37, T9, T38, T12, max_valued3_in_gaa(T9, s(T39), T12))
max_valued3_in_gaa(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47) → U11_gaa(T43, T44, T45, T47, higher_valued77_in_ag(T48, T43))
U11_gaa(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → max_valued3_out_gaa(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47)
U11_gaa(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → U12_gaa(T43, T44, T45, T47, max_valued3_in_gaa(T44, s(T49), T47))
max_valued3_in_gaa(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56) → U13_gaa(T52, T53, T54, T56, higher_valued82_in_ag(T54, T52))
higher_valued82_in_ag(T57, T58) → U31_ag(T57, T58, greater64_in_ag(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58)))))))
U31_ag(T57, T58, greater64_out_ag(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58))))))) → higher_valued82_out_ag(T57, T58)
U13_gaa(T52, T53, T54, T56, higher_valued82_out_ag(T54, T52)) → max_valued3_out_gaa(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56)
U13_gaa(T52, T53, T54, T56, higher_valued82_out_ag(T54, T52)) → U14_gaa(T52, T53, T54, T56, max_valued3_in_gaa(T53, s(s(s(s(s(s(T54)))))), T56))
max_valued3_in_gaa(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63) → U15_gaa(T59, T60, T61, T63, higher_valued87_in_ag(T61, T59))
higher_valued87_in_ag(T64, T65) → U32_ag(T64, T65, greater64_in_ag(s(s(s(s(s(s(T64)))))), s(s(s(s(T65))))))
U32_ag(T64, T65, greater64_out_ag(s(s(s(s(s(s(T64)))))), s(s(s(s(T65)))))) → higher_valued87_out_ag(T64, T65)
U15_gaa(T59, T60, T61, T63, higher_valued87_out_ag(T61, T59)) → max_valued3_out_gaa(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63)
U15_gaa(T59, T60, T61, T63, higher_valued87_out_ag(T61, T59)) → U16_gaa(T59, T60, T61, T63, max_valued3_in_gaa(T60, s(s(s(s(s(T61))))), T63))
max_valued3_in_gaa(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70) → U17_gaa(T66, T67, T68, T70, higher_valued92_in_ag(T68, T66))
higher_valued92_in_ag(T71, T72) → U33_ag(T71, T72, greater64_in_ag(s(s(s(s(s(T71))))), s(s(s(T72)))))
U33_ag(T71, T72, greater64_out_ag(s(s(s(s(s(T71))))), s(s(s(T72))))) → higher_valued92_out_ag(T71, T72)
U17_gaa(T66, T67, T68, T70, higher_valued92_out_ag(T68, T66)) → max_valued3_out_gaa(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70)
U17_gaa(T66, T67, T68, T70, higher_valued92_out_ag(T68, T66)) → U18_gaa(T66, T67, T68, T70, max_valued3_in_gaa(T67, s(s(s(s(T68)))), T70))
max_valued3_in_gaa(.(s(s(T73)), T74), s(s(s(T75))), T77) → U19_gaa(T73, T74, T75, T77, higher_valued97_in_ag(T75, T73))
higher_valued97_in_ag(T78, T79) → U34_ag(T78, T79, greater64_in_ag(s(s(s(s(T78)))), s(s(T79))))
U34_ag(T78, T79, greater64_out_ag(s(s(s(s(T78)))), s(s(T79)))) → higher_valued97_out_ag(T78, T79)
U19_gaa(T73, T74, T75, T77, higher_valued97_out_ag(T75, T73)) → max_valued3_out_gaa(.(s(s(T73)), T74), s(s(s(T75))), T77)
U19_gaa(T73, T74, T75, T77, higher_valued97_out_ag(T75, T73)) → U20_gaa(T73, T74, T75, T77, max_valued3_in_gaa(T74, s(s(s(T75))), T77))
max_valued3_in_gaa(.(s(T80), T81), s(s(T82)), T84) → U21_gaa(T80, T81, T82, T84, higher_valued102_in_ag(T82, T80))
higher_valued102_in_ag(T85, T86) → U35_ag(T85, T86, greater64_in_ag(s(s(s(T85))), s(T86)))
U35_ag(T85, T86, greater64_out_ag(s(s(s(T85))), s(T86))) → higher_valued102_out_ag(T85, T86)
U21_gaa(T80, T81, T82, T84, higher_valued102_out_ag(T82, T80)) → max_valued3_out_gaa(.(s(T80), T81), s(s(T82)), T84)
U21_gaa(T80, T81, T82, T84, higher_valued102_out_ag(T82, T80)) → U22_gaa(T80, T81, T82, T84, max_valued3_in_gaa(T81, s(s(T82)), T84))
max_valued3_in_gaa(.(T87, T88), s(T89), T91) → U23_gaa(T87, T88, T89, T91, higher_valued107_in_ag(T89, T87))
higher_valued107_in_ag(T92, T93) → U36_ag(T92, T93, greater64_in_ag(s(s(T92)), T93))
U36_ag(T92, T93, greater64_out_ag(s(s(T92)), T93)) → higher_valued107_out_ag(T92, T93)
U23_gaa(T87, T88, T89, T91, higher_valued107_out_ag(T89, T87)) → max_valued3_out_gaa(.(T87, T88), s(T89), T91)
U23_gaa(T87, T88, T89, T91, higher_valued107_out_ag(T89, T87)) → U24_gaa(T87, T88, T89, T91, max_valued3_in_gaa(T88, s(T89), T91))
max_valued3_in_gaa(.(T94, T95), T96, T98) → U25_gaa(T94, T95, T96, T98, higher_valued112_in_ag(T96, T94))
higher_valued112_in_ag(T99, T100) → U37_ag(T99, T100, greater64_in_ag(s(T99), T100))
U37_ag(T99, T100, greater64_out_ag(s(T99), T100)) → higher_valued112_out_ag(T99, T100)
U25_gaa(T94, T95, T96, T98, higher_valued112_out_ag(T96, T94)) → max_valued3_out_gaa(.(T94, T95), T96, T98)
U25_gaa(T94, T95, T96, T98, higher_valued112_out_ag(T96, T94)) → U26_gaa(T94, T95, T96, T98, max_valued3_in_gaa(T95, T96, T98))
max_valued3_in_gaa(.(T101, T102), T103, T105) → U27_gaa(T101, T102, T103, T105, higher_valued118_in_ag(T103, T101))
higher_valued118_in_ag(T106, T107) → U38_ag(T106, T107, greater64_in_ag(s(T106), T107))
U38_ag(T106, T107, greater64_out_ag(s(T106), T107)) → higher_valued118_out_ag(T106, T107)
U27_gaa(T101, T102, T103, T105, higher_valued118_out_ag(T103, T101)) → max_valued3_out_gaa(.(T101, T102), T103, T105)
U27_gaa(T101, T102, T103, T105, higher_valued118_out_ag(T103, T101)) → U28_gaa(T101, T102, T103, T105, max_valued3_in_gaa(T102, T103, T105))
U28_gaa(T101, T102, T103, T105, max_valued3_out_gaa(T102, T103, T105)) → max_valued3_out_gaa(.(T101, T102), T103, T105)
U26_gaa(T94, T95, T96, T98, max_valued3_out_gaa(T95, T96, T98)) → max_valued3_out_gaa(.(T94, T95), T96, T98)
U24_gaa(T87, T88, T89, T91, max_valued3_out_gaa(T88, s(T89), T91)) → max_valued3_out_gaa(.(T87, T88), s(T89), T91)
U22_gaa(T80, T81, T82, T84, max_valued3_out_gaa(T81, s(s(T82)), T84)) → max_valued3_out_gaa(.(s(T80), T81), s(s(T82)), T84)
U20_gaa(T73, T74, T75, T77, max_valued3_out_gaa(T74, s(s(s(T75))), T77)) → max_valued3_out_gaa(.(s(s(T73)), T74), s(s(s(T75))), T77)
U18_gaa(T66, T67, T68, T70, max_valued3_out_gaa(T67, s(s(s(s(T68)))), T70)) → max_valued3_out_gaa(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70)
U16_gaa(T59, T60, T61, T63, max_valued3_out_gaa(T60, s(s(s(s(s(T61))))), T63)) → max_valued3_out_gaa(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63)
U14_gaa(T52, T53, T54, T56, max_valued3_out_gaa(T53, s(s(s(s(s(s(T54)))))), T56)) → max_valued3_out_gaa(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56)
U12_gaa(T43, T44, T45, T47, max_valued3_out_gaa(T44, s(T49), T47)) → max_valued3_out_gaa(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47)
U10_gaa(T37, T9, T38, T12, max_valued3_out_gaa(T9, s(T39), T12)) → max_valued3_out_gaa(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12)
U12_gga(T43, T44, T45, T47, max_valued3_out_gaa(T44, s(T49), T47)) → max_valued3_out_gga(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47)
U1_gaa(T15, T9, T12, max_valued3_out_gga(T9, T15, T12)) → max_valued3_out_gaa(.(T15, T9), 0, T12)
U10_gga(T37, T9, T38, T12, max_valued3_out_gaa(T9, s(T39), T12)) → max_valued3_out_gga(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12)
U8_gga(T36, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(s(T36))))))), T12)) → max_valued3_out_gga(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12)
U7_gga(T33, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(T33)))))), T12)) → max_valued3_out_gga(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12)
U6_gga(T30, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(T30))))), T12)) → max_valued3_out_gga(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12)
U5_gga(T27, T9, T12, max_valued3_out_gga(T9, s(s(s(s(T27)))), T12)) → max_valued3_out_gga(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12)
U4_gga(T24, T9, T12, max_valued3_out_gga(T9, s(s(s(T24))), T12)) → max_valued3_out_gga(.(s(s(s(T24))), T9), s(s(s(0))), T12)
U3_gga(T21, T9, T12, max_valued3_out_gga(T9, s(s(T21)), T12)) → max_valued3_out_gga(.(s(s(T21)), T9), s(s(0)), T12)
U2_gga(T18, T9, T12, max_valued3_out_gga(T9, s(T18), T12)) → max_valued3_out_gga(.(s(T18), T9), s(0), T12)
U1_gga(T15, T9, T12, max_valued3_out_gga(T9, T15, T12)) → max_valued3_out_gga(.(T15, T9), 0, T12)
U39_ga(T15, T9, T12, max_valued3_out_gga(T9, T15, T12)) → max_valued1_out_ga(.(0, .(T15, T9)), T12)
max_valued1_in_ga(.(s(0), .(s(T18), T9)), T12) → U40_ga(T18, T9, T12, max_valued3_in_gga(T9, s(T18), T12))
U40_ga(T18, T9, T12, max_valued3_out_gga(T9, s(T18), T12)) → max_valued1_out_ga(.(s(0), .(s(T18), T9)), T12)
max_valued1_in_ga(.(s(s(0)), .(s(s(T21)), T9)), T12) → U41_ga(T21, T9, T12, max_valued3_in_gga(T9, s(s(T21)), T12))
U41_ga(T21, T9, T12, max_valued3_out_gga(T9, s(s(T21)), T12)) → max_valued1_out_ga(.(s(s(0)), .(s(s(T21)), T9)), T12)
max_valued1_in_ga(.(s(s(s(0))), .(s(s(s(T24))), T9)), T12) → U42_ga(T24, T9, T12, max_valued3_in_gga(T9, s(s(s(T24))), T12))
U42_ga(T24, T9, T12, max_valued3_out_gga(T9, s(s(s(T24))), T12)) → max_valued1_out_ga(.(s(s(s(0))), .(s(s(s(T24))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(0)))), .(s(s(s(s(T27)))), T9)), T12) → U43_ga(T27, T9, T12, max_valued3_in_gga(T9, s(s(s(s(T27)))), T12))
U43_ga(T27, T9, T12, max_valued3_out_gga(T9, s(s(s(s(T27)))), T12)) → max_valued1_out_ga(.(s(s(s(s(0)))), .(s(s(s(s(T27)))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(0))))), .(s(s(s(s(s(T30))))), T9)), T12) → U44_ga(T30, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(T30))))), T12))
U44_ga(T30, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(T30))))), T12)) → max_valued1_out_ga(.(s(s(s(s(s(0))))), .(s(s(s(s(s(T30))))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(s(0)))))), .(s(s(s(s(s(s(T33)))))), T9)), T12) → U45_ga(T33, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(T33)))))), T12))
U45_ga(T33, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(T33)))))), T12)) → max_valued1_out_ga(.(s(s(s(s(s(s(0)))))), .(s(s(s(s(s(s(T33)))))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(s(s(0))))))), .(s(s(s(s(s(s(s(T36))))))), T9)), T12) → U46_ga(T36, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(s(T36))))))), T12))
U46_ga(T36, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(s(T36))))))), T12)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(0))))))), .(s(s(s(s(s(s(s(T36))))))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(s(s(s(T38)))))))), .(s(s(s(s(s(s(s(T37))))))), T9)), T12) → U47_ga(T38, T37, T9, T12, greater64_in_gg(T37, T38))
U47_ga(T38, T37, T9, T12, greater64_out_gg(T37, T38)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(s(T38)))))))), .(s(s(s(s(s(s(s(T37))))))), T9)), T12)
U47_ga(T38, T37, T9, T12, greater64_out_gg(T37, T38)) → U48_ga(T38, T37, T9, T12, max_valued3_in_gaa(T9, s(T39), T12))
U48_ga(T38, T37, T9, T12, max_valued3_out_gaa(T9, s(T39), T12)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(s(T38)))))))), .(s(s(s(s(s(s(s(T37))))))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(s(s(T45))))))), .(s(s(s(s(s(s(T43)))))), T44)), T47) → U49_ga(T45, T43, T44, T47, higher_valued77_in_ag(T48, T43))
U49_ga(T45, T43, T44, T47, higher_valued77_out_ag(T48, T43)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(T45))))))), .(s(s(s(s(s(s(T43)))))), T44)), T47)
U49_ga(T45, T43, T44, T47, higher_valued77_out_ag(T48, T43)) → U50_ga(T45, T43, T44, T47, max_valued3_in_gaa(T44, s(T49), T47))
U50_ga(T45, T43, T44, T47, max_valued3_out_gaa(T44, s(T49), T47)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(T45))))))), .(s(s(s(s(s(s(T43)))))), T44)), T47)
max_valued1_in_ga(.(s(s(s(s(s(s(T54)))))), .(s(s(s(s(s(T52))))), T53)), T56) → U51_ga(T54, T52, T53, T56, higher_valued82_in_gg(T54, T52))
U51_ga(T54, T52, T53, T56, higher_valued82_out_gg(T54, T52)) → max_valued1_out_ga(.(s(s(s(s(s(s(T54)))))), .(s(s(s(s(s(T52))))), T53)), T56)
U51_ga(T54, T52, T53, T56, higher_valued82_out_gg(T54, T52)) → U52_ga(T54, T52, T53, T56, max_valued3_in_gga(T53, s(s(s(s(s(s(T54)))))), T56))
U52_ga(T54, T52, T53, T56, max_valued3_out_gga(T53, s(s(s(s(s(s(T54)))))), T56)) → max_valued1_out_ga(.(s(s(s(s(s(s(T54)))))), .(s(s(s(s(s(T52))))), T53)), T56)
max_valued1_in_ga(.(s(s(s(s(s(T61))))), .(s(s(s(s(T59)))), T60)), T63) → U53_ga(T61, T59, T60, T63, higher_valued87_in_gg(T61, T59))
U53_ga(T61, T59, T60, T63, higher_valued87_out_gg(T61, T59)) → max_valued1_out_ga(.(s(s(s(s(s(T61))))), .(s(s(s(s(T59)))), T60)), T63)
U53_ga(T61, T59, T60, T63, higher_valued87_out_gg(T61, T59)) → U54_ga(T61, T59, T60, T63, max_valued3_in_gga(T60, s(s(s(s(s(T61))))), T63))
U54_ga(T61, T59, T60, T63, max_valued3_out_gga(T60, s(s(s(s(s(T61))))), T63)) → max_valued1_out_ga(.(s(s(s(s(s(T61))))), .(s(s(s(s(T59)))), T60)), T63)
max_valued1_in_ga(.(s(s(s(s(T68)))), .(s(s(s(T66))), T67)), T70) → U55_ga(T68, T66, T67, T70, higher_valued92_in_gg(T68, T66))
U55_ga(T68, T66, T67, T70, higher_valued92_out_gg(T68, T66)) → max_valued1_out_ga(.(s(s(s(s(T68)))), .(s(s(s(T66))), T67)), T70)
U55_ga(T68, T66, T67, T70, higher_valued92_out_gg(T68, T66)) → U56_ga(T68, T66, T67, T70, max_valued3_in_gga(T67, s(s(s(s(T68)))), T70))
U56_ga(T68, T66, T67, T70, max_valued3_out_gga(T67, s(s(s(s(T68)))), T70)) → max_valued1_out_ga(.(s(s(s(s(T68)))), .(s(s(s(T66))), T67)), T70)
max_valued1_in_ga(.(s(s(s(T75))), .(s(s(T73)), T74)), T77) → U57_ga(T75, T73, T74, T77, higher_valued97_in_gg(T75, T73))
U57_ga(T75, T73, T74, T77, higher_valued97_out_gg(T75, T73)) → max_valued1_out_ga(.(s(s(s(T75))), .(s(s(T73)), T74)), T77)
U57_ga(T75, T73, T74, T77, higher_valued97_out_gg(T75, T73)) → U58_ga(T75, T73, T74, T77, max_valued3_in_gga(T74, s(s(s(T75))), T77))
U58_ga(T75, T73, T74, T77, max_valued3_out_gga(T74, s(s(s(T75))), T77)) → max_valued1_out_ga(.(s(s(s(T75))), .(s(s(T73)), T74)), T77)
max_valued1_in_ga(.(s(s(T82)), .(s(T80), T81)), T84) → U59_ga(T82, T80, T81, T84, higher_valued102_in_gg(T82, T80))
U59_ga(T82, T80, T81, T84, higher_valued102_out_gg(T82, T80)) → max_valued1_out_ga(.(s(s(T82)), .(s(T80), T81)), T84)
U59_ga(T82, T80, T81, T84, higher_valued102_out_gg(T82, T80)) → U60_ga(T82, T80, T81, T84, max_valued3_in_gga(T81, s(s(T82)), T84))
U60_ga(T82, T80, T81, T84, max_valued3_out_gga(T81, s(s(T82)), T84)) → max_valued1_out_ga(.(s(s(T82)), .(s(T80), T81)), T84)
max_valued1_in_ga(.(s(T89), .(T87, T88)), T91) → U61_ga(T89, T87, T88, T91, higher_valued107_in_gg(T89, T87))
U61_ga(T89, T87, T88, T91, higher_valued107_out_gg(T89, T87)) → max_valued1_out_ga(.(s(T89), .(T87, T88)), T91)
U61_ga(T89, T87, T88, T91, higher_valued107_out_gg(T89, T87)) → U62_ga(T89, T87, T88, T91, max_valued3_in_gga(T88, s(T89), T91))
U62_ga(T89, T87, T88, T91, max_valued3_out_gga(T88, s(T89), T91)) → max_valued1_out_ga(.(s(T89), .(T87, T88)), T91)
max_valued1_in_ga(.(T96, .(T94, T95)), T98) → U63_ga(T96, T94, T95, T98, higher_valued112_in_gg(T96, T94))
U63_ga(T96, T94, T95, T98, higher_valued112_out_gg(T96, T94)) → max_valued1_out_ga(.(T96, .(T94, T95)), T98)
U63_ga(T96, T94, T95, T98, higher_valued112_out_gg(T96, T94)) → U64_ga(T96, T94, T95, T98, max_valued3_in_gga(T95, T96, T98))
U64_ga(T96, T94, T95, T98, max_valued3_out_gga(T95, T96, T98)) → max_valued1_out_ga(.(T96, .(T94, T95)), T98)
max_valued1_in_ga(.(T103, .(T101, T102)), T105) → U65_ga(T103, T101, T102, T105, higher_valued118_in_gg(T103, T101))
U65_ga(T103, T101, T102, T105, higher_valued118_out_gg(T103, T101)) → max_valued1_out_ga(.(T103, .(T101, T102)), T105)
U65_ga(T103, T101, T102, T105, higher_valued118_out_gg(T103, T101)) → U66_ga(T103, T101, T102, T105, max_valued3_in_gga(T102, T103, T105))
U66_ga(T103, T101, T102, T105, max_valued3_out_gga(T102, T103, T105)) → max_valued1_out_ga(.(T103, .(T101, T102)), T105)
MAX_VALUED1_IN_GA(.(0, .(T15, T9)), T12) → U39_GA(T15, T9, T12, max_valued3_in_gga(T9, T15, T12))
MAX_VALUED1_IN_GA(.(0, .(T15, T9)), T12) → MAX_VALUED3_IN_GGA(T9, T15, T12)
MAX_VALUED3_IN_GGA(.(T15, T9), 0, T12) → U1_GGA(T15, T9, T12, max_valued3_in_gga(T9, T15, T12))
MAX_VALUED3_IN_GGA(.(T15, T9), 0, T12) → MAX_VALUED3_IN_GGA(T9, T15, T12)
MAX_VALUED3_IN_GGA(.(s(T18), T9), s(0), T12) → U2_GGA(T18, T9, T12, max_valued3_in_gga(T9, s(T18), T12))
MAX_VALUED3_IN_GGA(.(s(T18), T9), s(0), T12) → MAX_VALUED3_IN_GGA(T9, s(T18), T12)
MAX_VALUED3_IN_GGA(.(s(s(T21)), T9), s(s(0)), T12) → U3_GGA(T21, T9, T12, max_valued3_in_gga(T9, s(s(T21)), T12))
MAX_VALUED3_IN_GGA(.(s(s(T21)), T9), s(s(0)), T12) → MAX_VALUED3_IN_GGA(T9, s(s(T21)), T12)
MAX_VALUED3_IN_GGA(.(s(s(s(T24))), T9), s(s(s(0))), T12) → U4_GGA(T24, T9, T12, max_valued3_in_gga(T9, s(s(s(T24))), T12))
MAX_VALUED3_IN_GGA(.(s(s(s(T24))), T9), s(s(s(0))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(T24))), T12)
MAX_VALUED3_IN_GGA(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12) → U5_GGA(T27, T9, T12, max_valued3_in_gga(T9, s(s(s(s(T27)))), T12))
MAX_VALUED3_IN_GGA(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(T27)))), T12)
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12) → U6_GGA(T30, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(T30))))), T12))
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(T30))))), T12)
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12) → U7_GGA(T33, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(T33)))))), T12))
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(s(T33)))))), T12)
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12) → U8_GGA(T36, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(s(T36))))))), T12))
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(s(s(T36))))))), T12)
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12) → U9_GGA(T37, T9, T38, T12, greater64_in_gg(T37, T38))
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12) → GREATER64_IN_GG(T37, T38)
GREATER64_IN_GG(s(T41), s(T42)) → U29_GG(T41, T42, greater64_in_gg(T41, T42))
GREATER64_IN_GG(s(T41), s(T42)) → GREATER64_IN_GG(T41, T42)
U9_GGA(T37, T9, T38, T12, greater64_out_gg(T37, T38)) → U10_GGA(T37, T9, T38, T12, max_valued3_in_gaa(T9, s(T39), T12))
U9_GGA(T37, T9, T38, T12, greater64_out_gg(T37, T38)) → MAX_VALUED3_IN_GAA(T9, s(T39), T12)
MAX_VALUED3_IN_GAA(.(T15, T9), 0, T12) → U1_GAA(T15, T9, T12, max_valued3_in_gga(T9, T15, T12))
MAX_VALUED3_IN_GAA(.(T15, T9), 0, T12) → MAX_VALUED3_IN_GGA(T9, T15, T12)
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47) → U11_GGA(T43, T44, T45, T47, higher_valued77_in_ag(T48, T43))
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47) → HIGHER_VALUED77_IN_AG(T48, T43)
HIGHER_VALUED77_IN_AG(T50, T51) → U30_AG(T50, T51, greater64_in_ag(s(s(T50)), s(s(s(s(s(s(T51))))))))
HIGHER_VALUED77_IN_AG(T50, T51) → GREATER64_IN_AG(s(s(T50)), s(s(s(s(s(s(T51)))))))
GREATER64_IN_AG(s(T41), s(T42)) → U29_AG(T41, T42, greater64_in_ag(T41, T42))
GREATER64_IN_AG(s(T41), s(T42)) → GREATER64_IN_AG(T41, T42)
U11_GGA(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → U12_GGA(T43, T44, T45, T47, max_valued3_in_gaa(T44, s(T49), T47))
U11_GGA(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → MAX_VALUED3_IN_GAA(T44, s(T49), T47)
MAX_VALUED3_IN_GAA(.(s(T18), T9), s(0), T12) → U2_GAA(T18, T9, T12, max_valued3_in_gga(T9, s(T18), T12))
MAX_VALUED3_IN_GAA(.(s(T18), T9), s(0), T12) → MAX_VALUED3_IN_GGA(T9, s(T18), T12)
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56) → U13_GGA(T52, T53, T54, T56, higher_valued82_in_gg(T54, T52))
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56) → HIGHER_VALUED82_IN_GG(T54, T52)
HIGHER_VALUED82_IN_GG(T57, T58) → U31_GG(T57, T58, greater64_in_gg(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58)))))))
HIGHER_VALUED82_IN_GG(T57, T58) → GREATER64_IN_GG(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58))))))
U13_GGA(T52, T53, T54, T56, higher_valued82_out_gg(T54, T52)) → U14_GGA(T52, T53, T54, T56, max_valued3_in_gga(T53, s(s(s(s(s(s(T54)))))), T56))
U13_GGA(T52, T53, T54, T56, higher_valued82_out_gg(T54, T52)) → MAX_VALUED3_IN_GGA(T53, s(s(s(s(s(s(T54)))))), T56)
MAX_VALUED3_IN_GGA(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63) → U15_GGA(T59, T60, T61, T63, higher_valued87_in_gg(T61, T59))
MAX_VALUED3_IN_GGA(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63) → HIGHER_VALUED87_IN_GG(T61, T59)
HIGHER_VALUED87_IN_GG(T64, T65) → U32_GG(T64, T65, greater64_in_gg(s(s(s(s(s(s(T64)))))), s(s(s(s(T65))))))
HIGHER_VALUED87_IN_GG(T64, T65) → GREATER64_IN_GG(s(s(s(s(s(s(T64)))))), s(s(s(s(T65)))))
U15_GGA(T59, T60, T61, T63, higher_valued87_out_gg(T61, T59)) → U16_GGA(T59, T60, T61, T63, max_valued3_in_gga(T60, s(s(s(s(s(T61))))), T63))
U15_GGA(T59, T60, T61, T63, higher_valued87_out_gg(T61, T59)) → MAX_VALUED3_IN_GGA(T60, s(s(s(s(s(T61))))), T63)
MAX_VALUED3_IN_GGA(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70) → U17_GGA(T66, T67, T68, T70, higher_valued92_in_gg(T68, T66))
MAX_VALUED3_IN_GGA(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70) → HIGHER_VALUED92_IN_GG(T68, T66)
HIGHER_VALUED92_IN_GG(T71, T72) → U33_GG(T71, T72, greater64_in_gg(s(s(s(s(s(T71))))), s(s(s(T72)))))
HIGHER_VALUED92_IN_GG(T71, T72) → GREATER64_IN_GG(s(s(s(s(s(T71))))), s(s(s(T72))))
U17_GGA(T66, T67, T68, T70, higher_valued92_out_gg(T68, T66)) → U18_GGA(T66, T67, T68, T70, max_valued3_in_gga(T67, s(s(s(s(T68)))), T70))
U17_GGA(T66, T67, T68, T70, higher_valued92_out_gg(T68, T66)) → MAX_VALUED3_IN_GGA(T67, s(s(s(s(T68)))), T70)
MAX_VALUED3_IN_GGA(.(s(s(T73)), T74), s(s(s(T75))), T77) → U19_GGA(T73, T74, T75, T77, higher_valued97_in_gg(T75, T73))
MAX_VALUED3_IN_GGA(.(s(s(T73)), T74), s(s(s(T75))), T77) → HIGHER_VALUED97_IN_GG(T75, T73)
HIGHER_VALUED97_IN_GG(T78, T79) → U34_GG(T78, T79, greater64_in_gg(s(s(s(s(T78)))), s(s(T79))))
HIGHER_VALUED97_IN_GG(T78, T79) → GREATER64_IN_GG(s(s(s(s(T78)))), s(s(T79)))
U19_GGA(T73, T74, T75, T77, higher_valued97_out_gg(T75, T73)) → U20_GGA(T73, T74, T75, T77, max_valued3_in_gga(T74, s(s(s(T75))), T77))
U19_GGA(T73, T74, T75, T77, higher_valued97_out_gg(T75, T73)) → MAX_VALUED3_IN_GGA(T74, s(s(s(T75))), T77)
MAX_VALUED3_IN_GGA(.(s(T80), T81), s(s(T82)), T84) → U21_GGA(T80, T81, T82, T84, higher_valued102_in_gg(T82, T80))
MAX_VALUED3_IN_GGA(.(s(T80), T81), s(s(T82)), T84) → HIGHER_VALUED102_IN_GG(T82, T80)
HIGHER_VALUED102_IN_GG(T85, T86) → U35_GG(T85, T86, greater64_in_gg(s(s(s(T85))), s(T86)))
HIGHER_VALUED102_IN_GG(T85, T86) → GREATER64_IN_GG(s(s(s(T85))), s(T86))
U21_GGA(T80, T81, T82, T84, higher_valued102_out_gg(T82, T80)) → U22_GGA(T80, T81, T82, T84, max_valued3_in_gga(T81, s(s(T82)), T84))
U21_GGA(T80, T81, T82, T84, higher_valued102_out_gg(T82, T80)) → MAX_VALUED3_IN_GGA(T81, s(s(T82)), T84)
MAX_VALUED3_IN_GGA(.(T87, T88), s(T89), T91) → U23_GGA(T87, T88, T89, T91, higher_valued107_in_gg(T89, T87))
MAX_VALUED3_IN_GGA(.(T87, T88), s(T89), T91) → HIGHER_VALUED107_IN_GG(T89, T87)
HIGHER_VALUED107_IN_GG(T92, T93) → U36_GG(T92, T93, greater64_in_gg(s(s(T92)), T93))
HIGHER_VALUED107_IN_GG(T92, T93) → GREATER64_IN_GG(s(s(T92)), T93)
U23_GGA(T87, T88, T89, T91, higher_valued107_out_gg(T89, T87)) → U24_GGA(T87, T88, T89, T91, max_valued3_in_gga(T88, s(T89), T91))
U23_GGA(T87, T88, T89, T91, higher_valued107_out_gg(T89, T87)) → MAX_VALUED3_IN_GGA(T88, s(T89), T91)
MAX_VALUED3_IN_GGA(.(T94, T95), T96, T98) → U25_GGA(T94, T95, T96, T98, higher_valued112_in_gg(T96, T94))
MAX_VALUED3_IN_GGA(.(T94, T95), T96, T98) → HIGHER_VALUED112_IN_GG(T96, T94)
HIGHER_VALUED112_IN_GG(T99, T100) → U37_GG(T99, T100, greater64_in_gg(s(T99), T100))
HIGHER_VALUED112_IN_GG(T99, T100) → GREATER64_IN_GG(s(T99), T100)
U25_GGA(T94, T95, T96, T98, higher_valued112_out_gg(T96, T94)) → U26_GGA(T94, T95, T96, T98, max_valued3_in_gga(T95, T96, T98))
U25_GGA(T94, T95, T96, T98, higher_valued112_out_gg(T96, T94)) → MAX_VALUED3_IN_GGA(T95, T96, T98)
MAX_VALUED3_IN_GGA(.(T101, T102), T103, T105) → U27_GGA(T101, T102, T103, T105, higher_valued118_in_gg(T103, T101))
MAX_VALUED3_IN_GGA(.(T101, T102), T103, T105) → HIGHER_VALUED118_IN_GG(T103, T101)
HIGHER_VALUED118_IN_GG(T106, T107) → U38_GG(T106, T107, greater64_in_gg(s(T106), T107))
HIGHER_VALUED118_IN_GG(T106, T107) → GREATER64_IN_GG(s(T106), T107)
U27_GGA(T101, T102, T103, T105, higher_valued118_out_gg(T103, T101)) → U28_GGA(T101, T102, T103, T105, max_valued3_in_gga(T102, T103, T105))
U27_GGA(T101, T102, T103, T105, higher_valued118_out_gg(T103, T101)) → MAX_VALUED3_IN_GGA(T102, T103, T105)
MAX_VALUED3_IN_GAA(.(s(s(T21)), T9), s(s(0)), T12) → U3_GAA(T21, T9, T12, max_valued3_in_gga(T9, s(s(T21)), T12))
MAX_VALUED3_IN_GAA(.(s(s(T21)), T9), s(s(0)), T12) → MAX_VALUED3_IN_GGA(T9, s(s(T21)), T12)
MAX_VALUED3_IN_GAA(.(s(s(s(T24))), T9), s(s(s(0))), T12) → U4_GAA(T24, T9, T12, max_valued3_in_gga(T9, s(s(s(T24))), T12))
MAX_VALUED3_IN_GAA(.(s(s(s(T24))), T9), s(s(s(0))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(T24))), T12)
MAX_VALUED3_IN_GAA(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12) → U5_GAA(T27, T9, T12, max_valued3_in_gga(T9, s(s(s(s(T27)))), T12))
MAX_VALUED3_IN_GAA(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(T27)))), T12)
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12) → U6_GAA(T30, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(T30))))), T12))
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(T30))))), T12)
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12) → U7_GAA(T33, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(T33)))))), T12))
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(s(T33)))))), T12)
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12) → U8_GAA(T36, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(s(T36))))))), T12))
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(s(s(T36))))))), T12)
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12) → U9_GAA(T37, T9, T38, T12, greater64_in_ga(T37, T38))
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12) → GREATER64_IN_GA(T37, T38)
GREATER64_IN_GA(s(T41), s(T42)) → U29_GA(T41, T42, greater64_in_ga(T41, T42))
GREATER64_IN_GA(s(T41), s(T42)) → GREATER64_IN_GA(T41, T42)
U9_GAA(T37, T9, T38, T12, greater64_out_ga(T37, T38)) → U10_GAA(T37, T9, T38, T12, max_valued3_in_gaa(T9, s(T39), T12))
U9_GAA(T37, T9, T38, T12, greater64_out_ga(T37, T38)) → MAX_VALUED3_IN_GAA(T9, s(T39), T12)
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47) → U11_GAA(T43, T44, T45, T47, higher_valued77_in_ag(T48, T43))
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47) → HIGHER_VALUED77_IN_AG(T48, T43)
U11_GAA(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → U12_GAA(T43, T44, T45, T47, max_valued3_in_gaa(T44, s(T49), T47))
U11_GAA(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → MAX_VALUED3_IN_GAA(T44, s(T49), T47)
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56) → U13_GAA(T52, T53, T54, T56, higher_valued82_in_ag(T54, T52))
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56) → HIGHER_VALUED82_IN_AG(T54, T52)
HIGHER_VALUED82_IN_AG(T57, T58) → U31_AG(T57, T58, greater64_in_ag(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58)))))))
HIGHER_VALUED82_IN_AG(T57, T58) → GREATER64_IN_AG(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58))))))
U13_GAA(T52, T53, T54, T56, higher_valued82_out_ag(T54, T52)) → U14_GAA(T52, T53, T54, T56, max_valued3_in_gaa(T53, s(s(s(s(s(s(T54)))))), T56))
U13_GAA(T52, T53, T54, T56, higher_valued82_out_ag(T54, T52)) → MAX_VALUED3_IN_GAA(T53, s(s(s(s(s(s(T54)))))), T56)
MAX_VALUED3_IN_GAA(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63) → U15_GAA(T59, T60, T61, T63, higher_valued87_in_ag(T61, T59))
MAX_VALUED3_IN_GAA(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63) → HIGHER_VALUED87_IN_AG(T61, T59)
HIGHER_VALUED87_IN_AG(T64, T65) → U32_AG(T64, T65, greater64_in_ag(s(s(s(s(s(s(T64)))))), s(s(s(s(T65))))))
HIGHER_VALUED87_IN_AG(T64, T65) → GREATER64_IN_AG(s(s(s(s(s(s(T64)))))), s(s(s(s(T65)))))
U15_GAA(T59, T60, T61, T63, higher_valued87_out_ag(T61, T59)) → U16_GAA(T59, T60, T61, T63, max_valued3_in_gaa(T60, s(s(s(s(s(T61))))), T63))
U15_GAA(T59, T60, T61, T63, higher_valued87_out_ag(T61, T59)) → MAX_VALUED3_IN_GAA(T60, s(s(s(s(s(T61))))), T63)
MAX_VALUED3_IN_GAA(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70) → U17_GAA(T66, T67, T68, T70, higher_valued92_in_ag(T68, T66))
MAX_VALUED3_IN_GAA(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70) → HIGHER_VALUED92_IN_AG(T68, T66)
HIGHER_VALUED92_IN_AG(T71, T72) → U33_AG(T71, T72, greater64_in_ag(s(s(s(s(s(T71))))), s(s(s(T72)))))
HIGHER_VALUED92_IN_AG(T71, T72) → GREATER64_IN_AG(s(s(s(s(s(T71))))), s(s(s(T72))))
U17_GAA(T66, T67, T68, T70, higher_valued92_out_ag(T68, T66)) → U18_GAA(T66, T67, T68, T70, max_valued3_in_gaa(T67, s(s(s(s(T68)))), T70))
U17_GAA(T66, T67, T68, T70, higher_valued92_out_ag(T68, T66)) → MAX_VALUED3_IN_GAA(T67, s(s(s(s(T68)))), T70)
MAX_VALUED3_IN_GAA(.(s(s(T73)), T74), s(s(s(T75))), T77) → U19_GAA(T73, T74, T75, T77, higher_valued97_in_ag(T75, T73))
MAX_VALUED3_IN_GAA(.(s(s(T73)), T74), s(s(s(T75))), T77) → HIGHER_VALUED97_IN_AG(T75, T73)
HIGHER_VALUED97_IN_AG(T78, T79) → U34_AG(T78, T79, greater64_in_ag(s(s(s(s(T78)))), s(s(T79))))
HIGHER_VALUED97_IN_AG(T78, T79) → GREATER64_IN_AG(s(s(s(s(T78)))), s(s(T79)))
U19_GAA(T73, T74, T75, T77, higher_valued97_out_ag(T75, T73)) → U20_GAA(T73, T74, T75, T77, max_valued3_in_gaa(T74, s(s(s(T75))), T77))
U19_GAA(T73, T74, T75, T77, higher_valued97_out_ag(T75, T73)) → MAX_VALUED3_IN_GAA(T74, s(s(s(T75))), T77)
MAX_VALUED3_IN_GAA(.(s(T80), T81), s(s(T82)), T84) → U21_GAA(T80, T81, T82, T84, higher_valued102_in_ag(T82, T80))
MAX_VALUED3_IN_GAA(.(s(T80), T81), s(s(T82)), T84) → HIGHER_VALUED102_IN_AG(T82, T80)
HIGHER_VALUED102_IN_AG(T85, T86) → U35_AG(T85, T86, greater64_in_ag(s(s(s(T85))), s(T86)))
HIGHER_VALUED102_IN_AG(T85, T86) → GREATER64_IN_AG(s(s(s(T85))), s(T86))
U21_GAA(T80, T81, T82, T84, higher_valued102_out_ag(T82, T80)) → U22_GAA(T80, T81, T82, T84, max_valued3_in_gaa(T81, s(s(T82)), T84))
U21_GAA(T80, T81, T82, T84, higher_valued102_out_ag(T82, T80)) → MAX_VALUED3_IN_GAA(T81, s(s(T82)), T84)
MAX_VALUED3_IN_GAA(.(T87, T88), s(T89), T91) → U23_GAA(T87, T88, T89, T91, higher_valued107_in_ag(T89, T87))
MAX_VALUED3_IN_GAA(.(T87, T88), s(T89), T91) → HIGHER_VALUED107_IN_AG(T89, T87)
HIGHER_VALUED107_IN_AG(T92, T93) → U36_AG(T92, T93, greater64_in_ag(s(s(T92)), T93))
HIGHER_VALUED107_IN_AG(T92, T93) → GREATER64_IN_AG(s(s(T92)), T93)
U23_GAA(T87, T88, T89, T91, higher_valued107_out_ag(T89, T87)) → U24_GAA(T87, T88, T89, T91, max_valued3_in_gaa(T88, s(T89), T91))
U23_GAA(T87, T88, T89, T91, higher_valued107_out_ag(T89, T87)) → MAX_VALUED3_IN_GAA(T88, s(T89), T91)
MAX_VALUED3_IN_GAA(.(T94, T95), T96, T98) → U25_GAA(T94, T95, T96, T98, higher_valued112_in_ag(T96, T94))
MAX_VALUED3_IN_GAA(.(T94, T95), T96, T98) → HIGHER_VALUED112_IN_AG(T96, T94)
HIGHER_VALUED112_IN_AG(T99, T100) → U37_AG(T99, T100, greater64_in_ag(s(T99), T100))
HIGHER_VALUED112_IN_AG(T99, T100) → GREATER64_IN_AG(s(T99), T100)
U25_GAA(T94, T95, T96, T98, higher_valued112_out_ag(T96, T94)) → U26_GAA(T94, T95, T96, T98, max_valued3_in_gaa(T95, T96, T98))
U25_GAA(T94, T95, T96, T98, higher_valued112_out_ag(T96, T94)) → MAX_VALUED3_IN_GAA(T95, T96, T98)
MAX_VALUED3_IN_GAA(.(T101, T102), T103, T105) → U27_GAA(T101, T102, T103, T105, higher_valued118_in_ag(T103, T101))
MAX_VALUED3_IN_GAA(.(T101, T102), T103, T105) → HIGHER_VALUED118_IN_AG(T103, T101)
HIGHER_VALUED118_IN_AG(T106, T107) → U38_AG(T106, T107, greater64_in_ag(s(T106), T107))
HIGHER_VALUED118_IN_AG(T106, T107) → GREATER64_IN_AG(s(T106), T107)
U27_GAA(T101, T102, T103, T105, higher_valued118_out_ag(T103, T101)) → U28_GAA(T101, T102, T103, T105, max_valued3_in_gaa(T102, T103, T105))
U27_GAA(T101, T102, T103, T105, higher_valued118_out_ag(T103, T101)) → MAX_VALUED3_IN_GAA(T102, T103, T105)
MAX_VALUED1_IN_GA(.(s(0), .(s(T18), T9)), T12) → U40_GA(T18, T9, T12, max_valued3_in_gga(T9, s(T18), T12))
MAX_VALUED1_IN_GA(.(s(0), .(s(T18), T9)), T12) → MAX_VALUED3_IN_GGA(T9, s(T18), T12)
MAX_VALUED1_IN_GA(.(s(s(0)), .(s(s(T21)), T9)), T12) → U41_GA(T21, T9, T12, max_valued3_in_gga(T9, s(s(T21)), T12))
MAX_VALUED1_IN_GA(.(s(s(0)), .(s(s(T21)), T9)), T12) → MAX_VALUED3_IN_GGA(T9, s(s(T21)), T12)
MAX_VALUED1_IN_GA(.(s(s(s(0))), .(s(s(s(T24))), T9)), T12) → U42_GA(T24, T9, T12, max_valued3_in_gga(T9, s(s(s(T24))), T12))
MAX_VALUED1_IN_GA(.(s(s(s(0))), .(s(s(s(T24))), T9)), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(T24))), T12)
MAX_VALUED1_IN_GA(.(s(s(s(s(0)))), .(s(s(s(s(T27)))), T9)), T12) → U43_GA(T27, T9, T12, max_valued3_in_gga(T9, s(s(s(s(T27)))), T12))
MAX_VALUED1_IN_GA(.(s(s(s(s(0)))), .(s(s(s(s(T27)))), T9)), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(T27)))), T12)
MAX_VALUED1_IN_GA(.(s(s(s(s(s(0))))), .(s(s(s(s(s(T30))))), T9)), T12) → U44_GA(T30, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(T30))))), T12))
MAX_VALUED1_IN_GA(.(s(s(s(s(s(0))))), .(s(s(s(s(s(T30))))), T9)), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(T30))))), T12)
MAX_VALUED1_IN_GA(.(s(s(s(s(s(s(0)))))), .(s(s(s(s(s(s(T33)))))), T9)), T12) → U45_GA(T33, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(T33)))))), T12))
MAX_VALUED1_IN_GA(.(s(s(s(s(s(s(0)))))), .(s(s(s(s(s(s(T33)))))), T9)), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(s(T33)))))), T12)
MAX_VALUED1_IN_GA(.(s(s(s(s(s(s(s(0))))))), .(s(s(s(s(s(s(s(T36))))))), T9)), T12) → U46_GA(T36, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(s(T36))))))), T12))
MAX_VALUED1_IN_GA(.(s(s(s(s(s(s(s(0))))))), .(s(s(s(s(s(s(s(T36))))))), T9)), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(s(s(T36))))))), T12)
MAX_VALUED1_IN_GA(.(s(s(s(s(s(s(s(s(T38)))))))), .(s(s(s(s(s(s(s(T37))))))), T9)), T12) → U47_GA(T38, T37, T9, T12, greater64_in_gg(T37, T38))
MAX_VALUED1_IN_GA(.(s(s(s(s(s(s(s(s(T38)))))))), .(s(s(s(s(s(s(s(T37))))))), T9)), T12) → GREATER64_IN_GG(T37, T38)
U47_GA(T38, T37, T9, T12, greater64_out_gg(T37, T38)) → U48_GA(T38, T37, T9, T12, max_valued3_in_gaa(T9, s(T39), T12))
U47_GA(T38, T37, T9, T12, greater64_out_gg(T37, T38)) → MAX_VALUED3_IN_GAA(T9, s(T39), T12)
MAX_VALUED1_IN_GA(.(s(s(s(s(s(s(s(T45))))))), .(s(s(s(s(s(s(T43)))))), T44)), T47) → U49_GA(T45, T43, T44, T47, higher_valued77_in_ag(T48, T43))
MAX_VALUED1_IN_GA(.(s(s(s(s(s(s(s(T45))))))), .(s(s(s(s(s(s(T43)))))), T44)), T47) → HIGHER_VALUED77_IN_AG(T48, T43)
U49_GA(T45, T43, T44, T47, higher_valued77_out_ag(T48, T43)) → U50_GA(T45, T43, T44, T47, max_valued3_in_gaa(T44, s(T49), T47))
U49_GA(T45, T43, T44, T47, higher_valued77_out_ag(T48, T43)) → MAX_VALUED3_IN_GAA(T44, s(T49), T47)
MAX_VALUED1_IN_GA(.(s(s(s(s(s(s(T54)))))), .(s(s(s(s(s(T52))))), T53)), T56) → U51_GA(T54, T52, T53, T56, higher_valued82_in_gg(T54, T52))
MAX_VALUED1_IN_GA(.(s(s(s(s(s(s(T54)))))), .(s(s(s(s(s(T52))))), T53)), T56) → HIGHER_VALUED82_IN_GG(T54, T52)
U51_GA(T54, T52, T53, T56, higher_valued82_out_gg(T54, T52)) → U52_GA(T54, T52, T53, T56, max_valued3_in_gga(T53, s(s(s(s(s(s(T54)))))), T56))
U51_GA(T54, T52, T53, T56, higher_valued82_out_gg(T54, T52)) → MAX_VALUED3_IN_GGA(T53, s(s(s(s(s(s(T54)))))), T56)
MAX_VALUED1_IN_GA(.(s(s(s(s(s(T61))))), .(s(s(s(s(T59)))), T60)), T63) → U53_GA(T61, T59, T60, T63, higher_valued87_in_gg(T61, T59))
MAX_VALUED1_IN_GA(.(s(s(s(s(s(T61))))), .(s(s(s(s(T59)))), T60)), T63) → HIGHER_VALUED87_IN_GG(T61, T59)
U53_GA(T61, T59, T60, T63, higher_valued87_out_gg(T61, T59)) → U54_GA(T61, T59, T60, T63, max_valued3_in_gga(T60, s(s(s(s(s(T61))))), T63))
U53_GA(T61, T59, T60, T63, higher_valued87_out_gg(T61, T59)) → MAX_VALUED3_IN_GGA(T60, s(s(s(s(s(T61))))), T63)
MAX_VALUED1_IN_GA(.(s(s(s(s(T68)))), .(s(s(s(T66))), T67)), T70) → U55_GA(T68, T66, T67, T70, higher_valued92_in_gg(T68, T66))
MAX_VALUED1_IN_GA(.(s(s(s(s(T68)))), .(s(s(s(T66))), T67)), T70) → HIGHER_VALUED92_IN_GG(T68, T66)
U55_GA(T68, T66, T67, T70, higher_valued92_out_gg(T68, T66)) → U56_GA(T68, T66, T67, T70, max_valued3_in_gga(T67, s(s(s(s(T68)))), T70))
U55_GA(T68, T66, T67, T70, higher_valued92_out_gg(T68, T66)) → MAX_VALUED3_IN_GGA(T67, s(s(s(s(T68)))), T70)
MAX_VALUED1_IN_GA(.(s(s(s(T75))), .(s(s(T73)), T74)), T77) → U57_GA(T75, T73, T74, T77, higher_valued97_in_gg(T75, T73))
MAX_VALUED1_IN_GA(.(s(s(s(T75))), .(s(s(T73)), T74)), T77) → HIGHER_VALUED97_IN_GG(T75, T73)
U57_GA(T75, T73, T74, T77, higher_valued97_out_gg(T75, T73)) → U58_GA(T75, T73, T74, T77, max_valued3_in_gga(T74, s(s(s(T75))), T77))
U57_GA(T75, T73, T74, T77, higher_valued97_out_gg(T75, T73)) → MAX_VALUED3_IN_GGA(T74, s(s(s(T75))), T77)
MAX_VALUED1_IN_GA(.(s(s(T82)), .(s(T80), T81)), T84) → U59_GA(T82, T80, T81, T84, higher_valued102_in_gg(T82, T80))
MAX_VALUED1_IN_GA(.(s(s(T82)), .(s(T80), T81)), T84) → HIGHER_VALUED102_IN_GG(T82, T80)
U59_GA(T82, T80, T81, T84, higher_valued102_out_gg(T82, T80)) → U60_GA(T82, T80, T81, T84, max_valued3_in_gga(T81, s(s(T82)), T84))
U59_GA(T82, T80, T81, T84, higher_valued102_out_gg(T82, T80)) → MAX_VALUED3_IN_GGA(T81, s(s(T82)), T84)
MAX_VALUED1_IN_GA(.(s(T89), .(T87, T88)), T91) → U61_GA(T89, T87, T88, T91, higher_valued107_in_gg(T89, T87))
MAX_VALUED1_IN_GA(.(s(T89), .(T87, T88)), T91) → HIGHER_VALUED107_IN_GG(T89, T87)
U61_GA(T89, T87, T88, T91, higher_valued107_out_gg(T89, T87)) → U62_GA(T89, T87, T88, T91, max_valued3_in_gga(T88, s(T89), T91))
U61_GA(T89, T87, T88, T91, higher_valued107_out_gg(T89, T87)) → MAX_VALUED3_IN_GGA(T88, s(T89), T91)
MAX_VALUED1_IN_GA(.(T96, .(T94, T95)), T98) → U63_GA(T96, T94, T95, T98, higher_valued112_in_gg(T96, T94))
MAX_VALUED1_IN_GA(.(T96, .(T94, T95)), T98) → HIGHER_VALUED112_IN_GG(T96, T94)
U63_GA(T96, T94, T95, T98, higher_valued112_out_gg(T96, T94)) → U64_GA(T96, T94, T95, T98, max_valued3_in_gga(T95, T96, T98))
U63_GA(T96, T94, T95, T98, higher_valued112_out_gg(T96, T94)) → MAX_VALUED3_IN_GGA(T95, T96, T98)
MAX_VALUED1_IN_GA(.(T103, .(T101, T102)), T105) → U65_GA(T103, T101, T102, T105, higher_valued118_in_gg(T103, T101))
MAX_VALUED1_IN_GA(.(T103, .(T101, T102)), T105) → HIGHER_VALUED118_IN_GG(T103, T101)
U65_GA(T103, T101, T102, T105, higher_valued118_out_gg(T103, T101)) → U66_GA(T103, T101, T102, T105, max_valued3_in_gga(T102, T103, T105))
U65_GA(T103, T101, T102, T105, higher_valued118_out_gg(T103, T101)) → MAX_VALUED3_IN_GGA(T102, T103, T105)
max_valued1_in_ga(.(T7, []), T7) → max_valued1_out_ga(.(T7, []), T7)
max_valued1_in_ga(.(0, .(T15, T9)), T12) → U39_ga(T15, T9, T12, max_valued3_in_gga(T9, T15, T12))
max_valued3_in_gga([], T7, T7) → max_valued3_out_gga([], T7, T7)
max_valued3_in_gga(.(T15, T9), 0, T12) → U1_gga(T15, T9, T12, max_valued3_in_gga(T9, T15, T12))
max_valued3_in_gga(.(s(T18), T9), s(0), T12) → U2_gga(T18, T9, T12, max_valued3_in_gga(T9, s(T18), T12))
max_valued3_in_gga(.(s(s(T21)), T9), s(s(0)), T12) → U3_gga(T21, T9, T12, max_valued3_in_gga(T9, s(s(T21)), T12))
max_valued3_in_gga(.(s(s(s(T24))), T9), s(s(s(0))), T12) → U4_gga(T24, T9, T12, max_valued3_in_gga(T9, s(s(s(T24))), T12))
max_valued3_in_gga(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12) → U5_gga(T27, T9, T12, max_valued3_in_gga(T9, s(s(s(s(T27)))), T12))
max_valued3_in_gga(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12) → U6_gga(T30, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(T30))))), T12))
max_valued3_in_gga(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12) → U7_gga(T33, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(T33)))))), T12))
max_valued3_in_gga(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12) → U8_gga(T36, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(s(T36))))))), T12))
max_valued3_in_gga(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12) → U9_gga(T37, T9, T38, T12, greater64_in_gg(T37, T38))
greater64_in_gg(s(T40), 0) → greater64_out_gg(s(T40), 0)
greater64_in_gg(s(T41), s(T42)) → U29_gg(T41, T42, greater64_in_gg(T41, T42))
U29_gg(T41, T42, greater64_out_gg(T41, T42)) → greater64_out_gg(s(T41), s(T42))
U9_gga(T37, T9, T38, T12, greater64_out_gg(T37, T38)) → max_valued3_out_gga(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12)
U9_gga(T37, T9, T38, T12, greater64_out_gg(T37, T38)) → U10_gga(T37, T9, T38, T12, max_valued3_in_gaa(T9, s(T39), T12))
max_valued3_in_gaa([], T7, T7) → max_valued3_out_gaa([], T7, T7)
max_valued3_in_gaa(.(T15, T9), 0, T12) → U1_gaa(T15, T9, T12, max_valued3_in_gga(T9, T15, T12))
max_valued3_in_gga(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47) → U11_gga(T43, T44, T45, T47, higher_valued77_in_ag(T48, T43))
higher_valued77_in_ag(T50, T51) → U30_ag(T50, T51, greater64_in_ag(s(s(T50)), s(s(s(s(s(s(T51))))))))
greater64_in_ag(s(T40), 0) → greater64_out_ag(s(T40), 0)
greater64_in_ag(s(T41), s(T42)) → U29_ag(T41, T42, greater64_in_ag(T41, T42))
U29_ag(T41, T42, greater64_out_ag(T41, T42)) → greater64_out_ag(s(T41), s(T42))
U30_ag(T50, T51, greater64_out_ag(s(s(T50)), s(s(s(s(s(s(T51)))))))) → higher_valued77_out_ag(T50, T51)
U11_gga(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → max_valued3_out_gga(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47)
U11_gga(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → U12_gga(T43, T44, T45, T47, max_valued3_in_gaa(T44, s(T49), T47))
max_valued3_in_gaa(.(s(T18), T9), s(0), T12) → U2_gaa(T18, T9, T12, max_valued3_in_gga(T9, s(T18), T12))
max_valued3_in_gga(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56) → U13_gga(T52, T53, T54, T56, higher_valued82_in_gg(T54, T52))
higher_valued82_in_gg(T57, T58) → U31_gg(T57, T58, greater64_in_gg(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58)))))))
U31_gg(T57, T58, greater64_out_gg(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58))))))) → higher_valued82_out_gg(T57, T58)
U13_gga(T52, T53, T54, T56, higher_valued82_out_gg(T54, T52)) → max_valued3_out_gga(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56)
U13_gga(T52, T53, T54, T56, higher_valued82_out_gg(T54, T52)) → U14_gga(T52, T53, T54, T56, max_valued3_in_gga(T53, s(s(s(s(s(s(T54)))))), T56))
max_valued3_in_gga(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63) → U15_gga(T59, T60, T61, T63, higher_valued87_in_gg(T61, T59))
higher_valued87_in_gg(T64, T65) → U32_gg(T64, T65, greater64_in_gg(s(s(s(s(s(s(T64)))))), s(s(s(s(T65))))))
U32_gg(T64, T65, greater64_out_gg(s(s(s(s(s(s(T64)))))), s(s(s(s(T65)))))) → higher_valued87_out_gg(T64, T65)
U15_gga(T59, T60, T61, T63, higher_valued87_out_gg(T61, T59)) → max_valued3_out_gga(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63)
U15_gga(T59, T60, T61, T63, higher_valued87_out_gg(T61, T59)) → U16_gga(T59, T60, T61, T63, max_valued3_in_gga(T60, s(s(s(s(s(T61))))), T63))
max_valued3_in_gga(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70) → U17_gga(T66, T67, T68, T70, higher_valued92_in_gg(T68, T66))
higher_valued92_in_gg(T71, T72) → U33_gg(T71, T72, greater64_in_gg(s(s(s(s(s(T71))))), s(s(s(T72)))))
U33_gg(T71, T72, greater64_out_gg(s(s(s(s(s(T71))))), s(s(s(T72))))) → higher_valued92_out_gg(T71, T72)
U17_gga(T66, T67, T68, T70, higher_valued92_out_gg(T68, T66)) → max_valued3_out_gga(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70)
U17_gga(T66, T67, T68, T70, higher_valued92_out_gg(T68, T66)) → U18_gga(T66, T67, T68, T70, max_valued3_in_gga(T67, s(s(s(s(T68)))), T70))
max_valued3_in_gga(.(s(s(T73)), T74), s(s(s(T75))), T77) → U19_gga(T73, T74, T75, T77, higher_valued97_in_gg(T75, T73))
higher_valued97_in_gg(T78, T79) → U34_gg(T78, T79, greater64_in_gg(s(s(s(s(T78)))), s(s(T79))))
U34_gg(T78, T79, greater64_out_gg(s(s(s(s(T78)))), s(s(T79)))) → higher_valued97_out_gg(T78, T79)
U19_gga(T73, T74, T75, T77, higher_valued97_out_gg(T75, T73)) → max_valued3_out_gga(.(s(s(T73)), T74), s(s(s(T75))), T77)
U19_gga(T73, T74, T75, T77, higher_valued97_out_gg(T75, T73)) → U20_gga(T73, T74, T75, T77, max_valued3_in_gga(T74, s(s(s(T75))), T77))
max_valued3_in_gga(.(s(T80), T81), s(s(T82)), T84) → U21_gga(T80, T81, T82, T84, higher_valued102_in_gg(T82, T80))
higher_valued102_in_gg(T85, T86) → U35_gg(T85, T86, greater64_in_gg(s(s(s(T85))), s(T86)))
U35_gg(T85, T86, greater64_out_gg(s(s(s(T85))), s(T86))) → higher_valued102_out_gg(T85, T86)
U21_gga(T80, T81, T82, T84, higher_valued102_out_gg(T82, T80)) → max_valued3_out_gga(.(s(T80), T81), s(s(T82)), T84)
U21_gga(T80, T81, T82, T84, higher_valued102_out_gg(T82, T80)) → U22_gga(T80, T81, T82, T84, max_valued3_in_gga(T81, s(s(T82)), T84))
max_valued3_in_gga(.(T87, T88), s(T89), T91) → U23_gga(T87, T88, T89, T91, higher_valued107_in_gg(T89, T87))
higher_valued107_in_gg(T92, T93) → U36_gg(T92, T93, greater64_in_gg(s(s(T92)), T93))
U36_gg(T92, T93, greater64_out_gg(s(s(T92)), T93)) → higher_valued107_out_gg(T92, T93)
U23_gga(T87, T88, T89, T91, higher_valued107_out_gg(T89, T87)) → max_valued3_out_gga(.(T87, T88), s(T89), T91)
U23_gga(T87, T88, T89, T91, higher_valued107_out_gg(T89, T87)) → U24_gga(T87, T88, T89, T91, max_valued3_in_gga(T88, s(T89), T91))
max_valued3_in_gga(.(T94, T95), T96, T98) → U25_gga(T94, T95, T96, T98, higher_valued112_in_gg(T96, T94))
higher_valued112_in_gg(T99, T100) → U37_gg(T99, T100, greater64_in_gg(s(T99), T100))
U37_gg(T99, T100, greater64_out_gg(s(T99), T100)) → higher_valued112_out_gg(T99, T100)
U25_gga(T94, T95, T96, T98, higher_valued112_out_gg(T96, T94)) → max_valued3_out_gga(.(T94, T95), T96, T98)
U25_gga(T94, T95, T96, T98, higher_valued112_out_gg(T96, T94)) → U26_gga(T94, T95, T96, T98, max_valued3_in_gga(T95, T96, T98))
max_valued3_in_gga(.(T101, T102), T103, T105) → U27_gga(T101, T102, T103, T105, higher_valued118_in_gg(T103, T101))
higher_valued118_in_gg(T106, T107) → U38_gg(T106, T107, greater64_in_gg(s(T106), T107))
U38_gg(T106, T107, greater64_out_gg(s(T106), T107)) → higher_valued118_out_gg(T106, T107)
U27_gga(T101, T102, T103, T105, higher_valued118_out_gg(T103, T101)) → max_valued3_out_gga(.(T101, T102), T103, T105)
U27_gga(T101, T102, T103, T105, higher_valued118_out_gg(T103, T101)) → U28_gga(T101, T102, T103, T105, max_valued3_in_gga(T102, T103, T105))
U28_gga(T101, T102, T103, T105, max_valued3_out_gga(T102, T103, T105)) → max_valued3_out_gga(.(T101, T102), T103, T105)
U26_gga(T94, T95, T96, T98, max_valued3_out_gga(T95, T96, T98)) → max_valued3_out_gga(.(T94, T95), T96, T98)
U24_gga(T87, T88, T89, T91, max_valued3_out_gga(T88, s(T89), T91)) → max_valued3_out_gga(.(T87, T88), s(T89), T91)
U22_gga(T80, T81, T82, T84, max_valued3_out_gga(T81, s(s(T82)), T84)) → max_valued3_out_gga(.(s(T80), T81), s(s(T82)), T84)
U20_gga(T73, T74, T75, T77, max_valued3_out_gga(T74, s(s(s(T75))), T77)) → max_valued3_out_gga(.(s(s(T73)), T74), s(s(s(T75))), T77)
U18_gga(T66, T67, T68, T70, max_valued3_out_gga(T67, s(s(s(s(T68)))), T70)) → max_valued3_out_gga(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70)
U16_gga(T59, T60, T61, T63, max_valued3_out_gga(T60, s(s(s(s(s(T61))))), T63)) → max_valued3_out_gga(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63)
U14_gga(T52, T53, T54, T56, max_valued3_out_gga(T53, s(s(s(s(s(s(T54)))))), T56)) → max_valued3_out_gga(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56)
U2_gaa(T18, T9, T12, max_valued3_out_gga(T9, s(T18), T12)) → max_valued3_out_gaa(.(s(T18), T9), s(0), T12)
max_valued3_in_gaa(.(s(s(T21)), T9), s(s(0)), T12) → U3_gaa(T21, T9, T12, max_valued3_in_gga(T9, s(s(T21)), T12))
U3_gaa(T21, T9, T12, max_valued3_out_gga(T9, s(s(T21)), T12)) → max_valued3_out_gaa(.(s(s(T21)), T9), s(s(0)), T12)
max_valued3_in_gaa(.(s(s(s(T24))), T9), s(s(s(0))), T12) → U4_gaa(T24, T9, T12, max_valued3_in_gga(T9, s(s(s(T24))), T12))
U4_gaa(T24, T9, T12, max_valued3_out_gga(T9, s(s(s(T24))), T12)) → max_valued3_out_gaa(.(s(s(s(T24))), T9), s(s(s(0))), T12)
max_valued3_in_gaa(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12) → U5_gaa(T27, T9, T12, max_valued3_in_gga(T9, s(s(s(s(T27)))), T12))
U5_gaa(T27, T9, T12, max_valued3_out_gga(T9, s(s(s(s(T27)))), T12)) → max_valued3_out_gaa(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12)
max_valued3_in_gaa(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12) → U6_gaa(T30, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(T30))))), T12))
U6_gaa(T30, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(T30))))), T12)) → max_valued3_out_gaa(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12)
max_valued3_in_gaa(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12) → U7_gaa(T33, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(T33)))))), T12))
U7_gaa(T33, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(T33)))))), T12)) → max_valued3_out_gaa(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12)
max_valued3_in_gaa(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12) → U8_gaa(T36, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(s(T36))))))), T12))
U8_gaa(T36, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(s(T36))))))), T12)) → max_valued3_out_gaa(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12)
max_valued3_in_gaa(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12) → U9_gaa(T37, T9, T38, T12, greater64_in_ga(T37, T38))
greater64_in_ga(s(T40), 0) → greater64_out_ga(s(T40), 0)
greater64_in_ga(s(T41), s(T42)) → U29_ga(T41, T42, greater64_in_ga(T41, T42))
U29_ga(T41, T42, greater64_out_ga(T41, T42)) → greater64_out_ga(s(T41), s(T42))
U9_gaa(T37, T9, T38, T12, greater64_out_ga(T37, T38)) → max_valued3_out_gaa(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12)
U9_gaa(T37, T9, T38, T12, greater64_out_ga(T37, T38)) → U10_gaa(T37, T9, T38, T12, max_valued3_in_gaa(T9, s(T39), T12))
max_valued3_in_gaa(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47) → U11_gaa(T43, T44, T45, T47, higher_valued77_in_ag(T48, T43))
U11_gaa(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → max_valued3_out_gaa(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47)
U11_gaa(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → U12_gaa(T43, T44, T45, T47, max_valued3_in_gaa(T44, s(T49), T47))
max_valued3_in_gaa(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56) → U13_gaa(T52, T53, T54, T56, higher_valued82_in_ag(T54, T52))
higher_valued82_in_ag(T57, T58) → U31_ag(T57, T58, greater64_in_ag(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58)))))))
U31_ag(T57, T58, greater64_out_ag(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58))))))) → higher_valued82_out_ag(T57, T58)
U13_gaa(T52, T53, T54, T56, higher_valued82_out_ag(T54, T52)) → max_valued3_out_gaa(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56)
U13_gaa(T52, T53, T54, T56, higher_valued82_out_ag(T54, T52)) → U14_gaa(T52, T53, T54, T56, max_valued3_in_gaa(T53, s(s(s(s(s(s(T54)))))), T56))
max_valued3_in_gaa(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63) → U15_gaa(T59, T60, T61, T63, higher_valued87_in_ag(T61, T59))
higher_valued87_in_ag(T64, T65) → U32_ag(T64, T65, greater64_in_ag(s(s(s(s(s(s(T64)))))), s(s(s(s(T65))))))
U32_ag(T64, T65, greater64_out_ag(s(s(s(s(s(s(T64)))))), s(s(s(s(T65)))))) → higher_valued87_out_ag(T64, T65)
U15_gaa(T59, T60, T61, T63, higher_valued87_out_ag(T61, T59)) → max_valued3_out_gaa(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63)
U15_gaa(T59, T60, T61, T63, higher_valued87_out_ag(T61, T59)) → U16_gaa(T59, T60, T61, T63, max_valued3_in_gaa(T60, s(s(s(s(s(T61))))), T63))
max_valued3_in_gaa(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70) → U17_gaa(T66, T67, T68, T70, higher_valued92_in_ag(T68, T66))
higher_valued92_in_ag(T71, T72) → U33_ag(T71, T72, greater64_in_ag(s(s(s(s(s(T71))))), s(s(s(T72)))))
U33_ag(T71, T72, greater64_out_ag(s(s(s(s(s(T71))))), s(s(s(T72))))) → higher_valued92_out_ag(T71, T72)
U17_gaa(T66, T67, T68, T70, higher_valued92_out_ag(T68, T66)) → max_valued3_out_gaa(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70)
U17_gaa(T66, T67, T68, T70, higher_valued92_out_ag(T68, T66)) → U18_gaa(T66, T67, T68, T70, max_valued3_in_gaa(T67, s(s(s(s(T68)))), T70))
max_valued3_in_gaa(.(s(s(T73)), T74), s(s(s(T75))), T77) → U19_gaa(T73, T74, T75, T77, higher_valued97_in_ag(T75, T73))
higher_valued97_in_ag(T78, T79) → U34_ag(T78, T79, greater64_in_ag(s(s(s(s(T78)))), s(s(T79))))
U34_ag(T78, T79, greater64_out_ag(s(s(s(s(T78)))), s(s(T79)))) → higher_valued97_out_ag(T78, T79)
U19_gaa(T73, T74, T75, T77, higher_valued97_out_ag(T75, T73)) → max_valued3_out_gaa(.(s(s(T73)), T74), s(s(s(T75))), T77)
U19_gaa(T73, T74, T75, T77, higher_valued97_out_ag(T75, T73)) → U20_gaa(T73, T74, T75, T77, max_valued3_in_gaa(T74, s(s(s(T75))), T77))
max_valued3_in_gaa(.(s(T80), T81), s(s(T82)), T84) → U21_gaa(T80, T81, T82, T84, higher_valued102_in_ag(T82, T80))
higher_valued102_in_ag(T85, T86) → U35_ag(T85, T86, greater64_in_ag(s(s(s(T85))), s(T86)))
U35_ag(T85, T86, greater64_out_ag(s(s(s(T85))), s(T86))) → higher_valued102_out_ag(T85, T86)
U21_gaa(T80, T81, T82, T84, higher_valued102_out_ag(T82, T80)) → max_valued3_out_gaa(.(s(T80), T81), s(s(T82)), T84)
U21_gaa(T80, T81, T82, T84, higher_valued102_out_ag(T82, T80)) → U22_gaa(T80, T81, T82, T84, max_valued3_in_gaa(T81, s(s(T82)), T84))
max_valued3_in_gaa(.(T87, T88), s(T89), T91) → U23_gaa(T87, T88, T89, T91, higher_valued107_in_ag(T89, T87))
higher_valued107_in_ag(T92, T93) → U36_ag(T92, T93, greater64_in_ag(s(s(T92)), T93))
U36_ag(T92, T93, greater64_out_ag(s(s(T92)), T93)) → higher_valued107_out_ag(T92, T93)
U23_gaa(T87, T88, T89, T91, higher_valued107_out_ag(T89, T87)) → max_valued3_out_gaa(.(T87, T88), s(T89), T91)
U23_gaa(T87, T88, T89, T91, higher_valued107_out_ag(T89, T87)) → U24_gaa(T87, T88, T89, T91, max_valued3_in_gaa(T88, s(T89), T91))
max_valued3_in_gaa(.(T94, T95), T96, T98) → U25_gaa(T94, T95, T96, T98, higher_valued112_in_ag(T96, T94))
higher_valued112_in_ag(T99, T100) → U37_ag(T99, T100, greater64_in_ag(s(T99), T100))
U37_ag(T99, T100, greater64_out_ag(s(T99), T100)) → higher_valued112_out_ag(T99, T100)
U25_gaa(T94, T95, T96, T98, higher_valued112_out_ag(T96, T94)) → max_valued3_out_gaa(.(T94, T95), T96, T98)
U25_gaa(T94, T95, T96, T98, higher_valued112_out_ag(T96, T94)) → U26_gaa(T94, T95, T96, T98, max_valued3_in_gaa(T95, T96, T98))
max_valued3_in_gaa(.(T101, T102), T103, T105) → U27_gaa(T101, T102, T103, T105, higher_valued118_in_ag(T103, T101))
higher_valued118_in_ag(T106, T107) → U38_ag(T106, T107, greater64_in_ag(s(T106), T107))
U38_ag(T106, T107, greater64_out_ag(s(T106), T107)) → higher_valued118_out_ag(T106, T107)
U27_gaa(T101, T102, T103, T105, higher_valued118_out_ag(T103, T101)) → max_valued3_out_gaa(.(T101, T102), T103, T105)
U27_gaa(T101, T102, T103, T105, higher_valued118_out_ag(T103, T101)) → U28_gaa(T101, T102, T103, T105, max_valued3_in_gaa(T102, T103, T105))
U28_gaa(T101, T102, T103, T105, max_valued3_out_gaa(T102, T103, T105)) → max_valued3_out_gaa(.(T101, T102), T103, T105)
U26_gaa(T94, T95, T96, T98, max_valued3_out_gaa(T95, T96, T98)) → max_valued3_out_gaa(.(T94, T95), T96, T98)
U24_gaa(T87, T88, T89, T91, max_valued3_out_gaa(T88, s(T89), T91)) → max_valued3_out_gaa(.(T87, T88), s(T89), T91)
U22_gaa(T80, T81, T82, T84, max_valued3_out_gaa(T81, s(s(T82)), T84)) → max_valued3_out_gaa(.(s(T80), T81), s(s(T82)), T84)
U20_gaa(T73, T74, T75, T77, max_valued3_out_gaa(T74, s(s(s(T75))), T77)) → max_valued3_out_gaa(.(s(s(T73)), T74), s(s(s(T75))), T77)
U18_gaa(T66, T67, T68, T70, max_valued3_out_gaa(T67, s(s(s(s(T68)))), T70)) → max_valued3_out_gaa(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70)
U16_gaa(T59, T60, T61, T63, max_valued3_out_gaa(T60, s(s(s(s(s(T61))))), T63)) → max_valued3_out_gaa(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63)
U14_gaa(T52, T53, T54, T56, max_valued3_out_gaa(T53, s(s(s(s(s(s(T54)))))), T56)) → max_valued3_out_gaa(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56)
U12_gaa(T43, T44, T45, T47, max_valued3_out_gaa(T44, s(T49), T47)) → max_valued3_out_gaa(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47)
U10_gaa(T37, T9, T38, T12, max_valued3_out_gaa(T9, s(T39), T12)) → max_valued3_out_gaa(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12)
U12_gga(T43, T44, T45, T47, max_valued3_out_gaa(T44, s(T49), T47)) → max_valued3_out_gga(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47)
U1_gaa(T15, T9, T12, max_valued3_out_gga(T9, T15, T12)) → max_valued3_out_gaa(.(T15, T9), 0, T12)
U10_gga(T37, T9, T38, T12, max_valued3_out_gaa(T9, s(T39), T12)) → max_valued3_out_gga(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12)
U8_gga(T36, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(s(T36))))))), T12)) → max_valued3_out_gga(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12)
U7_gga(T33, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(T33)))))), T12)) → max_valued3_out_gga(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12)
U6_gga(T30, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(T30))))), T12)) → max_valued3_out_gga(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12)
U5_gga(T27, T9, T12, max_valued3_out_gga(T9, s(s(s(s(T27)))), T12)) → max_valued3_out_gga(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12)
U4_gga(T24, T9, T12, max_valued3_out_gga(T9, s(s(s(T24))), T12)) → max_valued3_out_gga(.(s(s(s(T24))), T9), s(s(s(0))), T12)
U3_gga(T21, T9, T12, max_valued3_out_gga(T9, s(s(T21)), T12)) → max_valued3_out_gga(.(s(s(T21)), T9), s(s(0)), T12)
U2_gga(T18, T9, T12, max_valued3_out_gga(T9, s(T18), T12)) → max_valued3_out_gga(.(s(T18), T9), s(0), T12)
U1_gga(T15, T9, T12, max_valued3_out_gga(T9, T15, T12)) → max_valued3_out_gga(.(T15, T9), 0, T12)
U39_ga(T15, T9, T12, max_valued3_out_gga(T9, T15, T12)) → max_valued1_out_ga(.(0, .(T15, T9)), T12)
max_valued1_in_ga(.(s(0), .(s(T18), T9)), T12) → U40_ga(T18, T9, T12, max_valued3_in_gga(T9, s(T18), T12))
U40_ga(T18, T9, T12, max_valued3_out_gga(T9, s(T18), T12)) → max_valued1_out_ga(.(s(0), .(s(T18), T9)), T12)
max_valued1_in_ga(.(s(s(0)), .(s(s(T21)), T9)), T12) → U41_ga(T21, T9, T12, max_valued3_in_gga(T9, s(s(T21)), T12))
U41_ga(T21, T9, T12, max_valued3_out_gga(T9, s(s(T21)), T12)) → max_valued1_out_ga(.(s(s(0)), .(s(s(T21)), T9)), T12)
max_valued1_in_ga(.(s(s(s(0))), .(s(s(s(T24))), T9)), T12) → U42_ga(T24, T9, T12, max_valued3_in_gga(T9, s(s(s(T24))), T12))
U42_ga(T24, T9, T12, max_valued3_out_gga(T9, s(s(s(T24))), T12)) → max_valued1_out_ga(.(s(s(s(0))), .(s(s(s(T24))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(0)))), .(s(s(s(s(T27)))), T9)), T12) → U43_ga(T27, T9, T12, max_valued3_in_gga(T9, s(s(s(s(T27)))), T12))
U43_ga(T27, T9, T12, max_valued3_out_gga(T9, s(s(s(s(T27)))), T12)) → max_valued1_out_ga(.(s(s(s(s(0)))), .(s(s(s(s(T27)))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(0))))), .(s(s(s(s(s(T30))))), T9)), T12) → U44_ga(T30, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(T30))))), T12))
U44_ga(T30, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(T30))))), T12)) → max_valued1_out_ga(.(s(s(s(s(s(0))))), .(s(s(s(s(s(T30))))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(s(0)))))), .(s(s(s(s(s(s(T33)))))), T9)), T12) → U45_ga(T33, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(T33)))))), T12))
U45_ga(T33, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(T33)))))), T12)) → max_valued1_out_ga(.(s(s(s(s(s(s(0)))))), .(s(s(s(s(s(s(T33)))))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(s(s(0))))))), .(s(s(s(s(s(s(s(T36))))))), T9)), T12) → U46_ga(T36, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(s(T36))))))), T12))
U46_ga(T36, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(s(T36))))))), T12)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(0))))))), .(s(s(s(s(s(s(s(T36))))))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(s(s(s(T38)))))))), .(s(s(s(s(s(s(s(T37))))))), T9)), T12) → U47_ga(T38, T37, T9, T12, greater64_in_gg(T37, T38))
U47_ga(T38, T37, T9, T12, greater64_out_gg(T37, T38)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(s(T38)))))))), .(s(s(s(s(s(s(s(T37))))))), T9)), T12)
U47_ga(T38, T37, T9, T12, greater64_out_gg(T37, T38)) → U48_ga(T38, T37, T9, T12, max_valued3_in_gaa(T9, s(T39), T12))
U48_ga(T38, T37, T9, T12, max_valued3_out_gaa(T9, s(T39), T12)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(s(T38)))))))), .(s(s(s(s(s(s(s(T37))))))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(s(s(T45))))))), .(s(s(s(s(s(s(T43)))))), T44)), T47) → U49_ga(T45, T43, T44, T47, higher_valued77_in_ag(T48, T43))
U49_ga(T45, T43, T44, T47, higher_valued77_out_ag(T48, T43)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(T45))))))), .(s(s(s(s(s(s(T43)))))), T44)), T47)
U49_ga(T45, T43, T44, T47, higher_valued77_out_ag(T48, T43)) → U50_ga(T45, T43, T44, T47, max_valued3_in_gaa(T44, s(T49), T47))
U50_ga(T45, T43, T44, T47, max_valued3_out_gaa(T44, s(T49), T47)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(T45))))))), .(s(s(s(s(s(s(T43)))))), T44)), T47)
max_valued1_in_ga(.(s(s(s(s(s(s(T54)))))), .(s(s(s(s(s(T52))))), T53)), T56) → U51_ga(T54, T52, T53, T56, higher_valued82_in_gg(T54, T52))
U51_ga(T54, T52, T53, T56, higher_valued82_out_gg(T54, T52)) → max_valued1_out_ga(.(s(s(s(s(s(s(T54)))))), .(s(s(s(s(s(T52))))), T53)), T56)
U51_ga(T54, T52, T53, T56, higher_valued82_out_gg(T54, T52)) → U52_ga(T54, T52, T53, T56, max_valued3_in_gga(T53, s(s(s(s(s(s(T54)))))), T56))
U52_ga(T54, T52, T53, T56, max_valued3_out_gga(T53, s(s(s(s(s(s(T54)))))), T56)) → max_valued1_out_ga(.(s(s(s(s(s(s(T54)))))), .(s(s(s(s(s(T52))))), T53)), T56)
max_valued1_in_ga(.(s(s(s(s(s(T61))))), .(s(s(s(s(T59)))), T60)), T63) → U53_ga(T61, T59, T60, T63, higher_valued87_in_gg(T61, T59))
U53_ga(T61, T59, T60, T63, higher_valued87_out_gg(T61, T59)) → max_valued1_out_ga(.(s(s(s(s(s(T61))))), .(s(s(s(s(T59)))), T60)), T63)
U53_ga(T61, T59, T60, T63, higher_valued87_out_gg(T61, T59)) → U54_ga(T61, T59, T60, T63, max_valued3_in_gga(T60, s(s(s(s(s(T61))))), T63))
U54_ga(T61, T59, T60, T63, max_valued3_out_gga(T60, s(s(s(s(s(T61))))), T63)) → max_valued1_out_ga(.(s(s(s(s(s(T61))))), .(s(s(s(s(T59)))), T60)), T63)
max_valued1_in_ga(.(s(s(s(s(T68)))), .(s(s(s(T66))), T67)), T70) → U55_ga(T68, T66, T67, T70, higher_valued92_in_gg(T68, T66))
U55_ga(T68, T66, T67, T70, higher_valued92_out_gg(T68, T66)) → max_valued1_out_ga(.(s(s(s(s(T68)))), .(s(s(s(T66))), T67)), T70)
U55_ga(T68, T66, T67, T70, higher_valued92_out_gg(T68, T66)) → U56_ga(T68, T66, T67, T70, max_valued3_in_gga(T67, s(s(s(s(T68)))), T70))
U56_ga(T68, T66, T67, T70, max_valued3_out_gga(T67, s(s(s(s(T68)))), T70)) → max_valued1_out_ga(.(s(s(s(s(T68)))), .(s(s(s(T66))), T67)), T70)
max_valued1_in_ga(.(s(s(s(T75))), .(s(s(T73)), T74)), T77) → U57_ga(T75, T73, T74, T77, higher_valued97_in_gg(T75, T73))
U57_ga(T75, T73, T74, T77, higher_valued97_out_gg(T75, T73)) → max_valued1_out_ga(.(s(s(s(T75))), .(s(s(T73)), T74)), T77)
U57_ga(T75, T73, T74, T77, higher_valued97_out_gg(T75, T73)) → U58_ga(T75, T73, T74, T77, max_valued3_in_gga(T74, s(s(s(T75))), T77))
U58_ga(T75, T73, T74, T77, max_valued3_out_gga(T74, s(s(s(T75))), T77)) → max_valued1_out_ga(.(s(s(s(T75))), .(s(s(T73)), T74)), T77)
max_valued1_in_ga(.(s(s(T82)), .(s(T80), T81)), T84) → U59_ga(T82, T80, T81, T84, higher_valued102_in_gg(T82, T80))
U59_ga(T82, T80, T81, T84, higher_valued102_out_gg(T82, T80)) → max_valued1_out_ga(.(s(s(T82)), .(s(T80), T81)), T84)
U59_ga(T82, T80, T81, T84, higher_valued102_out_gg(T82, T80)) → U60_ga(T82, T80, T81, T84, max_valued3_in_gga(T81, s(s(T82)), T84))
U60_ga(T82, T80, T81, T84, max_valued3_out_gga(T81, s(s(T82)), T84)) → max_valued1_out_ga(.(s(s(T82)), .(s(T80), T81)), T84)
max_valued1_in_ga(.(s(T89), .(T87, T88)), T91) → U61_ga(T89, T87, T88, T91, higher_valued107_in_gg(T89, T87))
U61_ga(T89, T87, T88, T91, higher_valued107_out_gg(T89, T87)) → max_valued1_out_ga(.(s(T89), .(T87, T88)), T91)
U61_ga(T89, T87, T88, T91, higher_valued107_out_gg(T89, T87)) → U62_ga(T89, T87, T88, T91, max_valued3_in_gga(T88, s(T89), T91))
U62_ga(T89, T87, T88, T91, max_valued3_out_gga(T88, s(T89), T91)) → max_valued1_out_ga(.(s(T89), .(T87, T88)), T91)
max_valued1_in_ga(.(T96, .(T94, T95)), T98) → U63_ga(T96, T94, T95, T98, higher_valued112_in_gg(T96, T94))
U63_ga(T96, T94, T95, T98, higher_valued112_out_gg(T96, T94)) → max_valued1_out_ga(.(T96, .(T94, T95)), T98)
U63_ga(T96, T94, T95, T98, higher_valued112_out_gg(T96, T94)) → U64_ga(T96, T94, T95, T98, max_valued3_in_gga(T95, T96, T98))
U64_ga(T96, T94, T95, T98, max_valued3_out_gga(T95, T96, T98)) → max_valued1_out_ga(.(T96, .(T94, T95)), T98)
max_valued1_in_ga(.(T103, .(T101, T102)), T105) → U65_ga(T103, T101, T102, T105, higher_valued118_in_gg(T103, T101))
U65_ga(T103, T101, T102, T105, higher_valued118_out_gg(T103, T101)) → max_valued1_out_ga(.(T103, .(T101, T102)), T105)
U65_ga(T103, T101, T102, T105, higher_valued118_out_gg(T103, T101)) → U66_ga(T103, T101, T102, T105, max_valued3_in_gga(T102, T103, T105))
U66_ga(T103, T101, T102, T105, max_valued3_out_gga(T102, T103, T105)) → max_valued1_out_ga(.(T103, .(T101, T102)), T105)
MAX_VALUED1_IN_GA(.(0, .(T15, T9)), T12) → U39_GA(T15, T9, T12, max_valued3_in_gga(T9, T15, T12))
MAX_VALUED1_IN_GA(.(0, .(T15, T9)), T12) → MAX_VALUED3_IN_GGA(T9, T15, T12)
MAX_VALUED3_IN_GGA(.(T15, T9), 0, T12) → U1_GGA(T15, T9, T12, max_valued3_in_gga(T9, T15, T12))
MAX_VALUED3_IN_GGA(.(T15, T9), 0, T12) → MAX_VALUED3_IN_GGA(T9, T15, T12)
MAX_VALUED3_IN_GGA(.(s(T18), T9), s(0), T12) → U2_GGA(T18, T9, T12, max_valued3_in_gga(T9, s(T18), T12))
MAX_VALUED3_IN_GGA(.(s(T18), T9), s(0), T12) → MAX_VALUED3_IN_GGA(T9, s(T18), T12)
MAX_VALUED3_IN_GGA(.(s(s(T21)), T9), s(s(0)), T12) → U3_GGA(T21, T9, T12, max_valued3_in_gga(T9, s(s(T21)), T12))
MAX_VALUED3_IN_GGA(.(s(s(T21)), T9), s(s(0)), T12) → MAX_VALUED3_IN_GGA(T9, s(s(T21)), T12)
MAX_VALUED3_IN_GGA(.(s(s(s(T24))), T9), s(s(s(0))), T12) → U4_GGA(T24, T9, T12, max_valued3_in_gga(T9, s(s(s(T24))), T12))
MAX_VALUED3_IN_GGA(.(s(s(s(T24))), T9), s(s(s(0))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(T24))), T12)
MAX_VALUED3_IN_GGA(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12) → U5_GGA(T27, T9, T12, max_valued3_in_gga(T9, s(s(s(s(T27)))), T12))
MAX_VALUED3_IN_GGA(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(T27)))), T12)
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12) → U6_GGA(T30, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(T30))))), T12))
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(T30))))), T12)
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12) → U7_GGA(T33, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(T33)))))), T12))
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(s(T33)))))), T12)
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12) → U8_GGA(T36, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(s(T36))))))), T12))
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(s(s(T36))))))), T12)
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12) → U9_GGA(T37, T9, T38, T12, greater64_in_gg(T37, T38))
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12) → GREATER64_IN_GG(T37, T38)
GREATER64_IN_GG(s(T41), s(T42)) → U29_GG(T41, T42, greater64_in_gg(T41, T42))
GREATER64_IN_GG(s(T41), s(T42)) → GREATER64_IN_GG(T41, T42)
U9_GGA(T37, T9, T38, T12, greater64_out_gg(T37, T38)) → U10_GGA(T37, T9, T38, T12, max_valued3_in_gaa(T9, s(T39), T12))
U9_GGA(T37, T9, T38, T12, greater64_out_gg(T37, T38)) → MAX_VALUED3_IN_GAA(T9, s(T39), T12)
MAX_VALUED3_IN_GAA(.(T15, T9), 0, T12) → U1_GAA(T15, T9, T12, max_valued3_in_gga(T9, T15, T12))
MAX_VALUED3_IN_GAA(.(T15, T9), 0, T12) → MAX_VALUED3_IN_GGA(T9, T15, T12)
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47) → U11_GGA(T43, T44, T45, T47, higher_valued77_in_ag(T48, T43))
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47) → HIGHER_VALUED77_IN_AG(T48, T43)
HIGHER_VALUED77_IN_AG(T50, T51) → U30_AG(T50, T51, greater64_in_ag(s(s(T50)), s(s(s(s(s(s(T51))))))))
HIGHER_VALUED77_IN_AG(T50, T51) → GREATER64_IN_AG(s(s(T50)), s(s(s(s(s(s(T51)))))))
GREATER64_IN_AG(s(T41), s(T42)) → U29_AG(T41, T42, greater64_in_ag(T41, T42))
GREATER64_IN_AG(s(T41), s(T42)) → GREATER64_IN_AG(T41, T42)
U11_GGA(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → U12_GGA(T43, T44, T45, T47, max_valued3_in_gaa(T44, s(T49), T47))
U11_GGA(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → MAX_VALUED3_IN_GAA(T44, s(T49), T47)
MAX_VALUED3_IN_GAA(.(s(T18), T9), s(0), T12) → U2_GAA(T18, T9, T12, max_valued3_in_gga(T9, s(T18), T12))
MAX_VALUED3_IN_GAA(.(s(T18), T9), s(0), T12) → MAX_VALUED3_IN_GGA(T9, s(T18), T12)
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56) → U13_GGA(T52, T53, T54, T56, higher_valued82_in_gg(T54, T52))
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56) → HIGHER_VALUED82_IN_GG(T54, T52)
HIGHER_VALUED82_IN_GG(T57, T58) → U31_GG(T57, T58, greater64_in_gg(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58)))))))
HIGHER_VALUED82_IN_GG(T57, T58) → GREATER64_IN_GG(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58))))))
U13_GGA(T52, T53, T54, T56, higher_valued82_out_gg(T54, T52)) → U14_GGA(T52, T53, T54, T56, max_valued3_in_gga(T53, s(s(s(s(s(s(T54)))))), T56))
U13_GGA(T52, T53, T54, T56, higher_valued82_out_gg(T54, T52)) → MAX_VALUED3_IN_GGA(T53, s(s(s(s(s(s(T54)))))), T56)
MAX_VALUED3_IN_GGA(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63) → U15_GGA(T59, T60, T61, T63, higher_valued87_in_gg(T61, T59))
MAX_VALUED3_IN_GGA(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63) → HIGHER_VALUED87_IN_GG(T61, T59)
HIGHER_VALUED87_IN_GG(T64, T65) → U32_GG(T64, T65, greater64_in_gg(s(s(s(s(s(s(T64)))))), s(s(s(s(T65))))))
HIGHER_VALUED87_IN_GG(T64, T65) → GREATER64_IN_GG(s(s(s(s(s(s(T64)))))), s(s(s(s(T65)))))
U15_GGA(T59, T60, T61, T63, higher_valued87_out_gg(T61, T59)) → U16_GGA(T59, T60, T61, T63, max_valued3_in_gga(T60, s(s(s(s(s(T61))))), T63))
U15_GGA(T59, T60, T61, T63, higher_valued87_out_gg(T61, T59)) → MAX_VALUED3_IN_GGA(T60, s(s(s(s(s(T61))))), T63)
MAX_VALUED3_IN_GGA(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70) → U17_GGA(T66, T67, T68, T70, higher_valued92_in_gg(T68, T66))
MAX_VALUED3_IN_GGA(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70) → HIGHER_VALUED92_IN_GG(T68, T66)
HIGHER_VALUED92_IN_GG(T71, T72) → U33_GG(T71, T72, greater64_in_gg(s(s(s(s(s(T71))))), s(s(s(T72)))))
HIGHER_VALUED92_IN_GG(T71, T72) → GREATER64_IN_GG(s(s(s(s(s(T71))))), s(s(s(T72))))
U17_GGA(T66, T67, T68, T70, higher_valued92_out_gg(T68, T66)) → U18_GGA(T66, T67, T68, T70, max_valued3_in_gga(T67, s(s(s(s(T68)))), T70))
U17_GGA(T66, T67, T68, T70, higher_valued92_out_gg(T68, T66)) → MAX_VALUED3_IN_GGA(T67, s(s(s(s(T68)))), T70)
MAX_VALUED3_IN_GGA(.(s(s(T73)), T74), s(s(s(T75))), T77) → U19_GGA(T73, T74, T75, T77, higher_valued97_in_gg(T75, T73))
MAX_VALUED3_IN_GGA(.(s(s(T73)), T74), s(s(s(T75))), T77) → HIGHER_VALUED97_IN_GG(T75, T73)
HIGHER_VALUED97_IN_GG(T78, T79) → U34_GG(T78, T79, greater64_in_gg(s(s(s(s(T78)))), s(s(T79))))
HIGHER_VALUED97_IN_GG(T78, T79) → GREATER64_IN_GG(s(s(s(s(T78)))), s(s(T79)))
U19_GGA(T73, T74, T75, T77, higher_valued97_out_gg(T75, T73)) → U20_GGA(T73, T74, T75, T77, max_valued3_in_gga(T74, s(s(s(T75))), T77))
U19_GGA(T73, T74, T75, T77, higher_valued97_out_gg(T75, T73)) → MAX_VALUED3_IN_GGA(T74, s(s(s(T75))), T77)
MAX_VALUED3_IN_GGA(.(s(T80), T81), s(s(T82)), T84) → U21_GGA(T80, T81, T82, T84, higher_valued102_in_gg(T82, T80))
MAX_VALUED3_IN_GGA(.(s(T80), T81), s(s(T82)), T84) → HIGHER_VALUED102_IN_GG(T82, T80)
HIGHER_VALUED102_IN_GG(T85, T86) → U35_GG(T85, T86, greater64_in_gg(s(s(s(T85))), s(T86)))
HIGHER_VALUED102_IN_GG(T85, T86) → GREATER64_IN_GG(s(s(s(T85))), s(T86))
U21_GGA(T80, T81, T82, T84, higher_valued102_out_gg(T82, T80)) → U22_GGA(T80, T81, T82, T84, max_valued3_in_gga(T81, s(s(T82)), T84))
U21_GGA(T80, T81, T82, T84, higher_valued102_out_gg(T82, T80)) → MAX_VALUED3_IN_GGA(T81, s(s(T82)), T84)
MAX_VALUED3_IN_GGA(.(T87, T88), s(T89), T91) → U23_GGA(T87, T88, T89, T91, higher_valued107_in_gg(T89, T87))
MAX_VALUED3_IN_GGA(.(T87, T88), s(T89), T91) → HIGHER_VALUED107_IN_GG(T89, T87)
HIGHER_VALUED107_IN_GG(T92, T93) → U36_GG(T92, T93, greater64_in_gg(s(s(T92)), T93))
HIGHER_VALUED107_IN_GG(T92, T93) → GREATER64_IN_GG(s(s(T92)), T93)
U23_GGA(T87, T88, T89, T91, higher_valued107_out_gg(T89, T87)) → U24_GGA(T87, T88, T89, T91, max_valued3_in_gga(T88, s(T89), T91))
U23_GGA(T87, T88, T89, T91, higher_valued107_out_gg(T89, T87)) → MAX_VALUED3_IN_GGA(T88, s(T89), T91)
MAX_VALUED3_IN_GGA(.(T94, T95), T96, T98) → U25_GGA(T94, T95, T96, T98, higher_valued112_in_gg(T96, T94))
MAX_VALUED3_IN_GGA(.(T94, T95), T96, T98) → HIGHER_VALUED112_IN_GG(T96, T94)
HIGHER_VALUED112_IN_GG(T99, T100) → U37_GG(T99, T100, greater64_in_gg(s(T99), T100))
HIGHER_VALUED112_IN_GG(T99, T100) → GREATER64_IN_GG(s(T99), T100)
U25_GGA(T94, T95, T96, T98, higher_valued112_out_gg(T96, T94)) → U26_GGA(T94, T95, T96, T98, max_valued3_in_gga(T95, T96, T98))
U25_GGA(T94, T95, T96, T98, higher_valued112_out_gg(T96, T94)) → MAX_VALUED3_IN_GGA(T95, T96, T98)
MAX_VALUED3_IN_GGA(.(T101, T102), T103, T105) → U27_GGA(T101, T102, T103, T105, higher_valued118_in_gg(T103, T101))
MAX_VALUED3_IN_GGA(.(T101, T102), T103, T105) → HIGHER_VALUED118_IN_GG(T103, T101)
HIGHER_VALUED118_IN_GG(T106, T107) → U38_GG(T106, T107, greater64_in_gg(s(T106), T107))
HIGHER_VALUED118_IN_GG(T106, T107) → GREATER64_IN_GG(s(T106), T107)
U27_GGA(T101, T102, T103, T105, higher_valued118_out_gg(T103, T101)) → U28_GGA(T101, T102, T103, T105, max_valued3_in_gga(T102, T103, T105))
U27_GGA(T101, T102, T103, T105, higher_valued118_out_gg(T103, T101)) → MAX_VALUED3_IN_GGA(T102, T103, T105)
MAX_VALUED3_IN_GAA(.(s(s(T21)), T9), s(s(0)), T12) → U3_GAA(T21, T9, T12, max_valued3_in_gga(T9, s(s(T21)), T12))
MAX_VALUED3_IN_GAA(.(s(s(T21)), T9), s(s(0)), T12) → MAX_VALUED3_IN_GGA(T9, s(s(T21)), T12)
MAX_VALUED3_IN_GAA(.(s(s(s(T24))), T9), s(s(s(0))), T12) → U4_GAA(T24, T9, T12, max_valued3_in_gga(T9, s(s(s(T24))), T12))
MAX_VALUED3_IN_GAA(.(s(s(s(T24))), T9), s(s(s(0))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(T24))), T12)
MAX_VALUED3_IN_GAA(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12) → U5_GAA(T27, T9, T12, max_valued3_in_gga(T9, s(s(s(s(T27)))), T12))
MAX_VALUED3_IN_GAA(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(T27)))), T12)
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12) → U6_GAA(T30, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(T30))))), T12))
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(T30))))), T12)
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12) → U7_GAA(T33, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(T33)))))), T12))
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(s(T33)))))), T12)
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12) → U8_GAA(T36, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(s(T36))))))), T12))
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(s(s(T36))))))), T12)
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12) → U9_GAA(T37, T9, T38, T12, greater64_in_ga(T37, T38))
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12) → GREATER64_IN_GA(T37, T38)
GREATER64_IN_GA(s(T41), s(T42)) → U29_GA(T41, T42, greater64_in_ga(T41, T42))
GREATER64_IN_GA(s(T41), s(T42)) → GREATER64_IN_GA(T41, T42)
U9_GAA(T37, T9, T38, T12, greater64_out_ga(T37, T38)) → U10_GAA(T37, T9, T38, T12, max_valued3_in_gaa(T9, s(T39), T12))
U9_GAA(T37, T9, T38, T12, greater64_out_ga(T37, T38)) → MAX_VALUED3_IN_GAA(T9, s(T39), T12)
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47) → U11_GAA(T43, T44, T45, T47, higher_valued77_in_ag(T48, T43))
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47) → HIGHER_VALUED77_IN_AG(T48, T43)
U11_GAA(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → U12_GAA(T43, T44, T45, T47, max_valued3_in_gaa(T44, s(T49), T47))
U11_GAA(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → MAX_VALUED3_IN_GAA(T44, s(T49), T47)
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56) → U13_GAA(T52, T53, T54, T56, higher_valued82_in_ag(T54, T52))
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56) → HIGHER_VALUED82_IN_AG(T54, T52)
HIGHER_VALUED82_IN_AG(T57, T58) → U31_AG(T57, T58, greater64_in_ag(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58)))))))
HIGHER_VALUED82_IN_AG(T57, T58) → GREATER64_IN_AG(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58))))))
U13_GAA(T52, T53, T54, T56, higher_valued82_out_ag(T54, T52)) → U14_GAA(T52, T53, T54, T56, max_valued3_in_gaa(T53, s(s(s(s(s(s(T54)))))), T56))
U13_GAA(T52, T53, T54, T56, higher_valued82_out_ag(T54, T52)) → MAX_VALUED3_IN_GAA(T53, s(s(s(s(s(s(T54)))))), T56)
MAX_VALUED3_IN_GAA(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63) → U15_GAA(T59, T60, T61, T63, higher_valued87_in_ag(T61, T59))
MAX_VALUED3_IN_GAA(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63) → HIGHER_VALUED87_IN_AG(T61, T59)
HIGHER_VALUED87_IN_AG(T64, T65) → U32_AG(T64, T65, greater64_in_ag(s(s(s(s(s(s(T64)))))), s(s(s(s(T65))))))
HIGHER_VALUED87_IN_AG(T64, T65) → GREATER64_IN_AG(s(s(s(s(s(s(T64)))))), s(s(s(s(T65)))))
U15_GAA(T59, T60, T61, T63, higher_valued87_out_ag(T61, T59)) → U16_GAA(T59, T60, T61, T63, max_valued3_in_gaa(T60, s(s(s(s(s(T61))))), T63))
U15_GAA(T59, T60, T61, T63, higher_valued87_out_ag(T61, T59)) → MAX_VALUED3_IN_GAA(T60, s(s(s(s(s(T61))))), T63)
MAX_VALUED3_IN_GAA(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70) → U17_GAA(T66, T67, T68, T70, higher_valued92_in_ag(T68, T66))
MAX_VALUED3_IN_GAA(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70) → HIGHER_VALUED92_IN_AG(T68, T66)
HIGHER_VALUED92_IN_AG(T71, T72) → U33_AG(T71, T72, greater64_in_ag(s(s(s(s(s(T71))))), s(s(s(T72)))))
HIGHER_VALUED92_IN_AG(T71, T72) → GREATER64_IN_AG(s(s(s(s(s(T71))))), s(s(s(T72))))
U17_GAA(T66, T67, T68, T70, higher_valued92_out_ag(T68, T66)) → U18_GAA(T66, T67, T68, T70, max_valued3_in_gaa(T67, s(s(s(s(T68)))), T70))
U17_GAA(T66, T67, T68, T70, higher_valued92_out_ag(T68, T66)) → MAX_VALUED3_IN_GAA(T67, s(s(s(s(T68)))), T70)
MAX_VALUED3_IN_GAA(.(s(s(T73)), T74), s(s(s(T75))), T77) → U19_GAA(T73, T74, T75, T77, higher_valued97_in_ag(T75, T73))
MAX_VALUED3_IN_GAA(.(s(s(T73)), T74), s(s(s(T75))), T77) → HIGHER_VALUED97_IN_AG(T75, T73)
HIGHER_VALUED97_IN_AG(T78, T79) → U34_AG(T78, T79, greater64_in_ag(s(s(s(s(T78)))), s(s(T79))))
HIGHER_VALUED97_IN_AG(T78, T79) → GREATER64_IN_AG(s(s(s(s(T78)))), s(s(T79)))
U19_GAA(T73, T74, T75, T77, higher_valued97_out_ag(T75, T73)) → U20_GAA(T73, T74, T75, T77, max_valued3_in_gaa(T74, s(s(s(T75))), T77))
U19_GAA(T73, T74, T75, T77, higher_valued97_out_ag(T75, T73)) → MAX_VALUED3_IN_GAA(T74, s(s(s(T75))), T77)
MAX_VALUED3_IN_GAA(.(s(T80), T81), s(s(T82)), T84) → U21_GAA(T80, T81, T82, T84, higher_valued102_in_ag(T82, T80))
MAX_VALUED3_IN_GAA(.(s(T80), T81), s(s(T82)), T84) → HIGHER_VALUED102_IN_AG(T82, T80)
HIGHER_VALUED102_IN_AG(T85, T86) → U35_AG(T85, T86, greater64_in_ag(s(s(s(T85))), s(T86)))
HIGHER_VALUED102_IN_AG(T85, T86) → GREATER64_IN_AG(s(s(s(T85))), s(T86))
U21_GAA(T80, T81, T82, T84, higher_valued102_out_ag(T82, T80)) → U22_GAA(T80, T81, T82, T84, max_valued3_in_gaa(T81, s(s(T82)), T84))
U21_GAA(T80, T81, T82, T84, higher_valued102_out_ag(T82, T80)) → MAX_VALUED3_IN_GAA(T81, s(s(T82)), T84)
MAX_VALUED3_IN_GAA(.(T87, T88), s(T89), T91) → U23_GAA(T87, T88, T89, T91, higher_valued107_in_ag(T89, T87))
MAX_VALUED3_IN_GAA(.(T87, T88), s(T89), T91) → HIGHER_VALUED107_IN_AG(T89, T87)
HIGHER_VALUED107_IN_AG(T92, T93) → U36_AG(T92, T93, greater64_in_ag(s(s(T92)), T93))
HIGHER_VALUED107_IN_AG(T92, T93) → GREATER64_IN_AG(s(s(T92)), T93)
U23_GAA(T87, T88, T89, T91, higher_valued107_out_ag(T89, T87)) → U24_GAA(T87, T88, T89, T91, max_valued3_in_gaa(T88, s(T89), T91))
U23_GAA(T87, T88, T89, T91, higher_valued107_out_ag(T89, T87)) → MAX_VALUED3_IN_GAA(T88, s(T89), T91)
MAX_VALUED3_IN_GAA(.(T94, T95), T96, T98) → U25_GAA(T94, T95, T96, T98, higher_valued112_in_ag(T96, T94))
MAX_VALUED3_IN_GAA(.(T94, T95), T96, T98) → HIGHER_VALUED112_IN_AG(T96, T94)
HIGHER_VALUED112_IN_AG(T99, T100) → U37_AG(T99, T100, greater64_in_ag(s(T99), T100))
HIGHER_VALUED112_IN_AG(T99, T100) → GREATER64_IN_AG(s(T99), T100)
U25_GAA(T94, T95, T96, T98, higher_valued112_out_ag(T96, T94)) → U26_GAA(T94, T95, T96, T98, max_valued3_in_gaa(T95, T96, T98))
U25_GAA(T94, T95, T96, T98, higher_valued112_out_ag(T96, T94)) → MAX_VALUED3_IN_GAA(T95, T96, T98)
MAX_VALUED3_IN_GAA(.(T101, T102), T103, T105) → U27_GAA(T101, T102, T103, T105, higher_valued118_in_ag(T103, T101))
MAX_VALUED3_IN_GAA(.(T101, T102), T103, T105) → HIGHER_VALUED118_IN_AG(T103, T101)
HIGHER_VALUED118_IN_AG(T106, T107) → U38_AG(T106, T107, greater64_in_ag(s(T106), T107))
HIGHER_VALUED118_IN_AG(T106, T107) → GREATER64_IN_AG(s(T106), T107)
U27_GAA(T101, T102, T103, T105, higher_valued118_out_ag(T103, T101)) → U28_GAA(T101, T102, T103, T105, max_valued3_in_gaa(T102, T103, T105))
U27_GAA(T101, T102, T103, T105, higher_valued118_out_ag(T103, T101)) → MAX_VALUED3_IN_GAA(T102, T103, T105)
MAX_VALUED1_IN_GA(.(s(0), .(s(T18), T9)), T12) → U40_GA(T18, T9, T12, max_valued3_in_gga(T9, s(T18), T12))
MAX_VALUED1_IN_GA(.(s(0), .(s(T18), T9)), T12) → MAX_VALUED3_IN_GGA(T9, s(T18), T12)
MAX_VALUED1_IN_GA(.(s(s(0)), .(s(s(T21)), T9)), T12) → U41_GA(T21, T9, T12, max_valued3_in_gga(T9, s(s(T21)), T12))
MAX_VALUED1_IN_GA(.(s(s(0)), .(s(s(T21)), T9)), T12) → MAX_VALUED3_IN_GGA(T9, s(s(T21)), T12)
MAX_VALUED1_IN_GA(.(s(s(s(0))), .(s(s(s(T24))), T9)), T12) → U42_GA(T24, T9, T12, max_valued3_in_gga(T9, s(s(s(T24))), T12))
MAX_VALUED1_IN_GA(.(s(s(s(0))), .(s(s(s(T24))), T9)), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(T24))), T12)
MAX_VALUED1_IN_GA(.(s(s(s(s(0)))), .(s(s(s(s(T27)))), T9)), T12) → U43_GA(T27, T9, T12, max_valued3_in_gga(T9, s(s(s(s(T27)))), T12))
MAX_VALUED1_IN_GA(.(s(s(s(s(0)))), .(s(s(s(s(T27)))), T9)), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(T27)))), T12)
MAX_VALUED1_IN_GA(.(s(s(s(s(s(0))))), .(s(s(s(s(s(T30))))), T9)), T12) → U44_GA(T30, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(T30))))), T12))
MAX_VALUED1_IN_GA(.(s(s(s(s(s(0))))), .(s(s(s(s(s(T30))))), T9)), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(T30))))), T12)
MAX_VALUED1_IN_GA(.(s(s(s(s(s(s(0)))))), .(s(s(s(s(s(s(T33)))))), T9)), T12) → U45_GA(T33, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(T33)))))), T12))
MAX_VALUED1_IN_GA(.(s(s(s(s(s(s(0)))))), .(s(s(s(s(s(s(T33)))))), T9)), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(s(T33)))))), T12)
MAX_VALUED1_IN_GA(.(s(s(s(s(s(s(s(0))))))), .(s(s(s(s(s(s(s(T36))))))), T9)), T12) → U46_GA(T36, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(s(T36))))))), T12))
MAX_VALUED1_IN_GA(.(s(s(s(s(s(s(s(0))))))), .(s(s(s(s(s(s(s(T36))))))), T9)), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(s(s(T36))))))), T12)
MAX_VALUED1_IN_GA(.(s(s(s(s(s(s(s(s(T38)))))))), .(s(s(s(s(s(s(s(T37))))))), T9)), T12) → U47_GA(T38, T37, T9, T12, greater64_in_gg(T37, T38))
MAX_VALUED1_IN_GA(.(s(s(s(s(s(s(s(s(T38)))))))), .(s(s(s(s(s(s(s(T37))))))), T9)), T12) → GREATER64_IN_GG(T37, T38)
U47_GA(T38, T37, T9, T12, greater64_out_gg(T37, T38)) → U48_GA(T38, T37, T9, T12, max_valued3_in_gaa(T9, s(T39), T12))
U47_GA(T38, T37, T9, T12, greater64_out_gg(T37, T38)) → MAX_VALUED3_IN_GAA(T9, s(T39), T12)
MAX_VALUED1_IN_GA(.(s(s(s(s(s(s(s(T45))))))), .(s(s(s(s(s(s(T43)))))), T44)), T47) → U49_GA(T45, T43, T44, T47, higher_valued77_in_ag(T48, T43))
MAX_VALUED1_IN_GA(.(s(s(s(s(s(s(s(T45))))))), .(s(s(s(s(s(s(T43)))))), T44)), T47) → HIGHER_VALUED77_IN_AG(T48, T43)
U49_GA(T45, T43, T44, T47, higher_valued77_out_ag(T48, T43)) → U50_GA(T45, T43, T44, T47, max_valued3_in_gaa(T44, s(T49), T47))
U49_GA(T45, T43, T44, T47, higher_valued77_out_ag(T48, T43)) → MAX_VALUED3_IN_GAA(T44, s(T49), T47)
MAX_VALUED1_IN_GA(.(s(s(s(s(s(s(T54)))))), .(s(s(s(s(s(T52))))), T53)), T56) → U51_GA(T54, T52, T53, T56, higher_valued82_in_gg(T54, T52))
MAX_VALUED1_IN_GA(.(s(s(s(s(s(s(T54)))))), .(s(s(s(s(s(T52))))), T53)), T56) → HIGHER_VALUED82_IN_GG(T54, T52)
U51_GA(T54, T52, T53, T56, higher_valued82_out_gg(T54, T52)) → U52_GA(T54, T52, T53, T56, max_valued3_in_gga(T53, s(s(s(s(s(s(T54)))))), T56))
U51_GA(T54, T52, T53, T56, higher_valued82_out_gg(T54, T52)) → MAX_VALUED3_IN_GGA(T53, s(s(s(s(s(s(T54)))))), T56)
MAX_VALUED1_IN_GA(.(s(s(s(s(s(T61))))), .(s(s(s(s(T59)))), T60)), T63) → U53_GA(T61, T59, T60, T63, higher_valued87_in_gg(T61, T59))
MAX_VALUED1_IN_GA(.(s(s(s(s(s(T61))))), .(s(s(s(s(T59)))), T60)), T63) → HIGHER_VALUED87_IN_GG(T61, T59)
U53_GA(T61, T59, T60, T63, higher_valued87_out_gg(T61, T59)) → U54_GA(T61, T59, T60, T63, max_valued3_in_gga(T60, s(s(s(s(s(T61))))), T63))
U53_GA(T61, T59, T60, T63, higher_valued87_out_gg(T61, T59)) → MAX_VALUED3_IN_GGA(T60, s(s(s(s(s(T61))))), T63)
MAX_VALUED1_IN_GA(.(s(s(s(s(T68)))), .(s(s(s(T66))), T67)), T70) → U55_GA(T68, T66, T67, T70, higher_valued92_in_gg(T68, T66))
MAX_VALUED1_IN_GA(.(s(s(s(s(T68)))), .(s(s(s(T66))), T67)), T70) → HIGHER_VALUED92_IN_GG(T68, T66)
U55_GA(T68, T66, T67, T70, higher_valued92_out_gg(T68, T66)) → U56_GA(T68, T66, T67, T70, max_valued3_in_gga(T67, s(s(s(s(T68)))), T70))
U55_GA(T68, T66, T67, T70, higher_valued92_out_gg(T68, T66)) → MAX_VALUED3_IN_GGA(T67, s(s(s(s(T68)))), T70)
MAX_VALUED1_IN_GA(.(s(s(s(T75))), .(s(s(T73)), T74)), T77) → U57_GA(T75, T73, T74, T77, higher_valued97_in_gg(T75, T73))
MAX_VALUED1_IN_GA(.(s(s(s(T75))), .(s(s(T73)), T74)), T77) → HIGHER_VALUED97_IN_GG(T75, T73)
U57_GA(T75, T73, T74, T77, higher_valued97_out_gg(T75, T73)) → U58_GA(T75, T73, T74, T77, max_valued3_in_gga(T74, s(s(s(T75))), T77))
U57_GA(T75, T73, T74, T77, higher_valued97_out_gg(T75, T73)) → MAX_VALUED3_IN_GGA(T74, s(s(s(T75))), T77)
MAX_VALUED1_IN_GA(.(s(s(T82)), .(s(T80), T81)), T84) → U59_GA(T82, T80, T81, T84, higher_valued102_in_gg(T82, T80))
MAX_VALUED1_IN_GA(.(s(s(T82)), .(s(T80), T81)), T84) → HIGHER_VALUED102_IN_GG(T82, T80)
U59_GA(T82, T80, T81, T84, higher_valued102_out_gg(T82, T80)) → U60_GA(T82, T80, T81, T84, max_valued3_in_gga(T81, s(s(T82)), T84))
U59_GA(T82, T80, T81, T84, higher_valued102_out_gg(T82, T80)) → MAX_VALUED3_IN_GGA(T81, s(s(T82)), T84)
MAX_VALUED1_IN_GA(.(s(T89), .(T87, T88)), T91) → U61_GA(T89, T87, T88, T91, higher_valued107_in_gg(T89, T87))
MAX_VALUED1_IN_GA(.(s(T89), .(T87, T88)), T91) → HIGHER_VALUED107_IN_GG(T89, T87)
U61_GA(T89, T87, T88, T91, higher_valued107_out_gg(T89, T87)) → U62_GA(T89, T87, T88, T91, max_valued3_in_gga(T88, s(T89), T91))
U61_GA(T89, T87, T88, T91, higher_valued107_out_gg(T89, T87)) → MAX_VALUED3_IN_GGA(T88, s(T89), T91)
MAX_VALUED1_IN_GA(.(T96, .(T94, T95)), T98) → U63_GA(T96, T94, T95, T98, higher_valued112_in_gg(T96, T94))
MAX_VALUED1_IN_GA(.(T96, .(T94, T95)), T98) → HIGHER_VALUED112_IN_GG(T96, T94)
U63_GA(T96, T94, T95, T98, higher_valued112_out_gg(T96, T94)) → U64_GA(T96, T94, T95, T98, max_valued3_in_gga(T95, T96, T98))
U63_GA(T96, T94, T95, T98, higher_valued112_out_gg(T96, T94)) → MAX_VALUED3_IN_GGA(T95, T96, T98)
MAX_VALUED1_IN_GA(.(T103, .(T101, T102)), T105) → U65_GA(T103, T101, T102, T105, higher_valued118_in_gg(T103, T101))
MAX_VALUED1_IN_GA(.(T103, .(T101, T102)), T105) → HIGHER_VALUED118_IN_GG(T103, T101)
U65_GA(T103, T101, T102, T105, higher_valued118_out_gg(T103, T101)) → U66_GA(T103, T101, T102, T105, max_valued3_in_gga(T102, T103, T105))
U65_GA(T103, T101, T102, T105, higher_valued118_out_gg(T103, T101)) → MAX_VALUED3_IN_GGA(T102, T103, T105)
max_valued1_in_ga(.(T7, []), T7) → max_valued1_out_ga(.(T7, []), T7)
max_valued1_in_ga(.(0, .(T15, T9)), T12) → U39_ga(T15, T9, T12, max_valued3_in_gga(T9, T15, T12))
max_valued3_in_gga([], T7, T7) → max_valued3_out_gga([], T7, T7)
max_valued3_in_gga(.(T15, T9), 0, T12) → U1_gga(T15, T9, T12, max_valued3_in_gga(T9, T15, T12))
max_valued3_in_gga(.(s(T18), T9), s(0), T12) → U2_gga(T18, T9, T12, max_valued3_in_gga(T9, s(T18), T12))
max_valued3_in_gga(.(s(s(T21)), T9), s(s(0)), T12) → U3_gga(T21, T9, T12, max_valued3_in_gga(T9, s(s(T21)), T12))
max_valued3_in_gga(.(s(s(s(T24))), T9), s(s(s(0))), T12) → U4_gga(T24, T9, T12, max_valued3_in_gga(T9, s(s(s(T24))), T12))
max_valued3_in_gga(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12) → U5_gga(T27, T9, T12, max_valued3_in_gga(T9, s(s(s(s(T27)))), T12))
max_valued3_in_gga(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12) → U6_gga(T30, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(T30))))), T12))
max_valued3_in_gga(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12) → U7_gga(T33, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(T33)))))), T12))
max_valued3_in_gga(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12) → U8_gga(T36, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(s(T36))))))), T12))
max_valued3_in_gga(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12) → U9_gga(T37, T9, T38, T12, greater64_in_gg(T37, T38))
greater64_in_gg(s(T40), 0) → greater64_out_gg(s(T40), 0)
greater64_in_gg(s(T41), s(T42)) → U29_gg(T41, T42, greater64_in_gg(T41, T42))
U29_gg(T41, T42, greater64_out_gg(T41, T42)) → greater64_out_gg(s(T41), s(T42))
U9_gga(T37, T9, T38, T12, greater64_out_gg(T37, T38)) → max_valued3_out_gga(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12)
U9_gga(T37, T9, T38, T12, greater64_out_gg(T37, T38)) → U10_gga(T37, T9, T38, T12, max_valued3_in_gaa(T9, s(T39), T12))
max_valued3_in_gaa([], T7, T7) → max_valued3_out_gaa([], T7, T7)
max_valued3_in_gaa(.(T15, T9), 0, T12) → U1_gaa(T15, T9, T12, max_valued3_in_gga(T9, T15, T12))
max_valued3_in_gga(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47) → U11_gga(T43, T44, T45, T47, higher_valued77_in_ag(T48, T43))
higher_valued77_in_ag(T50, T51) → U30_ag(T50, T51, greater64_in_ag(s(s(T50)), s(s(s(s(s(s(T51))))))))
greater64_in_ag(s(T40), 0) → greater64_out_ag(s(T40), 0)
greater64_in_ag(s(T41), s(T42)) → U29_ag(T41, T42, greater64_in_ag(T41, T42))
U29_ag(T41, T42, greater64_out_ag(T41, T42)) → greater64_out_ag(s(T41), s(T42))
U30_ag(T50, T51, greater64_out_ag(s(s(T50)), s(s(s(s(s(s(T51)))))))) → higher_valued77_out_ag(T50, T51)
U11_gga(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → max_valued3_out_gga(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47)
U11_gga(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → U12_gga(T43, T44, T45, T47, max_valued3_in_gaa(T44, s(T49), T47))
max_valued3_in_gaa(.(s(T18), T9), s(0), T12) → U2_gaa(T18, T9, T12, max_valued3_in_gga(T9, s(T18), T12))
max_valued3_in_gga(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56) → U13_gga(T52, T53, T54, T56, higher_valued82_in_gg(T54, T52))
higher_valued82_in_gg(T57, T58) → U31_gg(T57, T58, greater64_in_gg(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58)))))))
U31_gg(T57, T58, greater64_out_gg(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58))))))) → higher_valued82_out_gg(T57, T58)
U13_gga(T52, T53, T54, T56, higher_valued82_out_gg(T54, T52)) → max_valued3_out_gga(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56)
U13_gga(T52, T53, T54, T56, higher_valued82_out_gg(T54, T52)) → U14_gga(T52, T53, T54, T56, max_valued3_in_gga(T53, s(s(s(s(s(s(T54)))))), T56))
max_valued3_in_gga(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63) → U15_gga(T59, T60, T61, T63, higher_valued87_in_gg(T61, T59))
higher_valued87_in_gg(T64, T65) → U32_gg(T64, T65, greater64_in_gg(s(s(s(s(s(s(T64)))))), s(s(s(s(T65))))))
U32_gg(T64, T65, greater64_out_gg(s(s(s(s(s(s(T64)))))), s(s(s(s(T65)))))) → higher_valued87_out_gg(T64, T65)
U15_gga(T59, T60, T61, T63, higher_valued87_out_gg(T61, T59)) → max_valued3_out_gga(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63)
U15_gga(T59, T60, T61, T63, higher_valued87_out_gg(T61, T59)) → U16_gga(T59, T60, T61, T63, max_valued3_in_gga(T60, s(s(s(s(s(T61))))), T63))
max_valued3_in_gga(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70) → U17_gga(T66, T67, T68, T70, higher_valued92_in_gg(T68, T66))
higher_valued92_in_gg(T71, T72) → U33_gg(T71, T72, greater64_in_gg(s(s(s(s(s(T71))))), s(s(s(T72)))))
U33_gg(T71, T72, greater64_out_gg(s(s(s(s(s(T71))))), s(s(s(T72))))) → higher_valued92_out_gg(T71, T72)
U17_gga(T66, T67, T68, T70, higher_valued92_out_gg(T68, T66)) → max_valued3_out_gga(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70)
U17_gga(T66, T67, T68, T70, higher_valued92_out_gg(T68, T66)) → U18_gga(T66, T67, T68, T70, max_valued3_in_gga(T67, s(s(s(s(T68)))), T70))
max_valued3_in_gga(.(s(s(T73)), T74), s(s(s(T75))), T77) → U19_gga(T73, T74, T75, T77, higher_valued97_in_gg(T75, T73))
higher_valued97_in_gg(T78, T79) → U34_gg(T78, T79, greater64_in_gg(s(s(s(s(T78)))), s(s(T79))))
U34_gg(T78, T79, greater64_out_gg(s(s(s(s(T78)))), s(s(T79)))) → higher_valued97_out_gg(T78, T79)
U19_gga(T73, T74, T75, T77, higher_valued97_out_gg(T75, T73)) → max_valued3_out_gga(.(s(s(T73)), T74), s(s(s(T75))), T77)
U19_gga(T73, T74, T75, T77, higher_valued97_out_gg(T75, T73)) → U20_gga(T73, T74, T75, T77, max_valued3_in_gga(T74, s(s(s(T75))), T77))
max_valued3_in_gga(.(s(T80), T81), s(s(T82)), T84) → U21_gga(T80, T81, T82, T84, higher_valued102_in_gg(T82, T80))
higher_valued102_in_gg(T85, T86) → U35_gg(T85, T86, greater64_in_gg(s(s(s(T85))), s(T86)))
U35_gg(T85, T86, greater64_out_gg(s(s(s(T85))), s(T86))) → higher_valued102_out_gg(T85, T86)
U21_gga(T80, T81, T82, T84, higher_valued102_out_gg(T82, T80)) → max_valued3_out_gga(.(s(T80), T81), s(s(T82)), T84)
U21_gga(T80, T81, T82, T84, higher_valued102_out_gg(T82, T80)) → U22_gga(T80, T81, T82, T84, max_valued3_in_gga(T81, s(s(T82)), T84))
max_valued3_in_gga(.(T87, T88), s(T89), T91) → U23_gga(T87, T88, T89, T91, higher_valued107_in_gg(T89, T87))
higher_valued107_in_gg(T92, T93) → U36_gg(T92, T93, greater64_in_gg(s(s(T92)), T93))
U36_gg(T92, T93, greater64_out_gg(s(s(T92)), T93)) → higher_valued107_out_gg(T92, T93)
U23_gga(T87, T88, T89, T91, higher_valued107_out_gg(T89, T87)) → max_valued3_out_gga(.(T87, T88), s(T89), T91)
U23_gga(T87, T88, T89, T91, higher_valued107_out_gg(T89, T87)) → U24_gga(T87, T88, T89, T91, max_valued3_in_gga(T88, s(T89), T91))
max_valued3_in_gga(.(T94, T95), T96, T98) → U25_gga(T94, T95, T96, T98, higher_valued112_in_gg(T96, T94))
higher_valued112_in_gg(T99, T100) → U37_gg(T99, T100, greater64_in_gg(s(T99), T100))
U37_gg(T99, T100, greater64_out_gg(s(T99), T100)) → higher_valued112_out_gg(T99, T100)
U25_gga(T94, T95, T96, T98, higher_valued112_out_gg(T96, T94)) → max_valued3_out_gga(.(T94, T95), T96, T98)
U25_gga(T94, T95, T96, T98, higher_valued112_out_gg(T96, T94)) → U26_gga(T94, T95, T96, T98, max_valued3_in_gga(T95, T96, T98))
max_valued3_in_gga(.(T101, T102), T103, T105) → U27_gga(T101, T102, T103, T105, higher_valued118_in_gg(T103, T101))
higher_valued118_in_gg(T106, T107) → U38_gg(T106, T107, greater64_in_gg(s(T106), T107))
U38_gg(T106, T107, greater64_out_gg(s(T106), T107)) → higher_valued118_out_gg(T106, T107)
U27_gga(T101, T102, T103, T105, higher_valued118_out_gg(T103, T101)) → max_valued3_out_gga(.(T101, T102), T103, T105)
U27_gga(T101, T102, T103, T105, higher_valued118_out_gg(T103, T101)) → U28_gga(T101, T102, T103, T105, max_valued3_in_gga(T102, T103, T105))
U28_gga(T101, T102, T103, T105, max_valued3_out_gga(T102, T103, T105)) → max_valued3_out_gga(.(T101, T102), T103, T105)
U26_gga(T94, T95, T96, T98, max_valued3_out_gga(T95, T96, T98)) → max_valued3_out_gga(.(T94, T95), T96, T98)
U24_gga(T87, T88, T89, T91, max_valued3_out_gga(T88, s(T89), T91)) → max_valued3_out_gga(.(T87, T88), s(T89), T91)
U22_gga(T80, T81, T82, T84, max_valued3_out_gga(T81, s(s(T82)), T84)) → max_valued3_out_gga(.(s(T80), T81), s(s(T82)), T84)
U20_gga(T73, T74, T75, T77, max_valued3_out_gga(T74, s(s(s(T75))), T77)) → max_valued3_out_gga(.(s(s(T73)), T74), s(s(s(T75))), T77)
U18_gga(T66, T67, T68, T70, max_valued3_out_gga(T67, s(s(s(s(T68)))), T70)) → max_valued3_out_gga(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70)
U16_gga(T59, T60, T61, T63, max_valued3_out_gga(T60, s(s(s(s(s(T61))))), T63)) → max_valued3_out_gga(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63)
U14_gga(T52, T53, T54, T56, max_valued3_out_gga(T53, s(s(s(s(s(s(T54)))))), T56)) → max_valued3_out_gga(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56)
U2_gaa(T18, T9, T12, max_valued3_out_gga(T9, s(T18), T12)) → max_valued3_out_gaa(.(s(T18), T9), s(0), T12)
max_valued3_in_gaa(.(s(s(T21)), T9), s(s(0)), T12) → U3_gaa(T21, T9, T12, max_valued3_in_gga(T9, s(s(T21)), T12))
U3_gaa(T21, T9, T12, max_valued3_out_gga(T9, s(s(T21)), T12)) → max_valued3_out_gaa(.(s(s(T21)), T9), s(s(0)), T12)
max_valued3_in_gaa(.(s(s(s(T24))), T9), s(s(s(0))), T12) → U4_gaa(T24, T9, T12, max_valued3_in_gga(T9, s(s(s(T24))), T12))
U4_gaa(T24, T9, T12, max_valued3_out_gga(T9, s(s(s(T24))), T12)) → max_valued3_out_gaa(.(s(s(s(T24))), T9), s(s(s(0))), T12)
max_valued3_in_gaa(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12) → U5_gaa(T27, T9, T12, max_valued3_in_gga(T9, s(s(s(s(T27)))), T12))
U5_gaa(T27, T9, T12, max_valued3_out_gga(T9, s(s(s(s(T27)))), T12)) → max_valued3_out_gaa(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12)
max_valued3_in_gaa(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12) → U6_gaa(T30, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(T30))))), T12))
U6_gaa(T30, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(T30))))), T12)) → max_valued3_out_gaa(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12)
max_valued3_in_gaa(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12) → U7_gaa(T33, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(T33)))))), T12))
U7_gaa(T33, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(T33)))))), T12)) → max_valued3_out_gaa(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12)
max_valued3_in_gaa(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12) → U8_gaa(T36, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(s(T36))))))), T12))
U8_gaa(T36, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(s(T36))))))), T12)) → max_valued3_out_gaa(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12)
max_valued3_in_gaa(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12) → U9_gaa(T37, T9, T38, T12, greater64_in_ga(T37, T38))
greater64_in_ga(s(T40), 0) → greater64_out_ga(s(T40), 0)
greater64_in_ga(s(T41), s(T42)) → U29_ga(T41, T42, greater64_in_ga(T41, T42))
U29_ga(T41, T42, greater64_out_ga(T41, T42)) → greater64_out_ga(s(T41), s(T42))
U9_gaa(T37, T9, T38, T12, greater64_out_ga(T37, T38)) → max_valued3_out_gaa(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12)
U9_gaa(T37, T9, T38, T12, greater64_out_ga(T37, T38)) → U10_gaa(T37, T9, T38, T12, max_valued3_in_gaa(T9, s(T39), T12))
max_valued3_in_gaa(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47) → U11_gaa(T43, T44, T45, T47, higher_valued77_in_ag(T48, T43))
U11_gaa(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → max_valued3_out_gaa(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47)
U11_gaa(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → U12_gaa(T43, T44, T45, T47, max_valued3_in_gaa(T44, s(T49), T47))
max_valued3_in_gaa(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56) → U13_gaa(T52, T53, T54, T56, higher_valued82_in_ag(T54, T52))
higher_valued82_in_ag(T57, T58) → U31_ag(T57, T58, greater64_in_ag(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58)))))))
U31_ag(T57, T58, greater64_out_ag(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58))))))) → higher_valued82_out_ag(T57, T58)
U13_gaa(T52, T53, T54, T56, higher_valued82_out_ag(T54, T52)) → max_valued3_out_gaa(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56)
U13_gaa(T52, T53, T54, T56, higher_valued82_out_ag(T54, T52)) → U14_gaa(T52, T53, T54, T56, max_valued3_in_gaa(T53, s(s(s(s(s(s(T54)))))), T56))
max_valued3_in_gaa(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63) → U15_gaa(T59, T60, T61, T63, higher_valued87_in_ag(T61, T59))
higher_valued87_in_ag(T64, T65) → U32_ag(T64, T65, greater64_in_ag(s(s(s(s(s(s(T64)))))), s(s(s(s(T65))))))
U32_ag(T64, T65, greater64_out_ag(s(s(s(s(s(s(T64)))))), s(s(s(s(T65)))))) → higher_valued87_out_ag(T64, T65)
U15_gaa(T59, T60, T61, T63, higher_valued87_out_ag(T61, T59)) → max_valued3_out_gaa(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63)
U15_gaa(T59, T60, T61, T63, higher_valued87_out_ag(T61, T59)) → U16_gaa(T59, T60, T61, T63, max_valued3_in_gaa(T60, s(s(s(s(s(T61))))), T63))
max_valued3_in_gaa(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70) → U17_gaa(T66, T67, T68, T70, higher_valued92_in_ag(T68, T66))
higher_valued92_in_ag(T71, T72) → U33_ag(T71, T72, greater64_in_ag(s(s(s(s(s(T71))))), s(s(s(T72)))))
U33_ag(T71, T72, greater64_out_ag(s(s(s(s(s(T71))))), s(s(s(T72))))) → higher_valued92_out_ag(T71, T72)
U17_gaa(T66, T67, T68, T70, higher_valued92_out_ag(T68, T66)) → max_valued3_out_gaa(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70)
U17_gaa(T66, T67, T68, T70, higher_valued92_out_ag(T68, T66)) → U18_gaa(T66, T67, T68, T70, max_valued3_in_gaa(T67, s(s(s(s(T68)))), T70))
max_valued3_in_gaa(.(s(s(T73)), T74), s(s(s(T75))), T77) → U19_gaa(T73, T74, T75, T77, higher_valued97_in_ag(T75, T73))
higher_valued97_in_ag(T78, T79) → U34_ag(T78, T79, greater64_in_ag(s(s(s(s(T78)))), s(s(T79))))
U34_ag(T78, T79, greater64_out_ag(s(s(s(s(T78)))), s(s(T79)))) → higher_valued97_out_ag(T78, T79)
U19_gaa(T73, T74, T75, T77, higher_valued97_out_ag(T75, T73)) → max_valued3_out_gaa(.(s(s(T73)), T74), s(s(s(T75))), T77)
U19_gaa(T73, T74, T75, T77, higher_valued97_out_ag(T75, T73)) → U20_gaa(T73, T74, T75, T77, max_valued3_in_gaa(T74, s(s(s(T75))), T77))
max_valued3_in_gaa(.(s(T80), T81), s(s(T82)), T84) → U21_gaa(T80, T81, T82, T84, higher_valued102_in_ag(T82, T80))
higher_valued102_in_ag(T85, T86) → U35_ag(T85, T86, greater64_in_ag(s(s(s(T85))), s(T86)))
U35_ag(T85, T86, greater64_out_ag(s(s(s(T85))), s(T86))) → higher_valued102_out_ag(T85, T86)
U21_gaa(T80, T81, T82, T84, higher_valued102_out_ag(T82, T80)) → max_valued3_out_gaa(.(s(T80), T81), s(s(T82)), T84)
U21_gaa(T80, T81, T82, T84, higher_valued102_out_ag(T82, T80)) → U22_gaa(T80, T81, T82, T84, max_valued3_in_gaa(T81, s(s(T82)), T84))
max_valued3_in_gaa(.(T87, T88), s(T89), T91) → U23_gaa(T87, T88, T89, T91, higher_valued107_in_ag(T89, T87))
higher_valued107_in_ag(T92, T93) → U36_ag(T92, T93, greater64_in_ag(s(s(T92)), T93))
U36_ag(T92, T93, greater64_out_ag(s(s(T92)), T93)) → higher_valued107_out_ag(T92, T93)
U23_gaa(T87, T88, T89, T91, higher_valued107_out_ag(T89, T87)) → max_valued3_out_gaa(.(T87, T88), s(T89), T91)
U23_gaa(T87, T88, T89, T91, higher_valued107_out_ag(T89, T87)) → U24_gaa(T87, T88, T89, T91, max_valued3_in_gaa(T88, s(T89), T91))
max_valued3_in_gaa(.(T94, T95), T96, T98) → U25_gaa(T94, T95, T96, T98, higher_valued112_in_ag(T96, T94))
higher_valued112_in_ag(T99, T100) → U37_ag(T99, T100, greater64_in_ag(s(T99), T100))
U37_ag(T99, T100, greater64_out_ag(s(T99), T100)) → higher_valued112_out_ag(T99, T100)
U25_gaa(T94, T95, T96, T98, higher_valued112_out_ag(T96, T94)) → max_valued3_out_gaa(.(T94, T95), T96, T98)
U25_gaa(T94, T95, T96, T98, higher_valued112_out_ag(T96, T94)) → U26_gaa(T94, T95, T96, T98, max_valued3_in_gaa(T95, T96, T98))
max_valued3_in_gaa(.(T101, T102), T103, T105) → U27_gaa(T101, T102, T103, T105, higher_valued118_in_ag(T103, T101))
higher_valued118_in_ag(T106, T107) → U38_ag(T106, T107, greater64_in_ag(s(T106), T107))
U38_ag(T106, T107, greater64_out_ag(s(T106), T107)) → higher_valued118_out_ag(T106, T107)
U27_gaa(T101, T102, T103, T105, higher_valued118_out_ag(T103, T101)) → max_valued3_out_gaa(.(T101, T102), T103, T105)
U27_gaa(T101, T102, T103, T105, higher_valued118_out_ag(T103, T101)) → U28_gaa(T101, T102, T103, T105, max_valued3_in_gaa(T102, T103, T105))
U28_gaa(T101, T102, T103, T105, max_valued3_out_gaa(T102, T103, T105)) → max_valued3_out_gaa(.(T101, T102), T103, T105)
U26_gaa(T94, T95, T96, T98, max_valued3_out_gaa(T95, T96, T98)) → max_valued3_out_gaa(.(T94, T95), T96, T98)
U24_gaa(T87, T88, T89, T91, max_valued3_out_gaa(T88, s(T89), T91)) → max_valued3_out_gaa(.(T87, T88), s(T89), T91)
U22_gaa(T80, T81, T82, T84, max_valued3_out_gaa(T81, s(s(T82)), T84)) → max_valued3_out_gaa(.(s(T80), T81), s(s(T82)), T84)
U20_gaa(T73, T74, T75, T77, max_valued3_out_gaa(T74, s(s(s(T75))), T77)) → max_valued3_out_gaa(.(s(s(T73)), T74), s(s(s(T75))), T77)
U18_gaa(T66, T67, T68, T70, max_valued3_out_gaa(T67, s(s(s(s(T68)))), T70)) → max_valued3_out_gaa(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70)
U16_gaa(T59, T60, T61, T63, max_valued3_out_gaa(T60, s(s(s(s(s(T61))))), T63)) → max_valued3_out_gaa(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63)
U14_gaa(T52, T53, T54, T56, max_valued3_out_gaa(T53, s(s(s(s(s(s(T54)))))), T56)) → max_valued3_out_gaa(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56)
U12_gaa(T43, T44, T45, T47, max_valued3_out_gaa(T44, s(T49), T47)) → max_valued3_out_gaa(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47)
U10_gaa(T37, T9, T38, T12, max_valued3_out_gaa(T9, s(T39), T12)) → max_valued3_out_gaa(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12)
U12_gga(T43, T44, T45, T47, max_valued3_out_gaa(T44, s(T49), T47)) → max_valued3_out_gga(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47)
U1_gaa(T15, T9, T12, max_valued3_out_gga(T9, T15, T12)) → max_valued3_out_gaa(.(T15, T9), 0, T12)
U10_gga(T37, T9, T38, T12, max_valued3_out_gaa(T9, s(T39), T12)) → max_valued3_out_gga(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12)
U8_gga(T36, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(s(T36))))))), T12)) → max_valued3_out_gga(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12)
U7_gga(T33, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(T33)))))), T12)) → max_valued3_out_gga(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12)
U6_gga(T30, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(T30))))), T12)) → max_valued3_out_gga(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12)
U5_gga(T27, T9, T12, max_valued3_out_gga(T9, s(s(s(s(T27)))), T12)) → max_valued3_out_gga(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12)
U4_gga(T24, T9, T12, max_valued3_out_gga(T9, s(s(s(T24))), T12)) → max_valued3_out_gga(.(s(s(s(T24))), T9), s(s(s(0))), T12)
U3_gga(T21, T9, T12, max_valued3_out_gga(T9, s(s(T21)), T12)) → max_valued3_out_gga(.(s(s(T21)), T9), s(s(0)), T12)
U2_gga(T18, T9, T12, max_valued3_out_gga(T9, s(T18), T12)) → max_valued3_out_gga(.(s(T18), T9), s(0), T12)
U1_gga(T15, T9, T12, max_valued3_out_gga(T9, T15, T12)) → max_valued3_out_gga(.(T15, T9), 0, T12)
U39_ga(T15, T9, T12, max_valued3_out_gga(T9, T15, T12)) → max_valued1_out_ga(.(0, .(T15, T9)), T12)
max_valued1_in_ga(.(s(0), .(s(T18), T9)), T12) → U40_ga(T18, T9, T12, max_valued3_in_gga(T9, s(T18), T12))
U40_ga(T18, T9, T12, max_valued3_out_gga(T9, s(T18), T12)) → max_valued1_out_ga(.(s(0), .(s(T18), T9)), T12)
max_valued1_in_ga(.(s(s(0)), .(s(s(T21)), T9)), T12) → U41_ga(T21, T9, T12, max_valued3_in_gga(T9, s(s(T21)), T12))
U41_ga(T21, T9, T12, max_valued3_out_gga(T9, s(s(T21)), T12)) → max_valued1_out_ga(.(s(s(0)), .(s(s(T21)), T9)), T12)
max_valued1_in_ga(.(s(s(s(0))), .(s(s(s(T24))), T9)), T12) → U42_ga(T24, T9, T12, max_valued3_in_gga(T9, s(s(s(T24))), T12))
U42_ga(T24, T9, T12, max_valued3_out_gga(T9, s(s(s(T24))), T12)) → max_valued1_out_ga(.(s(s(s(0))), .(s(s(s(T24))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(0)))), .(s(s(s(s(T27)))), T9)), T12) → U43_ga(T27, T9, T12, max_valued3_in_gga(T9, s(s(s(s(T27)))), T12))
U43_ga(T27, T9, T12, max_valued3_out_gga(T9, s(s(s(s(T27)))), T12)) → max_valued1_out_ga(.(s(s(s(s(0)))), .(s(s(s(s(T27)))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(0))))), .(s(s(s(s(s(T30))))), T9)), T12) → U44_ga(T30, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(T30))))), T12))
U44_ga(T30, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(T30))))), T12)) → max_valued1_out_ga(.(s(s(s(s(s(0))))), .(s(s(s(s(s(T30))))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(s(0)))))), .(s(s(s(s(s(s(T33)))))), T9)), T12) → U45_ga(T33, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(T33)))))), T12))
U45_ga(T33, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(T33)))))), T12)) → max_valued1_out_ga(.(s(s(s(s(s(s(0)))))), .(s(s(s(s(s(s(T33)))))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(s(s(0))))))), .(s(s(s(s(s(s(s(T36))))))), T9)), T12) → U46_ga(T36, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(s(T36))))))), T12))
U46_ga(T36, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(s(T36))))))), T12)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(0))))))), .(s(s(s(s(s(s(s(T36))))))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(s(s(s(T38)))))))), .(s(s(s(s(s(s(s(T37))))))), T9)), T12) → U47_ga(T38, T37, T9, T12, greater64_in_gg(T37, T38))
U47_ga(T38, T37, T9, T12, greater64_out_gg(T37, T38)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(s(T38)))))))), .(s(s(s(s(s(s(s(T37))))))), T9)), T12)
U47_ga(T38, T37, T9, T12, greater64_out_gg(T37, T38)) → U48_ga(T38, T37, T9, T12, max_valued3_in_gaa(T9, s(T39), T12))
U48_ga(T38, T37, T9, T12, max_valued3_out_gaa(T9, s(T39), T12)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(s(T38)))))))), .(s(s(s(s(s(s(s(T37))))))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(s(s(T45))))))), .(s(s(s(s(s(s(T43)))))), T44)), T47) → U49_ga(T45, T43, T44, T47, higher_valued77_in_ag(T48, T43))
U49_ga(T45, T43, T44, T47, higher_valued77_out_ag(T48, T43)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(T45))))))), .(s(s(s(s(s(s(T43)))))), T44)), T47)
U49_ga(T45, T43, T44, T47, higher_valued77_out_ag(T48, T43)) → U50_ga(T45, T43, T44, T47, max_valued3_in_gaa(T44, s(T49), T47))
U50_ga(T45, T43, T44, T47, max_valued3_out_gaa(T44, s(T49), T47)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(T45))))))), .(s(s(s(s(s(s(T43)))))), T44)), T47)
max_valued1_in_ga(.(s(s(s(s(s(s(T54)))))), .(s(s(s(s(s(T52))))), T53)), T56) → U51_ga(T54, T52, T53, T56, higher_valued82_in_gg(T54, T52))
U51_ga(T54, T52, T53, T56, higher_valued82_out_gg(T54, T52)) → max_valued1_out_ga(.(s(s(s(s(s(s(T54)))))), .(s(s(s(s(s(T52))))), T53)), T56)
U51_ga(T54, T52, T53, T56, higher_valued82_out_gg(T54, T52)) → U52_ga(T54, T52, T53, T56, max_valued3_in_gga(T53, s(s(s(s(s(s(T54)))))), T56))
U52_ga(T54, T52, T53, T56, max_valued3_out_gga(T53, s(s(s(s(s(s(T54)))))), T56)) → max_valued1_out_ga(.(s(s(s(s(s(s(T54)))))), .(s(s(s(s(s(T52))))), T53)), T56)
max_valued1_in_ga(.(s(s(s(s(s(T61))))), .(s(s(s(s(T59)))), T60)), T63) → U53_ga(T61, T59, T60, T63, higher_valued87_in_gg(T61, T59))
U53_ga(T61, T59, T60, T63, higher_valued87_out_gg(T61, T59)) → max_valued1_out_ga(.(s(s(s(s(s(T61))))), .(s(s(s(s(T59)))), T60)), T63)
U53_ga(T61, T59, T60, T63, higher_valued87_out_gg(T61, T59)) → U54_ga(T61, T59, T60, T63, max_valued3_in_gga(T60, s(s(s(s(s(T61))))), T63))
U54_ga(T61, T59, T60, T63, max_valued3_out_gga(T60, s(s(s(s(s(T61))))), T63)) → max_valued1_out_ga(.(s(s(s(s(s(T61))))), .(s(s(s(s(T59)))), T60)), T63)
max_valued1_in_ga(.(s(s(s(s(T68)))), .(s(s(s(T66))), T67)), T70) → U55_ga(T68, T66, T67, T70, higher_valued92_in_gg(T68, T66))
U55_ga(T68, T66, T67, T70, higher_valued92_out_gg(T68, T66)) → max_valued1_out_ga(.(s(s(s(s(T68)))), .(s(s(s(T66))), T67)), T70)
U55_ga(T68, T66, T67, T70, higher_valued92_out_gg(T68, T66)) → U56_ga(T68, T66, T67, T70, max_valued3_in_gga(T67, s(s(s(s(T68)))), T70))
U56_ga(T68, T66, T67, T70, max_valued3_out_gga(T67, s(s(s(s(T68)))), T70)) → max_valued1_out_ga(.(s(s(s(s(T68)))), .(s(s(s(T66))), T67)), T70)
max_valued1_in_ga(.(s(s(s(T75))), .(s(s(T73)), T74)), T77) → U57_ga(T75, T73, T74, T77, higher_valued97_in_gg(T75, T73))
U57_ga(T75, T73, T74, T77, higher_valued97_out_gg(T75, T73)) → max_valued1_out_ga(.(s(s(s(T75))), .(s(s(T73)), T74)), T77)
U57_ga(T75, T73, T74, T77, higher_valued97_out_gg(T75, T73)) → U58_ga(T75, T73, T74, T77, max_valued3_in_gga(T74, s(s(s(T75))), T77))
U58_ga(T75, T73, T74, T77, max_valued3_out_gga(T74, s(s(s(T75))), T77)) → max_valued1_out_ga(.(s(s(s(T75))), .(s(s(T73)), T74)), T77)
max_valued1_in_ga(.(s(s(T82)), .(s(T80), T81)), T84) → U59_ga(T82, T80, T81, T84, higher_valued102_in_gg(T82, T80))
U59_ga(T82, T80, T81, T84, higher_valued102_out_gg(T82, T80)) → max_valued1_out_ga(.(s(s(T82)), .(s(T80), T81)), T84)
U59_ga(T82, T80, T81, T84, higher_valued102_out_gg(T82, T80)) → U60_ga(T82, T80, T81, T84, max_valued3_in_gga(T81, s(s(T82)), T84))
U60_ga(T82, T80, T81, T84, max_valued3_out_gga(T81, s(s(T82)), T84)) → max_valued1_out_ga(.(s(s(T82)), .(s(T80), T81)), T84)
max_valued1_in_ga(.(s(T89), .(T87, T88)), T91) → U61_ga(T89, T87, T88, T91, higher_valued107_in_gg(T89, T87))
U61_ga(T89, T87, T88, T91, higher_valued107_out_gg(T89, T87)) → max_valued1_out_ga(.(s(T89), .(T87, T88)), T91)
U61_ga(T89, T87, T88, T91, higher_valued107_out_gg(T89, T87)) → U62_ga(T89, T87, T88, T91, max_valued3_in_gga(T88, s(T89), T91))
U62_ga(T89, T87, T88, T91, max_valued3_out_gga(T88, s(T89), T91)) → max_valued1_out_ga(.(s(T89), .(T87, T88)), T91)
max_valued1_in_ga(.(T96, .(T94, T95)), T98) → U63_ga(T96, T94, T95, T98, higher_valued112_in_gg(T96, T94))
U63_ga(T96, T94, T95, T98, higher_valued112_out_gg(T96, T94)) → max_valued1_out_ga(.(T96, .(T94, T95)), T98)
U63_ga(T96, T94, T95, T98, higher_valued112_out_gg(T96, T94)) → U64_ga(T96, T94, T95, T98, max_valued3_in_gga(T95, T96, T98))
U64_ga(T96, T94, T95, T98, max_valued3_out_gga(T95, T96, T98)) → max_valued1_out_ga(.(T96, .(T94, T95)), T98)
max_valued1_in_ga(.(T103, .(T101, T102)), T105) → U65_ga(T103, T101, T102, T105, higher_valued118_in_gg(T103, T101))
U65_ga(T103, T101, T102, T105, higher_valued118_out_gg(T103, T101)) → max_valued1_out_ga(.(T103, .(T101, T102)), T105)
U65_ga(T103, T101, T102, T105, higher_valued118_out_gg(T103, T101)) → U66_ga(T103, T101, T102, T105, max_valued3_in_gga(T102, T103, T105))
U66_ga(T103, T101, T102, T105, max_valued3_out_gga(T102, T103, T105)) → max_valued1_out_ga(.(T103, .(T101, T102)), T105)
GREATER64_IN_GA(s(T41), s(T42)) → GREATER64_IN_GA(T41, T42)
max_valued1_in_ga(.(T7, []), T7) → max_valued1_out_ga(.(T7, []), T7)
max_valued1_in_ga(.(0, .(T15, T9)), T12) → U39_ga(T15, T9, T12, max_valued3_in_gga(T9, T15, T12))
max_valued3_in_gga([], T7, T7) → max_valued3_out_gga([], T7, T7)
max_valued3_in_gga(.(T15, T9), 0, T12) → U1_gga(T15, T9, T12, max_valued3_in_gga(T9, T15, T12))
max_valued3_in_gga(.(s(T18), T9), s(0), T12) → U2_gga(T18, T9, T12, max_valued3_in_gga(T9, s(T18), T12))
max_valued3_in_gga(.(s(s(T21)), T9), s(s(0)), T12) → U3_gga(T21, T9, T12, max_valued3_in_gga(T9, s(s(T21)), T12))
max_valued3_in_gga(.(s(s(s(T24))), T9), s(s(s(0))), T12) → U4_gga(T24, T9, T12, max_valued3_in_gga(T9, s(s(s(T24))), T12))
max_valued3_in_gga(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12) → U5_gga(T27, T9, T12, max_valued3_in_gga(T9, s(s(s(s(T27)))), T12))
max_valued3_in_gga(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12) → U6_gga(T30, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(T30))))), T12))
max_valued3_in_gga(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12) → U7_gga(T33, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(T33)))))), T12))
max_valued3_in_gga(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12) → U8_gga(T36, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(s(T36))))))), T12))
max_valued3_in_gga(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12) → U9_gga(T37, T9, T38, T12, greater64_in_gg(T37, T38))
greater64_in_gg(s(T40), 0) → greater64_out_gg(s(T40), 0)
greater64_in_gg(s(T41), s(T42)) → U29_gg(T41, T42, greater64_in_gg(T41, T42))
U29_gg(T41, T42, greater64_out_gg(T41, T42)) → greater64_out_gg(s(T41), s(T42))
U9_gga(T37, T9, T38, T12, greater64_out_gg(T37, T38)) → max_valued3_out_gga(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12)
U9_gga(T37, T9, T38, T12, greater64_out_gg(T37, T38)) → U10_gga(T37, T9, T38, T12, max_valued3_in_gaa(T9, s(T39), T12))
max_valued3_in_gaa([], T7, T7) → max_valued3_out_gaa([], T7, T7)
max_valued3_in_gaa(.(T15, T9), 0, T12) → U1_gaa(T15, T9, T12, max_valued3_in_gga(T9, T15, T12))
max_valued3_in_gga(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47) → U11_gga(T43, T44, T45, T47, higher_valued77_in_ag(T48, T43))
higher_valued77_in_ag(T50, T51) → U30_ag(T50, T51, greater64_in_ag(s(s(T50)), s(s(s(s(s(s(T51))))))))
greater64_in_ag(s(T40), 0) → greater64_out_ag(s(T40), 0)
greater64_in_ag(s(T41), s(T42)) → U29_ag(T41, T42, greater64_in_ag(T41, T42))
U29_ag(T41, T42, greater64_out_ag(T41, T42)) → greater64_out_ag(s(T41), s(T42))
U30_ag(T50, T51, greater64_out_ag(s(s(T50)), s(s(s(s(s(s(T51)))))))) → higher_valued77_out_ag(T50, T51)
U11_gga(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → max_valued3_out_gga(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47)
U11_gga(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → U12_gga(T43, T44, T45, T47, max_valued3_in_gaa(T44, s(T49), T47))
max_valued3_in_gaa(.(s(T18), T9), s(0), T12) → U2_gaa(T18, T9, T12, max_valued3_in_gga(T9, s(T18), T12))
max_valued3_in_gga(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56) → U13_gga(T52, T53, T54, T56, higher_valued82_in_gg(T54, T52))
higher_valued82_in_gg(T57, T58) → U31_gg(T57, T58, greater64_in_gg(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58)))))))
U31_gg(T57, T58, greater64_out_gg(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58))))))) → higher_valued82_out_gg(T57, T58)
U13_gga(T52, T53, T54, T56, higher_valued82_out_gg(T54, T52)) → max_valued3_out_gga(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56)
U13_gga(T52, T53, T54, T56, higher_valued82_out_gg(T54, T52)) → U14_gga(T52, T53, T54, T56, max_valued3_in_gga(T53, s(s(s(s(s(s(T54)))))), T56))
max_valued3_in_gga(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63) → U15_gga(T59, T60, T61, T63, higher_valued87_in_gg(T61, T59))
higher_valued87_in_gg(T64, T65) → U32_gg(T64, T65, greater64_in_gg(s(s(s(s(s(s(T64)))))), s(s(s(s(T65))))))
U32_gg(T64, T65, greater64_out_gg(s(s(s(s(s(s(T64)))))), s(s(s(s(T65)))))) → higher_valued87_out_gg(T64, T65)
U15_gga(T59, T60, T61, T63, higher_valued87_out_gg(T61, T59)) → max_valued3_out_gga(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63)
U15_gga(T59, T60, T61, T63, higher_valued87_out_gg(T61, T59)) → U16_gga(T59, T60, T61, T63, max_valued3_in_gga(T60, s(s(s(s(s(T61))))), T63))
max_valued3_in_gga(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70) → U17_gga(T66, T67, T68, T70, higher_valued92_in_gg(T68, T66))
higher_valued92_in_gg(T71, T72) → U33_gg(T71, T72, greater64_in_gg(s(s(s(s(s(T71))))), s(s(s(T72)))))
U33_gg(T71, T72, greater64_out_gg(s(s(s(s(s(T71))))), s(s(s(T72))))) → higher_valued92_out_gg(T71, T72)
U17_gga(T66, T67, T68, T70, higher_valued92_out_gg(T68, T66)) → max_valued3_out_gga(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70)
U17_gga(T66, T67, T68, T70, higher_valued92_out_gg(T68, T66)) → U18_gga(T66, T67, T68, T70, max_valued3_in_gga(T67, s(s(s(s(T68)))), T70))
max_valued3_in_gga(.(s(s(T73)), T74), s(s(s(T75))), T77) → U19_gga(T73, T74, T75, T77, higher_valued97_in_gg(T75, T73))
higher_valued97_in_gg(T78, T79) → U34_gg(T78, T79, greater64_in_gg(s(s(s(s(T78)))), s(s(T79))))
U34_gg(T78, T79, greater64_out_gg(s(s(s(s(T78)))), s(s(T79)))) → higher_valued97_out_gg(T78, T79)
U19_gga(T73, T74, T75, T77, higher_valued97_out_gg(T75, T73)) → max_valued3_out_gga(.(s(s(T73)), T74), s(s(s(T75))), T77)
U19_gga(T73, T74, T75, T77, higher_valued97_out_gg(T75, T73)) → U20_gga(T73, T74, T75, T77, max_valued3_in_gga(T74, s(s(s(T75))), T77))
max_valued3_in_gga(.(s(T80), T81), s(s(T82)), T84) → U21_gga(T80, T81, T82, T84, higher_valued102_in_gg(T82, T80))
higher_valued102_in_gg(T85, T86) → U35_gg(T85, T86, greater64_in_gg(s(s(s(T85))), s(T86)))
U35_gg(T85, T86, greater64_out_gg(s(s(s(T85))), s(T86))) → higher_valued102_out_gg(T85, T86)
U21_gga(T80, T81, T82, T84, higher_valued102_out_gg(T82, T80)) → max_valued3_out_gga(.(s(T80), T81), s(s(T82)), T84)
U21_gga(T80, T81, T82, T84, higher_valued102_out_gg(T82, T80)) → U22_gga(T80, T81, T82, T84, max_valued3_in_gga(T81, s(s(T82)), T84))
max_valued3_in_gga(.(T87, T88), s(T89), T91) → U23_gga(T87, T88, T89, T91, higher_valued107_in_gg(T89, T87))
higher_valued107_in_gg(T92, T93) → U36_gg(T92, T93, greater64_in_gg(s(s(T92)), T93))
U36_gg(T92, T93, greater64_out_gg(s(s(T92)), T93)) → higher_valued107_out_gg(T92, T93)
U23_gga(T87, T88, T89, T91, higher_valued107_out_gg(T89, T87)) → max_valued3_out_gga(.(T87, T88), s(T89), T91)
U23_gga(T87, T88, T89, T91, higher_valued107_out_gg(T89, T87)) → U24_gga(T87, T88, T89, T91, max_valued3_in_gga(T88, s(T89), T91))
max_valued3_in_gga(.(T94, T95), T96, T98) → U25_gga(T94, T95, T96, T98, higher_valued112_in_gg(T96, T94))
higher_valued112_in_gg(T99, T100) → U37_gg(T99, T100, greater64_in_gg(s(T99), T100))
U37_gg(T99, T100, greater64_out_gg(s(T99), T100)) → higher_valued112_out_gg(T99, T100)
U25_gga(T94, T95, T96, T98, higher_valued112_out_gg(T96, T94)) → max_valued3_out_gga(.(T94, T95), T96, T98)
U25_gga(T94, T95, T96, T98, higher_valued112_out_gg(T96, T94)) → U26_gga(T94, T95, T96, T98, max_valued3_in_gga(T95, T96, T98))
max_valued3_in_gga(.(T101, T102), T103, T105) → U27_gga(T101, T102, T103, T105, higher_valued118_in_gg(T103, T101))
higher_valued118_in_gg(T106, T107) → U38_gg(T106, T107, greater64_in_gg(s(T106), T107))
U38_gg(T106, T107, greater64_out_gg(s(T106), T107)) → higher_valued118_out_gg(T106, T107)
U27_gga(T101, T102, T103, T105, higher_valued118_out_gg(T103, T101)) → max_valued3_out_gga(.(T101, T102), T103, T105)
U27_gga(T101, T102, T103, T105, higher_valued118_out_gg(T103, T101)) → U28_gga(T101, T102, T103, T105, max_valued3_in_gga(T102, T103, T105))
U28_gga(T101, T102, T103, T105, max_valued3_out_gga(T102, T103, T105)) → max_valued3_out_gga(.(T101, T102), T103, T105)
U26_gga(T94, T95, T96, T98, max_valued3_out_gga(T95, T96, T98)) → max_valued3_out_gga(.(T94, T95), T96, T98)
U24_gga(T87, T88, T89, T91, max_valued3_out_gga(T88, s(T89), T91)) → max_valued3_out_gga(.(T87, T88), s(T89), T91)
U22_gga(T80, T81, T82, T84, max_valued3_out_gga(T81, s(s(T82)), T84)) → max_valued3_out_gga(.(s(T80), T81), s(s(T82)), T84)
U20_gga(T73, T74, T75, T77, max_valued3_out_gga(T74, s(s(s(T75))), T77)) → max_valued3_out_gga(.(s(s(T73)), T74), s(s(s(T75))), T77)
U18_gga(T66, T67, T68, T70, max_valued3_out_gga(T67, s(s(s(s(T68)))), T70)) → max_valued3_out_gga(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70)
U16_gga(T59, T60, T61, T63, max_valued3_out_gga(T60, s(s(s(s(s(T61))))), T63)) → max_valued3_out_gga(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63)
U14_gga(T52, T53, T54, T56, max_valued3_out_gga(T53, s(s(s(s(s(s(T54)))))), T56)) → max_valued3_out_gga(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56)
U2_gaa(T18, T9, T12, max_valued3_out_gga(T9, s(T18), T12)) → max_valued3_out_gaa(.(s(T18), T9), s(0), T12)
max_valued3_in_gaa(.(s(s(T21)), T9), s(s(0)), T12) → U3_gaa(T21, T9, T12, max_valued3_in_gga(T9, s(s(T21)), T12))
U3_gaa(T21, T9, T12, max_valued3_out_gga(T9, s(s(T21)), T12)) → max_valued3_out_gaa(.(s(s(T21)), T9), s(s(0)), T12)
max_valued3_in_gaa(.(s(s(s(T24))), T9), s(s(s(0))), T12) → U4_gaa(T24, T9, T12, max_valued3_in_gga(T9, s(s(s(T24))), T12))
U4_gaa(T24, T9, T12, max_valued3_out_gga(T9, s(s(s(T24))), T12)) → max_valued3_out_gaa(.(s(s(s(T24))), T9), s(s(s(0))), T12)
max_valued3_in_gaa(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12) → U5_gaa(T27, T9, T12, max_valued3_in_gga(T9, s(s(s(s(T27)))), T12))
U5_gaa(T27, T9, T12, max_valued3_out_gga(T9, s(s(s(s(T27)))), T12)) → max_valued3_out_gaa(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12)
max_valued3_in_gaa(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12) → U6_gaa(T30, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(T30))))), T12))
U6_gaa(T30, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(T30))))), T12)) → max_valued3_out_gaa(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12)
max_valued3_in_gaa(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12) → U7_gaa(T33, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(T33)))))), T12))
U7_gaa(T33, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(T33)))))), T12)) → max_valued3_out_gaa(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12)
max_valued3_in_gaa(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12) → U8_gaa(T36, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(s(T36))))))), T12))
U8_gaa(T36, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(s(T36))))))), T12)) → max_valued3_out_gaa(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12)
max_valued3_in_gaa(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12) → U9_gaa(T37, T9, T38, T12, greater64_in_ga(T37, T38))
greater64_in_ga(s(T40), 0) → greater64_out_ga(s(T40), 0)
greater64_in_ga(s(T41), s(T42)) → U29_ga(T41, T42, greater64_in_ga(T41, T42))
U29_ga(T41, T42, greater64_out_ga(T41, T42)) → greater64_out_ga(s(T41), s(T42))
U9_gaa(T37, T9, T38, T12, greater64_out_ga(T37, T38)) → max_valued3_out_gaa(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12)
U9_gaa(T37, T9, T38, T12, greater64_out_ga(T37, T38)) → U10_gaa(T37, T9, T38, T12, max_valued3_in_gaa(T9, s(T39), T12))
max_valued3_in_gaa(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47) → U11_gaa(T43, T44, T45, T47, higher_valued77_in_ag(T48, T43))
U11_gaa(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → max_valued3_out_gaa(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47)
U11_gaa(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → U12_gaa(T43, T44, T45, T47, max_valued3_in_gaa(T44, s(T49), T47))
max_valued3_in_gaa(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56) → U13_gaa(T52, T53, T54, T56, higher_valued82_in_ag(T54, T52))
higher_valued82_in_ag(T57, T58) → U31_ag(T57, T58, greater64_in_ag(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58)))))))
U31_ag(T57, T58, greater64_out_ag(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58))))))) → higher_valued82_out_ag(T57, T58)
U13_gaa(T52, T53, T54, T56, higher_valued82_out_ag(T54, T52)) → max_valued3_out_gaa(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56)
U13_gaa(T52, T53, T54, T56, higher_valued82_out_ag(T54, T52)) → U14_gaa(T52, T53, T54, T56, max_valued3_in_gaa(T53, s(s(s(s(s(s(T54)))))), T56))
max_valued3_in_gaa(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63) → U15_gaa(T59, T60, T61, T63, higher_valued87_in_ag(T61, T59))
higher_valued87_in_ag(T64, T65) → U32_ag(T64, T65, greater64_in_ag(s(s(s(s(s(s(T64)))))), s(s(s(s(T65))))))
U32_ag(T64, T65, greater64_out_ag(s(s(s(s(s(s(T64)))))), s(s(s(s(T65)))))) → higher_valued87_out_ag(T64, T65)
U15_gaa(T59, T60, T61, T63, higher_valued87_out_ag(T61, T59)) → max_valued3_out_gaa(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63)
U15_gaa(T59, T60, T61, T63, higher_valued87_out_ag(T61, T59)) → U16_gaa(T59, T60, T61, T63, max_valued3_in_gaa(T60, s(s(s(s(s(T61))))), T63))
max_valued3_in_gaa(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70) → U17_gaa(T66, T67, T68, T70, higher_valued92_in_ag(T68, T66))
higher_valued92_in_ag(T71, T72) → U33_ag(T71, T72, greater64_in_ag(s(s(s(s(s(T71))))), s(s(s(T72)))))
U33_ag(T71, T72, greater64_out_ag(s(s(s(s(s(T71))))), s(s(s(T72))))) → higher_valued92_out_ag(T71, T72)
U17_gaa(T66, T67, T68, T70, higher_valued92_out_ag(T68, T66)) → max_valued3_out_gaa(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70)
U17_gaa(T66, T67, T68, T70, higher_valued92_out_ag(T68, T66)) → U18_gaa(T66, T67, T68, T70, max_valued3_in_gaa(T67, s(s(s(s(T68)))), T70))
max_valued3_in_gaa(.(s(s(T73)), T74), s(s(s(T75))), T77) → U19_gaa(T73, T74, T75, T77, higher_valued97_in_ag(T75, T73))
higher_valued97_in_ag(T78, T79) → U34_ag(T78, T79, greater64_in_ag(s(s(s(s(T78)))), s(s(T79))))
U34_ag(T78, T79, greater64_out_ag(s(s(s(s(T78)))), s(s(T79)))) → higher_valued97_out_ag(T78, T79)
U19_gaa(T73, T74, T75, T77, higher_valued97_out_ag(T75, T73)) → max_valued3_out_gaa(.(s(s(T73)), T74), s(s(s(T75))), T77)
U19_gaa(T73, T74, T75, T77, higher_valued97_out_ag(T75, T73)) → U20_gaa(T73, T74, T75, T77, max_valued3_in_gaa(T74, s(s(s(T75))), T77))
max_valued3_in_gaa(.(s(T80), T81), s(s(T82)), T84) → U21_gaa(T80, T81, T82, T84, higher_valued102_in_ag(T82, T80))
higher_valued102_in_ag(T85, T86) → U35_ag(T85, T86, greater64_in_ag(s(s(s(T85))), s(T86)))
U35_ag(T85, T86, greater64_out_ag(s(s(s(T85))), s(T86))) → higher_valued102_out_ag(T85, T86)
U21_gaa(T80, T81, T82, T84, higher_valued102_out_ag(T82, T80)) → max_valued3_out_gaa(.(s(T80), T81), s(s(T82)), T84)
U21_gaa(T80, T81, T82, T84, higher_valued102_out_ag(T82, T80)) → U22_gaa(T80, T81, T82, T84, max_valued3_in_gaa(T81, s(s(T82)), T84))
max_valued3_in_gaa(.(T87, T88), s(T89), T91) → U23_gaa(T87, T88, T89, T91, higher_valued107_in_ag(T89, T87))
higher_valued107_in_ag(T92, T93) → U36_ag(T92, T93, greater64_in_ag(s(s(T92)), T93))
U36_ag(T92, T93, greater64_out_ag(s(s(T92)), T93)) → higher_valued107_out_ag(T92, T93)
U23_gaa(T87, T88, T89, T91, higher_valued107_out_ag(T89, T87)) → max_valued3_out_gaa(.(T87, T88), s(T89), T91)
U23_gaa(T87, T88, T89, T91, higher_valued107_out_ag(T89, T87)) → U24_gaa(T87, T88, T89, T91, max_valued3_in_gaa(T88, s(T89), T91))
max_valued3_in_gaa(.(T94, T95), T96, T98) → U25_gaa(T94, T95, T96, T98, higher_valued112_in_ag(T96, T94))
higher_valued112_in_ag(T99, T100) → U37_ag(T99, T100, greater64_in_ag(s(T99), T100))
U37_ag(T99, T100, greater64_out_ag(s(T99), T100)) → higher_valued112_out_ag(T99, T100)
U25_gaa(T94, T95, T96, T98, higher_valued112_out_ag(T96, T94)) → max_valued3_out_gaa(.(T94, T95), T96, T98)
U25_gaa(T94, T95, T96, T98, higher_valued112_out_ag(T96, T94)) → U26_gaa(T94, T95, T96, T98, max_valued3_in_gaa(T95, T96, T98))
max_valued3_in_gaa(.(T101, T102), T103, T105) → U27_gaa(T101, T102, T103, T105, higher_valued118_in_ag(T103, T101))
higher_valued118_in_ag(T106, T107) → U38_ag(T106, T107, greater64_in_ag(s(T106), T107))
U38_ag(T106, T107, greater64_out_ag(s(T106), T107)) → higher_valued118_out_ag(T106, T107)
U27_gaa(T101, T102, T103, T105, higher_valued118_out_ag(T103, T101)) → max_valued3_out_gaa(.(T101, T102), T103, T105)
U27_gaa(T101, T102, T103, T105, higher_valued118_out_ag(T103, T101)) → U28_gaa(T101, T102, T103, T105, max_valued3_in_gaa(T102, T103, T105))
U28_gaa(T101, T102, T103, T105, max_valued3_out_gaa(T102, T103, T105)) → max_valued3_out_gaa(.(T101, T102), T103, T105)
U26_gaa(T94, T95, T96, T98, max_valued3_out_gaa(T95, T96, T98)) → max_valued3_out_gaa(.(T94, T95), T96, T98)
U24_gaa(T87, T88, T89, T91, max_valued3_out_gaa(T88, s(T89), T91)) → max_valued3_out_gaa(.(T87, T88), s(T89), T91)
U22_gaa(T80, T81, T82, T84, max_valued3_out_gaa(T81, s(s(T82)), T84)) → max_valued3_out_gaa(.(s(T80), T81), s(s(T82)), T84)
U20_gaa(T73, T74, T75, T77, max_valued3_out_gaa(T74, s(s(s(T75))), T77)) → max_valued3_out_gaa(.(s(s(T73)), T74), s(s(s(T75))), T77)
U18_gaa(T66, T67, T68, T70, max_valued3_out_gaa(T67, s(s(s(s(T68)))), T70)) → max_valued3_out_gaa(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70)
U16_gaa(T59, T60, T61, T63, max_valued3_out_gaa(T60, s(s(s(s(s(T61))))), T63)) → max_valued3_out_gaa(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63)
U14_gaa(T52, T53, T54, T56, max_valued3_out_gaa(T53, s(s(s(s(s(s(T54)))))), T56)) → max_valued3_out_gaa(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56)
U12_gaa(T43, T44, T45, T47, max_valued3_out_gaa(T44, s(T49), T47)) → max_valued3_out_gaa(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47)
U10_gaa(T37, T9, T38, T12, max_valued3_out_gaa(T9, s(T39), T12)) → max_valued3_out_gaa(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12)
U12_gga(T43, T44, T45, T47, max_valued3_out_gaa(T44, s(T49), T47)) → max_valued3_out_gga(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47)
U1_gaa(T15, T9, T12, max_valued3_out_gga(T9, T15, T12)) → max_valued3_out_gaa(.(T15, T9), 0, T12)
U10_gga(T37, T9, T38, T12, max_valued3_out_gaa(T9, s(T39), T12)) → max_valued3_out_gga(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12)
U8_gga(T36, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(s(T36))))))), T12)) → max_valued3_out_gga(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12)
U7_gga(T33, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(T33)))))), T12)) → max_valued3_out_gga(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12)
U6_gga(T30, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(T30))))), T12)) → max_valued3_out_gga(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12)
U5_gga(T27, T9, T12, max_valued3_out_gga(T9, s(s(s(s(T27)))), T12)) → max_valued3_out_gga(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12)
U4_gga(T24, T9, T12, max_valued3_out_gga(T9, s(s(s(T24))), T12)) → max_valued3_out_gga(.(s(s(s(T24))), T9), s(s(s(0))), T12)
U3_gga(T21, T9, T12, max_valued3_out_gga(T9, s(s(T21)), T12)) → max_valued3_out_gga(.(s(s(T21)), T9), s(s(0)), T12)
U2_gga(T18, T9, T12, max_valued3_out_gga(T9, s(T18), T12)) → max_valued3_out_gga(.(s(T18), T9), s(0), T12)
U1_gga(T15, T9, T12, max_valued3_out_gga(T9, T15, T12)) → max_valued3_out_gga(.(T15, T9), 0, T12)
U39_ga(T15, T9, T12, max_valued3_out_gga(T9, T15, T12)) → max_valued1_out_ga(.(0, .(T15, T9)), T12)
max_valued1_in_ga(.(s(0), .(s(T18), T9)), T12) → U40_ga(T18, T9, T12, max_valued3_in_gga(T9, s(T18), T12))
U40_ga(T18, T9, T12, max_valued3_out_gga(T9, s(T18), T12)) → max_valued1_out_ga(.(s(0), .(s(T18), T9)), T12)
max_valued1_in_ga(.(s(s(0)), .(s(s(T21)), T9)), T12) → U41_ga(T21, T9, T12, max_valued3_in_gga(T9, s(s(T21)), T12))
U41_ga(T21, T9, T12, max_valued3_out_gga(T9, s(s(T21)), T12)) → max_valued1_out_ga(.(s(s(0)), .(s(s(T21)), T9)), T12)
max_valued1_in_ga(.(s(s(s(0))), .(s(s(s(T24))), T9)), T12) → U42_ga(T24, T9, T12, max_valued3_in_gga(T9, s(s(s(T24))), T12))
U42_ga(T24, T9, T12, max_valued3_out_gga(T9, s(s(s(T24))), T12)) → max_valued1_out_ga(.(s(s(s(0))), .(s(s(s(T24))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(0)))), .(s(s(s(s(T27)))), T9)), T12) → U43_ga(T27, T9, T12, max_valued3_in_gga(T9, s(s(s(s(T27)))), T12))
U43_ga(T27, T9, T12, max_valued3_out_gga(T9, s(s(s(s(T27)))), T12)) → max_valued1_out_ga(.(s(s(s(s(0)))), .(s(s(s(s(T27)))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(0))))), .(s(s(s(s(s(T30))))), T9)), T12) → U44_ga(T30, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(T30))))), T12))
U44_ga(T30, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(T30))))), T12)) → max_valued1_out_ga(.(s(s(s(s(s(0))))), .(s(s(s(s(s(T30))))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(s(0)))))), .(s(s(s(s(s(s(T33)))))), T9)), T12) → U45_ga(T33, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(T33)))))), T12))
U45_ga(T33, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(T33)))))), T12)) → max_valued1_out_ga(.(s(s(s(s(s(s(0)))))), .(s(s(s(s(s(s(T33)))))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(s(s(0))))))), .(s(s(s(s(s(s(s(T36))))))), T9)), T12) → U46_ga(T36, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(s(T36))))))), T12))
U46_ga(T36, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(s(T36))))))), T12)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(0))))))), .(s(s(s(s(s(s(s(T36))))))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(s(s(s(T38)))))))), .(s(s(s(s(s(s(s(T37))))))), T9)), T12) → U47_ga(T38, T37, T9, T12, greater64_in_gg(T37, T38))
U47_ga(T38, T37, T9, T12, greater64_out_gg(T37, T38)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(s(T38)))))))), .(s(s(s(s(s(s(s(T37))))))), T9)), T12)
U47_ga(T38, T37, T9, T12, greater64_out_gg(T37, T38)) → U48_ga(T38, T37, T9, T12, max_valued3_in_gaa(T9, s(T39), T12))
U48_ga(T38, T37, T9, T12, max_valued3_out_gaa(T9, s(T39), T12)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(s(T38)))))))), .(s(s(s(s(s(s(s(T37))))))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(s(s(T45))))))), .(s(s(s(s(s(s(T43)))))), T44)), T47) → U49_ga(T45, T43, T44, T47, higher_valued77_in_ag(T48, T43))
U49_ga(T45, T43, T44, T47, higher_valued77_out_ag(T48, T43)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(T45))))))), .(s(s(s(s(s(s(T43)))))), T44)), T47)
U49_ga(T45, T43, T44, T47, higher_valued77_out_ag(T48, T43)) → U50_ga(T45, T43, T44, T47, max_valued3_in_gaa(T44, s(T49), T47))
U50_ga(T45, T43, T44, T47, max_valued3_out_gaa(T44, s(T49), T47)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(T45))))))), .(s(s(s(s(s(s(T43)))))), T44)), T47)
max_valued1_in_ga(.(s(s(s(s(s(s(T54)))))), .(s(s(s(s(s(T52))))), T53)), T56) → U51_ga(T54, T52, T53, T56, higher_valued82_in_gg(T54, T52))
U51_ga(T54, T52, T53, T56, higher_valued82_out_gg(T54, T52)) → max_valued1_out_ga(.(s(s(s(s(s(s(T54)))))), .(s(s(s(s(s(T52))))), T53)), T56)
U51_ga(T54, T52, T53, T56, higher_valued82_out_gg(T54, T52)) → U52_ga(T54, T52, T53, T56, max_valued3_in_gga(T53, s(s(s(s(s(s(T54)))))), T56))
U52_ga(T54, T52, T53, T56, max_valued3_out_gga(T53, s(s(s(s(s(s(T54)))))), T56)) → max_valued1_out_ga(.(s(s(s(s(s(s(T54)))))), .(s(s(s(s(s(T52))))), T53)), T56)
max_valued1_in_ga(.(s(s(s(s(s(T61))))), .(s(s(s(s(T59)))), T60)), T63) → U53_ga(T61, T59, T60, T63, higher_valued87_in_gg(T61, T59))
U53_ga(T61, T59, T60, T63, higher_valued87_out_gg(T61, T59)) → max_valued1_out_ga(.(s(s(s(s(s(T61))))), .(s(s(s(s(T59)))), T60)), T63)
U53_ga(T61, T59, T60, T63, higher_valued87_out_gg(T61, T59)) → U54_ga(T61, T59, T60, T63, max_valued3_in_gga(T60, s(s(s(s(s(T61))))), T63))
U54_ga(T61, T59, T60, T63, max_valued3_out_gga(T60, s(s(s(s(s(T61))))), T63)) → max_valued1_out_ga(.(s(s(s(s(s(T61))))), .(s(s(s(s(T59)))), T60)), T63)
max_valued1_in_ga(.(s(s(s(s(T68)))), .(s(s(s(T66))), T67)), T70) → U55_ga(T68, T66, T67, T70, higher_valued92_in_gg(T68, T66))
U55_ga(T68, T66, T67, T70, higher_valued92_out_gg(T68, T66)) → max_valued1_out_ga(.(s(s(s(s(T68)))), .(s(s(s(T66))), T67)), T70)
U55_ga(T68, T66, T67, T70, higher_valued92_out_gg(T68, T66)) → U56_ga(T68, T66, T67, T70, max_valued3_in_gga(T67, s(s(s(s(T68)))), T70))
U56_ga(T68, T66, T67, T70, max_valued3_out_gga(T67, s(s(s(s(T68)))), T70)) → max_valued1_out_ga(.(s(s(s(s(T68)))), .(s(s(s(T66))), T67)), T70)
max_valued1_in_ga(.(s(s(s(T75))), .(s(s(T73)), T74)), T77) → U57_ga(T75, T73, T74, T77, higher_valued97_in_gg(T75, T73))
U57_ga(T75, T73, T74, T77, higher_valued97_out_gg(T75, T73)) → max_valued1_out_ga(.(s(s(s(T75))), .(s(s(T73)), T74)), T77)
U57_ga(T75, T73, T74, T77, higher_valued97_out_gg(T75, T73)) → U58_ga(T75, T73, T74, T77, max_valued3_in_gga(T74, s(s(s(T75))), T77))
U58_ga(T75, T73, T74, T77, max_valued3_out_gga(T74, s(s(s(T75))), T77)) → max_valued1_out_ga(.(s(s(s(T75))), .(s(s(T73)), T74)), T77)
max_valued1_in_ga(.(s(s(T82)), .(s(T80), T81)), T84) → U59_ga(T82, T80, T81, T84, higher_valued102_in_gg(T82, T80))
U59_ga(T82, T80, T81, T84, higher_valued102_out_gg(T82, T80)) → max_valued1_out_ga(.(s(s(T82)), .(s(T80), T81)), T84)
U59_ga(T82, T80, T81, T84, higher_valued102_out_gg(T82, T80)) → U60_ga(T82, T80, T81, T84, max_valued3_in_gga(T81, s(s(T82)), T84))
U60_ga(T82, T80, T81, T84, max_valued3_out_gga(T81, s(s(T82)), T84)) → max_valued1_out_ga(.(s(s(T82)), .(s(T80), T81)), T84)
max_valued1_in_ga(.(s(T89), .(T87, T88)), T91) → U61_ga(T89, T87, T88, T91, higher_valued107_in_gg(T89, T87))
U61_ga(T89, T87, T88, T91, higher_valued107_out_gg(T89, T87)) → max_valued1_out_ga(.(s(T89), .(T87, T88)), T91)
U61_ga(T89, T87, T88, T91, higher_valued107_out_gg(T89, T87)) → U62_ga(T89, T87, T88, T91, max_valued3_in_gga(T88, s(T89), T91))
U62_ga(T89, T87, T88, T91, max_valued3_out_gga(T88, s(T89), T91)) → max_valued1_out_ga(.(s(T89), .(T87, T88)), T91)
max_valued1_in_ga(.(T96, .(T94, T95)), T98) → U63_ga(T96, T94, T95, T98, higher_valued112_in_gg(T96, T94))
U63_ga(T96, T94, T95, T98, higher_valued112_out_gg(T96, T94)) → max_valued1_out_ga(.(T96, .(T94, T95)), T98)
U63_ga(T96, T94, T95, T98, higher_valued112_out_gg(T96, T94)) → U64_ga(T96, T94, T95, T98, max_valued3_in_gga(T95, T96, T98))
U64_ga(T96, T94, T95, T98, max_valued3_out_gga(T95, T96, T98)) → max_valued1_out_ga(.(T96, .(T94, T95)), T98)
max_valued1_in_ga(.(T103, .(T101, T102)), T105) → U65_ga(T103, T101, T102, T105, higher_valued118_in_gg(T103, T101))
U65_ga(T103, T101, T102, T105, higher_valued118_out_gg(T103, T101)) → max_valued1_out_ga(.(T103, .(T101, T102)), T105)
U65_ga(T103, T101, T102, T105, higher_valued118_out_gg(T103, T101)) → U66_ga(T103, T101, T102, T105, max_valued3_in_gga(T102, T103, T105))
U66_ga(T103, T101, T102, T105, max_valued3_out_gga(T102, T103, T105)) → max_valued1_out_ga(.(T103, .(T101, T102)), T105)
GREATER64_IN_GA(s(T41), s(T42)) → GREATER64_IN_GA(T41, T42)
GREATER64_IN_GA(s(T41)) → GREATER64_IN_GA(T41)
From the DPs we obtained the following set of size-change graphs:
GREATER64_IN_AG(s(T41), s(T42)) → GREATER64_IN_AG(T41, T42)
max_valued1_in_ga(.(T7, []), T7) → max_valued1_out_ga(.(T7, []), T7)
max_valued1_in_ga(.(0, .(T15, T9)), T12) → U39_ga(T15, T9, T12, max_valued3_in_gga(T9, T15, T12))
max_valued3_in_gga([], T7, T7) → max_valued3_out_gga([], T7, T7)
max_valued3_in_gga(.(T15, T9), 0, T12) → U1_gga(T15, T9, T12, max_valued3_in_gga(T9, T15, T12))
max_valued3_in_gga(.(s(T18), T9), s(0), T12) → U2_gga(T18, T9, T12, max_valued3_in_gga(T9, s(T18), T12))
max_valued3_in_gga(.(s(s(T21)), T9), s(s(0)), T12) → U3_gga(T21, T9, T12, max_valued3_in_gga(T9, s(s(T21)), T12))
max_valued3_in_gga(.(s(s(s(T24))), T9), s(s(s(0))), T12) → U4_gga(T24, T9, T12, max_valued3_in_gga(T9, s(s(s(T24))), T12))
max_valued3_in_gga(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12) → U5_gga(T27, T9, T12, max_valued3_in_gga(T9, s(s(s(s(T27)))), T12))
max_valued3_in_gga(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12) → U6_gga(T30, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(T30))))), T12))
max_valued3_in_gga(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12) → U7_gga(T33, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(T33)))))), T12))
max_valued3_in_gga(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12) → U8_gga(T36, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(s(T36))))))), T12))
max_valued3_in_gga(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12) → U9_gga(T37, T9, T38, T12, greater64_in_gg(T37, T38))
greater64_in_gg(s(T40), 0) → greater64_out_gg(s(T40), 0)
greater64_in_gg(s(T41), s(T42)) → U29_gg(T41, T42, greater64_in_gg(T41, T42))
U29_gg(T41, T42, greater64_out_gg(T41, T42)) → greater64_out_gg(s(T41), s(T42))
U9_gga(T37, T9, T38, T12, greater64_out_gg(T37, T38)) → max_valued3_out_gga(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12)
U9_gga(T37, T9, T38, T12, greater64_out_gg(T37, T38)) → U10_gga(T37, T9, T38, T12, max_valued3_in_gaa(T9, s(T39), T12))
max_valued3_in_gaa([], T7, T7) → max_valued3_out_gaa([], T7, T7)
max_valued3_in_gaa(.(T15, T9), 0, T12) → U1_gaa(T15, T9, T12, max_valued3_in_gga(T9, T15, T12))
max_valued3_in_gga(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47) → U11_gga(T43, T44, T45, T47, higher_valued77_in_ag(T48, T43))
higher_valued77_in_ag(T50, T51) → U30_ag(T50, T51, greater64_in_ag(s(s(T50)), s(s(s(s(s(s(T51))))))))
greater64_in_ag(s(T40), 0) → greater64_out_ag(s(T40), 0)
greater64_in_ag(s(T41), s(T42)) → U29_ag(T41, T42, greater64_in_ag(T41, T42))
U29_ag(T41, T42, greater64_out_ag(T41, T42)) → greater64_out_ag(s(T41), s(T42))
U30_ag(T50, T51, greater64_out_ag(s(s(T50)), s(s(s(s(s(s(T51)))))))) → higher_valued77_out_ag(T50, T51)
U11_gga(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → max_valued3_out_gga(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47)
U11_gga(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → U12_gga(T43, T44, T45, T47, max_valued3_in_gaa(T44, s(T49), T47))
max_valued3_in_gaa(.(s(T18), T9), s(0), T12) → U2_gaa(T18, T9, T12, max_valued3_in_gga(T9, s(T18), T12))
max_valued3_in_gga(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56) → U13_gga(T52, T53, T54, T56, higher_valued82_in_gg(T54, T52))
higher_valued82_in_gg(T57, T58) → U31_gg(T57, T58, greater64_in_gg(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58)))))))
U31_gg(T57, T58, greater64_out_gg(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58))))))) → higher_valued82_out_gg(T57, T58)
U13_gga(T52, T53, T54, T56, higher_valued82_out_gg(T54, T52)) → max_valued3_out_gga(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56)
U13_gga(T52, T53, T54, T56, higher_valued82_out_gg(T54, T52)) → U14_gga(T52, T53, T54, T56, max_valued3_in_gga(T53, s(s(s(s(s(s(T54)))))), T56))
max_valued3_in_gga(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63) → U15_gga(T59, T60, T61, T63, higher_valued87_in_gg(T61, T59))
higher_valued87_in_gg(T64, T65) → U32_gg(T64, T65, greater64_in_gg(s(s(s(s(s(s(T64)))))), s(s(s(s(T65))))))
U32_gg(T64, T65, greater64_out_gg(s(s(s(s(s(s(T64)))))), s(s(s(s(T65)))))) → higher_valued87_out_gg(T64, T65)
U15_gga(T59, T60, T61, T63, higher_valued87_out_gg(T61, T59)) → max_valued3_out_gga(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63)
U15_gga(T59, T60, T61, T63, higher_valued87_out_gg(T61, T59)) → U16_gga(T59, T60, T61, T63, max_valued3_in_gga(T60, s(s(s(s(s(T61))))), T63))
max_valued3_in_gga(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70) → U17_gga(T66, T67, T68, T70, higher_valued92_in_gg(T68, T66))
higher_valued92_in_gg(T71, T72) → U33_gg(T71, T72, greater64_in_gg(s(s(s(s(s(T71))))), s(s(s(T72)))))
U33_gg(T71, T72, greater64_out_gg(s(s(s(s(s(T71))))), s(s(s(T72))))) → higher_valued92_out_gg(T71, T72)
U17_gga(T66, T67, T68, T70, higher_valued92_out_gg(T68, T66)) → max_valued3_out_gga(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70)
U17_gga(T66, T67, T68, T70, higher_valued92_out_gg(T68, T66)) → U18_gga(T66, T67, T68, T70, max_valued3_in_gga(T67, s(s(s(s(T68)))), T70))
max_valued3_in_gga(.(s(s(T73)), T74), s(s(s(T75))), T77) → U19_gga(T73, T74, T75, T77, higher_valued97_in_gg(T75, T73))
higher_valued97_in_gg(T78, T79) → U34_gg(T78, T79, greater64_in_gg(s(s(s(s(T78)))), s(s(T79))))
U34_gg(T78, T79, greater64_out_gg(s(s(s(s(T78)))), s(s(T79)))) → higher_valued97_out_gg(T78, T79)
U19_gga(T73, T74, T75, T77, higher_valued97_out_gg(T75, T73)) → max_valued3_out_gga(.(s(s(T73)), T74), s(s(s(T75))), T77)
U19_gga(T73, T74, T75, T77, higher_valued97_out_gg(T75, T73)) → U20_gga(T73, T74, T75, T77, max_valued3_in_gga(T74, s(s(s(T75))), T77))
max_valued3_in_gga(.(s(T80), T81), s(s(T82)), T84) → U21_gga(T80, T81, T82, T84, higher_valued102_in_gg(T82, T80))
higher_valued102_in_gg(T85, T86) → U35_gg(T85, T86, greater64_in_gg(s(s(s(T85))), s(T86)))
U35_gg(T85, T86, greater64_out_gg(s(s(s(T85))), s(T86))) → higher_valued102_out_gg(T85, T86)
U21_gga(T80, T81, T82, T84, higher_valued102_out_gg(T82, T80)) → max_valued3_out_gga(.(s(T80), T81), s(s(T82)), T84)
U21_gga(T80, T81, T82, T84, higher_valued102_out_gg(T82, T80)) → U22_gga(T80, T81, T82, T84, max_valued3_in_gga(T81, s(s(T82)), T84))
max_valued3_in_gga(.(T87, T88), s(T89), T91) → U23_gga(T87, T88, T89, T91, higher_valued107_in_gg(T89, T87))
higher_valued107_in_gg(T92, T93) → U36_gg(T92, T93, greater64_in_gg(s(s(T92)), T93))
U36_gg(T92, T93, greater64_out_gg(s(s(T92)), T93)) → higher_valued107_out_gg(T92, T93)
U23_gga(T87, T88, T89, T91, higher_valued107_out_gg(T89, T87)) → max_valued3_out_gga(.(T87, T88), s(T89), T91)
U23_gga(T87, T88, T89, T91, higher_valued107_out_gg(T89, T87)) → U24_gga(T87, T88, T89, T91, max_valued3_in_gga(T88, s(T89), T91))
max_valued3_in_gga(.(T94, T95), T96, T98) → U25_gga(T94, T95, T96, T98, higher_valued112_in_gg(T96, T94))
higher_valued112_in_gg(T99, T100) → U37_gg(T99, T100, greater64_in_gg(s(T99), T100))
U37_gg(T99, T100, greater64_out_gg(s(T99), T100)) → higher_valued112_out_gg(T99, T100)
U25_gga(T94, T95, T96, T98, higher_valued112_out_gg(T96, T94)) → max_valued3_out_gga(.(T94, T95), T96, T98)
U25_gga(T94, T95, T96, T98, higher_valued112_out_gg(T96, T94)) → U26_gga(T94, T95, T96, T98, max_valued3_in_gga(T95, T96, T98))
max_valued3_in_gga(.(T101, T102), T103, T105) → U27_gga(T101, T102, T103, T105, higher_valued118_in_gg(T103, T101))
higher_valued118_in_gg(T106, T107) → U38_gg(T106, T107, greater64_in_gg(s(T106), T107))
U38_gg(T106, T107, greater64_out_gg(s(T106), T107)) → higher_valued118_out_gg(T106, T107)
U27_gga(T101, T102, T103, T105, higher_valued118_out_gg(T103, T101)) → max_valued3_out_gga(.(T101, T102), T103, T105)
U27_gga(T101, T102, T103, T105, higher_valued118_out_gg(T103, T101)) → U28_gga(T101, T102, T103, T105, max_valued3_in_gga(T102, T103, T105))
U28_gga(T101, T102, T103, T105, max_valued3_out_gga(T102, T103, T105)) → max_valued3_out_gga(.(T101, T102), T103, T105)
U26_gga(T94, T95, T96, T98, max_valued3_out_gga(T95, T96, T98)) → max_valued3_out_gga(.(T94, T95), T96, T98)
U24_gga(T87, T88, T89, T91, max_valued3_out_gga(T88, s(T89), T91)) → max_valued3_out_gga(.(T87, T88), s(T89), T91)
U22_gga(T80, T81, T82, T84, max_valued3_out_gga(T81, s(s(T82)), T84)) → max_valued3_out_gga(.(s(T80), T81), s(s(T82)), T84)
U20_gga(T73, T74, T75, T77, max_valued3_out_gga(T74, s(s(s(T75))), T77)) → max_valued3_out_gga(.(s(s(T73)), T74), s(s(s(T75))), T77)
U18_gga(T66, T67, T68, T70, max_valued3_out_gga(T67, s(s(s(s(T68)))), T70)) → max_valued3_out_gga(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70)
U16_gga(T59, T60, T61, T63, max_valued3_out_gga(T60, s(s(s(s(s(T61))))), T63)) → max_valued3_out_gga(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63)
U14_gga(T52, T53, T54, T56, max_valued3_out_gga(T53, s(s(s(s(s(s(T54)))))), T56)) → max_valued3_out_gga(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56)
U2_gaa(T18, T9, T12, max_valued3_out_gga(T9, s(T18), T12)) → max_valued3_out_gaa(.(s(T18), T9), s(0), T12)
max_valued3_in_gaa(.(s(s(T21)), T9), s(s(0)), T12) → U3_gaa(T21, T9, T12, max_valued3_in_gga(T9, s(s(T21)), T12))
U3_gaa(T21, T9, T12, max_valued3_out_gga(T9, s(s(T21)), T12)) → max_valued3_out_gaa(.(s(s(T21)), T9), s(s(0)), T12)
max_valued3_in_gaa(.(s(s(s(T24))), T9), s(s(s(0))), T12) → U4_gaa(T24, T9, T12, max_valued3_in_gga(T9, s(s(s(T24))), T12))
U4_gaa(T24, T9, T12, max_valued3_out_gga(T9, s(s(s(T24))), T12)) → max_valued3_out_gaa(.(s(s(s(T24))), T9), s(s(s(0))), T12)
max_valued3_in_gaa(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12) → U5_gaa(T27, T9, T12, max_valued3_in_gga(T9, s(s(s(s(T27)))), T12))
U5_gaa(T27, T9, T12, max_valued3_out_gga(T9, s(s(s(s(T27)))), T12)) → max_valued3_out_gaa(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12)
max_valued3_in_gaa(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12) → U6_gaa(T30, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(T30))))), T12))
U6_gaa(T30, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(T30))))), T12)) → max_valued3_out_gaa(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12)
max_valued3_in_gaa(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12) → U7_gaa(T33, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(T33)))))), T12))
U7_gaa(T33, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(T33)))))), T12)) → max_valued3_out_gaa(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12)
max_valued3_in_gaa(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12) → U8_gaa(T36, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(s(T36))))))), T12))
U8_gaa(T36, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(s(T36))))))), T12)) → max_valued3_out_gaa(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12)
max_valued3_in_gaa(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12) → U9_gaa(T37, T9, T38, T12, greater64_in_ga(T37, T38))
greater64_in_ga(s(T40), 0) → greater64_out_ga(s(T40), 0)
greater64_in_ga(s(T41), s(T42)) → U29_ga(T41, T42, greater64_in_ga(T41, T42))
U29_ga(T41, T42, greater64_out_ga(T41, T42)) → greater64_out_ga(s(T41), s(T42))
U9_gaa(T37, T9, T38, T12, greater64_out_ga(T37, T38)) → max_valued3_out_gaa(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12)
U9_gaa(T37, T9, T38, T12, greater64_out_ga(T37, T38)) → U10_gaa(T37, T9, T38, T12, max_valued3_in_gaa(T9, s(T39), T12))
max_valued3_in_gaa(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47) → U11_gaa(T43, T44, T45, T47, higher_valued77_in_ag(T48, T43))
U11_gaa(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → max_valued3_out_gaa(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47)
U11_gaa(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → U12_gaa(T43, T44, T45, T47, max_valued3_in_gaa(T44, s(T49), T47))
max_valued3_in_gaa(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56) → U13_gaa(T52, T53, T54, T56, higher_valued82_in_ag(T54, T52))
higher_valued82_in_ag(T57, T58) → U31_ag(T57, T58, greater64_in_ag(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58)))))))
U31_ag(T57, T58, greater64_out_ag(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58))))))) → higher_valued82_out_ag(T57, T58)
U13_gaa(T52, T53, T54, T56, higher_valued82_out_ag(T54, T52)) → max_valued3_out_gaa(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56)
U13_gaa(T52, T53, T54, T56, higher_valued82_out_ag(T54, T52)) → U14_gaa(T52, T53, T54, T56, max_valued3_in_gaa(T53, s(s(s(s(s(s(T54)))))), T56))
max_valued3_in_gaa(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63) → U15_gaa(T59, T60, T61, T63, higher_valued87_in_ag(T61, T59))
higher_valued87_in_ag(T64, T65) → U32_ag(T64, T65, greater64_in_ag(s(s(s(s(s(s(T64)))))), s(s(s(s(T65))))))
U32_ag(T64, T65, greater64_out_ag(s(s(s(s(s(s(T64)))))), s(s(s(s(T65)))))) → higher_valued87_out_ag(T64, T65)
U15_gaa(T59, T60, T61, T63, higher_valued87_out_ag(T61, T59)) → max_valued3_out_gaa(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63)
U15_gaa(T59, T60, T61, T63, higher_valued87_out_ag(T61, T59)) → U16_gaa(T59, T60, T61, T63, max_valued3_in_gaa(T60, s(s(s(s(s(T61))))), T63))
max_valued3_in_gaa(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70) → U17_gaa(T66, T67, T68, T70, higher_valued92_in_ag(T68, T66))
higher_valued92_in_ag(T71, T72) → U33_ag(T71, T72, greater64_in_ag(s(s(s(s(s(T71))))), s(s(s(T72)))))
U33_ag(T71, T72, greater64_out_ag(s(s(s(s(s(T71))))), s(s(s(T72))))) → higher_valued92_out_ag(T71, T72)
U17_gaa(T66, T67, T68, T70, higher_valued92_out_ag(T68, T66)) → max_valued3_out_gaa(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70)
U17_gaa(T66, T67, T68, T70, higher_valued92_out_ag(T68, T66)) → U18_gaa(T66, T67, T68, T70, max_valued3_in_gaa(T67, s(s(s(s(T68)))), T70))
max_valued3_in_gaa(.(s(s(T73)), T74), s(s(s(T75))), T77) → U19_gaa(T73, T74, T75, T77, higher_valued97_in_ag(T75, T73))
higher_valued97_in_ag(T78, T79) → U34_ag(T78, T79, greater64_in_ag(s(s(s(s(T78)))), s(s(T79))))
U34_ag(T78, T79, greater64_out_ag(s(s(s(s(T78)))), s(s(T79)))) → higher_valued97_out_ag(T78, T79)
U19_gaa(T73, T74, T75, T77, higher_valued97_out_ag(T75, T73)) → max_valued3_out_gaa(.(s(s(T73)), T74), s(s(s(T75))), T77)
U19_gaa(T73, T74, T75, T77, higher_valued97_out_ag(T75, T73)) → U20_gaa(T73, T74, T75, T77, max_valued3_in_gaa(T74, s(s(s(T75))), T77))
max_valued3_in_gaa(.(s(T80), T81), s(s(T82)), T84) → U21_gaa(T80, T81, T82, T84, higher_valued102_in_ag(T82, T80))
higher_valued102_in_ag(T85, T86) → U35_ag(T85, T86, greater64_in_ag(s(s(s(T85))), s(T86)))
U35_ag(T85, T86, greater64_out_ag(s(s(s(T85))), s(T86))) → higher_valued102_out_ag(T85, T86)
U21_gaa(T80, T81, T82, T84, higher_valued102_out_ag(T82, T80)) → max_valued3_out_gaa(.(s(T80), T81), s(s(T82)), T84)
U21_gaa(T80, T81, T82, T84, higher_valued102_out_ag(T82, T80)) → U22_gaa(T80, T81, T82, T84, max_valued3_in_gaa(T81, s(s(T82)), T84))
max_valued3_in_gaa(.(T87, T88), s(T89), T91) → U23_gaa(T87, T88, T89, T91, higher_valued107_in_ag(T89, T87))
higher_valued107_in_ag(T92, T93) → U36_ag(T92, T93, greater64_in_ag(s(s(T92)), T93))
U36_ag(T92, T93, greater64_out_ag(s(s(T92)), T93)) → higher_valued107_out_ag(T92, T93)
U23_gaa(T87, T88, T89, T91, higher_valued107_out_ag(T89, T87)) → max_valued3_out_gaa(.(T87, T88), s(T89), T91)
U23_gaa(T87, T88, T89, T91, higher_valued107_out_ag(T89, T87)) → U24_gaa(T87, T88, T89, T91, max_valued3_in_gaa(T88, s(T89), T91))
max_valued3_in_gaa(.(T94, T95), T96, T98) → U25_gaa(T94, T95, T96, T98, higher_valued112_in_ag(T96, T94))
higher_valued112_in_ag(T99, T100) → U37_ag(T99, T100, greater64_in_ag(s(T99), T100))
U37_ag(T99, T100, greater64_out_ag(s(T99), T100)) → higher_valued112_out_ag(T99, T100)
U25_gaa(T94, T95, T96, T98, higher_valued112_out_ag(T96, T94)) → max_valued3_out_gaa(.(T94, T95), T96, T98)
U25_gaa(T94, T95, T96, T98, higher_valued112_out_ag(T96, T94)) → U26_gaa(T94, T95, T96, T98, max_valued3_in_gaa(T95, T96, T98))
max_valued3_in_gaa(.(T101, T102), T103, T105) → U27_gaa(T101, T102, T103, T105, higher_valued118_in_ag(T103, T101))
higher_valued118_in_ag(T106, T107) → U38_ag(T106, T107, greater64_in_ag(s(T106), T107))
U38_ag(T106, T107, greater64_out_ag(s(T106), T107)) → higher_valued118_out_ag(T106, T107)
U27_gaa(T101, T102, T103, T105, higher_valued118_out_ag(T103, T101)) → max_valued3_out_gaa(.(T101, T102), T103, T105)
U27_gaa(T101, T102, T103, T105, higher_valued118_out_ag(T103, T101)) → U28_gaa(T101, T102, T103, T105, max_valued3_in_gaa(T102, T103, T105))
U28_gaa(T101, T102, T103, T105, max_valued3_out_gaa(T102, T103, T105)) → max_valued3_out_gaa(.(T101, T102), T103, T105)
U26_gaa(T94, T95, T96, T98, max_valued3_out_gaa(T95, T96, T98)) → max_valued3_out_gaa(.(T94, T95), T96, T98)
U24_gaa(T87, T88, T89, T91, max_valued3_out_gaa(T88, s(T89), T91)) → max_valued3_out_gaa(.(T87, T88), s(T89), T91)
U22_gaa(T80, T81, T82, T84, max_valued3_out_gaa(T81, s(s(T82)), T84)) → max_valued3_out_gaa(.(s(T80), T81), s(s(T82)), T84)
U20_gaa(T73, T74, T75, T77, max_valued3_out_gaa(T74, s(s(s(T75))), T77)) → max_valued3_out_gaa(.(s(s(T73)), T74), s(s(s(T75))), T77)
U18_gaa(T66, T67, T68, T70, max_valued3_out_gaa(T67, s(s(s(s(T68)))), T70)) → max_valued3_out_gaa(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70)
U16_gaa(T59, T60, T61, T63, max_valued3_out_gaa(T60, s(s(s(s(s(T61))))), T63)) → max_valued3_out_gaa(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63)
U14_gaa(T52, T53, T54, T56, max_valued3_out_gaa(T53, s(s(s(s(s(s(T54)))))), T56)) → max_valued3_out_gaa(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56)
U12_gaa(T43, T44, T45, T47, max_valued3_out_gaa(T44, s(T49), T47)) → max_valued3_out_gaa(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47)
U10_gaa(T37, T9, T38, T12, max_valued3_out_gaa(T9, s(T39), T12)) → max_valued3_out_gaa(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12)
U12_gga(T43, T44, T45, T47, max_valued3_out_gaa(T44, s(T49), T47)) → max_valued3_out_gga(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47)
U1_gaa(T15, T9, T12, max_valued3_out_gga(T9, T15, T12)) → max_valued3_out_gaa(.(T15, T9), 0, T12)
U10_gga(T37, T9, T38, T12, max_valued3_out_gaa(T9, s(T39), T12)) → max_valued3_out_gga(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12)
U8_gga(T36, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(s(T36))))))), T12)) → max_valued3_out_gga(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12)
U7_gga(T33, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(T33)))))), T12)) → max_valued3_out_gga(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12)
U6_gga(T30, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(T30))))), T12)) → max_valued3_out_gga(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12)
U5_gga(T27, T9, T12, max_valued3_out_gga(T9, s(s(s(s(T27)))), T12)) → max_valued3_out_gga(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12)
U4_gga(T24, T9, T12, max_valued3_out_gga(T9, s(s(s(T24))), T12)) → max_valued3_out_gga(.(s(s(s(T24))), T9), s(s(s(0))), T12)
U3_gga(T21, T9, T12, max_valued3_out_gga(T9, s(s(T21)), T12)) → max_valued3_out_gga(.(s(s(T21)), T9), s(s(0)), T12)
U2_gga(T18, T9, T12, max_valued3_out_gga(T9, s(T18), T12)) → max_valued3_out_gga(.(s(T18), T9), s(0), T12)
U1_gga(T15, T9, T12, max_valued3_out_gga(T9, T15, T12)) → max_valued3_out_gga(.(T15, T9), 0, T12)
U39_ga(T15, T9, T12, max_valued3_out_gga(T9, T15, T12)) → max_valued1_out_ga(.(0, .(T15, T9)), T12)
max_valued1_in_ga(.(s(0), .(s(T18), T9)), T12) → U40_ga(T18, T9, T12, max_valued3_in_gga(T9, s(T18), T12))
U40_ga(T18, T9, T12, max_valued3_out_gga(T9, s(T18), T12)) → max_valued1_out_ga(.(s(0), .(s(T18), T9)), T12)
max_valued1_in_ga(.(s(s(0)), .(s(s(T21)), T9)), T12) → U41_ga(T21, T9, T12, max_valued3_in_gga(T9, s(s(T21)), T12))
U41_ga(T21, T9, T12, max_valued3_out_gga(T9, s(s(T21)), T12)) → max_valued1_out_ga(.(s(s(0)), .(s(s(T21)), T9)), T12)
max_valued1_in_ga(.(s(s(s(0))), .(s(s(s(T24))), T9)), T12) → U42_ga(T24, T9, T12, max_valued3_in_gga(T9, s(s(s(T24))), T12))
U42_ga(T24, T9, T12, max_valued3_out_gga(T9, s(s(s(T24))), T12)) → max_valued1_out_ga(.(s(s(s(0))), .(s(s(s(T24))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(0)))), .(s(s(s(s(T27)))), T9)), T12) → U43_ga(T27, T9, T12, max_valued3_in_gga(T9, s(s(s(s(T27)))), T12))
U43_ga(T27, T9, T12, max_valued3_out_gga(T9, s(s(s(s(T27)))), T12)) → max_valued1_out_ga(.(s(s(s(s(0)))), .(s(s(s(s(T27)))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(0))))), .(s(s(s(s(s(T30))))), T9)), T12) → U44_ga(T30, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(T30))))), T12))
U44_ga(T30, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(T30))))), T12)) → max_valued1_out_ga(.(s(s(s(s(s(0))))), .(s(s(s(s(s(T30))))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(s(0)))))), .(s(s(s(s(s(s(T33)))))), T9)), T12) → U45_ga(T33, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(T33)))))), T12))
U45_ga(T33, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(T33)))))), T12)) → max_valued1_out_ga(.(s(s(s(s(s(s(0)))))), .(s(s(s(s(s(s(T33)))))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(s(s(0))))))), .(s(s(s(s(s(s(s(T36))))))), T9)), T12) → U46_ga(T36, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(s(T36))))))), T12))
U46_ga(T36, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(s(T36))))))), T12)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(0))))))), .(s(s(s(s(s(s(s(T36))))))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(s(s(s(T38)))))))), .(s(s(s(s(s(s(s(T37))))))), T9)), T12) → U47_ga(T38, T37, T9, T12, greater64_in_gg(T37, T38))
U47_ga(T38, T37, T9, T12, greater64_out_gg(T37, T38)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(s(T38)))))))), .(s(s(s(s(s(s(s(T37))))))), T9)), T12)
U47_ga(T38, T37, T9, T12, greater64_out_gg(T37, T38)) → U48_ga(T38, T37, T9, T12, max_valued3_in_gaa(T9, s(T39), T12))
U48_ga(T38, T37, T9, T12, max_valued3_out_gaa(T9, s(T39), T12)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(s(T38)))))))), .(s(s(s(s(s(s(s(T37))))))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(s(s(T45))))))), .(s(s(s(s(s(s(T43)))))), T44)), T47) → U49_ga(T45, T43, T44, T47, higher_valued77_in_ag(T48, T43))
U49_ga(T45, T43, T44, T47, higher_valued77_out_ag(T48, T43)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(T45))))))), .(s(s(s(s(s(s(T43)))))), T44)), T47)
U49_ga(T45, T43, T44, T47, higher_valued77_out_ag(T48, T43)) → U50_ga(T45, T43, T44, T47, max_valued3_in_gaa(T44, s(T49), T47))
U50_ga(T45, T43, T44, T47, max_valued3_out_gaa(T44, s(T49), T47)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(T45))))))), .(s(s(s(s(s(s(T43)))))), T44)), T47)
max_valued1_in_ga(.(s(s(s(s(s(s(T54)))))), .(s(s(s(s(s(T52))))), T53)), T56) → U51_ga(T54, T52, T53, T56, higher_valued82_in_gg(T54, T52))
U51_ga(T54, T52, T53, T56, higher_valued82_out_gg(T54, T52)) → max_valued1_out_ga(.(s(s(s(s(s(s(T54)))))), .(s(s(s(s(s(T52))))), T53)), T56)
U51_ga(T54, T52, T53, T56, higher_valued82_out_gg(T54, T52)) → U52_ga(T54, T52, T53, T56, max_valued3_in_gga(T53, s(s(s(s(s(s(T54)))))), T56))
U52_ga(T54, T52, T53, T56, max_valued3_out_gga(T53, s(s(s(s(s(s(T54)))))), T56)) → max_valued1_out_ga(.(s(s(s(s(s(s(T54)))))), .(s(s(s(s(s(T52))))), T53)), T56)
max_valued1_in_ga(.(s(s(s(s(s(T61))))), .(s(s(s(s(T59)))), T60)), T63) → U53_ga(T61, T59, T60, T63, higher_valued87_in_gg(T61, T59))
U53_ga(T61, T59, T60, T63, higher_valued87_out_gg(T61, T59)) → max_valued1_out_ga(.(s(s(s(s(s(T61))))), .(s(s(s(s(T59)))), T60)), T63)
U53_ga(T61, T59, T60, T63, higher_valued87_out_gg(T61, T59)) → U54_ga(T61, T59, T60, T63, max_valued3_in_gga(T60, s(s(s(s(s(T61))))), T63))
U54_ga(T61, T59, T60, T63, max_valued3_out_gga(T60, s(s(s(s(s(T61))))), T63)) → max_valued1_out_ga(.(s(s(s(s(s(T61))))), .(s(s(s(s(T59)))), T60)), T63)
max_valued1_in_ga(.(s(s(s(s(T68)))), .(s(s(s(T66))), T67)), T70) → U55_ga(T68, T66, T67, T70, higher_valued92_in_gg(T68, T66))
U55_ga(T68, T66, T67, T70, higher_valued92_out_gg(T68, T66)) → max_valued1_out_ga(.(s(s(s(s(T68)))), .(s(s(s(T66))), T67)), T70)
U55_ga(T68, T66, T67, T70, higher_valued92_out_gg(T68, T66)) → U56_ga(T68, T66, T67, T70, max_valued3_in_gga(T67, s(s(s(s(T68)))), T70))
U56_ga(T68, T66, T67, T70, max_valued3_out_gga(T67, s(s(s(s(T68)))), T70)) → max_valued1_out_ga(.(s(s(s(s(T68)))), .(s(s(s(T66))), T67)), T70)
max_valued1_in_ga(.(s(s(s(T75))), .(s(s(T73)), T74)), T77) → U57_ga(T75, T73, T74, T77, higher_valued97_in_gg(T75, T73))
U57_ga(T75, T73, T74, T77, higher_valued97_out_gg(T75, T73)) → max_valued1_out_ga(.(s(s(s(T75))), .(s(s(T73)), T74)), T77)
U57_ga(T75, T73, T74, T77, higher_valued97_out_gg(T75, T73)) → U58_ga(T75, T73, T74, T77, max_valued3_in_gga(T74, s(s(s(T75))), T77))
U58_ga(T75, T73, T74, T77, max_valued3_out_gga(T74, s(s(s(T75))), T77)) → max_valued1_out_ga(.(s(s(s(T75))), .(s(s(T73)), T74)), T77)
max_valued1_in_ga(.(s(s(T82)), .(s(T80), T81)), T84) → U59_ga(T82, T80, T81, T84, higher_valued102_in_gg(T82, T80))
U59_ga(T82, T80, T81, T84, higher_valued102_out_gg(T82, T80)) → max_valued1_out_ga(.(s(s(T82)), .(s(T80), T81)), T84)
U59_ga(T82, T80, T81, T84, higher_valued102_out_gg(T82, T80)) → U60_ga(T82, T80, T81, T84, max_valued3_in_gga(T81, s(s(T82)), T84))
U60_ga(T82, T80, T81, T84, max_valued3_out_gga(T81, s(s(T82)), T84)) → max_valued1_out_ga(.(s(s(T82)), .(s(T80), T81)), T84)
max_valued1_in_ga(.(s(T89), .(T87, T88)), T91) → U61_ga(T89, T87, T88, T91, higher_valued107_in_gg(T89, T87))
U61_ga(T89, T87, T88, T91, higher_valued107_out_gg(T89, T87)) → max_valued1_out_ga(.(s(T89), .(T87, T88)), T91)
U61_ga(T89, T87, T88, T91, higher_valued107_out_gg(T89, T87)) → U62_ga(T89, T87, T88, T91, max_valued3_in_gga(T88, s(T89), T91))
U62_ga(T89, T87, T88, T91, max_valued3_out_gga(T88, s(T89), T91)) → max_valued1_out_ga(.(s(T89), .(T87, T88)), T91)
max_valued1_in_ga(.(T96, .(T94, T95)), T98) → U63_ga(T96, T94, T95, T98, higher_valued112_in_gg(T96, T94))
U63_ga(T96, T94, T95, T98, higher_valued112_out_gg(T96, T94)) → max_valued1_out_ga(.(T96, .(T94, T95)), T98)
U63_ga(T96, T94, T95, T98, higher_valued112_out_gg(T96, T94)) → U64_ga(T96, T94, T95, T98, max_valued3_in_gga(T95, T96, T98))
U64_ga(T96, T94, T95, T98, max_valued3_out_gga(T95, T96, T98)) → max_valued1_out_ga(.(T96, .(T94, T95)), T98)
max_valued1_in_ga(.(T103, .(T101, T102)), T105) → U65_ga(T103, T101, T102, T105, higher_valued118_in_gg(T103, T101))
U65_ga(T103, T101, T102, T105, higher_valued118_out_gg(T103, T101)) → max_valued1_out_ga(.(T103, .(T101, T102)), T105)
U65_ga(T103, T101, T102, T105, higher_valued118_out_gg(T103, T101)) → U66_ga(T103, T101, T102, T105, max_valued3_in_gga(T102, T103, T105))
U66_ga(T103, T101, T102, T105, max_valued3_out_gga(T102, T103, T105)) → max_valued1_out_ga(.(T103, .(T101, T102)), T105)
GREATER64_IN_AG(s(T41), s(T42)) → GREATER64_IN_AG(T41, T42)
GREATER64_IN_AG(s(T42)) → GREATER64_IN_AG(T42)
From the DPs we obtained the following set of size-change graphs:
GREATER64_IN_GG(s(T41), s(T42)) → GREATER64_IN_GG(T41, T42)
max_valued1_in_ga(.(T7, []), T7) → max_valued1_out_ga(.(T7, []), T7)
max_valued1_in_ga(.(0, .(T15, T9)), T12) → U39_ga(T15, T9, T12, max_valued3_in_gga(T9, T15, T12))
max_valued3_in_gga([], T7, T7) → max_valued3_out_gga([], T7, T7)
max_valued3_in_gga(.(T15, T9), 0, T12) → U1_gga(T15, T9, T12, max_valued3_in_gga(T9, T15, T12))
max_valued3_in_gga(.(s(T18), T9), s(0), T12) → U2_gga(T18, T9, T12, max_valued3_in_gga(T9, s(T18), T12))
max_valued3_in_gga(.(s(s(T21)), T9), s(s(0)), T12) → U3_gga(T21, T9, T12, max_valued3_in_gga(T9, s(s(T21)), T12))
max_valued3_in_gga(.(s(s(s(T24))), T9), s(s(s(0))), T12) → U4_gga(T24, T9, T12, max_valued3_in_gga(T9, s(s(s(T24))), T12))
max_valued3_in_gga(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12) → U5_gga(T27, T9, T12, max_valued3_in_gga(T9, s(s(s(s(T27)))), T12))
max_valued3_in_gga(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12) → U6_gga(T30, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(T30))))), T12))
max_valued3_in_gga(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12) → U7_gga(T33, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(T33)))))), T12))
max_valued3_in_gga(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12) → U8_gga(T36, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(s(T36))))))), T12))
max_valued3_in_gga(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12) → U9_gga(T37, T9, T38, T12, greater64_in_gg(T37, T38))
greater64_in_gg(s(T40), 0) → greater64_out_gg(s(T40), 0)
greater64_in_gg(s(T41), s(T42)) → U29_gg(T41, T42, greater64_in_gg(T41, T42))
U29_gg(T41, T42, greater64_out_gg(T41, T42)) → greater64_out_gg(s(T41), s(T42))
U9_gga(T37, T9, T38, T12, greater64_out_gg(T37, T38)) → max_valued3_out_gga(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12)
U9_gga(T37, T9, T38, T12, greater64_out_gg(T37, T38)) → U10_gga(T37, T9, T38, T12, max_valued3_in_gaa(T9, s(T39), T12))
max_valued3_in_gaa([], T7, T7) → max_valued3_out_gaa([], T7, T7)
max_valued3_in_gaa(.(T15, T9), 0, T12) → U1_gaa(T15, T9, T12, max_valued3_in_gga(T9, T15, T12))
max_valued3_in_gga(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47) → U11_gga(T43, T44, T45, T47, higher_valued77_in_ag(T48, T43))
higher_valued77_in_ag(T50, T51) → U30_ag(T50, T51, greater64_in_ag(s(s(T50)), s(s(s(s(s(s(T51))))))))
greater64_in_ag(s(T40), 0) → greater64_out_ag(s(T40), 0)
greater64_in_ag(s(T41), s(T42)) → U29_ag(T41, T42, greater64_in_ag(T41, T42))
U29_ag(T41, T42, greater64_out_ag(T41, T42)) → greater64_out_ag(s(T41), s(T42))
U30_ag(T50, T51, greater64_out_ag(s(s(T50)), s(s(s(s(s(s(T51)))))))) → higher_valued77_out_ag(T50, T51)
U11_gga(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → max_valued3_out_gga(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47)
U11_gga(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → U12_gga(T43, T44, T45, T47, max_valued3_in_gaa(T44, s(T49), T47))
max_valued3_in_gaa(.(s(T18), T9), s(0), T12) → U2_gaa(T18, T9, T12, max_valued3_in_gga(T9, s(T18), T12))
max_valued3_in_gga(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56) → U13_gga(T52, T53, T54, T56, higher_valued82_in_gg(T54, T52))
higher_valued82_in_gg(T57, T58) → U31_gg(T57, T58, greater64_in_gg(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58)))))))
U31_gg(T57, T58, greater64_out_gg(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58))))))) → higher_valued82_out_gg(T57, T58)
U13_gga(T52, T53, T54, T56, higher_valued82_out_gg(T54, T52)) → max_valued3_out_gga(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56)
U13_gga(T52, T53, T54, T56, higher_valued82_out_gg(T54, T52)) → U14_gga(T52, T53, T54, T56, max_valued3_in_gga(T53, s(s(s(s(s(s(T54)))))), T56))
max_valued3_in_gga(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63) → U15_gga(T59, T60, T61, T63, higher_valued87_in_gg(T61, T59))
higher_valued87_in_gg(T64, T65) → U32_gg(T64, T65, greater64_in_gg(s(s(s(s(s(s(T64)))))), s(s(s(s(T65))))))
U32_gg(T64, T65, greater64_out_gg(s(s(s(s(s(s(T64)))))), s(s(s(s(T65)))))) → higher_valued87_out_gg(T64, T65)
U15_gga(T59, T60, T61, T63, higher_valued87_out_gg(T61, T59)) → max_valued3_out_gga(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63)
U15_gga(T59, T60, T61, T63, higher_valued87_out_gg(T61, T59)) → U16_gga(T59, T60, T61, T63, max_valued3_in_gga(T60, s(s(s(s(s(T61))))), T63))
max_valued3_in_gga(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70) → U17_gga(T66, T67, T68, T70, higher_valued92_in_gg(T68, T66))
higher_valued92_in_gg(T71, T72) → U33_gg(T71, T72, greater64_in_gg(s(s(s(s(s(T71))))), s(s(s(T72)))))
U33_gg(T71, T72, greater64_out_gg(s(s(s(s(s(T71))))), s(s(s(T72))))) → higher_valued92_out_gg(T71, T72)
U17_gga(T66, T67, T68, T70, higher_valued92_out_gg(T68, T66)) → max_valued3_out_gga(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70)
U17_gga(T66, T67, T68, T70, higher_valued92_out_gg(T68, T66)) → U18_gga(T66, T67, T68, T70, max_valued3_in_gga(T67, s(s(s(s(T68)))), T70))
max_valued3_in_gga(.(s(s(T73)), T74), s(s(s(T75))), T77) → U19_gga(T73, T74, T75, T77, higher_valued97_in_gg(T75, T73))
higher_valued97_in_gg(T78, T79) → U34_gg(T78, T79, greater64_in_gg(s(s(s(s(T78)))), s(s(T79))))
U34_gg(T78, T79, greater64_out_gg(s(s(s(s(T78)))), s(s(T79)))) → higher_valued97_out_gg(T78, T79)
U19_gga(T73, T74, T75, T77, higher_valued97_out_gg(T75, T73)) → max_valued3_out_gga(.(s(s(T73)), T74), s(s(s(T75))), T77)
U19_gga(T73, T74, T75, T77, higher_valued97_out_gg(T75, T73)) → U20_gga(T73, T74, T75, T77, max_valued3_in_gga(T74, s(s(s(T75))), T77))
max_valued3_in_gga(.(s(T80), T81), s(s(T82)), T84) → U21_gga(T80, T81, T82, T84, higher_valued102_in_gg(T82, T80))
higher_valued102_in_gg(T85, T86) → U35_gg(T85, T86, greater64_in_gg(s(s(s(T85))), s(T86)))
U35_gg(T85, T86, greater64_out_gg(s(s(s(T85))), s(T86))) → higher_valued102_out_gg(T85, T86)
U21_gga(T80, T81, T82, T84, higher_valued102_out_gg(T82, T80)) → max_valued3_out_gga(.(s(T80), T81), s(s(T82)), T84)
U21_gga(T80, T81, T82, T84, higher_valued102_out_gg(T82, T80)) → U22_gga(T80, T81, T82, T84, max_valued3_in_gga(T81, s(s(T82)), T84))
max_valued3_in_gga(.(T87, T88), s(T89), T91) → U23_gga(T87, T88, T89, T91, higher_valued107_in_gg(T89, T87))
higher_valued107_in_gg(T92, T93) → U36_gg(T92, T93, greater64_in_gg(s(s(T92)), T93))
U36_gg(T92, T93, greater64_out_gg(s(s(T92)), T93)) → higher_valued107_out_gg(T92, T93)
U23_gga(T87, T88, T89, T91, higher_valued107_out_gg(T89, T87)) → max_valued3_out_gga(.(T87, T88), s(T89), T91)
U23_gga(T87, T88, T89, T91, higher_valued107_out_gg(T89, T87)) → U24_gga(T87, T88, T89, T91, max_valued3_in_gga(T88, s(T89), T91))
max_valued3_in_gga(.(T94, T95), T96, T98) → U25_gga(T94, T95, T96, T98, higher_valued112_in_gg(T96, T94))
higher_valued112_in_gg(T99, T100) → U37_gg(T99, T100, greater64_in_gg(s(T99), T100))
U37_gg(T99, T100, greater64_out_gg(s(T99), T100)) → higher_valued112_out_gg(T99, T100)
U25_gga(T94, T95, T96, T98, higher_valued112_out_gg(T96, T94)) → max_valued3_out_gga(.(T94, T95), T96, T98)
U25_gga(T94, T95, T96, T98, higher_valued112_out_gg(T96, T94)) → U26_gga(T94, T95, T96, T98, max_valued3_in_gga(T95, T96, T98))
max_valued3_in_gga(.(T101, T102), T103, T105) → U27_gga(T101, T102, T103, T105, higher_valued118_in_gg(T103, T101))
higher_valued118_in_gg(T106, T107) → U38_gg(T106, T107, greater64_in_gg(s(T106), T107))
U38_gg(T106, T107, greater64_out_gg(s(T106), T107)) → higher_valued118_out_gg(T106, T107)
U27_gga(T101, T102, T103, T105, higher_valued118_out_gg(T103, T101)) → max_valued3_out_gga(.(T101, T102), T103, T105)
U27_gga(T101, T102, T103, T105, higher_valued118_out_gg(T103, T101)) → U28_gga(T101, T102, T103, T105, max_valued3_in_gga(T102, T103, T105))
U28_gga(T101, T102, T103, T105, max_valued3_out_gga(T102, T103, T105)) → max_valued3_out_gga(.(T101, T102), T103, T105)
U26_gga(T94, T95, T96, T98, max_valued3_out_gga(T95, T96, T98)) → max_valued3_out_gga(.(T94, T95), T96, T98)
U24_gga(T87, T88, T89, T91, max_valued3_out_gga(T88, s(T89), T91)) → max_valued3_out_gga(.(T87, T88), s(T89), T91)
U22_gga(T80, T81, T82, T84, max_valued3_out_gga(T81, s(s(T82)), T84)) → max_valued3_out_gga(.(s(T80), T81), s(s(T82)), T84)
U20_gga(T73, T74, T75, T77, max_valued3_out_gga(T74, s(s(s(T75))), T77)) → max_valued3_out_gga(.(s(s(T73)), T74), s(s(s(T75))), T77)
U18_gga(T66, T67, T68, T70, max_valued3_out_gga(T67, s(s(s(s(T68)))), T70)) → max_valued3_out_gga(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70)
U16_gga(T59, T60, T61, T63, max_valued3_out_gga(T60, s(s(s(s(s(T61))))), T63)) → max_valued3_out_gga(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63)
U14_gga(T52, T53, T54, T56, max_valued3_out_gga(T53, s(s(s(s(s(s(T54)))))), T56)) → max_valued3_out_gga(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56)
U2_gaa(T18, T9, T12, max_valued3_out_gga(T9, s(T18), T12)) → max_valued3_out_gaa(.(s(T18), T9), s(0), T12)
max_valued3_in_gaa(.(s(s(T21)), T9), s(s(0)), T12) → U3_gaa(T21, T9, T12, max_valued3_in_gga(T9, s(s(T21)), T12))
U3_gaa(T21, T9, T12, max_valued3_out_gga(T9, s(s(T21)), T12)) → max_valued3_out_gaa(.(s(s(T21)), T9), s(s(0)), T12)
max_valued3_in_gaa(.(s(s(s(T24))), T9), s(s(s(0))), T12) → U4_gaa(T24, T9, T12, max_valued3_in_gga(T9, s(s(s(T24))), T12))
U4_gaa(T24, T9, T12, max_valued3_out_gga(T9, s(s(s(T24))), T12)) → max_valued3_out_gaa(.(s(s(s(T24))), T9), s(s(s(0))), T12)
max_valued3_in_gaa(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12) → U5_gaa(T27, T9, T12, max_valued3_in_gga(T9, s(s(s(s(T27)))), T12))
U5_gaa(T27, T9, T12, max_valued3_out_gga(T9, s(s(s(s(T27)))), T12)) → max_valued3_out_gaa(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12)
max_valued3_in_gaa(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12) → U6_gaa(T30, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(T30))))), T12))
U6_gaa(T30, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(T30))))), T12)) → max_valued3_out_gaa(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12)
max_valued3_in_gaa(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12) → U7_gaa(T33, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(T33)))))), T12))
U7_gaa(T33, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(T33)))))), T12)) → max_valued3_out_gaa(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12)
max_valued3_in_gaa(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12) → U8_gaa(T36, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(s(T36))))))), T12))
U8_gaa(T36, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(s(T36))))))), T12)) → max_valued3_out_gaa(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12)
max_valued3_in_gaa(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12) → U9_gaa(T37, T9, T38, T12, greater64_in_ga(T37, T38))
greater64_in_ga(s(T40), 0) → greater64_out_ga(s(T40), 0)
greater64_in_ga(s(T41), s(T42)) → U29_ga(T41, T42, greater64_in_ga(T41, T42))
U29_ga(T41, T42, greater64_out_ga(T41, T42)) → greater64_out_ga(s(T41), s(T42))
U9_gaa(T37, T9, T38, T12, greater64_out_ga(T37, T38)) → max_valued3_out_gaa(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12)
U9_gaa(T37, T9, T38, T12, greater64_out_ga(T37, T38)) → U10_gaa(T37, T9, T38, T12, max_valued3_in_gaa(T9, s(T39), T12))
max_valued3_in_gaa(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47) → U11_gaa(T43, T44, T45, T47, higher_valued77_in_ag(T48, T43))
U11_gaa(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → max_valued3_out_gaa(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47)
U11_gaa(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → U12_gaa(T43, T44, T45, T47, max_valued3_in_gaa(T44, s(T49), T47))
max_valued3_in_gaa(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56) → U13_gaa(T52, T53, T54, T56, higher_valued82_in_ag(T54, T52))
higher_valued82_in_ag(T57, T58) → U31_ag(T57, T58, greater64_in_ag(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58)))))))
U31_ag(T57, T58, greater64_out_ag(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58))))))) → higher_valued82_out_ag(T57, T58)
U13_gaa(T52, T53, T54, T56, higher_valued82_out_ag(T54, T52)) → max_valued3_out_gaa(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56)
U13_gaa(T52, T53, T54, T56, higher_valued82_out_ag(T54, T52)) → U14_gaa(T52, T53, T54, T56, max_valued3_in_gaa(T53, s(s(s(s(s(s(T54)))))), T56))
max_valued3_in_gaa(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63) → U15_gaa(T59, T60, T61, T63, higher_valued87_in_ag(T61, T59))
higher_valued87_in_ag(T64, T65) → U32_ag(T64, T65, greater64_in_ag(s(s(s(s(s(s(T64)))))), s(s(s(s(T65))))))
U32_ag(T64, T65, greater64_out_ag(s(s(s(s(s(s(T64)))))), s(s(s(s(T65)))))) → higher_valued87_out_ag(T64, T65)
U15_gaa(T59, T60, T61, T63, higher_valued87_out_ag(T61, T59)) → max_valued3_out_gaa(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63)
U15_gaa(T59, T60, T61, T63, higher_valued87_out_ag(T61, T59)) → U16_gaa(T59, T60, T61, T63, max_valued3_in_gaa(T60, s(s(s(s(s(T61))))), T63))
max_valued3_in_gaa(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70) → U17_gaa(T66, T67, T68, T70, higher_valued92_in_ag(T68, T66))
higher_valued92_in_ag(T71, T72) → U33_ag(T71, T72, greater64_in_ag(s(s(s(s(s(T71))))), s(s(s(T72)))))
U33_ag(T71, T72, greater64_out_ag(s(s(s(s(s(T71))))), s(s(s(T72))))) → higher_valued92_out_ag(T71, T72)
U17_gaa(T66, T67, T68, T70, higher_valued92_out_ag(T68, T66)) → max_valued3_out_gaa(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70)
U17_gaa(T66, T67, T68, T70, higher_valued92_out_ag(T68, T66)) → U18_gaa(T66, T67, T68, T70, max_valued3_in_gaa(T67, s(s(s(s(T68)))), T70))
max_valued3_in_gaa(.(s(s(T73)), T74), s(s(s(T75))), T77) → U19_gaa(T73, T74, T75, T77, higher_valued97_in_ag(T75, T73))
higher_valued97_in_ag(T78, T79) → U34_ag(T78, T79, greater64_in_ag(s(s(s(s(T78)))), s(s(T79))))
U34_ag(T78, T79, greater64_out_ag(s(s(s(s(T78)))), s(s(T79)))) → higher_valued97_out_ag(T78, T79)
U19_gaa(T73, T74, T75, T77, higher_valued97_out_ag(T75, T73)) → max_valued3_out_gaa(.(s(s(T73)), T74), s(s(s(T75))), T77)
U19_gaa(T73, T74, T75, T77, higher_valued97_out_ag(T75, T73)) → U20_gaa(T73, T74, T75, T77, max_valued3_in_gaa(T74, s(s(s(T75))), T77))
max_valued3_in_gaa(.(s(T80), T81), s(s(T82)), T84) → U21_gaa(T80, T81, T82, T84, higher_valued102_in_ag(T82, T80))
higher_valued102_in_ag(T85, T86) → U35_ag(T85, T86, greater64_in_ag(s(s(s(T85))), s(T86)))
U35_ag(T85, T86, greater64_out_ag(s(s(s(T85))), s(T86))) → higher_valued102_out_ag(T85, T86)
U21_gaa(T80, T81, T82, T84, higher_valued102_out_ag(T82, T80)) → max_valued3_out_gaa(.(s(T80), T81), s(s(T82)), T84)
U21_gaa(T80, T81, T82, T84, higher_valued102_out_ag(T82, T80)) → U22_gaa(T80, T81, T82, T84, max_valued3_in_gaa(T81, s(s(T82)), T84))
max_valued3_in_gaa(.(T87, T88), s(T89), T91) → U23_gaa(T87, T88, T89, T91, higher_valued107_in_ag(T89, T87))
higher_valued107_in_ag(T92, T93) → U36_ag(T92, T93, greater64_in_ag(s(s(T92)), T93))
U36_ag(T92, T93, greater64_out_ag(s(s(T92)), T93)) → higher_valued107_out_ag(T92, T93)
U23_gaa(T87, T88, T89, T91, higher_valued107_out_ag(T89, T87)) → max_valued3_out_gaa(.(T87, T88), s(T89), T91)
U23_gaa(T87, T88, T89, T91, higher_valued107_out_ag(T89, T87)) → U24_gaa(T87, T88, T89, T91, max_valued3_in_gaa(T88, s(T89), T91))
max_valued3_in_gaa(.(T94, T95), T96, T98) → U25_gaa(T94, T95, T96, T98, higher_valued112_in_ag(T96, T94))
higher_valued112_in_ag(T99, T100) → U37_ag(T99, T100, greater64_in_ag(s(T99), T100))
U37_ag(T99, T100, greater64_out_ag(s(T99), T100)) → higher_valued112_out_ag(T99, T100)
U25_gaa(T94, T95, T96, T98, higher_valued112_out_ag(T96, T94)) → max_valued3_out_gaa(.(T94, T95), T96, T98)
U25_gaa(T94, T95, T96, T98, higher_valued112_out_ag(T96, T94)) → U26_gaa(T94, T95, T96, T98, max_valued3_in_gaa(T95, T96, T98))
max_valued3_in_gaa(.(T101, T102), T103, T105) → U27_gaa(T101, T102, T103, T105, higher_valued118_in_ag(T103, T101))
higher_valued118_in_ag(T106, T107) → U38_ag(T106, T107, greater64_in_ag(s(T106), T107))
U38_ag(T106, T107, greater64_out_ag(s(T106), T107)) → higher_valued118_out_ag(T106, T107)
U27_gaa(T101, T102, T103, T105, higher_valued118_out_ag(T103, T101)) → max_valued3_out_gaa(.(T101, T102), T103, T105)
U27_gaa(T101, T102, T103, T105, higher_valued118_out_ag(T103, T101)) → U28_gaa(T101, T102, T103, T105, max_valued3_in_gaa(T102, T103, T105))
U28_gaa(T101, T102, T103, T105, max_valued3_out_gaa(T102, T103, T105)) → max_valued3_out_gaa(.(T101, T102), T103, T105)
U26_gaa(T94, T95, T96, T98, max_valued3_out_gaa(T95, T96, T98)) → max_valued3_out_gaa(.(T94, T95), T96, T98)
U24_gaa(T87, T88, T89, T91, max_valued3_out_gaa(T88, s(T89), T91)) → max_valued3_out_gaa(.(T87, T88), s(T89), T91)
U22_gaa(T80, T81, T82, T84, max_valued3_out_gaa(T81, s(s(T82)), T84)) → max_valued3_out_gaa(.(s(T80), T81), s(s(T82)), T84)
U20_gaa(T73, T74, T75, T77, max_valued3_out_gaa(T74, s(s(s(T75))), T77)) → max_valued3_out_gaa(.(s(s(T73)), T74), s(s(s(T75))), T77)
U18_gaa(T66, T67, T68, T70, max_valued3_out_gaa(T67, s(s(s(s(T68)))), T70)) → max_valued3_out_gaa(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70)
U16_gaa(T59, T60, T61, T63, max_valued3_out_gaa(T60, s(s(s(s(s(T61))))), T63)) → max_valued3_out_gaa(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63)
U14_gaa(T52, T53, T54, T56, max_valued3_out_gaa(T53, s(s(s(s(s(s(T54)))))), T56)) → max_valued3_out_gaa(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56)
U12_gaa(T43, T44, T45, T47, max_valued3_out_gaa(T44, s(T49), T47)) → max_valued3_out_gaa(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47)
U10_gaa(T37, T9, T38, T12, max_valued3_out_gaa(T9, s(T39), T12)) → max_valued3_out_gaa(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12)
U12_gga(T43, T44, T45, T47, max_valued3_out_gaa(T44, s(T49), T47)) → max_valued3_out_gga(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47)
U1_gaa(T15, T9, T12, max_valued3_out_gga(T9, T15, T12)) → max_valued3_out_gaa(.(T15, T9), 0, T12)
U10_gga(T37, T9, T38, T12, max_valued3_out_gaa(T9, s(T39), T12)) → max_valued3_out_gga(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12)
U8_gga(T36, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(s(T36))))))), T12)) → max_valued3_out_gga(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12)
U7_gga(T33, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(T33)))))), T12)) → max_valued3_out_gga(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12)
U6_gga(T30, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(T30))))), T12)) → max_valued3_out_gga(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12)
U5_gga(T27, T9, T12, max_valued3_out_gga(T9, s(s(s(s(T27)))), T12)) → max_valued3_out_gga(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12)
U4_gga(T24, T9, T12, max_valued3_out_gga(T9, s(s(s(T24))), T12)) → max_valued3_out_gga(.(s(s(s(T24))), T9), s(s(s(0))), T12)
U3_gga(T21, T9, T12, max_valued3_out_gga(T9, s(s(T21)), T12)) → max_valued3_out_gga(.(s(s(T21)), T9), s(s(0)), T12)
U2_gga(T18, T9, T12, max_valued3_out_gga(T9, s(T18), T12)) → max_valued3_out_gga(.(s(T18), T9), s(0), T12)
U1_gga(T15, T9, T12, max_valued3_out_gga(T9, T15, T12)) → max_valued3_out_gga(.(T15, T9), 0, T12)
U39_ga(T15, T9, T12, max_valued3_out_gga(T9, T15, T12)) → max_valued1_out_ga(.(0, .(T15, T9)), T12)
max_valued1_in_ga(.(s(0), .(s(T18), T9)), T12) → U40_ga(T18, T9, T12, max_valued3_in_gga(T9, s(T18), T12))
U40_ga(T18, T9, T12, max_valued3_out_gga(T9, s(T18), T12)) → max_valued1_out_ga(.(s(0), .(s(T18), T9)), T12)
max_valued1_in_ga(.(s(s(0)), .(s(s(T21)), T9)), T12) → U41_ga(T21, T9, T12, max_valued3_in_gga(T9, s(s(T21)), T12))
U41_ga(T21, T9, T12, max_valued3_out_gga(T9, s(s(T21)), T12)) → max_valued1_out_ga(.(s(s(0)), .(s(s(T21)), T9)), T12)
max_valued1_in_ga(.(s(s(s(0))), .(s(s(s(T24))), T9)), T12) → U42_ga(T24, T9, T12, max_valued3_in_gga(T9, s(s(s(T24))), T12))
U42_ga(T24, T9, T12, max_valued3_out_gga(T9, s(s(s(T24))), T12)) → max_valued1_out_ga(.(s(s(s(0))), .(s(s(s(T24))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(0)))), .(s(s(s(s(T27)))), T9)), T12) → U43_ga(T27, T9, T12, max_valued3_in_gga(T9, s(s(s(s(T27)))), T12))
U43_ga(T27, T9, T12, max_valued3_out_gga(T9, s(s(s(s(T27)))), T12)) → max_valued1_out_ga(.(s(s(s(s(0)))), .(s(s(s(s(T27)))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(0))))), .(s(s(s(s(s(T30))))), T9)), T12) → U44_ga(T30, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(T30))))), T12))
U44_ga(T30, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(T30))))), T12)) → max_valued1_out_ga(.(s(s(s(s(s(0))))), .(s(s(s(s(s(T30))))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(s(0)))))), .(s(s(s(s(s(s(T33)))))), T9)), T12) → U45_ga(T33, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(T33)))))), T12))
U45_ga(T33, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(T33)))))), T12)) → max_valued1_out_ga(.(s(s(s(s(s(s(0)))))), .(s(s(s(s(s(s(T33)))))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(s(s(0))))))), .(s(s(s(s(s(s(s(T36))))))), T9)), T12) → U46_ga(T36, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(s(T36))))))), T12))
U46_ga(T36, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(s(T36))))))), T12)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(0))))))), .(s(s(s(s(s(s(s(T36))))))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(s(s(s(T38)))))))), .(s(s(s(s(s(s(s(T37))))))), T9)), T12) → U47_ga(T38, T37, T9, T12, greater64_in_gg(T37, T38))
U47_ga(T38, T37, T9, T12, greater64_out_gg(T37, T38)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(s(T38)))))))), .(s(s(s(s(s(s(s(T37))))))), T9)), T12)
U47_ga(T38, T37, T9, T12, greater64_out_gg(T37, T38)) → U48_ga(T38, T37, T9, T12, max_valued3_in_gaa(T9, s(T39), T12))
U48_ga(T38, T37, T9, T12, max_valued3_out_gaa(T9, s(T39), T12)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(s(T38)))))))), .(s(s(s(s(s(s(s(T37))))))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(s(s(T45))))))), .(s(s(s(s(s(s(T43)))))), T44)), T47) → U49_ga(T45, T43, T44, T47, higher_valued77_in_ag(T48, T43))
U49_ga(T45, T43, T44, T47, higher_valued77_out_ag(T48, T43)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(T45))))))), .(s(s(s(s(s(s(T43)))))), T44)), T47)
U49_ga(T45, T43, T44, T47, higher_valued77_out_ag(T48, T43)) → U50_ga(T45, T43, T44, T47, max_valued3_in_gaa(T44, s(T49), T47))
U50_ga(T45, T43, T44, T47, max_valued3_out_gaa(T44, s(T49), T47)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(T45))))))), .(s(s(s(s(s(s(T43)))))), T44)), T47)
max_valued1_in_ga(.(s(s(s(s(s(s(T54)))))), .(s(s(s(s(s(T52))))), T53)), T56) → U51_ga(T54, T52, T53, T56, higher_valued82_in_gg(T54, T52))
U51_ga(T54, T52, T53, T56, higher_valued82_out_gg(T54, T52)) → max_valued1_out_ga(.(s(s(s(s(s(s(T54)))))), .(s(s(s(s(s(T52))))), T53)), T56)
U51_ga(T54, T52, T53, T56, higher_valued82_out_gg(T54, T52)) → U52_ga(T54, T52, T53, T56, max_valued3_in_gga(T53, s(s(s(s(s(s(T54)))))), T56))
U52_ga(T54, T52, T53, T56, max_valued3_out_gga(T53, s(s(s(s(s(s(T54)))))), T56)) → max_valued1_out_ga(.(s(s(s(s(s(s(T54)))))), .(s(s(s(s(s(T52))))), T53)), T56)
max_valued1_in_ga(.(s(s(s(s(s(T61))))), .(s(s(s(s(T59)))), T60)), T63) → U53_ga(T61, T59, T60, T63, higher_valued87_in_gg(T61, T59))
U53_ga(T61, T59, T60, T63, higher_valued87_out_gg(T61, T59)) → max_valued1_out_ga(.(s(s(s(s(s(T61))))), .(s(s(s(s(T59)))), T60)), T63)
U53_ga(T61, T59, T60, T63, higher_valued87_out_gg(T61, T59)) → U54_ga(T61, T59, T60, T63, max_valued3_in_gga(T60, s(s(s(s(s(T61))))), T63))
U54_ga(T61, T59, T60, T63, max_valued3_out_gga(T60, s(s(s(s(s(T61))))), T63)) → max_valued1_out_ga(.(s(s(s(s(s(T61))))), .(s(s(s(s(T59)))), T60)), T63)
max_valued1_in_ga(.(s(s(s(s(T68)))), .(s(s(s(T66))), T67)), T70) → U55_ga(T68, T66, T67, T70, higher_valued92_in_gg(T68, T66))
U55_ga(T68, T66, T67, T70, higher_valued92_out_gg(T68, T66)) → max_valued1_out_ga(.(s(s(s(s(T68)))), .(s(s(s(T66))), T67)), T70)
U55_ga(T68, T66, T67, T70, higher_valued92_out_gg(T68, T66)) → U56_ga(T68, T66, T67, T70, max_valued3_in_gga(T67, s(s(s(s(T68)))), T70))
U56_ga(T68, T66, T67, T70, max_valued3_out_gga(T67, s(s(s(s(T68)))), T70)) → max_valued1_out_ga(.(s(s(s(s(T68)))), .(s(s(s(T66))), T67)), T70)
max_valued1_in_ga(.(s(s(s(T75))), .(s(s(T73)), T74)), T77) → U57_ga(T75, T73, T74, T77, higher_valued97_in_gg(T75, T73))
U57_ga(T75, T73, T74, T77, higher_valued97_out_gg(T75, T73)) → max_valued1_out_ga(.(s(s(s(T75))), .(s(s(T73)), T74)), T77)
U57_ga(T75, T73, T74, T77, higher_valued97_out_gg(T75, T73)) → U58_ga(T75, T73, T74, T77, max_valued3_in_gga(T74, s(s(s(T75))), T77))
U58_ga(T75, T73, T74, T77, max_valued3_out_gga(T74, s(s(s(T75))), T77)) → max_valued1_out_ga(.(s(s(s(T75))), .(s(s(T73)), T74)), T77)
max_valued1_in_ga(.(s(s(T82)), .(s(T80), T81)), T84) → U59_ga(T82, T80, T81, T84, higher_valued102_in_gg(T82, T80))
U59_ga(T82, T80, T81, T84, higher_valued102_out_gg(T82, T80)) → max_valued1_out_ga(.(s(s(T82)), .(s(T80), T81)), T84)
U59_ga(T82, T80, T81, T84, higher_valued102_out_gg(T82, T80)) → U60_ga(T82, T80, T81, T84, max_valued3_in_gga(T81, s(s(T82)), T84))
U60_ga(T82, T80, T81, T84, max_valued3_out_gga(T81, s(s(T82)), T84)) → max_valued1_out_ga(.(s(s(T82)), .(s(T80), T81)), T84)
max_valued1_in_ga(.(s(T89), .(T87, T88)), T91) → U61_ga(T89, T87, T88, T91, higher_valued107_in_gg(T89, T87))
U61_ga(T89, T87, T88, T91, higher_valued107_out_gg(T89, T87)) → max_valued1_out_ga(.(s(T89), .(T87, T88)), T91)
U61_ga(T89, T87, T88, T91, higher_valued107_out_gg(T89, T87)) → U62_ga(T89, T87, T88, T91, max_valued3_in_gga(T88, s(T89), T91))
U62_ga(T89, T87, T88, T91, max_valued3_out_gga(T88, s(T89), T91)) → max_valued1_out_ga(.(s(T89), .(T87, T88)), T91)
max_valued1_in_ga(.(T96, .(T94, T95)), T98) → U63_ga(T96, T94, T95, T98, higher_valued112_in_gg(T96, T94))
U63_ga(T96, T94, T95, T98, higher_valued112_out_gg(T96, T94)) → max_valued1_out_ga(.(T96, .(T94, T95)), T98)
U63_ga(T96, T94, T95, T98, higher_valued112_out_gg(T96, T94)) → U64_ga(T96, T94, T95, T98, max_valued3_in_gga(T95, T96, T98))
U64_ga(T96, T94, T95, T98, max_valued3_out_gga(T95, T96, T98)) → max_valued1_out_ga(.(T96, .(T94, T95)), T98)
max_valued1_in_ga(.(T103, .(T101, T102)), T105) → U65_ga(T103, T101, T102, T105, higher_valued118_in_gg(T103, T101))
U65_ga(T103, T101, T102, T105, higher_valued118_out_gg(T103, T101)) → max_valued1_out_ga(.(T103, .(T101, T102)), T105)
U65_ga(T103, T101, T102, T105, higher_valued118_out_gg(T103, T101)) → U66_ga(T103, T101, T102, T105, max_valued3_in_gga(T102, T103, T105))
U66_ga(T103, T101, T102, T105, max_valued3_out_gga(T102, T103, T105)) → max_valued1_out_ga(.(T103, .(T101, T102)), T105)
GREATER64_IN_GG(s(T41), s(T42)) → GREATER64_IN_GG(T41, T42)
GREATER64_IN_GG(s(T41), s(T42)) → GREATER64_IN_GG(T41, T42)
From the DPs we obtained the following set of size-change graphs:
MAX_VALUED3_IN_GGA(.(s(T18), T9), s(0), T12) → MAX_VALUED3_IN_GGA(T9, s(T18), T12)
MAX_VALUED3_IN_GGA(.(s(s(T21)), T9), s(s(0)), T12) → MAX_VALUED3_IN_GGA(T9, s(s(T21)), T12)
MAX_VALUED3_IN_GGA(.(s(s(s(T24))), T9), s(s(s(0))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(T24))), T12)
MAX_VALUED3_IN_GGA(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(T27)))), T12)
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(T30))))), T12)
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(s(T33)))))), T12)
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(s(s(T36))))))), T12)
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12) → U9_GGA(T37, T9, T38, T12, greater64_in_gg(T37, T38))
U9_GGA(T37, T9, T38, T12, greater64_out_gg(T37, T38)) → MAX_VALUED3_IN_GAA(T9, s(T39), T12)
MAX_VALUED3_IN_GAA(.(s(T18), T9), s(0), T12) → MAX_VALUED3_IN_GGA(T9, s(T18), T12)
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47) → U11_GGA(T43, T44, T45, T47, higher_valued77_in_ag(T48, T43))
U11_GGA(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → MAX_VALUED3_IN_GAA(T44, s(T49), T47)
MAX_VALUED3_IN_GAA(.(s(s(T21)), T9), s(s(0)), T12) → MAX_VALUED3_IN_GGA(T9, s(s(T21)), T12)
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56) → U13_GGA(T52, T53, T54, T56, higher_valued82_in_gg(T54, T52))
U13_GGA(T52, T53, T54, T56, higher_valued82_out_gg(T54, T52)) → MAX_VALUED3_IN_GGA(T53, s(s(s(s(s(s(T54)))))), T56)
MAX_VALUED3_IN_GGA(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63) → U15_GGA(T59, T60, T61, T63, higher_valued87_in_gg(T61, T59))
U15_GGA(T59, T60, T61, T63, higher_valued87_out_gg(T61, T59)) → MAX_VALUED3_IN_GGA(T60, s(s(s(s(s(T61))))), T63)
MAX_VALUED3_IN_GGA(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70) → U17_GGA(T66, T67, T68, T70, higher_valued92_in_gg(T68, T66))
U17_GGA(T66, T67, T68, T70, higher_valued92_out_gg(T68, T66)) → MAX_VALUED3_IN_GGA(T67, s(s(s(s(T68)))), T70)
MAX_VALUED3_IN_GGA(.(s(s(T73)), T74), s(s(s(T75))), T77) → U19_GGA(T73, T74, T75, T77, higher_valued97_in_gg(T75, T73))
U19_GGA(T73, T74, T75, T77, higher_valued97_out_gg(T75, T73)) → MAX_VALUED3_IN_GGA(T74, s(s(s(T75))), T77)
MAX_VALUED3_IN_GGA(.(s(T80), T81), s(s(T82)), T84) → U21_GGA(T80, T81, T82, T84, higher_valued102_in_gg(T82, T80))
U21_GGA(T80, T81, T82, T84, higher_valued102_out_gg(T82, T80)) → MAX_VALUED3_IN_GGA(T81, s(s(T82)), T84)
MAX_VALUED3_IN_GGA(.(T87, T88), s(T89), T91) → U23_GGA(T87, T88, T89, T91, higher_valued107_in_gg(T89, T87))
U23_GGA(T87, T88, T89, T91, higher_valued107_out_gg(T89, T87)) → MAX_VALUED3_IN_GGA(T88, s(T89), T91)
MAX_VALUED3_IN_GGA(.(T94, T95), T96, T98) → U25_GGA(T94, T95, T96, T98, higher_valued112_in_gg(T96, T94))
U25_GGA(T94, T95, T96, T98, higher_valued112_out_gg(T96, T94)) → MAX_VALUED3_IN_GGA(T95, T96, T98)
MAX_VALUED3_IN_GGA(.(T15, T9), 0, T12) → MAX_VALUED3_IN_GGA(T9, T15, T12)
MAX_VALUED3_IN_GGA(.(T101, T102), T103, T105) → U27_GGA(T101, T102, T103, T105, higher_valued118_in_gg(T103, T101))
U27_GGA(T101, T102, T103, T105, higher_valued118_out_gg(T103, T101)) → MAX_VALUED3_IN_GGA(T102, T103, T105)
MAX_VALUED3_IN_GAA(.(s(s(s(T24))), T9), s(s(s(0))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(T24))), T12)
MAX_VALUED3_IN_GAA(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(T27)))), T12)
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(T30))))), T12)
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(s(T33)))))), T12)
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(s(s(T36))))))), T12)
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12) → U9_GAA(T37, T9, T38, T12, greater64_in_ga(T37, T38))
U9_GAA(T37, T9, T38, T12, greater64_out_ga(T37, T38)) → MAX_VALUED3_IN_GAA(T9, s(T39), T12)
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47) → U11_GAA(T43, T44, T45, T47, higher_valued77_in_ag(T48, T43))
U11_GAA(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → MAX_VALUED3_IN_GAA(T44, s(T49), T47)
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56) → U13_GAA(T52, T53, T54, T56, higher_valued82_in_ag(T54, T52))
U13_GAA(T52, T53, T54, T56, higher_valued82_out_ag(T54, T52)) → MAX_VALUED3_IN_GAA(T53, s(s(s(s(s(s(T54)))))), T56)
MAX_VALUED3_IN_GAA(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63) → U15_GAA(T59, T60, T61, T63, higher_valued87_in_ag(T61, T59))
U15_GAA(T59, T60, T61, T63, higher_valued87_out_ag(T61, T59)) → MAX_VALUED3_IN_GAA(T60, s(s(s(s(s(T61))))), T63)
MAX_VALUED3_IN_GAA(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70) → U17_GAA(T66, T67, T68, T70, higher_valued92_in_ag(T68, T66))
U17_GAA(T66, T67, T68, T70, higher_valued92_out_ag(T68, T66)) → MAX_VALUED3_IN_GAA(T67, s(s(s(s(T68)))), T70)
MAX_VALUED3_IN_GAA(.(s(s(T73)), T74), s(s(s(T75))), T77) → U19_GAA(T73, T74, T75, T77, higher_valued97_in_ag(T75, T73))
U19_GAA(T73, T74, T75, T77, higher_valued97_out_ag(T75, T73)) → MAX_VALUED3_IN_GAA(T74, s(s(s(T75))), T77)
MAX_VALUED3_IN_GAA(.(s(T80), T81), s(s(T82)), T84) → U21_GAA(T80, T81, T82, T84, higher_valued102_in_ag(T82, T80))
U21_GAA(T80, T81, T82, T84, higher_valued102_out_ag(T82, T80)) → MAX_VALUED3_IN_GAA(T81, s(s(T82)), T84)
MAX_VALUED3_IN_GAA(.(T87, T88), s(T89), T91) → U23_GAA(T87, T88, T89, T91, higher_valued107_in_ag(T89, T87))
U23_GAA(T87, T88, T89, T91, higher_valued107_out_ag(T89, T87)) → MAX_VALUED3_IN_GAA(T88, s(T89), T91)
MAX_VALUED3_IN_GAA(.(T94, T95), T96, T98) → U25_GAA(T94, T95, T96, T98, higher_valued112_in_ag(T96, T94))
U25_GAA(T94, T95, T96, T98, higher_valued112_out_ag(T96, T94)) → MAX_VALUED3_IN_GAA(T95, T96, T98)
MAX_VALUED3_IN_GAA(.(T15, T9), 0, T12) → MAX_VALUED3_IN_GGA(T9, T15, T12)
MAX_VALUED3_IN_GAA(.(T101, T102), T103, T105) → U27_GAA(T101, T102, T103, T105, higher_valued118_in_ag(T103, T101))
U27_GAA(T101, T102, T103, T105, higher_valued118_out_ag(T103, T101)) → MAX_VALUED3_IN_GAA(T102, T103, T105)
max_valued1_in_ga(.(T7, []), T7) → max_valued1_out_ga(.(T7, []), T7)
max_valued1_in_ga(.(0, .(T15, T9)), T12) → U39_ga(T15, T9, T12, max_valued3_in_gga(T9, T15, T12))
max_valued3_in_gga([], T7, T7) → max_valued3_out_gga([], T7, T7)
max_valued3_in_gga(.(T15, T9), 0, T12) → U1_gga(T15, T9, T12, max_valued3_in_gga(T9, T15, T12))
max_valued3_in_gga(.(s(T18), T9), s(0), T12) → U2_gga(T18, T9, T12, max_valued3_in_gga(T9, s(T18), T12))
max_valued3_in_gga(.(s(s(T21)), T9), s(s(0)), T12) → U3_gga(T21, T9, T12, max_valued3_in_gga(T9, s(s(T21)), T12))
max_valued3_in_gga(.(s(s(s(T24))), T9), s(s(s(0))), T12) → U4_gga(T24, T9, T12, max_valued3_in_gga(T9, s(s(s(T24))), T12))
max_valued3_in_gga(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12) → U5_gga(T27, T9, T12, max_valued3_in_gga(T9, s(s(s(s(T27)))), T12))
max_valued3_in_gga(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12) → U6_gga(T30, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(T30))))), T12))
max_valued3_in_gga(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12) → U7_gga(T33, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(T33)))))), T12))
max_valued3_in_gga(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12) → U8_gga(T36, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(s(T36))))))), T12))
max_valued3_in_gga(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12) → U9_gga(T37, T9, T38, T12, greater64_in_gg(T37, T38))
greater64_in_gg(s(T40), 0) → greater64_out_gg(s(T40), 0)
greater64_in_gg(s(T41), s(T42)) → U29_gg(T41, T42, greater64_in_gg(T41, T42))
U29_gg(T41, T42, greater64_out_gg(T41, T42)) → greater64_out_gg(s(T41), s(T42))
U9_gga(T37, T9, T38, T12, greater64_out_gg(T37, T38)) → max_valued3_out_gga(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12)
U9_gga(T37, T9, T38, T12, greater64_out_gg(T37, T38)) → U10_gga(T37, T9, T38, T12, max_valued3_in_gaa(T9, s(T39), T12))
max_valued3_in_gaa([], T7, T7) → max_valued3_out_gaa([], T7, T7)
max_valued3_in_gaa(.(T15, T9), 0, T12) → U1_gaa(T15, T9, T12, max_valued3_in_gga(T9, T15, T12))
max_valued3_in_gga(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47) → U11_gga(T43, T44, T45, T47, higher_valued77_in_ag(T48, T43))
higher_valued77_in_ag(T50, T51) → U30_ag(T50, T51, greater64_in_ag(s(s(T50)), s(s(s(s(s(s(T51))))))))
greater64_in_ag(s(T40), 0) → greater64_out_ag(s(T40), 0)
greater64_in_ag(s(T41), s(T42)) → U29_ag(T41, T42, greater64_in_ag(T41, T42))
U29_ag(T41, T42, greater64_out_ag(T41, T42)) → greater64_out_ag(s(T41), s(T42))
U30_ag(T50, T51, greater64_out_ag(s(s(T50)), s(s(s(s(s(s(T51)))))))) → higher_valued77_out_ag(T50, T51)
U11_gga(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → max_valued3_out_gga(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47)
U11_gga(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → U12_gga(T43, T44, T45, T47, max_valued3_in_gaa(T44, s(T49), T47))
max_valued3_in_gaa(.(s(T18), T9), s(0), T12) → U2_gaa(T18, T9, T12, max_valued3_in_gga(T9, s(T18), T12))
max_valued3_in_gga(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56) → U13_gga(T52, T53, T54, T56, higher_valued82_in_gg(T54, T52))
higher_valued82_in_gg(T57, T58) → U31_gg(T57, T58, greater64_in_gg(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58)))))))
U31_gg(T57, T58, greater64_out_gg(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58))))))) → higher_valued82_out_gg(T57, T58)
U13_gga(T52, T53, T54, T56, higher_valued82_out_gg(T54, T52)) → max_valued3_out_gga(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56)
U13_gga(T52, T53, T54, T56, higher_valued82_out_gg(T54, T52)) → U14_gga(T52, T53, T54, T56, max_valued3_in_gga(T53, s(s(s(s(s(s(T54)))))), T56))
max_valued3_in_gga(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63) → U15_gga(T59, T60, T61, T63, higher_valued87_in_gg(T61, T59))
higher_valued87_in_gg(T64, T65) → U32_gg(T64, T65, greater64_in_gg(s(s(s(s(s(s(T64)))))), s(s(s(s(T65))))))
U32_gg(T64, T65, greater64_out_gg(s(s(s(s(s(s(T64)))))), s(s(s(s(T65)))))) → higher_valued87_out_gg(T64, T65)
U15_gga(T59, T60, T61, T63, higher_valued87_out_gg(T61, T59)) → max_valued3_out_gga(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63)
U15_gga(T59, T60, T61, T63, higher_valued87_out_gg(T61, T59)) → U16_gga(T59, T60, T61, T63, max_valued3_in_gga(T60, s(s(s(s(s(T61))))), T63))
max_valued3_in_gga(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70) → U17_gga(T66, T67, T68, T70, higher_valued92_in_gg(T68, T66))
higher_valued92_in_gg(T71, T72) → U33_gg(T71, T72, greater64_in_gg(s(s(s(s(s(T71))))), s(s(s(T72)))))
U33_gg(T71, T72, greater64_out_gg(s(s(s(s(s(T71))))), s(s(s(T72))))) → higher_valued92_out_gg(T71, T72)
U17_gga(T66, T67, T68, T70, higher_valued92_out_gg(T68, T66)) → max_valued3_out_gga(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70)
U17_gga(T66, T67, T68, T70, higher_valued92_out_gg(T68, T66)) → U18_gga(T66, T67, T68, T70, max_valued3_in_gga(T67, s(s(s(s(T68)))), T70))
max_valued3_in_gga(.(s(s(T73)), T74), s(s(s(T75))), T77) → U19_gga(T73, T74, T75, T77, higher_valued97_in_gg(T75, T73))
higher_valued97_in_gg(T78, T79) → U34_gg(T78, T79, greater64_in_gg(s(s(s(s(T78)))), s(s(T79))))
U34_gg(T78, T79, greater64_out_gg(s(s(s(s(T78)))), s(s(T79)))) → higher_valued97_out_gg(T78, T79)
U19_gga(T73, T74, T75, T77, higher_valued97_out_gg(T75, T73)) → max_valued3_out_gga(.(s(s(T73)), T74), s(s(s(T75))), T77)
U19_gga(T73, T74, T75, T77, higher_valued97_out_gg(T75, T73)) → U20_gga(T73, T74, T75, T77, max_valued3_in_gga(T74, s(s(s(T75))), T77))
max_valued3_in_gga(.(s(T80), T81), s(s(T82)), T84) → U21_gga(T80, T81, T82, T84, higher_valued102_in_gg(T82, T80))
higher_valued102_in_gg(T85, T86) → U35_gg(T85, T86, greater64_in_gg(s(s(s(T85))), s(T86)))
U35_gg(T85, T86, greater64_out_gg(s(s(s(T85))), s(T86))) → higher_valued102_out_gg(T85, T86)
U21_gga(T80, T81, T82, T84, higher_valued102_out_gg(T82, T80)) → max_valued3_out_gga(.(s(T80), T81), s(s(T82)), T84)
U21_gga(T80, T81, T82, T84, higher_valued102_out_gg(T82, T80)) → U22_gga(T80, T81, T82, T84, max_valued3_in_gga(T81, s(s(T82)), T84))
max_valued3_in_gga(.(T87, T88), s(T89), T91) → U23_gga(T87, T88, T89, T91, higher_valued107_in_gg(T89, T87))
higher_valued107_in_gg(T92, T93) → U36_gg(T92, T93, greater64_in_gg(s(s(T92)), T93))
U36_gg(T92, T93, greater64_out_gg(s(s(T92)), T93)) → higher_valued107_out_gg(T92, T93)
U23_gga(T87, T88, T89, T91, higher_valued107_out_gg(T89, T87)) → max_valued3_out_gga(.(T87, T88), s(T89), T91)
U23_gga(T87, T88, T89, T91, higher_valued107_out_gg(T89, T87)) → U24_gga(T87, T88, T89, T91, max_valued3_in_gga(T88, s(T89), T91))
max_valued3_in_gga(.(T94, T95), T96, T98) → U25_gga(T94, T95, T96, T98, higher_valued112_in_gg(T96, T94))
higher_valued112_in_gg(T99, T100) → U37_gg(T99, T100, greater64_in_gg(s(T99), T100))
U37_gg(T99, T100, greater64_out_gg(s(T99), T100)) → higher_valued112_out_gg(T99, T100)
U25_gga(T94, T95, T96, T98, higher_valued112_out_gg(T96, T94)) → max_valued3_out_gga(.(T94, T95), T96, T98)
U25_gga(T94, T95, T96, T98, higher_valued112_out_gg(T96, T94)) → U26_gga(T94, T95, T96, T98, max_valued3_in_gga(T95, T96, T98))
max_valued3_in_gga(.(T101, T102), T103, T105) → U27_gga(T101, T102, T103, T105, higher_valued118_in_gg(T103, T101))
higher_valued118_in_gg(T106, T107) → U38_gg(T106, T107, greater64_in_gg(s(T106), T107))
U38_gg(T106, T107, greater64_out_gg(s(T106), T107)) → higher_valued118_out_gg(T106, T107)
U27_gga(T101, T102, T103, T105, higher_valued118_out_gg(T103, T101)) → max_valued3_out_gga(.(T101, T102), T103, T105)
U27_gga(T101, T102, T103, T105, higher_valued118_out_gg(T103, T101)) → U28_gga(T101, T102, T103, T105, max_valued3_in_gga(T102, T103, T105))
U28_gga(T101, T102, T103, T105, max_valued3_out_gga(T102, T103, T105)) → max_valued3_out_gga(.(T101, T102), T103, T105)
U26_gga(T94, T95, T96, T98, max_valued3_out_gga(T95, T96, T98)) → max_valued3_out_gga(.(T94, T95), T96, T98)
U24_gga(T87, T88, T89, T91, max_valued3_out_gga(T88, s(T89), T91)) → max_valued3_out_gga(.(T87, T88), s(T89), T91)
U22_gga(T80, T81, T82, T84, max_valued3_out_gga(T81, s(s(T82)), T84)) → max_valued3_out_gga(.(s(T80), T81), s(s(T82)), T84)
U20_gga(T73, T74, T75, T77, max_valued3_out_gga(T74, s(s(s(T75))), T77)) → max_valued3_out_gga(.(s(s(T73)), T74), s(s(s(T75))), T77)
U18_gga(T66, T67, T68, T70, max_valued3_out_gga(T67, s(s(s(s(T68)))), T70)) → max_valued3_out_gga(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70)
U16_gga(T59, T60, T61, T63, max_valued3_out_gga(T60, s(s(s(s(s(T61))))), T63)) → max_valued3_out_gga(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63)
U14_gga(T52, T53, T54, T56, max_valued3_out_gga(T53, s(s(s(s(s(s(T54)))))), T56)) → max_valued3_out_gga(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56)
U2_gaa(T18, T9, T12, max_valued3_out_gga(T9, s(T18), T12)) → max_valued3_out_gaa(.(s(T18), T9), s(0), T12)
max_valued3_in_gaa(.(s(s(T21)), T9), s(s(0)), T12) → U3_gaa(T21, T9, T12, max_valued3_in_gga(T9, s(s(T21)), T12))
U3_gaa(T21, T9, T12, max_valued3_out_gga(T9, s(s(T21)), T12)) → max_valued3_out_gaa(.(s(s(T21)), T9), s(s(0)), T12)
max_valued3_in_gaa(.(s(s(s(T24))), T9), s(s(s(0))), T12) → U4_gaa(T24, T9, T12, max_valued3_in_gga(T9, s(s(s(T24))), T12))
U4_gaa(T24, T9, T12, max_valued3_out_gga(T9, s(s(s(T24))), T12)) → max_valued3_out_gaa(.(s(s(s(T24))), T9), s(s(s(0))), T12)
max_valued3_in_gaa(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12) → U5_gaa(T27, T9, T12, max_valued3_in_gga(T9, s(s(s(s(T27)))), T12))
U5_gaa(T27, T9, T12, max_valued3_out_gga(T9, s(s(s(s(T27)))), T12)) → max_valued3_out_gaa(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12)
max_valued3_in_gaa(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12) → U6_gaa(T30, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(T30))))), T12))
U6_gaa(T30, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(T30))))), T12)) → max_valued3_out_gaa(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12)
max_valued3_in_gaa(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12) → U7_gaa(T33, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(T33)))))), T12))
U7_gaa(T33, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(T33)))))), T12)) → max_valued3_out_gaa(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12)
max_valued3_in_gaa(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12) → U8_gaa(T36, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(s(T36))))))), T12))
U8_gaa(T36, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(s(T36))))))), T12)) → max_valued3_out_gaa(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12)
max_valued3_in_gaa(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12) → U9_gaa(T37, T9, T38, T12, greater64_in_ga(T37, T38))
greater64_in_ga(s(T40), 0) → greater64_out_ga(s(T40), 0)
greater64_in_ga(s(T41), s(T42)) → U29_ga(T41, T42, greater64_in_ga(T41, T42))
U29_ga(T41, T42, greater64_out_ga(T41, T42)) → greater64_out_ga(s(T41), s(T42))
U9_gaa(T37, T9, T38, T12, greater64_out_ga(T37, T38)) → max_valued3_out_gaa(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12)
U9_gaa(T37, T9, T38, T12, greater64_out_ga(T37, T38)) → U10_gaa(T37, T9, T38, T12, max_valued3_in_gaa(T9, s(T39), T12))
max_valued3_in_gaa(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47) → U11_gaa(T43, T44, T45, T47, higher_valued77_in_ag(T48, T43))
U11_gaa(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → max_valued3_out_gaa(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47)
U11_gaa(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → U12_gaa(T43, T44, T45, T47, max_valued3_in_gaa(T44, s(T49), T47))
max_valued3_in_gaa(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56) → U13_gaa(T52, T53, T54, T56, higher_valued82_in_ag(T54, T52))
higher_valued82_in_ag(T57, T58) → U31_ag(T57, T58, greater64_in_ag(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58)))))))
U31_ag(T57, T58, greater64_out_ag(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58))))))) → higher_valued82_out_ag(T57, T58)
U13_gaa(T52, T53, T54, T56, higher_valued82_out_ag(T54, T52)) → max_valued3_out_gaa(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56)
U13_gaa(T52, T53, T54, T56, higher_valued82_out_ag(T54, T52)) → U14_gaa(T52, T53, T54, T56, max_valued3_in_gaa(T53, s(s(s(s(s(s(T54)))))), T56))
max_valued3_in_gaa(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63) → U15_gaa(T59, T60, T61, T63, higher_valued87_in_ag(T61, T59))
higher_valued87_in_ag(T64, T65) → U32_ag(T64, T65, greater64_in_ag(s(s(s(s(s(s(T64)))))), s(s(s(s(T65))))))
U32_ag(T64, T65, greater64_out_ag(s(s(s(s(s(s(T64)))))), s(s(s(s(T65)))))) → higher_valued87_out_ag(T64, T65)
U15_gaa(T59, T60, T61, T63, higher_valued87_out_ag(T61, T59)) → max_valued3_out_gaa(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63)
U15_gaa(T59, T60, T61, T63, higher_valued87_out_ag(T61, T59)) → U16_gaa(T59, T60, T61, T63, max_valued3_in_gaa(T60, s(s(s(s(s(T61))))), T63))
max_valued3_in_gaa(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70) → U17_gaa(T66, T67, T68, T70, higher_valued92_in_ag(T68, T66))
higher_valued92_in_ag(T71, T72) → U33_ag(T71, T72, greater64_in_ag(s(s(s(s(s(T71))))), s(s(s(T72)))))
U33_ag(T71, T72, greater64_out_ag(s(s(s(s(s(T71))))), s(s(s(T72))))) → higher_valued92_out_ag(T71, T72)
U17_gaa(T66, T67, T68, T70, higher_valued92_out_ag(T68, T66)) → max_valued3_out_gaa(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70)
U17_gaa(T66, T67, T68, T70, higher_valued92_out_ag(T68, T66)) → U18_gaa(T66, T67, T68, T70, max_valued3_in_gaa(T67, s(s(s(s(T68)))), T70))
max_valued3_in_gaa(.(s(s(T73)), T74), s(s(s(T75))), T77) → U19_gaa(T73, T74, T75, T77, higher_valued97_in_ag(T75, T73))
higher_valued97_in_ag(T78, T79) → U34_ag(T78, T79, greater64_in_ag(s(s(s(s(T78)))), s(s(T79))))
U34_ag(T78, T79, greater64_out_ag(s(s(s(s(T78)))), s(s(T79)))) → higher_valued97_out_ag(T78, T79)
U19_gaa(T73, T74, T75, T77, higher_valued97_out_ag(T75, T73)) → max_valued3_out_gaa(.(s(s(T73)), T74), s(s(s(T75))), T77)
U19_gaa(T73, T74, T75, T77, higher_valued97_out_ag(T75, T73)) → U20_gaa(T73, T74, T75, T77, max_valued3_in_gaa(T74, s(s(s(T75))), T77))
max_valued3_in_gaa(.(s(T80), T81), s(s(T82)), T84) → U21_gaa(T80, T81, T82, T84, higher_valued102_in_ag(T82, T80))
higher_valued102_in_ag(T85, T86) → U35_ag(T85, T86, greater64_in_ag(s(s(s(T85))), s(T86)))
U35_ag(T85, T86, greater64_out_ag(s(s(s(T85))), s(T86))) → higher_valued102_out_ag(T85, T86)
U21_gaa(T80, T81, T82, T84, higher_valued102_out_ag(T82, T80)) → max_valued3_out_gaa(.(s(T80), T81), s(s(T82)), T84)
U21_gaa(T80, T81, T82, T84, higher_valued102_out_ag(T82, T80)) → U22_gaa(T80, T81, T82, T84, max_valued3_in_gaa(T81, s(s(T82)), T84))
max_valued3_in_gaa(.(T87, T88), s(T89), T91) → U23_gaa(T87, T88, T89, T91, higher_valued107_in_ag(T89, T87))
higher_valued107_in_ag(T92, T93) → U36_ag(T92, T93, greater64_in_ag(s(s(T92)), T93))
U36_ag(T92, T93, greater64_out_ag(s(s(T92)), T93)) → higher_valued107_out_ag(T92, T93)
U23_gaa(T87, T88, T89, T91, higher_valued107_out_ag(T89, T87)) → max_valued3_out_gaa(.(T87, T88), s(T89), T91)
U23_gaa(T87, T88, T89, T91, higher_valued107_out_ag(T89, T87)) → U24_gaa(T87, T88, T89, T91, max_valued3_in_gaa(T88, s(T89), T91))
max_valued3_in_gaa(.(T94, T95), T96, T98) → U25_gaa(T94, T95, T96, T98, higher_valued112_in_ag(T96, T94))
higher_valued112_in_ag(T99, T100) → U37_ag(T99, T100, greater64_in_ag(s(T99), T100))
U37_ag(T99, T100, greater64_out_ag(s(T99), T100)) → higher_valued112_out_ag(T99, T100)
U25_gaa(T94, T95, T96, T98, higher_valued112_out_ag(T96, T94)) → max_valued3_out_gaa(.(T94, T95), T96, T98)
U25_gaa(T94, T95, T96, T98, higher_valued112_out_ag(T96, T94)) → U26_gaa(T94, T95, T96, T98, max_valued3_in_gaa(T95, T96, T98))
max_valued3_in_gaa(.(T101, T102), T103, T105) → U27_gaa(T101, T102, T103, T105, higher_valued118_in_ag(T103, T101))
higher_valued118_in_ag(T106, T107) → U38_ag(T106, T107, greater64_in_ag(s(T106), T107))
U38_ag(T106, T107, greater64_out_ag(s(T106), T107)) → higher_valued118_out_ag(T106, T107)
U27_gaa(T101, T102, T103, T105, higher_valued118_out_ag(T103, T101)) → max_valued3_out_gaa(.(T101, T102), T103, T105)
U27_gaa(T101, T102, T103, T105, higher_valued118_out_ag(T103, T101)) → U28_gaa(T101, T102, T103, T105, max_valued3_in_gaa(T102, T103, T105))
U28_gaa(T101, T102, T103, T105, max_valued3_out_gaa(T102, T103, T105)) → max_valued3_out_gaa(.(T101, T102), T103, T105)
U26_gaa(T94, T95, T96, T98, max_valued3_out_gaa(T95, T96, T98)) → max_valued3_out_gaa(.(T94, T95), T96, T98)
U24_gaa(T87, T88, T89, T91, max_valued3_out_gaa(T88, s(T89), T91)) → max_valued3_out_gaa(.(T87, T88), s(T89), T91)
U22_gaa(T80, T81, T82, T84, max_valued3_out_gaa(T81, s(s(T82)), T84)) → max_valued3_out_gaa(.(s(T80), T81), s(s(T82)), T84)
U20_gaa(T73, T74, T75, T77, max_valued3_out_gaa(T74, s(s(s(T75))), T77)) → max_valued3_out_gaa(.(s(s(T73)), T74), s(s(s(T75))), T77)
U18_gaa(T66, T67, T68, T70, max_valued3_out_gaa(T67, s(s(s(s(T68)))), T70)) → max_valued3_out_gaa(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70)
U16_gaa(T59, T60, T61, T63, max_valued3_out_gaa(T60, s(s(s(s(s(T61))))), T63)) → max_valued3_out_gaa(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63)
U14_gaa(T52, T53, T54, T56, max_valued3_out_gaa(T53, s(s(s(s(s(s(T54)))))), T56)) → max_valued3_out_gaa(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56)
U12_gaa(T43, T44, T45, T47, max_valued3_out_gaa(T44, s(T49), T47)) → max_valued3_out_gaa(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47)
U10_gaa(T37, T9, T38, T12, max_valued3_out_gaa(T9, s(T39), T12)) → max_valued3_out_gaa(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12)
U12_gga(T43, T44, T45, T47, max_valued3_out_gaa(T44, s(T49), T47)) → max_valued3_out_gga(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47)
U1_gaa(T15, T9, T12, max_valued3_out_gga(T9, T15, T12)) → max_valued3_out_gaa(.(T15, T9), 0, T12)
U10_gga(T37, T9, T38, T12, max_valued3_out_gaa(T9, s(T39), T12)) → max_valued3_out_gga(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12)
U8_gga(T36, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(s(T36))))))), T12)) → max_valued3_out_gga(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12)
U7_gga(T33, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(T33)))))), T12)) → max_valued3_out_gga(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12)
U6_gga(T30, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(T30))))), T12)) → max_valued3_out_gga(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12)
U5_gga(T27, T9, T12, max_valued3_out_gga(T9, s(s(s(s(T27)))), T12)) → max_valued3_out_gga(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12)
U4_gga(T24, T9, T12, max_valued3_out_gga(T9, s(s(s(T24))), T12)) → max_valued3_out_gga(.(s(s(s(T24))), T9), s(s(s(0))), T12)
U3_gga(T21, T9, T12, max_valued3_out_gga(T9, s(s(T21)), T12)) → max_valued3_out_gga(.(s(s(T21)), T9), s(s(0)), T12)
U2_gga(T18, T9, T12, max_valued3_out_gga(T9, s(T18), T12)) → max_valued3_out_gga(.(s(T18), T9), s(0), T12)
U1_gga(T15, T9, T12, max_valued3_out_gga(T9, T15, T12)) → max_valued3_out_gga(.(T15, T9), 0, T12)
U39_ga(T15, T9, T12, max_valued3_out_gga(T9, T15, T12)) → max_valued1_out_ga(.(0, .(T15, T9)), T12)
max_valued1_in_ga(.(s(0), .(s(T18), T9)), T12) → U40_ga(T18, T9, T12, max_valued3_in_gga(T9, s(T18), T12))
U40_ga(T18, T9, T12, max_valued3_out_gga(T9, s(T18), T12)) → max_valued1_out_ga(.(s(0), .(s(T18), T9)), T12)
max_valued1_in_ga(.(s(s(0)), .(s(s(T21)), T9)), T12) → U41_ga(T21, T9, T12, max_valued3_in_gga(T9, s(s(T21)), T12))
U41_ga(T21, T9, T12, max_valued3_out_gga(T9, s(s(T21)), T12)) → max_valued1_out_ga(.(s(s(0)), .(s(s(T21)), T9)), T12)
max_valued1_in_ga(.(s(s(s(0))), .(s(s(s(T24))), T9)), T12) → U42_ga(T24, T9, T12, max_valued3_in_gga(T9, s(s(s(T24))), T12))
U42_ga(T24, T9, T12, max_valued3_out_gga(T9, s(s(s(T24))), T12)) → max_valued1_out_ga(.(s(s(s(0))), .(s(s(s(T24))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(0)))), .(s(s(s(s(T27)))), T9)), T12) → U43_ga(T27, T9, T12, max_valued3_in_gga(T9, s(s(s(s(T27)))), T12))
U43_ga(T27, T9, T12, max_valued3_out_gga(T9, s(s(s(s(T27)))), T12)) → max_valued1_out_ga(.(s(s(s(s(0)))), .(s(s(s(s(T27)))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(0))))), .(s(s(s(s(s(T30))))), T9)), T12) → U44_ga(T30, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(T30))))), T12))
U44_ga(T30, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(T30))))), T12)) → max_valued1_out_ga(.(s(s(s(s(s(0))))), .(s(s(s(s(s(T30))))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(s(0)))))), .(s(s(s(s(s(s(T33)))))), T9)), T12) → U45_ga(T33, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(T33)))))), T12))
U45_ga(T33, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(T33)))))), T12)) → max_valued1_out_ga(.(s(s(s(s(s(s(0)))))), .(s(s(s(s(s(s(T33)))))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(s(s(0))))))), .(s(s(s(s(s(s(s(T36))))))), T9)), T12) → U46_ga(T36, T9, T12, max_valued3_in_gga(T9, s(s(s(s(s(s(s(T36))))))), T12))
U46_ga(T36, T9, T12, max_valued3_out_gga(T9, s(s(s(s(s(s(s(T36))))))), T12)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(0))))))), .(s(s(s(s(s(s(s(T36))))))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(s(s(s(T38)))))))), .(s(s(s(s(s(s(s(T37))))))), T9)), T12) → U47_ga(T38, T37, T9, T12, greater64_in_gg(T37, T38))
U47_ga(T38, T37, T9, T12, greater64_out_gg(T37, T38)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(s(T38)))))))), .(s(s(s(s(s(s(s(T37))))))), T9)), T12)
U47_ga(T38, T37, T9, T12, greater64_out_gg(T37, T38)) → U48_ga(T38, T37, T9, T12, max_valued3_in_gaa(T9, s(T39), T12))
U48_ga(T38, T37, T9, T12, max_valued3_out_gaa(T9, s(T39), T12)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(s(T38)))))))), .(s(s(s(s(s(s(s(T37))))))), T9)), T12)
max_valued1_in_ga(.(s(s(s(s(s(s(s(T45))))))), .(s(s(s(s(s(s(T43)))))), T44)), T47) → U49_ga(T45, T43, T44, T47, higher_valued77_in_ag(T48, T43))
U49_ga(T45, T43, T44, T47, higher_valued77_out_ag(T48, T43)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(T45))))))), .(s(s(s(s(s(s(T43)))))), T44)), T47)
U49_ga(T45, T43, T44, T47, higher_valued77_out_ag(T48, T43)) → U50_ga(T45, T43, T44, T47, max_valued3_in_gaa(T44, s(T49), T47))
U50_ga(T45, T43, T44, T47, max_valued3_out_gaa(T44, s(T49), T47)) → max_valued1_out_ga(.(s(s(s(s(s(s(s(T45))))))), .(s(s(s(s(s(s(T43)))))), T44)), T47)
max_valued1_in_ga(.(s(s(s(s(s(s(T54)))))), .(s(s(s(s(s(T52))))), T53)), T56) → U51_ga(T54, T52, T53, T56, higher_valued82_in_gg(T54, T52))
U51_ga(T54, T52, T53, T56, higher_valued82_out_gg(T54, T52)) → max_valued1_out_ga(.(s(s(s(s(s(s(T54)))))), .(s(s(s(s(s(T52))))), T53)), T56)
U51_ga(T54, T52, T53, T56, higher_valued82_out_gg(T54, T52)) → U52_ga(T54, T52, T53, T56, max_valued3_in_gga(T53, s(s(s(s(s(s(T54)))))), T56))
U52_ga(T54, T52, T53, T56, max_valued3_out_gga(T53, s(s(s(s(s(s(T54)))))), T56)) → max_valued1_out_ga(.(s(s(s(s(s(s(T54)))))), .(s(s(s(s(s(T52))))), T53)), T56)
max_valued1_in_ga(.(s(s(s(s(s(T61))))), .(s(s(s(s(T59)))), T60)), T63) → U53_ga(T61, T59, T60, T63, higher_valued87_in_gg(T61, T59))
U53_ga(T61, T59, T60, T63, higher_valued87_out_gg(T61, T59)) → max_valued1_out_ga(.(s(s(s(s(s(T61))))), .(s(s(s(s(T59)))), T60)), T63)
U53_ga(T61, T59, T60, T63, higher_valued87_out_gg(T61, T59)) → U54_ga(T61, T59, T60, T63, max_valued3_in_gga(T60, s(s(s(s(s(T61))))), T63))
U54_ga(T61, T59, T60, T63, max_valued3_out_gga(T60, s(s(s(s(s(T61))))), T63)) → max_valued1_out_ga(.(s(s(s(s(s(T61))))), .(s(s(s(s(T59)))), T60)), T63)
max_valued1_in_ga(.(s(s(s(s(T68)))), .(s(s(s(T66))), T67)), T70) → U55_ga(T68, T66, T67, T70, higher_valued92_in_gg(T68, T66))
U55_ga(T68, T66, T67, T70, higher_valued92_out_gg(T68, T66)) → max_valued1_out_ga(.(s(s(s(s(T68)))), .(s(s(s(T66))), T67)), T70)
U55_ga(T68, T66, T67, T70, higher_valued92_out_gg(T68, T66)) → U56_ga(T68, T66, T67, T70, max_valued3_in_gga(T67, s(s(s(s(T68)))), T70))
U56_ga(T68, T66, T67, T70, max_valued3_out_gga(T67, s(s(s(s(T68)))), T70)) → max_valued1_out_ga(.(s(s(s(s(T68)))), .(s(s(s(T66))), T67)), T70)
max_valued1_in_ga(.(s(s(s(T75))), .(s(s(T73)), T74)), T77) → U57_ga(T75, T73, T74, T77, higher_valued97_in_gg(T75, T73))
U57_ga(T75, T73, T74, T77, higher_valued97_out_gg(T75, T73)) → max_valued1_out_ga(.(s(s(s(T75))), .(s(s(T73)), T74)), T77)
U57_ga(T75, T73, T74, T77, higher_valued97_out_gg(T75, T73)) → U58_ga(T75, T73, T74, T77, max_valued3_in_gga(T74, s(s(s(T75))), T77))
U58_ga(T75, T73, T74, T77, max_valued3_out_gga(T74, s(s(s(T75))), T77)) → max_valued1_out_ga(.(s(s(s(T75))), .(s(s(T73)), T74)), T77)
max_valued1_in_ga(.(s(s(T82)), .(s(T80), T81)), T84) → U59_ga(T82, T80, T81, T84, higher_valued102_in_gg(T82, T80))
U59_ga(T82, T80, T81, T84, higher_valued102_out_gg(T82, T80)) → max_valued1_out_ga(.(s(s(T82)), .(s(T80), T81)), T84)
U59_ga(T82, T80, T81, T84, higher_valued102_out_gg(T82, T80)) → U60_ga(T82, T80, T81, T84, max_valued3_in_gga(T81, s(s(T82)), T84))
U60_ga(T82, T80, T81, T84, max_valued3_out_gga(T81, s(s(T82)), T84)) → max_valued1_out_ga(.(s(s(T82)), .(s(T80), T81)), T84)
max_valued1_in_ga(.(s(T89), .(T87, T88)), T91) → U61_ga(T89, T87, T88, T91, higher_valued107_in_gg(T89, T87))
U61_ga(T89, T87, T88, T91, higher_valued107_out_gg(T89, T87)) → max_valued1_out_ga(.(s(T89), .(T87, T88)), T91)
U61_ga(T89, T87, T88, T91, higher_valued107_out_gg(T89, T87)) → U62_ga(T89, T87, T88, T91, max_valued3_in_gga(T88, s(T89), T91))
U62_ga(T89, T87, T88, T91, max_valued3_out_gga(T88, s(T89), T91)) → max_valued1_out_ga(.(s(T89), .(T87, T88)), T91)
max_valued1_in_ga(.(T96, .(T94, T95)), T98) → U63_ga(T96, T94, T95, T98, higher_valued112_in_gg(T96, T94))
U63_ga(T96, T94, T95, T98, higher_valued112_out_gg(T96, T94)) → max_valued1_out_ga(.(T96, .(T94, T95)), T98)
U63_ga(T96, T94, T95, T98, higher_valued112_out_gg(T96, T94)) → U64_ga(T96, T94, T95, T98, max_valued3_in_gga(T95, T96, T98))
U64_ga(T96, T94, T95, T98, max_valued3_out_gga(T95, T96, T98)) → max_valued1_out_ga(.(T96, .(T94, T95)), T98)
max_valued1_in_ga(.(T103, .(T101, T102)), T105) → U65_ga(T103, T101, T102, T105, higher_valued118_in_gg(T103, T101))
U65_ga(T103, T101, T102, T105, higher_valued118_out_gg(T103, T101)) → max_valued1_out_ga(.(T103, .(T101, T102)), T105)
U65_ga(T103, T101, T102, T105, higher_valued118_out_gg(T103, T101)) → U66_ga(T103, T101, T102, T105, max_valued3_in_gga(T102, T103, T105))
U66_ga(T103, T101, T102, T105, max_valued3_out_gga(T102, T103, T105)) → max_valued1_out_ga(.(T103, .(T101, T102)), T105)
MAX_VALUED3_IN_GGA(.(s(T18), T9), s(0), T12) → MAX_VALUED3_IN_GGA(T9, s(T18), T12)
MAX_VALUED3_IN_GGA(.(s(s(T21)), T9), s(s(0)), T12) → MAX_VALUED3_IN_GGA(T9, s(s(T21)), T12)
MAX_VALUED3_IN_GGA(.(s(s(s(T24))), T9), s(s(s(0))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(T24))), T12)
MAX_VALUED3_IN_GGA(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(T27)))), T12)
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(T30))))), T12)
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(s(T33)))))), T12)
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(s(s(T36))))))), T12)
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12) → U9_GGA(T37, T9, T38, T12, greater64_in_gg(T37, T38))
U9_GGA(T37, T9, T38, T12, greater64_out_gg(T37, T38)) → MAX_VALUED3_IN_GAA(T9, s(T39), T12)
MAX_VALUED3_IN_GAA(.(s(T18), T9), s(0), T12) → MAX_VALUED3_IN_GGA(T9, s(T18), T12)
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47) → U11_GGA(T43, T44, T45, T47, higher_valued77_in_ag(T48, T43))
U11_GGA(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → MAX_VALUED3_IN_GAA(T44, s(T49), T47)
MAX_VALUED3_IN_GAA(.(s(s(T21)), T9), s(s(0)), T12) → MAX_VALUED3_IN_GGA(T9, s(s(T21)), T12)
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56) → U13_GGA(T52, T53, T54, T56, higher_valued82_in_gg(T54, T52))
U13_GGA(T52, T53, T54, T56, higher_valued82_out_gg(T54, T52)) → MAX_VALUED3_IN_GGA(T53, s(s(s(s(s(s(T54)))))), T56)
MAX_VALUED3_IN_GGA(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63) → U15_GGA(T59, T60, T61, T63, higher_valued87_in_gg(T61, T59))
U15_GGA(T59, T60, T61, T63, higher_valued87_out_gg(T61, T59)) → MAX_VALUED3_IN_GGA(T60, s(s(s(s(s(T61))))), T63)
MAX_VALUED3_IN_GGA(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70) → U17_GGA(T66, T67, T68, T70, higher_valued92_in_gg(T68, T66))
U17_GGA(T66, T67, T68, T70, higher_valued92_out_gg(T68, T66)) → MAX_VALUED3_IN_GGA(T67, s(s(s(s(T68)))), T70)
MAX_VALUED3_IN_GGA(.(s(s(T73)), T74), s(s(s(T75))), T77) → U19_GGA(T73, T74, T75, T77, higher_valued97_in_gg(T75, T73))
U19_GGA(T73, T74, T75, T77, higher_valued97_out_gg(T75, T73)) → MAX_VALUED3_IN_GGA(T74, s(s(s(T75))), T77)
MAX_VALUED3_IN_GGA(.(s(T80), T81), s(s(T82)), T84) → U21_GGA(T80, T81, T82, T84, higher_valued102_in_gg(T82, T80))
U21_GGA(T80, T81, T82, T84, higher_valued102_out_gg(T82, T80)) → MAX_VALUED3_IN_GGA(T81, s(s(T82)), T84)
MAX_VALUED3_IN_GGA(.(T87, T88), s(T89), T91) → U23_GGA(T87, T88, T89, T91, higher_valued107_in_gg(T89, T87))
U23_GGA(T87, T88, T89, T91, higher_valued107_out_gg(T89, T87)) → MAX_VALUED3_IN_GGA(T88, s(T89), T91)
MAX_VALUED3_IN_GGA(.(T94, T95), T96, T98) → U25_GGA(T94, T95, T96, T98, higher_valued112_in_gg(T96, T94))
U25_GGA(T94, T95, T96, T98, higher_valued112_out_gg(T96, T94)) → MAX_VALUED3_IN_GGA(T95, T96, T98)
MAX_VALUED3_IN_GGA(.(T15, T9), 0, T12) → MAX_VALUED3_IN_GGA(T9, T15, T12)
MAX_VALUED3_IN_GGA(.(T101, T102), T103, T105) → U27_GGA(T101, T102, T103, T105, higher_valued118_in_gg(T103, T101))
U27_GGA(T101, T102, T103, T105, higher_valued118_out_gg(T103, T101)) → MAX_VALUED3_IN_GGA(T102, T103, T105)
MAX_VALUED3_IN_GAA(.(s(s(s(T24))), T9), s(s(s(0))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(T24))), T12)
MAX_VALUED3_IN_GAA(.(s(s(s(s(T27)))), T9), s(s(s(s(0)))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(T27)))), T12)
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0))))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(T30))))), T12)
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0)))))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(s(T33)))))), T12)
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0))))))), T12) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(s(s(T36))))))), T12)
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38)))))))), T12) → U9_GAA(T37, T9, T38, T12, greater64_in_ga(T37, T38))
U9_GAA(T37, T9, T38, T12, greater64_out_ga(T37, T38)) → MAX_VALUED3_IN_GAA(T9, s(T39), T12)
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45))))))), T47) → U11_GAA(T43, T44, T45, T47, higher_valued77_in_ag(T48, T43))
U11_GAA(T43, T44, T45, T47, higher_valued77_out_ag(T48, T43)) → MAX_VALUED3_IN_GAA(T44, s(T49), T47)
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54)))))), T56) → U13_GAA(T52, T53, T54, T56, higher_valued82_in_ag(T54, T52))
U13_GAA(T52, T53, T54, T56, higher_valued82_out_ag(T54, T52)) → MAX_VALUED3_IN_GAA(T53, s(s(s(s(s(s(T54)))))), T56)
MAX_VALUED3_IN_GAA(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61))))), T63) → U15_GAA(T59, T60, T61, T63, higher_valued87_in_ag(T61, T59))
U15_GAA(T59, T60, T61, T63, higher_valued87_out_ag(T61, T59)) → MAX_VALUED3_IN_GAA(T60, s(s(s(s(s(T61))))), T63)
MAX_VALUED3_IN_GAA(.(s(s(s(T66))), T67), s(s(s(s(T68)))), T70) → U17_GAA(T66, T67, T68, T70, higher_valued92_in_ag(T68, T66))
U17_GAA(T66, T67, T68, T70, higher_valued92_out_ag(T68, T66)) → MAX_VALUED3_IN_GAA(T67, s(s(s(s(T68)))), T70)
MAX_VALUED3_IN_GAA(.(s(s(T73)), T74), s(s(s(T75))), T77) → U19_GAA(T73, T74, T75, T77, higher_valued97_in_ag(T75, T73))
U19_GAA(T73, T74, T75, T77, higher_valued97_out_ag(T75, T73)) → MAX_VALUED3_IN_GAA(T74, s(s(s(T75))), T77)
MAX_VALUED3_IN_GAA(.(s(T80), T81), s(s(T82)), T84) → U21_GAA(T80, T81, T82, T84, higher_valued102_in_ag(T82, T80))
U21_GAA(T80, T81, T82, T84, higher_valued102_out_ag(T82, T80)) → MAX_VALUED3_IN_GAA(T81, s(s(T82)), T84)
MAX_VALUED3_IN_GAA(.(T87, T88), s(T89), T91) → U23_GAA(T87, T88, T89, T91, higher_valued107_in_ag(T89, T87))
U23_GAA(T87, T88, T89, T91, higher_valued107_out_ag(T89, T87)) → MAX_VALUED3_IN_GAA(T88, s(T89), T91)
MAX_VALUED3_IN_GAA(.(T94, T95), T96, T98) → U25_GAA(T94, T95, T96, T98, higher_valued112_in_ag(T96, T94))
U25_GAA(T94, T95, T96, T98, higher_valued112_out_ag(T96, T94)) → MAX_VALUED3_IN_GAA(T95, T96, T98)
MAX_VALUED3_IN_GAA(.(T15, T9), 0, T12) → MAX_VALUED3_IN_GGA(T9, T15, T12)
MAX_VALUED3_IN_GAA(.(T101, T102), T103, T105) → U27_GAA(T101, T102, T103, T105, higher_valued118_in_ag(T103, T101))
U27_GAA(T101, T102, T103, T105, higher_valued118_out_ag(T103, T101)) → MAX_VALUED3_IN_GAA(T102, T103, T105)
greater64_in_gg(s(T40), 0) → greater64_out_gg(s(T40), 0)
greater64_in_gg(s(T41), s(T42)) → U29_gg(T41, T42, greater64_in_gg(T41, T42))
higher_valued77_in_ag(T50, T51) → U30_ag(T50, T51, greater64_in_ag(s(s(T50)), s(s(s(s(s(s(T51))))))))
higher_valued82_in_gg(T57, T58) → U31_gg(T57, T58, greater64_in_gg(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58)))))))
higher_valued87_in_gg(T64, T65) → U32_gg(T64, T65, greater64_in_gg(s(s(s(s(s(s(T64)))))), s(s(s(s(T65))))))
higher_valued92_in_gg(T71, T72) → U33_gg(T71, T72, greater64_in_gg(s(s(s(s(s(T71))))), s(s(s(T72)))))
higher_valued97_in_gg(T78, T79) → U34_gg(T78, T79, greater64_in_gg(s(s(s(s(T78)))), s(s(T79))))
higher_valued102_in_gg(T85, T86) → U35_gg(T85, T86, greater64_in_gg(s(s(s(T85))), s(T86)))
higher_valued107_in_gg(T92, T93) → U36_gg(T92, T93, greater64_in_gg(s(s(T92)), T93))
higher_valued112_in_gg(T99, T100) → U37_gg(T99, T100, greater64_in_gg(s(T99), T100))
higher_valued118_in_gg(T106, T107) → U38_gg(T106, T107, greater64_in_gg(s(T106), T107))
greater64_in_ga(s(T40), 0) → greater64_out_ga(s(T40), 0)
greater64_in_ga(s(T41), s(T42)) → U29_ga(T41, T42, greater64_in_ga(T41, T42))
higher_valued82_in_ag(T57, T58) → U31_ag(T57, T58, greater64_in_ag(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58)))))))
higher_valued87_in_ag(T64, T65) → U32_ag(T64, T65, greater64_in_ag(s(s(s(s(s(s(T64)))))), s(s(s(s(T65))))))
higher_valued92_in_ag(T71, T72) → U33_ag(T71, T72, greater64_in_ag(s(s(s(s(s(T71))))), s(s(s(T72)))))
higher_valued97_in_ag(T78, T79) → U34_ag(T78, T79, greater64_in_ag(s(s(s(s(T78)))), s(s(T79))))
higher_valued102_in_ag(T85, T86) → U35_ag(T85, T86, greater64_in_ag(s(s(s(T85))), s(T86)))
higher_valued107_in_ag(T92, T93) → U36_ag(T92, T93, greater64_in_ag(s(s(T92)), T93))
higher_valued112_in_ag(T99, T100) → U37_ag(T99, T100, greater64_in_ag(s(T99), T100))
higher_valued118_in_ag(T106, T107) → U38_ag(T106, T107, greater64_in_ag(s(T106), T107))
U29_gg(T41, T42, greater64_out_gg(T41, T42)) → greater64_out_gg(s(T41), s(T42))
U30_ag(T50, T51, greater64_out_ag(s(s(T50)), s(s(s(s(s(s(T51)))))))) → higher_valued77_out_ag(T50, T51)
U31_gg(T57, T58, greater64_out_gg(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58))))))) → higher_valued82_out_gg(T57, T58)
U32_gg(T64, T65, greater64_out_gg(s(s(s(s(s(s(T64)))))), s(s(s(s(T65)))))) → higher_valued87_out_gg(T64, T65)
U33_gg(T71, T72, greater64_out_gg(s(s(s(s(s(T71))))), s(s(s(T72))))) → higher_valued92_out_gg(T71, T72)
U34_gg(T78, T79, greater64_out_gg(s(s(s(s(T78)))), s(s(T79)))) → higher_valued97_out_gg(T78, T79)
U35_gg(T85, T86, greater64_out_gg(s(s(s(T85))), s(T86))) → higher_valued102_out_gg(T85, T86)
U36_gg(T92, T93, greater64_out_gg(s(s(T92)), T93)) → higher_valued107_out_gg(T92, T93)
U37_gg(T99, T100, greater64_out_gg(s(T99), T100)) → higher_valued112_out_gg(T99, T100)
U38_gg(T106, T107, greater64_out_gg(s(T106), T107)) → higher_valued118_out_gg(T106, T107)
U29_ga(T41, T42, greater64_out_ga(T41, T42)) → greater64_out_ga(s(T41), s(T42))
U31_ag(T57, T58, greater64_out_ag(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58))))))) → higher_valued82_out_ag(T57, T58)
U32_ag(T64, T65, greater64_out_ag(s(s(s(s(s(s(T64)))))), s(s(s(s(T65)))))) → higher_valued87_out_ag(T64, T65)
U33_ag(T71, T72, greater64_out_ag(s(s(s(s(s(T71))))), s(s(s(T72))))) → higher_valued92_out_ag(T71, T72)
U34_ag(T78, T79, greater64_out_ag(s(s(s(s(T78)))), s(s(T79)))) → higher_valued97_out_ag(T78, T79)
U35_ag(T85, T86, greater64_out_ag(s(s(s(T85))), s(T86))) → higher_valued102_out_ag(T85, T86)
U36_ag(T92, T93, greater64_out_ag(s(s(T92)), T93)) → higher_valued107_out_ag(T92, T93)
U37_ag(T99, T100, greater64_out_ag(s(T99), T100)) → higher_valued112_out_ag(T99, T100)
U38_ag(T106, T107, greater64_out_ag(s(T106), T107)) → higher_valued118_out_ag(T106, T107)
greater64_in_ag(s(T41), s(T42)) → U29_ag(T41, T42, greater64_in_ag(T41, T42))
greater64_in_ag(s(T40), 0) → greater64_out_ag(s(T40), 0)
U29_ag(T41, T42, greater64_out_ag(T41, T42)) → greater64_out_ag(s(T41), s(T42))
MAX_VALUED3_IN_GGA(.(s(T18), T9), s(0)) → MAX_VALUED3_IN_GGA(T9, s(T18))
MAX_VALUED3_IN_GGA(.(s(s(T21)), T9), s(s(0))) → MAX_VALUED3_IN_GGA(T9, s(s(T21)))
MAX_VALUED3_IN_GGA(.(s(s(s(T24))), T9), s(s(s(0)))) → MAX_VALUED3_IN_GGA(T9, s(s(s(T24))))
MAX_VALUED3_IN_GGA(.(s(s(s(s(T27)))), T9), s(s(s(s(0))))) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(T27)))))
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0)))))) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(T30))))))
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0))))))) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(s(T33)))))))
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0)))))))) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(s(s(T36))))))))
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38))))))))) → U9_GGA(T9, greater64_in_gg(T37, T38))
U9_GGA(T9, greater64_out_gg) → MAX_VALUED3_IN_GAA(T9)
MAX_VALUED3_IN_GAA(.(s(T18), T9)) → MAX_VALUED3_IN_GGA(T9, s(T18))
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45)))))))) → U11_GGA(T44, higher_valued77_in_ag(T43))
U11_GGA(T44, higher_valued77_out_ag) → MAX_VALUED3_IN_GAA(T44)
MAX_VALUED3_IN_GAA(.(s(s(T21)), T9)) → MAX_VALUED3_IN_GGA(T9, s(s(T21)))
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54))))))) → U13_GGA(T53, T54, higher_valued82_in_gg(T54, T52))
U13_GGA(T53, T54, higher_valued82_out_gg) → MAX_VALUED3_IN_GGA(T53, s(s(s(s(s(s(T54)))))))
MAX_VALUED3_IN_GGA(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61)))))) → U15_GGA(T60, T61, higher_valued87_in_gg(T61, T59))
U15_GGA(T60, T61, higher_valued87_out_gg) → MAX_VALUED3_IN_GGA(T60, s(s(s(s(s(T61))))))
MAX_VALUED3_IN_GGA(.(s(s(s(T66))), T67), s(s(s(s(T68))))) → U17_GGA(T67, T68, higher_valued92_in_gg(T68, T66))
U17_GGA(T67, T68, higher_valued92_out_gg) → MAX_VALUED3_IN_GGA(T67, s(s(s(s(T68)))))
MAX_VALUED3_IN_GGA(.(s(s(T73)), T74), s(s(s(T75)))) → U19_GGA(T74, T75, higher_valued97_in_gg(T75, T73))
U19_GGA(T74, T75, higher_valued97_out_gg) → MAX_VALUED3_IN_GGA(T74, s(s(s(T75))))
MAX_VALUED3_IN_GGA(.(s(T80), T81), s(s(T82))) → U21_GGA(T81, T82, higher_valued102_in_gg(T82, T80))
U21_GGA(T81, T82, higher_valued102_out_gg) → MAX_VALUED3_IN_GGA(T81, s(s(T82)))
MAX_VALUED3_IN_GGA(.(T87, T88), s(T89)) → U23_GGA(T88, T89, higher_valued107_in_gg(T89, T87))
U23_GGA(T88, T89, higher_valued107_out_gg) → MAX_VALUED3_IN_GGA(T88, s(T89))
MAX_VALUED3_IN_GGA(.(T94, T95), T96) → U25_GGA(T95, T96, higher_valued112_in_gg(T96, T94))
U25_GGA(T95, T96, higher_valued112_out_gg) → MAX_VALUED3_IN_GGA(T95, T96)
MAX_VALUED3_IN_GGA(.(T15, T9), 0) → MAX_VALUED3_IN_GGA(T9, T15)
MAX_VALUED3_IN_GGA(.(T101, T102), T103) → U27_GGA(T102, T103, higher_valued118_in_gg(T103, T101))
U27_GGA(T102, T103, higher_valued118_out_gg) → MAX_VALUED3_IN_GGA(T102, T103)
MAX_VALUED3_IN_GAA(.(s(s(s(T24))), T9)) → MAX_VALUED3_IN_GGA(T9, s(s(s(T24))))
MAX_VALUED3_IN_GAA(.(s(s(s(s(T27)))), T9)) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(T27)))))
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(T30))))), T9)) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(T30))))))
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(s(T33)))))), T9)) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(s(T33)))))))
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(s(s(T36))))))), T9)) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(s(s(T36))))))))
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(s(s(T37))))))), T9)) → U9_GAA(T9, greater64_in_ga(T37))
U9_GAA(T9, greater64_out_ga(T38)) → MAX_VALUED3_IN_GAA(T9)
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(s(T43)))))), T44)) → U11_GAA(T44, higher_valued77_in_ag(T43))
U11_GAA(T44, higher_valued77_out_ag) → MAX_VALUED3_IN_GAA(T44)
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(T52))))), T53)) → U13_GAA(T53, higher_valued82_in_ag(T52))
U13_GAA(T53, higher_valued82_out_ag) → MAX_VALUED3_IN_GAA(T53)
MAX_VALUED3_IN_GAA(.(s(s(s(s(T59)))), T60)) → U15_GAA(T60, higher_valued87_in_ag(T59))
U15_GAA(T60, higher_valued87_out_ag) → MAX_VALUED3_IN_GAA(T60)
MAX_VALUED3_IN_GAA(.(s(s(s(T66))), T67)) → U17_GAA(T67, higher_valued92_in_ag(T66))
U17_GAA(T67, higher_valued92_out_ag) → MAX_VALUED3_IN_GAA(T67)
MAX_VALUED3_IN_GAA(.(s(s(T73)), T74)) → U19_GAA(T74, higher_valued97_in_ag(T73))
U19_GAA(T74, higher_valued97_out_ag) → MAX_VALUED3_IN_GAA(T74)
MAX_VALUED3_IN_GAA(.(s(T80), T81)) → U21_GAA(T81, higher_valued102_in_ag(T80))
U21_GAA(T81, higher_valued102_out_ag) → MAX_VALUED3_IN_GAA(T81)
MAX_VALUED3_IN_GAA(.(T87, T88)) → U23_GAA(T88, higher_valued107_in_ag(T87))
U23_GAA(T88, higher_valued107_out_ag) → MAX_VALUED3_IN_GAA(T88)
MAX_VALUED3_IN_GAA(.(T94, T95)) → U25_GAA(T95, higher_valued112_in_ag(T94))
U25_GAA(T95, higher_valued112_out_ag) → MAX_VALUED3_IN_GAA(T95)
MAX_VALUED3_IN_GAA(.(T15, T9)) → MAX_VALUED3_IN_GGA(T9, T15)
MAX_VALUED3_IN_GAA(.(T101, T102)) → U27_GAA(T102, higher_valued118_in_ag(T101))
U27_GAA(T102, higher_valued118_out_ag) → MAX_VALUED3_IN_GAA(T102)
greater64_in_gg(s(T40), 0) → greater64_out_gg
greater64_in_gg(s(T41), s(T42)) → U29_gg(greater64_in_gg(T41, T42))
higher_valued77_in_ag(T51) → U30_ag(greater64_in_ag(s(s(s(s(s(s(T51))))))))
higher_valued82_in_gg(T57, T58) → U31_gg(greater64_in_gg(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58)))))))
higher_valued87_in_gg(T64, T65) → U32_gg(greater64_in_gg(s(s(s(s(s(s(T64)))))), s(s(s(s(T65))))))
higher_valued92_in_gg(T71, T72) → U33_gg(greater64_in_gg(s(s(s(s(s(T71))))), s(s(s(T72)))))
higher_valued97_in_gg(T78, T79) → U34_gg(greater64_in_gg(s(s(s(s(T78)))), s(s(T79))))
higher_valued102_in_gg(T85, T86) → U35_gg(greater64_in_gg(s(s(s(T85))), s(T86)))
higher_valued107_in_gg(T92, T93) → U36_gg(greater64_in_gg(s(s(T92)), T93))
higher_valued112_in_gg(T99, T100) → U37_gg(greater64_in_gg(s(T99), T100))
higher_valued118_in_gg(T106, T107) → U38_gg(greater64_in_gg(s(T106), T107))
greater64_in_ga(s(T40)) → greater64_out_ga(0)
greater64_in_ga(s(T41)) → U29_ga(greater64_in_ga(T41))
higher_valued82_in_ag(T58) → U31_ag(greater64_in_ag(s(s(s(s(s(T58)))))))
higher_valued87_in_ag(T65) → U32_ag(greater64_in_ag(s(s(s(s(T65))))))
higher_valued92_in_ag(T72) → U33_ag(greater64_in_ag(s(s(s(T72)))))
higher_valued97_in_ag(T79) → U34_ag(greater64_in_ag(s(s(T79))))
higher_valued102_in_ag(T86) → U35_ag(greater64_in_ag(s(T86)))
higher_valued107_in_ag(T93) → U36_ag(greater64_in_ag(T93))
higher_valued112_in_ag(T100) → U37_ag(greater64_in_ag(T100))
higher_valued118_in_ag(T107) → U38_ag(greater64_in_ag(T107))
U29_gg(greater64_out_gg) → greater64_out_gg
U30_ag(greater64_out_ag) → higher_valued77_out_ag
U31_gg(greater64_out_gg) → higher_valued82_out_gg
U32_gg(greater64_out_gg) → higher_valued87_out_gg
U33_gg(greater64_out_gg) → higher_valued92_out_gg
U34_gg(greater64_out_gg) → higher_valued97_out_gg
U35_gg(greater64_out_gg) → higher_valued102_out_gg
U36_gg(greater64_out_gg) → higher_valued107_out_gg
U37_gg(greater64_out_gg) → higher_valued112_out_gg
U38_gg(greater64_out_gg) → higher_valued118_out_gg
U29_ga(greater64_out_ga(T42)) → greater64_out_ga(s(T42))
U31_ag(greater64_out_ag) → higher_valued82_out_ag
U32_ag(greater64_out_ag) → higher_valued87_out_ag
U33_ag(greater64_out_ag) → higher_valued92_out_ag
U34_ag(greater64_out_ag) → higher_valued97_out_ag
U35_ag(greater64_out_ag) → higher_valued102_out_ag
U36_ag(greater64_out_ag) → higher_valued107_out_ag
U37_ag(greater64_out_ag) → higher_valued112_out_ag
U38_ag(greater64_out_ag) → higher_valued118_out_ag
greater64_in_ag(s(T42)) → U29_ag(greater64_in_ag(T42))
greater64_in_ag(0) → greater64_out_ag
U29_ag(greater64_out_ag) → greater64_out_ag
greater64_in_gg(x0, x1)
higher_valued77_in_ag(x0)
higher_valued82_in_gg(x0, x1)
higher_valued87_in_gg(x0, x1)
higher_valued92_in_gg(x0, x1)
higher_valued97_in_gg(x0, x1)
higher_valued102_in_gg(x0, x1)
higher_valued107_in_gg(x0, x1)
higher_valued112_in_gg(x0, x1)
higher_valued118_in_gg(x0, x1)
greater64_in_ga(x0)
higher_valued82_in_ag(x0)
higher_valued87_in_ag(x0)
higher_valued92_in_ag(x0)
higher_valued97_in_ag(x0)
higher_valued102_in_ag(x0)
higher_valued107_in_ag(x0)
higher_valued112_in_ag(x0)
higher_valued118_in_ag(x0)
U29_gg(x0)
U30_ag(x0)
U31_gg(x0)
U32_gg(x0)
U33_gg(x0)
U34_gg(x0)
U35_gg(x0)
U36_gg(x0)
U37_gg(x0)
U38_gg(x0)
U29_ga(x0)
U31_ag(x0)
U32_ag(x0)
U33_ag(x0)
U34_ag(x0)
U35_ag(x0)
U36_ag(x0)
U37_ag(x0)
U38_ag(x0)
greater64_in_ag(x0)
U29_ag(x0)
The following pairs can be oriented strictly and are deleted.
The remaining pairs can at least be oriented weakly.
MAX_VALUED3_IN_GGA(.(s(T18), T9), s(0)) → MAX_VALUED3_IN_GGA(T9, s(T18))
MAX_VALUED3_IN_GGA(.(s(s(T21)), T9), s(s(0))) → MAX_VALUED3_IN_GGA(T9, s(s(T21)))
MAX_VALUED3_IN_GGA(.(s(s(s(T24))), T9), s(s(s(0)))) → MAX_VALUED3_IN_GGA(T9, s(s(s(T24))))
MAX_VALUED3_IN_GGA(.(s(s(s(s(T27)))), T9), s(s(s(s(0))))) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(T27)))))
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(T30))))), T9), s(s(s(s(s(0)))))) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(T30))))))
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(s(T33)))))), T9), s(s(s(s(s(s(0))))))) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(s(T33)))))))
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(s(s(T36))))))), T9), s(s(s(s(s(s(s(0)))))))) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(s(s(T36))))))))
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(s(s(T37))))))), T9), s(s(s(s(s(s(s(s(T38))))))))) → U9_GGA(T9, greater64_in_gg(T37, T38))
MAX_VALUED3_IN_GAA(.(s(T18), T9)) → MAX_VALUED3_IN_GGA(T9, s(T18))
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(s(T43)))))), T44), s(s(s(s(s(s(s(T45)))))))) → U11_GGA(T44, higher_valued77_in_ag(T43))
MAX_VALUED3_IN_GAA(.(s(s(T21)), T9)) → MAX_VALUED3_IN_GGA(T9, s(s(T21)))
MAX_VALUED3_IN_GGA(.(s(s(s(s(s(T52))))), T53), s(s(s(s(s(s(T54))))))) → U13_GGA(T53, T54, higher_valued82_in_gg(T54, T52))
MAX_VALUED3_IN_GGA(.(s(s(s(s(T59)))), T60), s(s(s(s(s(T61)))))) → U15_GGA(T60, T61, higher_valued87_in_gg(T61, T59))
MAX_VALUED3_IN_GGA(.(s(s(s(T66))), T67), s(s(s(s(T68))))) → U17_GGA(T67, T68, higher_valued92_in_gg(T68, T66))
MAX_VALUED3_IN_GGA(.(s(s(T73)), T74), s(s(s(T75)))) → U19_GGA(T74, T75, higher_valued97_in_gg(T75, T73))
MAX_VALUED3_IN_GGA(.(s(T80), T81), s(s(T82))) → U21_GGA(T81, T82, higher_valued102_in_gg(T82, T80))
MAX_VALUED3_IN_GGA(.(T87, T88), s(T89)) → U23_GGA(T88, T89, higher_valued107_in_gg(T89, T87))
MAX_VALUED3_IN_GGA(.(T94, T95), T96) → U25_GGA(T95, T96, higher_valued112_in_gg(T96, T94))
MAX_VALUED3_IN_GGA(.(T15, T9), 0) → MAX_VALUED3_IN_GGA(T9, T15)
U27_GGA(T102, T103, higher_valued118_out_gg) → MAX_VALUED3_IN_GGA(T102, T103)
MAX_VALUED3_IN_GAA(.(s(s(s(T24))), T9)) → MAX_VALUED3_IN_GGA(T9, s(s(s(T24))))
MAX_VALUED3_IN_GAA(.(s(s(s(s(T27)))), T9)) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(T27)))))
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(T30))))), T9)) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(T30))))))
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(s(T33)))))), T9)) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(s(T33)))))))
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(s(s(T36))))))), T9)) → MAX_VALUED3_IN_GGA(T9, s(s(s(s(s(s(s(T36))))))))
U9_GAA(T9, greater64_out_ga(T38)) → MAX_VALUED3_IN_GAA(T9)
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(s(T43)))))), T44)) → U11_GAA(T44, higher_valued77_in_ag(T43))
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(T52))))), T53)) → U13_GAA(T53, higher_valued82_in_ag(T52))
MAX_VALUED3_IN_GAA(.(s(s(s(s(T59)))), T60)) → U15_GAA(T60, higher_valued87_in_ag(T59))
MAX_VALUED3_IN_GAA(.(s(s(s(T66))), T67)) → U17_GAA(T67, higher_valued92_in_ag(T66))
MAX_VALUED3_IN_GAA(.(s(s(T73)), T74)) → U19_GAA(T74, higher_valued97_in_ag(T73))
MAX_VALUED3_IN_GAA(.(s(T80), T81)) → U21_GAA(T81, higher_valued102_in_ag(T80))
MAX_VALUED3_IN_GAA(.(T87, T88)) → U23_GAA(T88, higher_valued107_in_ag(T87))
MAX_VALUED3_IN_GAA(.(T94, T95)) → U25_GAA(T95, higher_valued112_in_ag(T94))
MAX_VALUED3_IN_GAA(.(T15, T9)) → MAX_VALUED3_IN_GGA(T9, T15)
MAX_VALUED3_IN_GAA(.(T101, T102)) → U27_GAA(T102, higher_valued118_in_ag(T101))
POL(.(x1, x2)) = 1 + x2
POL(0) = 0
POL(MAX_VALUED3_IN_GAA(x1)) = x1
POL(MAX_VALUED3_IN_GGA(x1, x2)) = x1
POL(U11_GAA(x1, x2)) = x1
POL(U11_GGA(x1, x2)) = x1
POL(U13_GAA(x1, x2)) = x1
POL(U13_GGA(x1, x2, x3)) = x1
POL(U15_GAA(x1, x2)) = x1
POL(U15_GGA(x1, x2, x3)) = x1
POL(U17_GAA(x1, x2)) = x1
POL(U17_GGA(x1, x2, x3)) = x1
POL(U19_GAA(x1, x2)) = x1
POL(U19_GGA(x1, x2, x3)) = x1
POL(U21_GAA(x1, x2)) = x1
POL(U21_GGA(x1, x2, x3)) = x1
POL(U23_GAA(x1, x2)) = x1
POL(U23_GGA(x1, x2, x3)) = x1
POL(U25_GAA(x1, x2)) = x1
POL(U25_GGA(x1, x2, x3)) = x1
POL(U27_GAA(x1, x2)) = x1
POL(U27_GGA(x1, x2, x3)) = 1 + x1
POL(U29_ag(x1)) = 0
POL(U29_ga(x1)) = 0
POL(U29_gg(x1)) = 0
POL(U30_ag(x1)) = 0
POL(U31_ag(x1)) = 0
POL(U31_gg(x1)) = 0
POL(U32_ag(x1)) = 0
POL(U32_gg(x1)) = 0
POL(U33_ag(x1)) = 0
POL(U33_gg(x1)) = 0
POL(U34_ag(x1)) = 0
POL(U34_gg(x1)) = 1
POL(U35_ag(x1)) = 0
POL(U35_gg(x1)) = 0
POL(U36_ag(x1)) = 0
POL(U36_gg(x1)) = 0
POL(U37_ag(x1)) = 0
POL(U37_gg(x1)) = 0
POL(U38_ag(x1)) = 0
POL(U38_gg(x1)) = 1
POL(U9_GAA(x1, x2)) = 1 + x1
POL(U9_GGA(x1, x2)) = x1
POL(greater64_in_ag(x1)) = 1
POL(greater64_in_ga(x1)) = 0
POL(greater64_in_gg(x1, x2)) = 0
POL(greater64_out_ag) = 0
POL(greater64_out_ga(x1)) = 0
POL(greater64_out_gg) = 0
POL(higher_valued102_in_ag(x1)) = 0
POL(higher_valued102_in_gg(x1, x2)) = 0
POL(higher_valued102_out_ag) = 0
POL(higher_valued102_out_gg) = 0
POL(higher_valued107_in_ag(x1)) = x1
POL(higher_valued107_in_gg(x1, x2)) = 0
POL(higher_valued107_out_ag) = 0
POL(higher_valued107_out_gg) = 0
POL(higher_valued112_in_ag(x1)) = 0
POL(higher_valued112_in_gg(x1, x2)) = 0
POL(higher_valued112_out_ag) = 0
POL(higher_valued112_out_gg) = 0
POL(higher_valued118_in_ag(x1)) = 0
POL(higher_valued118_in_gg(x1, x2)) = 1
POL(higher_valued118_out_ag) = 0
POL(higher_valued118_out_gg) = 1
POL(higher_valued77_in_ag(x1)) = 0
POL(higher_valued77_out_ag) = 0
POL(higher_valued82_in_ag(x1)) = 0
POL(higher_valued82_in_gg(x1, x2)) = 0
POL(higher_valued82_out_ag) = 0
POL(higher_valued82_out_gg) = 0
POL(higher_valued87_in_ag(x1)) = 0
POL(higher_valued87_in_gg(x1, x2)) = 1 + x2
POL(higher_valued87_out_ag) = 0
POL(higher_valued87_out_gg) = 0
POL(higher_valued92_in_ag(x1)) = 0
POL(higher_valued92_in_gg(x1, x2)) = 0
POL(higher_valued92_out_ag) = 0
POL(higher_valued92_out_gg) = 0
POL(higher_valued97_in_ag(x1)) = 0
POL(higher_valued97_in_gg(x1, x2)) = 1 + x2
POL(higher_valued97_out_ag) = 0
POL(higher_valued97_out_gg) = 0
POL(s(x1)) = 0
U9_GGA(T9, greater64_out_gg) → MAX_VALUED3_IN_GAA(T9)
U11_GGA(T44, higher_valued77_out_ag) → MAX_VALUED3_IN_GAA(T44)
U13_GGA(T53, T54, higher_valued82_out_gg) → MAX_VALUED3_IN_GGA(T53, s(s(s(s(s(s(T54)))))))
U15_GGA(T60, T61, higher_valued87_out_gg) → MAX_VALUED3_IN_GGA(T60, s(s(s(s(s(T61))))))
U17_GGA(T67, T68, higher_valued92_out_gg) → MAX_VALUED3_IN_GGA(T67, s(s(s(s(T68)))))
U19_GGA(T74, T75, higher_valued97_out_gg) → MAX_VALUED3_IN_GGA(T74, s(s(s(T75))))
U21_GGA(T81, T82, higher_valued102_out_gg) → MAX_VALUED3_IN_GGA(T81, s(s(T82)))
U23_GGA(T88, T89, higher_valued107_out_gg) → MAX_VALUED3_IN_GGA(T88, s(T89))
U25_GGA(T95, T96, higher_valued112_out_gg) → MAX_VALUED3_IN_GGA(T95, T96)
MAX_VALUED3_IN_GGA(.(T101, T102), T103) → U27_GGA(T102, T103, higher_valued118_in_gg(T103, T101))
MAX_VALUED3_IN_GAA(.(s(s(s(s(s(s(s(T37))))))), T9)) → U9_GAA(T9, greater64_in_ga(T37))
U11_GAA(T44, higher_valued77_out_ag) → MAX_VALUED3_IN_GAA(T44)
U13_GAA(T53, higher_valued82_out_ag) → MAX_VALUED3_IN_GAA(T53)
U15_GAA(T60, higher_valued87_out_ag) → MAX_VALUED3_IN_GAA(T60)
U17_GAA(T67, higher_valued92_out_ag) → MAX_VALUED3_IN_GAA(T67)
U19_GAA(T74, higher_valued97_out_ag) → MAX_VALUED3_IN_GAA(T74)
U21_GAA(T81, higher_valued102_out_ag) → MAX_VALUED3_IN_GAA(T81)
U23_GAA(T88, higher_valued107_out_ag) → MAX_VALUED3_IN_GAA(T88)
U25_GAA(T95, higher_valued112_out_ag) → MAX_VALUED3_IN_GAA(T95)
U27_GAA(T102, higher_valued118_out_ag) → MAX_VALUED3_IN_GAA(T102)
greater64_in_gg(s(T40), 0) → greater64_out_gg
greater64_in_gg(s(T41), s(T42)) → U29_gg(greater64_in_gg(T41, T42))
higher_valued77_in_ag(T51) → U30_ag(greater64_in_ag(s(s(s(s(s(s(T51))))))))
higher_valued82_in_gg(T57, T58) → U31_gg(greater64_in_gg(s(s(s(s(s(s(s(T57))))))), s(s(s(s(s(T58)))))))
higher_valued87_in_gg(T64, T65) → U32_gg(greater64_in_gg(s(s(s(s(s(s(T64)))))), s(s(s(s(T65))))))
higher_valued92_in_gg(T71, T72) → U33_gg(greater64_in_gg(s(s(s(s(s(T71))))), s(s(s(T72)))))
higher_valued97_in_gg(T78, T79) → U34_gg(greater64_in_gg(s(s(s(s(T78)))), s(s(T79))))
higher_valued102_in_gg(T85, T86) → U35_gg(greater64_in_gg(s(s(s(T85))), s(T86)))
higher_valued107_in_gg(T92, T93) → U36_gg(greater64_in_gg(s(s(T92)), T93))
higher_valued112_in_gg(T99, T100) → U37_gg(greater64_in_gg(s(T99), T100))
higher_valued118_in_gg(T106, T107) → U38_gg(greater64_in_gg(s(T106), T107))
greater64_in_ga(s(T40)) → greater64_out_ga(0)
greater64_in_ga(s(T41)) → U29_ga(greater64_in_ga(T41))
higher_valued82_in_ag(T58) → U31_ag(greater64_in_ag(s(s(s(s(s(T58)))))))
higher_valued87_in_ag(T65) → U32_ag(greater64_in_ag(s(s(s(s(T65))))))
higher_valued92_in_ag(T72) → U33_ag(greater64_in_ag(s(s(s(T72)))))
higher_valued97_in_ag(T79) → U34_ag(greater64_in_ag(s(s(T79))))
higher_valued102_in_ag(T86) → U35_ag(greater64_in_ag(s(T86)))
higher_valued107_in_ag(T93) → U36_ag(greater64_in_ag(T93))
higher_valued112_in_ag(T100) → U37_ag(greater64_in_ag(T100))
higher_valued118_in_ag(T107) → U38_ag(greater64_in_ag(T107))
U29_gg(greater64_out_gg) → greater64_out_gg
U30_ag(greater64_out_ag) → higher_valued77_out_ag
U31_gg(greater64_out_gg) → higher_valued82_out_gg
U32_gg(greater64_out_gg) → higher_valued87_out_gg
U33_gg(greater64_out_gg) → higher_valued92_out_gg
U34_gg(greater64_out_gg) → higher_valued97_out_gg
U35_gg(greater64_out_gg) → higher_valued102_out_gg
U36_gg(greater64_out_gg) → higher_valued107_out_gg
U37_gg(greater64_out_gg) → higher_valued112_out_gg
U38_gg(greater64_out_gg) → higher_valued118_out_gg
U29_ga(greater64_out_ga(T42)) → greater64_out_ga(s(T42))
U31_ag(greater64_out_ag) → higher_valued82_out_ag
U32_ag(greater64_out_ag) → higher_valued87_out_ag
U33_ag(greater64_out_ag) → higher_valued92_out_ag
U34_ag(greater64_out_ag) → higher_valued97_out_ag
U35_ag(greater64_out_ag) → higher_valued102_out_ag
U36_ag(greater64_out_ag) → higher_valued107_out_ag
U37_ag(greater64_out_ag) → higher_valued112_out_ag
U38_ag(greater64_out_ag) → higher_valued118_out_ag
greater64_in_ag(s(T42)) → U29_ag(greater64_in_ag(T42))
greater64_in_ag(0) → greater64_out_ag
U29_ag(greater64_out_ag) → greater64_out_ag
greater64_in_gg(x0, x1)
higher_valued77_in_ag(x0)
higher_valued82_in_gg(x0, x1)
higher_valued87_in_gg(x0, x1)
higher_valued92_in_gg(x0, x1)
higher_valued97_in_gg(x0, x1)
higher_valued102_in_gg(x0, x1)
higher_valued107_in_gg(x0, x1)
higher_valued112_in_gg(x0, x1)
higher_valued118_in_gg(x0, x1)
greater64_in_ga(x0)
higher_valued82_in_ag(x0)
higher_valued87_in_ag(x0)
higher_valued92_in_ag(x0)
higher_valued97_in_ag(x0)
higher_valued102_in_ag(x0)
higher_valued107_in_ag(x0)
higher_valued112_in_ag(x0)
higher_valued118_in_ag(x0)
U29_gg(x0)
U30_ag(x0)
U31_gg(x0)
U32_gg(x0)
U33_gg(x0)
U34_gg(x0)
U35_gg(x0)
U36_gg(x0)
U37_gg(x0)
U38_gg(x0)
U29_ga(x0)
U31_ag(x0)
U32_ag(x0)
U33_ag(x0)
U34_ag(x0)
U35_ag(x0)
U36_ag(x0)
U37_ag(x0)
U38_ag(x0)
greater64_in_ag(x0)
U29_ag(x0)