# -*- coding: cp932 -*-
import random
import re
N = 3
def uniq(L):
  R = []
  for i in L:
    if i not in R:
      R.append(i)
  return R
def make_code():
  while 1:
    s = str(random.randint(0, 10**N))
    if len(uniq(s)) == N:
      return s
def make_trial(k):
  while 1:
    print "%s回目のトライ> " % k,
    s = raw_input()
    s = re.sub("[^0-9]", "", s)
    if len(s) != N:
      print "%d桁の数字を入れてね" % N
    else:
      return s