Revert "doesn't work in UVA (runtime error)"

This reverts commit 7dd8c6688dc2494cad0314ac1608c80f714bbbbb.