Learning complex things by solving simple problems