eulerianPath generics