from random import randint, sample
s = []
for i in xrange(100000):
r = randint(1,81)
a = ([True] * r) + ([False] * (81 - r))
b = sample(a, 9)
if b[0] and b.count(True) == 3:
s.append(r)
print float(sum(s)) / len(s)
ZnJvbSByYW5kb20gaW1wb3J0IHJhbmRpbnQsIHNhbXBsZQoKcyA9IFtdCmZvciBpIGluIHhyYW5nZSgxMDAwMDApOgogIHIgPSByYW5kaW50KDEsODEpCiAgYSA9IChbVHJ1ZV0gKiByKSArIChbRmFsc2VdICogKDgxIC0gcikpCiAgYiA9IHNhbXBsZShhLCA5KQogIGlmIGJbMF0gYW5kIGIuY291bnQoVHJ1ZSkgPT0gMzoKICAgIHMuYXBwZW5kKHIpCgpwcmludCBmbG9hdChzdW0ocykpIC8gbGVuKHMp