How immigration shaped Toronto and New York