Given a finitely-presented and finite $p$-group $G = \langle S \mid R \rangle$, is there a systematic way to find its center? My end goal is to find a subnormal chain of every order $1, p, p^2, \dots, p^n$ by iteratively quotienting $G/H$ where $H \leq Z(G)$ is of order $p$. And by looking at its preimage I should yield a normal subgroup of order $p^{n-1}$ and so on. Is there a systematic/algorithmic way to find $Z(G)$ just given a $p$-group's presentation? For instance, given the $3$-group of order $3^5$:
$$G = \langle a, b, c \mid [b, a]=a^{3^3} = c, b^3=c^3=1\rangle$$