Problem

Source: Iran 3rd round 2017 Numbers theory final exam-P1

Tags: Iran 3rd Round, bezout, Orders



Let $x$ and $y$ be integers and let $p$ be a prime number. Suppose that there exist realatively prime positive integers $m$ and $n$ such that $$x^m \equiv y^n \pmod p$$Prove that there exists an unique integer $z$ modulo $p$ such that $$x \equiv z^n \pmod p \quad \text{and} \quad y \equiv z^m \pmod p$$