Rule 30 is a one-dimensional binary cellular automaton. You can have some information here:  
* [https://en.wikipedia.org/wiki/Rule_30](https://en.wikipedia.org/wiki/Rule_30)
You have to write a function that takes as input an array of 0 and 1 and a positive integer that represents the number of iterations. This function has to performe the nth iteration of the **Rule 30** with the given input.
The rule to derive a cell from itself and its neigbour is:
Current cell  | 000 | 001 | 010 | 011 | 100 | 101 | 110 | 111
:-------------|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:
 **New cell** |  0  |  1  |  1  |  1  |  1  |  0  |  0  |  0 
As you can see the new state of a certain cell depends on his neighborhood. In *Current cells* you have the *nth* cell with his left and right neighbor, for example the first configuration is **000**:
* left neighbor = 0
* current cell = 0
* right neighbor = 0
The result for the current cell is **0**, as reported in **New cell** row.
You also have to pay attention to the following things:
* the borders of the list are always 0
* values different from 0 and 1 must be considered as 0
* a negative number of iteration never changes the initial sequence
* you have to return an array of 0 and 1
Here a small example step by step, starting from the list **[1]** and iterating for 5 times:
* We have only one element so first of all we have to follow the rules adding the border, so the result will be **[0, 1, 0]**
* Now we can apply the rule 30 to all the elements and the result will be **[1, 1, 1]** (first iteration)
* Then, after continuing this way for 4 times, the result will be **[1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1]**
In Python, you can also use a support function to print the sequence named printRule30. This function takes as parameters the current list of 0 and 1 to print, the max level that you can reach (number of iterations) and the length of initial array.
```python
def printRule30(list_, maxLvl, startLen):
  ...
```
The last two parameters are optional and are useful if you are printing each line of the iteration to center the result like this:
░░▓░░  -> step 1  
░▓▓▓░  -> step 2  
▓▓░░▓  -> step 3  
If you pass only the array of 0 and 1 the previous result for each line will be like this:
▓ -> step 1   
▓▓▓ -> step 2  
▓▓░░▓ -> step 3 
**Note:** the function can print only the current list that you pass to it, so you have to use it in the proper way during the interactions of the rule 30.
def cell30(l, c, r):
  if l == 1: return 1 if c == 0 and r == 0 else 0
  return 0 if c == 0 and r == 0 else 1
def rule30(row, n):
  return pure30([c if c == 1 else 0 for c in row], n)
def pure30(row, n):
  for i in range(n):
    row.append(0)
    row.insert(0, 0)
    ref = row[:]
    row = [cell30(0 if i == 0 else ref[i - 1], v, ref[i + 1] if i + 1 < len(ref) else 0) for i, v in enumerate(row)]
  return row
def cell30(l, c, r):
  if l == 1: return 1 if c == 0 and r == 0 else 0
  return 0 if c == 0 and r == 0 else 1
def rule30(row, n):
  return pure30([c if c == 1 else 0 for c in row], n)
def pure30(row, n):
  for i in range(n):
    row.append(0)
    row.insert(0, 0)
    ref = row[:]
    row = [cell30(0 if i == 0 else ref[i - 1], v, ref[i + 1] if i + 1 < len(ref) else 0) for i, v in enumerate(row)]
  return row