Go: package main

import "fmt"

func main() {
	var n int

	for {
		result := 0
		_, err := fmt.Scanf("%d", &n)
		if err != nil {
			return
		}

		if n <= 36 {
			for a := 9; a >= 0; a-- {
				for b := 9; b >= 0; b-- {
					for c := 9; c >= 0; c-- {
						for d := 9; d >= 0; d-- {
							if a+b+c+d == n {
								// fmt.Println(a, b, c, d)
								result++
							}
						}
					}
				}
			}
		}
		fmt.Println(result)
	}
}

Python: while True:
    try:
        cnt = 0
        n = int(input())
        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 = cnt + 1

        print(str(cnt))
    except:
        break

Python: import sys

def count_combination(n):
    count = 0
    for i in range(10):
        for j in range(10):
            for k in range(10):
                l = n - (i + j + k)
                if l >= 0 and l < 10:
                    count += 1
    return count

for line in sys.stdin:
    n = int(line)
    print(count_combination(n))

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

Python: #coding:utf-8

while True:
    try:
        count = 0
        n = input()

        for a in xrange(0, 10):
            for b in xrange(0, 10):
                for c in xrange(0, 10):
                    for d in xrange(0, 10):
                        if a + b + c + d == n:
                            count += 1
        print(count)
    except:
        break

Python: import sys
for e in sys.stdin:
 e=int(e);x=range(10)
 print(sum([1 for a in x for b in x for c in x for d in x if a+b+c+d==e]))

Python: n=int(input())
ans=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:
					ans+=1
print(ans)

Python: n=int(input())
count=0
for a in range(1,10):
    for b in range(1,10):
        for c in range(1,10):
            if 50-a-b-c>=0 and 50-a-b-c<10:
                count+=1
print(count)

Python: a = []
while True:
    try:
        a.append(int(input()))
    except EOFError:
        break
for i in a:
    frag = 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 == i:
                        frag += 1
    print(frag)

Python: while True:
    try:
        n = int(input())
    except:
        exit()
    m = 9
    c = 0
    def loop(n,dep):
        l = n - m*(3-dep)
        u = n
        if (l < 0):l = 0
        if (m < u):u = 9
        return l,u+1

    il,iu= loop(n,0)
    for i in range(il,iu):
        jl,ju = loop(n-i,1)
        for j in range(jl,ju):
            ij = i+j
            kl,ku = loop(n-ij,2)
            for k in range(kl,ku):
                c += 1

    print(c)

Python: import sys
for line in sys.stdin:
    n=int(line)
    cnt=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:
                        cnt=cnt+1
    print(cnt)

Python: import sys

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

    print(num)

Python: import sys
for line in sys.stdin:
    n = int(line)
    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)

Python: import sys
def count(number) :
    result = 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 == 35 : result += 1
    return result

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

Python: #!/usr/bin/env python
# -*- conding: utf-8 -*-
import itertools
import sys
import math

for line in sys.stdin.readlines():
    n = int(line.strip())
    if n == 36:
        print(1)
        continue
    if n > 36:
        print(0)
        continue
    cnt = 0
    cmbs = itertools.combinations_with_replacement(range(0,10), 4)
    for cmb in cmbs:
        if sum(cmb) == n:
            if len(set(cmb)) == 1:
                cnt += 1
            elif len(set(cmb)) == 2:
                cnt += math.factorial(2) * 2
            elif len(set(cmb)) == 3:
                cnt += math.factorial(3)
            elif len(set(cmb)) == 4:
                cnt += math.factorial(4)
    print(cnt)

Python: def rec(i,n):
    r=0
    if i==4:
        return 1 if n==0 else 0
    for m in range(10):
        r+=rec(i+1,n-m)
    return r
while True:
    try:
        n=int(input())
        print(rec(0,n))
    except:
        break

Python: #!/usr/bin/env python3
import itertools
import sys


def operation(n):
    count = 0
    for a, b, c, d in itertools.product(range(10), repeat=4):
        if a + b + c + d == n:
            count += 1
    print(count)


def main():
    for l in sys.stdin:
        n = int(l.strip())
        operation(n)


if __name__ == '__main__':
    main()

Python: INF=-1
memo=[[INF]*51 for i in range(5)]
def rec(i,n):
    if memo[i][n]!=INF:
        return memo[i][n]
    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: import sys
dataset = sys.stdin.readlines()
for n in dataset:
	n = int(n)
	counter = 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:
						counter += 1
	print(counter)

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

Python: import sys
try:
    while True:
        n = int(input())
        
        res = 0
        
        for i in range(10):
            for j in range(10):
                for k in range(10):
                    for m in range(10):
                        if i + j + k + m == n:
                            res += 1
        
        print(res)
except Exception:
    sys.exit()

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]*4
for e in map(int,sys.stdin):print(a[e])

Python: import sys
  
n = [0]*51
for i in range(10):
    for j in range(10):
        for k in range(10):
            for l in range(10):
                n[i+j+k+l] += 1

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

Python: import itertools, sys

d = {i: 0 for i in range(51)}
for i in itertools.combinations_with_replacement(range(0,10), 4):
    d[sum(i)] += 1
print(d)
for i in map(int, sys.stdin):
    print(d[i]*4)

Python: n=int(input())
cnt=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:
                    cnt=cnt+1
                    print(i,j,k,l)

print(cnt)

Python: num = [0 for i in range(51)]
for a in range(10):
    for b in range(10):
        for c in range(10):
            for d in range(10):
                num[a+b+c+d] += 1
while 1:
    try:
        print(num[int(input())])
    except:
        break

Python: while True:
  try:
    n = int(input())
    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==n:
              ans=ans+1
    print(ans)
  except:
    break