A membership to gym A costs $42 plus $1 per visit. A membership to gym B costs $18 plus $4 per visit. After x visits, the cost of the memberships will be the same.