------
## 最终结论
```python
def mirrorReflection(p, q):
    from math import gcd
    g = gcd(p, q)
    p //= g
    q //= g
    if p % 2 == 0:
        return 2
    if q % 2 == 0:
        return 0
    return 1

# Example usage:
p = 2
q = 1
print(mirrorReflection(p, q))  # Output: 2
```