Buggy python submission (verdict: Runtime Error):
import sys
t='X'
for e in sys.stdin:
 for i in'0123456789'[(e[0]==t)*(e[1]!='+')or('+X'in e)*('+X='not in e)or('=X'in e)*(e[-1]==t):]:
  if eval(e.replace(t,i).replace('=','==')):print(i);break
 else:print('NA')


Fixed submission:
import sys
p,t='+X'
for e in sys.stdin:
 for i in'0123456789'[(e[0]==t)*(e[1]!=p)or('+X'in e)*('+X='not in e):]:
  l,r=e.replace(t,i).split('=')
  if sum(map(int,l.split(p)))==int(r):print(i);break
 else:print('NA')

Buggy python submission (verdict: Runtime Error):
import sys
t='X'
for e in sys.stdin:
 for i in'0123456789'[(e[0]==t)*('+'!=e[1])or('+X'in e)*('+X='not in e)or('=X'in e)*(e[-1]==t):]:
  if eval(e.replace(t,i).replace('=','==')):print(i);break
 else:print('NA')


Fixed submission:
import sys
p,t='+X'
for e in sys.stdin:
 for i in'0123456789'[(e[0]==t)*(e[1]!=p)or('+X'in e)*('+X='not in e):]:
  l,r=e.replace(t,i).split('=')
  if sum(map(int,l.split(p)))==int(r):print(i);break
 else:print('NA')

Buggy python submission (verdict: Runtime Error):
import sys
t='X'
for e in sys.stdin:
 for i in'0123456789'[(e[0]==t)*('+'!=e[1])or('+X'in e)*('+X='not in e)or('=X'in e)*(e[-2]=='='):]:
  if eval(e.replace(t,i).replace('=','==')):print(i);break
 else:print('NA')


Fixed submission:
import sys
p,t='+X'
for e in sys.stdin:
 for i in'0123456789'[(e[0]==t)*(e[1]!=p)or('+X'in e)*('+X='not in e):]:
  l,r=e.replace(t,i).split('=')
  if sum(map(int,l.split(p)))==int(r):print(i);break
 else:print('NA')

Buggy python submission (verdict: Runtime Error):
import sys
t='X'
for e in sys.stdin:
 for i in'0123456789'[(e[0]==t)*(e[1]!='+')or('+X'in e)*not('+X='in e)or('=X'in e)*(e[-2]!='='):]:
  if eval(e.replace(t,i).replace('=','==')):print(i);break
 else:print('NA')


Fixed submission:
import sys
p,t='+X'
for e in sys.stdin:
 for i in'0123456789'[(e[0]==t)*(e[1]!=p)or('+X'in e)*('+X='not in e):]:
  l,r=e.replace(t,i).split('=')
  if sum(map(int,l.split(p)))==int(r):print(i);break
 else:print('NA')

Buggy python submission (verdict: Runtime Error):
import sys
t='X'
for e in sys.stdin:
 for i in'0123456789'[(e[0]==t)*(e[1]!='+')or('+X'in e)*('+X='not in e)or(e[-2:]=='=X'):]:
  if eval(e.replace(t,i).replace('=','==')):print(i);break
 else:print('NA')


Fixed submission:
import sys
p,t='+X'
for e in sys.stdin:
 for i in'0123456789'[(e[0]==t)*(e[1]!=p)or('+X'in e)*('+X='not in e):]:
  l,r=e.replace(t,i).split('=')
  if sum(map(int,l.split(p)))==int(r):print(i);break
 else:print('NA')

Buggy python submission (verdict: Runtime Error):
import re
for e in sys.stdin:
    s=any([len(x)>1 and x[0]=='X' for x in re.split('[+=]',e)])
    for i in '0123456789'[s:]:
        if eval(e.replace('X',i).replace('=','==')):print(i);break
    else:print('NA')


Fixed submission:
import sys
p,t='+X'
for e in sys.stdin:
 for i in'0123456789'[(e[0]==t)*(e[1]!=p)or('+X'in e)*('+X='not in e):]:
  l,r=e.replace(t,i).split('=')
  if sum(map(int,l.split(p)))==int(r):print(i);break
 else:print('NA')

Buggy python submission (verdict: Runtime Error):
import sys
for e in sys.stdin:
 for i in'0123456789'[(e[0]==t)*(e[1]!='+')or('+X'in e)*('+X='not in e)or('=X'in e):]:
  l,r=e.replace('X',i).split('=')
  if sum(map(int,l.split('+')))==int(r):print(i);break
 else:print('NA')


Fixed submission:
import sys
p,t='+X'
for e in sys.stdin:
 for i in'0123456789'[(e[0]==t)*(e[1]!=p)or('+X'in e)*('+X='not in e):]:
  l,r=e.replace(t,i).split('=')
  if sum(map(int,l.split(p)))==int(r):print(i);break
 else:print('NA')