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: ans = []

while True :
    try :
        N = int(input())
        used = []

        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 :
        break

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: x = [0]*51
for a in range(10):
    for b in range(10):
        for c in range(10):
            for d in range(10):
                x[sum([a, b, c, d])] += 1
while True:
    try:
        print(x[int(input())])
    except:
        break

Python: import itertools, sys

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

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

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 : print(count(make))

Python: import sys

def main():
    istr = sys.stdin.read()
    wi = list(map(int,istr.splitlines()))

    for n in wi:
        """ ????????? """
        cnt = 0
        for a in range(10):
            for b in range(10):
                for c in range(10):
                     for d in range(10):
                        x = a + b + c + d
                        if x == n:
                            cnt += 1
                        elif x > n:
                            break
        print(cnt)

if __name__ == '__main__':
    main()

Python: def main():
	import sys

	table = [0]*51

	for a in range(10):
		for b in range(10):
			for c in range(10):
				for d in range(10):
					table[a+b+c+d] += 1

	for line in sys.stdin:
		n = int(line)
		print(table[n])


if __name__ == '__main__':
	main()

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: import sys
from itertools import product

sum = [0] * 51
for k,l in product([i+j for i,j in product(range(10),repeat=2)],repeat=2):
    sum[k+l] += 1

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

Python: while 1:
    try:
        count = 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:
                            count += 1
        print(count)
    except:
        break

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

Python: def count(a):#関数「count」を定義
	count = 0
	if a<=36:
		for i in range(10):#()内は0から一つ前までの数
			for j in range(10):
				for k in range(10):
					for l in range(10):
						if i+j+k+l==a:
							count +=1
	print(count)
while True:
	try:
		a=int(input())
		count(a)
	except EOFError:
		break

Python: import sys
import itertools
for line in sys.stdin:
    n = int(line)
    cnt = 0
    for i in itertools.product([i for i in range(10)], repeat=4):
        if n == sum(i):cnt += 1
    print(cnt)

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

    n=int(n)

    if n > 36:
        print(0)
        continue
    elif n==36:
        print(1)
        continue
    b = n
    for i in range(10):
        if n-i==0:
            a=a+1
            #print("(%d,0,0,0)"%(i))
            break
        for j in range(10):
            if n-i-j==0:
                a=a+1
                #print("(%d,%d,0,0)"%(i,j))
                break
            for k in range(10):
                b = n-i-j-k
                if b>=0 and b<=9:
                    a=a+1
                    #print("(%d,%d,%d,%d)"%(i,j,k,b))
                    continue
                elif b > 9:
                    continue
                else:
                    break


    print(a)

Python: 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):
				ans = a + b + c + d 
				if(n == ans):
					count += 1 
print(count)

Python: cnt=0
n=int(input())

s=range(10)

for i in s:
    for j in s:
        for k in s:
            for l in s:
                if i+j+k+l==n:
                    cnt+=1

print(cnt)

Python: def count(num):    
    l1=[]
    for a in range (10):
        for b in range(10):
            for c in range (10):
                for d in range (10):
                    l1.append([a,b,c,d])
    l1=list(filter(lambda x: sum(x)==num,l1))
    return(len(l1))
import sys
length=len(sys.stdin.readlines())
for i in range (length):
    print(count(int(input())))

Python: import sys

def count(n):
    k = 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:
                        k += 1
    return k

for line in sys.stdin:
    print(count(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-[0,a[i-10]*4][i>9]
for e in sys.stdin:
 print(a[int(e)])

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

    cnt = 0
    for a in range(10):
        for b in range(10):
            for c in range(10):
                d = n - a - b - c
                if 0 <= d < 10:
                    cnt += 1
    print(cnt)