title: How to search words by order in matrix (list) by python
body: <p>How to do that?
  i mean it is some kind of search on the matrix. I need to search <strong>search_matrix</strong> on <strong>main_matrix</strong>.
  Special rule is: if <strong>search_matrix</strong> is a included in beginning 4 elements of <strong>main_matrix</strong> then it can be a output. I mean if <strong>search_matrix</strong> is not in <strong>main_matrix's</strong> beginning (4 elements) it cannot be a in <strong>output_matrix</strong>.
  and element order is most important. elements must be in order.</p>
  <pre><code>main_matrix = 
   [['AAA', 'bbb', 'ccc'],
   ['ccc', 'AAA', 'bbb'],
   ['DDD', 'AAA', 'fff', 'ccc', 'hhhh', 'iii'],
   ['JJJ', 'kkk', 'lll', 'mmm', 'nnn', 'ooo'],
   ['PPP', 'qqq', 'rrr', 'sss', 'tttt', 'yyy'],
   ['mmm', 'kkk'],
   ['bbb', 'zzz', 'sss']]
   ['kkk', 'qqq', 'rrr', 'mmm', 'ttt', 'yyyyyy'],
   ['PPP', 'qqq', 'rrr', 'mmm', 'ttt', 'yyy'],
   ['zzz', 'zzzz', 'zzz', 'zzz', 'AAA', 'ccc']]
  
  search_matrix=
   [['AAA', 'ccc'],
   ['bbb', 'ccc'],
   ['kkk', 'mmm'],
   ['PPP','qqq', 'rrr']]
   
  </code></pre>
  <p>Desired output is:</p>
  <pre><code>output_matrix = 
       [['AAA', 'bbb', 'ccc'],
       ['DDD', 'AAA', 'fff', 'ccc', 'hhh', 'iii'],
       ['AAA', 'bbb', 'ccc'],
       ['JJJ', 'kkk', 'lll', 'mmm', 'nnn', 'ooo'],
       ['kkk', 'qqq', 'rrr', 'mmm', 'ttt', 'yyy'],
       ['PPP', 'qqq', 'rrr', 'sss', 'ttt', 'yyy']]
       
  </code></pre>
  <p>Please help me?</p>
  <p><strong>Update:</strong></p>
  <p>can we do it on last 3 elements?</p>