using System.Collections.Generic;
Func<T, R> Compose0<T, U, R>(Func<T, U> f, Func<U, R> g) =>
Func<T, U, R2> Compose<T, U, R1, R2>(Func<T, U, R1> f, Func<R1, R2> g) =>
(T x, U y) => g(f(x, y));
Func<T, U, V, R2> Compose1<T, U, V, R1, R2>(Func<T, U, V, R1> f, Func<R1, R2> g) =>
(T x, U y, V z) => g(f(x, y, z));
Func<T0, U, R1> PreCompose<T, U, R1, T0>(Func<T, U, R1> f, Func<T0, T> g) =>
(T0 x, U y) => f(g(x), y);
Func<T0, U0, R1> PreCompose1<T, U, R1, T0, U0>(Func<T, U, R1> f, Func<T0, T> g1, Func<U0, U> g2) =>
(T0 x, U0 y) => f(g1(x), g2(y));
Func<U> Compose2<T, U>(Func<T> f, Func<T, U> g) =>
Action<T> PreCompose3<T, R>(Func<T, R> g, Action<R> f) =>
void Compose4<T>(Func<T> f, Action<T> g) =>
Func<T, R2> Compose5<T, V, R1, R2>(Func<T, (V, R1)> f, Func<V, R1, R2> g) =>
(T x) => g(f(x).Item1, f(x).Item2);
public static void Main() { }