This is how Rákosi was ousted before the revolution

In 1945, Central and Eastern Europe fell under Soviet influence, leading to the establishment of one-party systems by 1949. The period from 1948 to 1953 is marked by Stalinist terror, with Mátyás Rákosi as a key figure in Hungary. Political repression was rampant, with thousands interned or executed. After Stalin's death in 1953, a thaw in policies occurred, allowing Imre Nagy to become Prime Minister, initiating reforms and partial rehabilitation of political prisoners. The 1956 revolution was influenced by domestic and international events, including the reburial of László Rajk and protests in Poland. The revolution began on October 23, 1956, with initial protests in Debrecen, escalating into a nationwide uprising against the regime.