#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int ans;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int m;
    ans = 0;
    cin >> m;
    for (int a = 0; a <= m; a++) {
      for (int b = 0; b <= m; b++) {
        for (int c = 0; c <= m; c++) {
          for (int d = 0; d <= m; d++) {
            if (a + b + c + d == m) {
              ans++;
            }
          }
        }
      }
    }
    cout << ans << endl;
  }
}
