Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var scanner = bufio.NewScanner(os.Stdin)

func nextString() string {
	scanner.Scan()
	return scanner.Text()
}

func nextInt() (int, error) {
	return strconv.Atoi(nextString())
}

func main() {
	scanner.Split(bufio.ScanWords)

	counts := map[int]int{}
	for i := 0; i < 10; i++ {
		for j := 0; j < 10; j++ {
			for k := 0; k < 10; k++ {
				for l := 0; l < 10; l++ {
					s := i + j + k + l
					if s <= 50 {
						counts[s]++
					}
				}
			}
		}
	}
	// fmt.Println(counts)
	for {
		n, err := nextInt()
		if err != nil {
			break
		}
		cnt, ok := counts[n]
		if ok {
			fmt.Println(cnt)
		} else {
			fmt.Println(0)
		}
	}
}

Python: 
memo=[[-1]*51 for i in range(5)]
def rec(i,n):
    if memo[i][n]!=-1:
        return memo[i][n]
    memo[i][n]=0
    if i==4:
        return 1 if n==0 else 0
    for m in range(10):
        memo[i][n]+=rec(i+1,n-m)
    return memo[i][n]
    
while True:
    try:
        n=int(input())
        print(rec(0,n))
    except:
        break

Python: while True:
  try:
    n=int(input())
    count=0
    for i in range(10):
      for j in range(10):
        for k in range(10):
          for l in range(10):
            if (i+j+k+l)==n:
              count=count+1
    print(count)
    
  except EOFError:
    break

Python: def sumint(n,num):
    if num==2:
        if n>18: return 0
        else:
            c=0
            for i in range(10):
                if 0<=n-i<10:c+=1
            return c
    ret=0
    for i in range(10):
        ret=ret+sumint(n-i,num-1)
    return ret
while True:
    try:n=int(input())
    except:break
    if n>36:print(0)
    else:
        print(sumint(n,4))

Python: import itertools
import sys
com = [0] * 51
r10 = range(10)
for a,b,c,d in itertools.product(r10,r10,r10,r10):
    com[a+b+c+d] += 1
for line in sys.stdin.readlines():
    print(com[int(line)])

Python: import sys
a=[0]*51
for i in range(19):
 a[i]=a[36-i]=(i+3)*(i+2)*(i+1)//6-max(2*(i-9)*(i-8)*(i-7)//3,0)
for e in sys.stdin:
 print(a[int(e)])

Python: import sys
t = [None for i in range(10000)]
c = 0
for i in range(10):
    for j in range(10):
        for k in range(10):
            for l in range(10):
                t[c] = i + j + k + l 
                c += 1
for line in sys.stdin:
    print(t.count(int(line)))

Python: n = int(input())

def rec(j,s):
    if s > n:
        return 0
    if s == n:
        return 1
    if j == 0:
        return 0
    v = 0
    for i in range(10):
        v += rec(j-1, s + i)
    return v

print(rec(4,0))

Python: while True:
    try:
        n = int(input())
    except:
        break
    ans = 0
    for a in range(10):
        for b in range(10):
            for c in range(10):
                d = n - (a + b + c)
                ans += 0 <= d <= 9
    print(ans)

Python: import sys
a=[0]*51
for i in range(10):
 a[i]=a[36-i]=(i+3)*(i+2)*(i+1)//6
for i in range(10,19):
 a[i]=a[36-i]=(i+3)*(i+2)*(i+1)//6-a[i-10]
for e in sys.stdin:
 print(a[int(e)])

Python: while True :
    try :
        n = int(input())
        
    except :
        break
    
    S = [(0, 0, 0, 0) for i in range(10000)]
    s = 0
        
    for a in range(10) :
        for b in range(10) :
            for c in range(10) :
                for d in range(10) :
                    if(a + b + c + d == n) :
                        S[s] = (a, b, c, d)
                        s += 1
                    else :
                        pass
        
    S = set(S)
        
    print(len(S) - 1)

Python: import sys

for line in sys.stdin:
    num = int(line)
    ans = 0
    for a in range(10):
        for b in range(10):
            for c in range(10):
                for d in range(10):
                    if a + b + c + d == num:
                        ans += 1
    print(ans)

Python: import sys
import math

