  We investigate how the environment affects the assembly history of massive
galaxies. For that purpose, we make use of SHARDS and HST spectro-photometric
data, whose depth, spectral resolution, and wavelength coverage allow to
perform a detailed analysis of the stellar emission as well as obtaining
unprecedentedly accurate photometric redshifts. This expedites a sufficiently
accurate estimate of the local environment and a robust derivation of the star
formation histories of a complete sample of 332 massive galaxies
($\mathrm{>10^{10}M_{\odot}}$) at redshift $1\leq z \leq 1.5$ in the GOODS-N
field. We find that massive galaxies in this redshift range avoid the lowest
density environments. Moreover, we observed that the oldest galaxies in our
sample with with mass-weighted formation redshift $\mathrm{\overline{z}_{M-w}
\geq 2.5}$, avoid the highest density regions, preferring intermediate
environments. Younger galaxies, including those with active star formation,
tend to live in denser environments ($\Sigma = \mathrm{5.0_{1.1}^{24.8}\times
10^{10}M_{\odot}Mpc^{-2}}$). This behavior could be expected if those massive
galaxies starting their formation first would merge with neighbors and sweep
their environment earlier. On the other hand, galaxies formed more recently
($\overline{z}_{M-w} < 2.5$) are accreted into large scale structures at later
times and we are observing them before sweeping their environment or,
alternatively, they are less likely to affect their environment. However, given
that both number and mass surface densities of neighbor galaxies is relatively
low for the oldest galaxies, our results reveal a very weak correlation between
environment and the first formation stages of the earliest massive galaxies.
