square and fair solution