わりよければすべてよし
Composed of
the end
if it is good
everything; all; the whole; entirely; completely; wholly
good; excellent; fine; nice; pleasant; agreeable