Go: package main

import (
	"fmt"
)

func main() {
	for {
		var a int
		fmt.Scan(&a)
		if a == 0 {
			break
		}
		rs := 0

		for i := 0; i < 10; i++ {
			for j := 0; j < 10; j++ {
				for k := 0; k < 10; k++ {
					for l := 0; l < 10; l++ {
						if i+j+k+l == a {
							rs++
						}
					}
				}
			}
		}
		fmt.Println(rs)
	}
}

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

Python: while True:
    try:
        #(a,b,c,d)=map(int,raw_input().split())
        n=input()
        cnt=0
        for a in xrange(10):
            for b in xrange(10):
                for c in xrange(10):
                    for d in xrange(10):
                        if a+b+c+d==n:
                            cnt+=1
        print(cnt)
    except EOFError: break

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

Python: #!/usr/bin/env python
# -*- coding: utf-8 -*-
# 


def kai(num):
	x = 0
	for i in range(10000):
		
		mk = str(i).zfill(4)
		if int(mk[0])+int(mk[1])+int(mk[2])+int(mk[3]) == num:
				x += 1
	return x

def main(): 
	while True:
		try:
			num = int(input())
		except:
			return
		else:
			print(kai(num))	
if __name__ == '__main__':
	main()

Python: t = 0
while t == 0:	
	p = 0
	try:
		n = int(input())
	except:
		break
	else:
		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):
							p += 1
	print(p)

Python: while True:
  try:
    n = int(input())
    results = []
    for i in range(10):
      for j in range(10):
        for k in range(10):
          for l in range(10):
            results.append( n == sum([i, j, k, l]) )
    print(len(list(filter(lambda x:x==True, results))))
  except:
    break

Python: # AOJ 0008 Sum of 4 Integers
# Python3 2018.6.9 bal4u

ans = [0 for i in range(51)]
for i in range(10):
	for j in range(10):
		for k in range(10):
			for l in range(10):
				ans[i+j+k+l] += 1
#for i in range(50+1):
#	print(i, ans[i])
	
while True:
    try:
        print(ans[int(input())])
    except EOFError:
        break

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

Python: import sys

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

Python: from __future__ import (division, absolute_import, print_function,
                        unicode_literals)
from sys import stdin
for line in stdin:
    n = int(line)
    cnt = 0
    for a in xrange(10):
        if n < a:
            break
        for ab in xrange(a, a + 10):
            if n < ab:
                break
            for abc in xrange(ab, ab + 10):
                if n < abc:
                    break
                for abcd in xrange(abc, abc + 10):
                    if n == abcd:
                        cnt += 1
                        break
                    if n < abcd:
                        break
    print(cnt)

Python: import itertools
while True:
	try: n=int(input())
	except EOFError: break
	ans=0
	for (i,j,k) in itertools.product(range(10),range(10),range(10)):
		ans+=(0<=n-(i+j+k)<=9)
	print(ans)

Python: import sys
import itertools

for n in sys.stdin.readlines():
    n = int(n)
    patterns = itertools.product(range(10), range(10), range(10), range(10))
    ans = 0
    for a, b, c, d in patterns:
       if a + b + c + d == n:
           ans +=1
    print(ans)

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

Python: import sys

lines = sys.stdin.readlines()
for line in lines:
    a = int(line)
    sets = 0
    for i in range(0, 10):
        for k in range(0, 10):
            for l in range(0, 10):
                for m in range(0, 10):
                    if(i+k+l+m == a):
                        sets += 1
    print(sets)

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: while True:
    try:
        N = int(input())
        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)
    except EOFError:
        break

Python: n=int(input())
a,b,c,d=0,0,0,0
ans=0
for i in range(10):
    c=0
    for j in range(10):
        b=0
        for f in range(10):
            a=0
            for e in range(10):
                if a+b+c+d==n:
                    ans+=1
                a+=1
            b+=1
        c+=1
    d+=1
print(ans)

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

Python: import sys


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

n = sys.stdin.readline()
while n:
    n = int(n)
    print(rec(4,0))
    n = sys.stdin.readline()

Python: lst=[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):
                lst[a+b+c+d] += 1
while 1:
    try:
        print(lst[int(input())])
    except:
        break

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

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)])