def METHOD_NAME(n, fine, start=0, end=360):
  assert n >= 1 and n<=4
  result = []
  #
  if(fine):
    if   (n in [1,2]): step=1
    elif (n == 3):     step=3
  else:
    step = 10
  #
  if(n==1):
    for a1 in range(start,end+step,step):
      result.append([a1])
  elif(n==2):
    for a1 in range(start,end+step,step):
      for a2 in range(start,end+step,step):
        result.append([a1, a2])
  elif(n==3):
    for a1 in range(start,end+step,step):
      for a2 in range(start,end+step,step):
        for a3 in range(start,end+step,step):
          result.append([a1, a2, a3])
  elif(n==4):
    if(fine):
      for a1 in range(start,end+7,7):
        for a2 in range(start,end+8,8):
          for a3 in range(start,end+9,9):
            for a4 in range(start,end+10,10):
              result.append([a1, a2, a3, a4])
    else:
      for a1 in range(start,end+step,step):
        for a2 in range(start,end+step,step):
          for a3 in range(start,end+step,step):
            for a4 in range(start,end+step,step):
              result.append([a1, a2, a3, a4])
  return result