for line in sys.stdin:
    N = int(line.rstrip())
    count = 0
    for i0 in range(10):
        for i1 in range(10):
           for i2 in range(10):
              for i3 in range(10):
                  if sum([i0,i1,i2,i3]) == N:
                      count += 1
                      break
    print(count)

Python: while True:
    try:
        n = int(input())
        if n > 18:
            n = 36 - n

        ans = (n+1)*(n+2)*(n+3)/6
        if n >= 10:
            n = n - 10
            ans = ans - 2*(n+1)*(n+2)*(n+3)/3
        
        if n < 0:
            ans = 0

        print(int(ans))

    except EOFError:
        break

Python: import sys

p = [0] * 51
v = 0
for i in range(10):
    p[i] = p[36-i] = (i+3)*(i+2)*(i+1)//6

for i in range(10,19):
    p[i] = p[36-i] = (i+1)*(i+2)*(i+3)//6 - 2*(i-9)*(i-8)*(i-7)//3

for i in sys.stdin:
    print(p[int(i)])

Python: a = int(input())
count = 0
for i in range(10):
    for j in range(10):
        for k in range(10):
            for l in range(10):
                if (i + j + k + l) is a:
                    count += 1
print(count)

Python: # -*- coding: utf-8 -*-

import sys

def sum_intergers(n, k=4, last=True):
    clip_9 = lambda x: x if x < 10 else 9

    if k > 1:
        c = sum_intergers(n, k=k-1, last=False)
    else:
        return [(s,) for s in range(clip_9(n)+1)]

    ret = []
    for cc in c:
        sum_cc = sum(cc) # memorize
        for s in range(clip_9(n-sum_cc)+1):
            if not last or s+sum_cc==n:
                r = [p for p in cc]
                r.append(s)
                ret.append(tuple(r))
    return ret


def main():
    ns = [int(n) for n in sys.stdin]
    for n in ns:
        c = len(sum_intergers(n, k=4))
        print(c)


if __name__ == '__main__':
    main()

Python: from itertools import product

while True:
    try:
        n = int(input())
    except:
        break

    count = sum(a+b+c+d == n for a, b, c, d in product(range(10), repeat=4))
    print(count)

Python: def count(n):
    cnt = 0
    for a in range(10):
        for b in range(10):
            for c in range(10):
                for d in range(10):
                    if a + b + c + d == n:
                        cnt += 1
    print(cnt)

while True:
    try:
        n = int(input())
        count(n)
    except EOFError:
        break

Python: import sys
def count(number) :
    Ranges = [(a, b, c, d) for a in range(10) for b in range(10) for c in range(10) for d in range(10) if a + b + c + d == number]
    return len(Ranges)

for make in sys.stdin : print(count(int(make)))

Python: # Aizu Problem 0008: Sum of 4 Integers
#
import sys, math, os

# read input:
PYDEV = os.environ.get('PYDEV')
if PYDEV=="True":
    sys.stdin = open("sample-input.txt", "rt")


def sum4(n):
    ans = 0
    for i in range(10):
        for j in range(10):
            for k in range(10):
                for l in range(10):
                    if n == i + j + k + l:
                        ans += 1
    return ans


mem = {}
for line in sys.stdin:
    n = int(line)
    if n in mem:
        print(mem[n])
    else:
        ans = sum4(n)
        mem[n] = ans
        print(ans)

Python: while True:
    try:
        n = int(input())
    except:
        break
    x = 0
    for a in range(0, 10):
        for b in range(0, 10):
            for c in range(0, 10):
                for d in range(0, 10):
                    x += (a + b + c + d == n)
    print(x)

Python: import sys
for n in sys.stdin:
	print(len([0 for a in range(10)for b in range(10)for c in range(10)for d in range(10) if int(n)==a+b+c+d]))

Python: import sys
for n in sys.stdin:
    num = 0
    n = int(n.replace("\n",""))
    for i in range(0, 10000):
        s = sum([i%10, int(i/10)%10, int(i/100)%10, int(i/1000)])
        if n == s:
            num += 1
    print(num)

Python: import sys
for line in sys.stdin.readlines():
  n = int(line)
  count = 0
  for a in range(10):
    for b in range(10):
      for c in range(10):
        for d in range(10):
          if a+b+c+d == n:
            count += 1
  print(count)