You are provided an unlimited collection of **red**, **green** and **blue** balls. Now your task is to arrange **N** balls taken from this collection in a line in such a way that **red** balls appear first, followed by **green** balls and then **blue** balls. Given a value of **N **you have to find the number of ways to do that.

**Note:**** ** In a particular arrangement a certain color of balls may be missing but the order must be strictly maintained with the available balls.

**Input **

The first line of the input contains **T**, the number of test cases. Then **T** lines follow. Each test case contains one line only containing the value of **N**.

**Output **

For each test case print the answer in a new line.

**Constraints**

1<=**T**<=100

1<=**N**<=10^9

**Example **

**Input**

2

1

2

**Output**

3

6

**Explanation**

**1.** For the first test case you are allowed to take 1 ball only. So that one ball can be red, green or blue. So the number of ways in this case is 3.

**2.** For the second test case you are allowed to take 2 balls. So you have six alternative arrangements ie. RG,GB,RB,RR,GG,BB.

If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.

d_Coder00 | 134 |

dungeon_master1299 | 126 |

Astikeysingh | 120 |

rajendrashekhawat063 | 115 |

kaustavbhattachaarya | 111 |

Pulkit__Sharma__ | 646 |

Anirban166 | 531 |

abducodes | 501 |

Found_me | 454 |

Yo_Nehru | 404 |

blackshadows | 5331 |

Ibrahim Nash | 5219 |

akhayrutdinov | 5111 |

mb1973 | 4929 |

Quandray | 4559 |

Login to report an issue on this page.