import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
class Main {
public static void main(String[] args) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringBuilder sb = new StringBuilder();
ArrayList<Long> list = new ArrayList<>(Arrays.asList(1L, 1L, 1L, 2L, 2L));
for (int i = 5; i < 100; i++) {
list.add(list.get(i - 5) + list.get(i - 1));
}
int TC = Integer.parseInt(br.readLine());
for (int t = 0; t < TC; t++) {
int N = Integer.parseInt(br.readLine());
sb.append(list.get(N-1)).append("\n");
}
System.out.print(sb);
}
}