Text this: First-principles study of R3c-MgSnX3 (X[dbnd]O, S and Se) for photovoltaic and ferroelectric application.