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

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

Python: import sys

sum = [0] * 51
for i in range(10):
    for j in range(10):
        for k in range(min(10,18-i-j)):
            for l in range(min(10,18-i-j-k)):
                sum[i+j+k+l] += 1
                sum[36-i-j-k-l] += 1

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

Python: import sys
import itertools

for line in sys.stdin:
    n = int(line)
    cnt = 0;
    for element in itertools.product(range(10), repeat=4):
        if sum(element) == n:
            cnt += 1
    print(cnt)

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

    except:
        break

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

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

Python: import sys

def getsum(n):
  if n > 36: return 0
  else:
    i = n if n < 19 else 36-n
    return (i+3)*(i+2)*(i+1)//6 - max(2*(i-9)*(i-8)*(i-7)//3,0)

for i in sys.stdin:
    print(getsum(int(i)))

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

Python: memo=[[-1]*51 for i in range(5)]
def rec(i,n):
    if memo[i][n]!=-1:
        return memo[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)
    memo[i][n]=r
    return r
     
while True:
    try:
        n=int(input())
        print(rec(0,n))
    except:
        break

Python: #Sum of 4 Integers

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

Python: import sys

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

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

n = int(raw_input())
case = 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:
                    case += 1
print(case)

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: lst=[0 for i in range(50)]
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 i:
    try:
        print(lst[int(input())])
    except:
        break

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

Python: import sys

for i in sys.stdin.readlines():
    n = int(i[:-1])
    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
a=[0]*51
for i in range(19):a[i]=a[36-i]=(i+3)*(i+2)*(i+1)//6-a[i-10]*4*(i>9)
for e in sys.stdin:print(a[int(e)])

Python: while(True):
    a = 0
    n = int(input())

    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: # -*- coding: utf-8 -*-

import sys
import os
import math


lst = sys.stdin.readlines()
#print(lst)

for s in lst:
    cnt = 0
    target_val = int(s)
    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 == target_val:
                        cnt += 1
    print(cnt)

Python: while True:
    try:
        num=int(input())
    except:
        break
    sum=0
    Range=10
    for a in range(Range):
        for b in range(Range):
            for c in range(Range):
                for d in range(Range):
                    if num==a+b+c+d:
                        sum+=1
    print(sum)

Python: import itertools
A = list(range(10))
A_sum = []
A_pair = list(itertools.product(A,repeat=4))
for i in range(len(A_pair)):
    A_sum.append(sum(A_pair[i]))

while True:
    try:
        n = int(input())
    except:
        break
    if 36<n:
        print(0)
    else:
        print(A_sum.count(n))

Python: n=int(input())
print(len([[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==n]))

Python: #!/usr/bin/env python3
# -*- coding: utf-8 -*-
def main(num): 
	if num >= 19:
		num = 19 - num + 17
	res = 1
	gro1 = 3
	for i in range(8):
		if i == num:
			return res
		if i == 0:
			gro2 = 3
		else:
			gro2 += 1
		res += gro1
		gro1 += gro2
	
	for i in range(8,19):
		if i == num:
			return res
		gro2 -= 3
		res += gro1
		gro1 += gro2
			
		
if __name__ == '__main__':
	while True:
		try:
			num = int(input())
		except:
			return
		else:
			print(main())

Python: import sys
[print([670, 660, 633, 592, 540, 480, 415, 348, 282, 220, 165, 120, 84, 56, 35, 20, 10, 4, 1][abs(18 - int(e))]) for e in sys.stdin]

Python: import itertools

try:
    while True:
        n = int(input())
        
        count = 0
        for a, b, c, d in itertools.product(range(10), repeat=4):
            if a + b + c + d == n:
                count += 1

        print(count)

except Exception as _:
    pass