Attempted weekly problem 26