input: Write a function to implement an object-oriented structure to solve a maze using Python. The function should initialize a Maze object with dimensions n by m, and it should be able to solve the maze by finding all possible paths from the start (0, 0) to the end (n-1, m-1). If no valid path is found, the function should return an empty list.
  
  assert Maze(3, 3).solve_maze() == []
  assert Maze(4, 4).solve_maze() == []
  assert Maze(5, 5).solve_maze() == []
  assert Maze(2, 2).solve_maze() == []
  assert Maze(1, 1).solve_maze() == []
output: def solve_maze(self):
      def is_valid(x, y):
          return 0 <= x < self.n and 0 <= y < self.m and self.maze[x][y] == 0
  
      def find_paths(x, y, path):
          if x == self.n - 1 and y == self.m - 1:
              self.paths.append(path)
              return
          for dx, dy in [(1, 0), (0, 1), (-1, 0), (0, -1)]:
              nx, ny = x + dx, y + dy
              if is_valid(nx, ny):
                  self.maze[nx][ny] = 1
                  find_paths(nx, ny, path + [(nx, ny)])
                  self.maze[nx][ny] = 0
  
      self.paths = []
      self.maze = [[0] * self.m for _ in range(self.n)]
      self.maze[0][0] = 1
      find_paths(0, 0, [(0, 0)])
      return self.paths