Sedimentary rock is compacted sediments which can come from any of the other rocks, plus remains of living things. It can erode back into sediment, or be pressurized into metamorphic rock and can be melted to magma , which forms igneous rocks .