import fileinput
err = False
for line in fileinput.input():
line = line.rstrip('\n')
if line != "".join(sorted(line)):
err = True
print("[%d] Bad line: %s" % (fileinput.lineno(), line))
if not err:
print("All ok!")
aW1wb3J0IGZpbGVpbnB1dAplcnIgPSBGYWxzZQpmb3IgbGluZSBpbiBmaWxlaW5wdXQuaW5wdXQoKToKCWxpbmUgPSBsaW5lLnJzdHJpcCgnXG4nKQoJaWYgbGluZSAhPSAiIi5qb2luKHNvcnRlZChsaW5lKSk6CgkJZXJyID0gVHJ1ZQoJCXByaW50KCJbJWRdIEJhZCBsaW5lOiAlcyIgJSAoZmlsZWlucHV0LmxpbmVubygpLCBsaW5lKSkKCQkKaWYgbm90IGVycjoKCXByaW50KCJBbGwgb2shIikK