Complex Space and Complex Time
```python3 []
class Solution:
    def __init__(self, m: int, n: int):
        self.start = 0
        self.end = m*n
        self.point = {}
        self.row_len = n
    def flip(self) -> List[int]:
        i = randrange(self.start, self.end)
        while i in self.point: i = self.point[i]
        j = self.start
        while j in self.point: j = self.point[j]
        self.point[i] = j
        self.start += 1
        return [i//self.row_len, i%self.row_len]
    def reset(self) -> None:
        self.start = 0
        self.point.clear()
```
['Python3']