output_description: For each find operation, print the minimum value.
input_description: n q
      query1
      query2
      :
      queryq
      
  
  In the first line, n (the number of elements in A) and q (the number of
  queries) are given. Then, _i_ th query queryi is given in the following
  format:
  
      
      
      0 s t x 
      
  
  or
  
      
      
      1 s t
      
  
  The first digit represents the type of the query. '0' denotes update(s, t, x)
  and '1' denotes find(s, t).
attempt: INT_MAX = 1 << 31 - 1
  _N, query_num = map(int, input().split())
  queries = [list(map(int, input().split())) for i in range(query_num)]
  N = 1 << 17
  
  arr_size = 2 * N - 1
  A = [INT_MAX] * (arr_size)
  lazy_A = [None] * (arr_size)
  
  
  def tree_propagate(k):
  
      if lazy_A[k] is None:
          return
  
      if k < N // 2:
          A[k * 2 + 1] = A[k * 2 + 2] = lazy_A[k * 2 + 1] = lazy_A[k * 2 + 2] = lazy_A[k]
          lazy_A[k] = None
          return
      if k < N - 1:
          A[k * 2 + 1] = A[k * 2 + 2] = lazy_A[k]
          lazy_A[k] = None
  
  
  def update(s, t, x, k, l, r):
  
      if r <= s or t <= l:
          return
      if s <= l and r <= t:
          A[k] = x
          if k < N - 1:
              lazy_A[k] = x
          return
  
      tree_propagate(k)
      center = (l + r) // 2
      update(s, t, x, k * 2 + 1, l, center)
      update(s, t, x, k * 2 + 2, center, r)
  
      A[k] = min(A[k * 2 + 1], A[k * 2 + 2])
  
  
  def find(s, t, k, l, r):
  
      if r <= s or t <= l:
          return INT_MAX
  
      if s <= l and r <= t:
          return A[k]
  
      tree_propagate(k)
      center = (l + r) // 2
      v_left = find(s, t, k * 2 + 1, l, center)
      v_right = find(s, t, k * 2 + 2, center, r)
      return min(v_left, v_right)
  
  
  answers = []
  for query in queries:
      # update
      if query[0] == 0:
          update(query[1], query[2] + 1, query[3], 0, 0, N)
      # find
      else:
          answers.append(find(query[1], query[2] + 1, 0, 0, N))
  
  print("\n".join([str(ans) for ans in answers]))
  
problem_description: RMQ and RUQ
  
  Write a program which manipulates a sequence A = {a0, a1, . . . , an−1} with
  the following operations:
  
    * update(s, t, x): change as, as+1, ..., at to x.
    * find(s, t): report the minimum element in as, as+1, ..., at.
  
  Note that the initial values of ai (i = 0, 1, . . . , n−1) are 231-1.
samples: [{"input": "3 5\n    0 0 1 1\n    0 1 2 3\n    0 2 2 2\n    1 0 2\n    1 1 2", "output": "1\n    2"}, {"input": "1 3\n    1 0 0\n    0 0 0 5\n    1 0 0", "output": "2147483647\n    5"}]