jym=[1,0,10,9,8,7,6,5,4,3,2]#校验码
a=[7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2]#对应系数
#b=[6,2,1,1,2,3,1,9,9,8,0,6,2,5]
b=list(input("输入身份证\n"))#输入的字符以数组格式储存
for i in range(0,len(b)):#把输入的字符转换成数字
 b[i]=int(b[i])
c=0 
for i in range(0,14):
    c=c+a[i]*b[i]
#print(c)

for i in range(0,10):
    for j in range(0,10):
        for m in range(0,10,2):
            d=c+8*i+4*j+2*m
            print(i,j,m,jym[d%11])