**Compilation/Execution Result:**

Given a number N, your task is to complete the function which generates all n-bit grey code sequences, a grey code sequence is a sequence such that successive patterns in it differ by one bit.

**Input:**

The first line of input contains an integer T denoting the no of test cases. Then T test cases follow. Each test case contains an integer N.

**Output:**

For each test case in print the generated grey code sequences separated by space.

**Constraints:**

1<=T<=10

1<=N<=10

**Example(To be used for expected output):**

**Input:**

2

2

1

**Output:**

00 01 11 10

0 1

Author: Shubham Joshi 1

surbhi_7 | 148 |

Rajat Thakur 2 | 140 |

Ibrahim Nash | 120 |

aksh1996aksh | 117 |

Anupam Prakash 1 | 117 |

Ibrahim Nash | 634 |

ashrepos | 534 |

RealHorror | 395 |

shi143din | 385 |

shaktiman_shaktiman_shaktiman | 363 |

akhayrutdinov | 4052 |

sanjay05 | 3423 |

Quandray | 2446 |

Michael Riegger | 2228 |

Jasleen Kaur 2 | 2012 |