from collections import Counter
def has_char_with_exactly_two_repeats(line):
char_counts = Counter(line)
return 2 in char_counts.values()
def main():
print('Use Ctrl + C to exit the program.')
try:
while True:
line = input().strip()
if has_char_with_exactly_two_repeats(line):
print(line)
except EOFError:
pass
except KeyboardInterrupt:
pass
main()
ZnJvbSBjb2xsZWN0aW9ucyBpbXBvcnQgQ291bnRlcgoKCmRlZiBoYXNfY2hhcl93aXRoX2V4YWN0bHlfdHdvX3JlcGVhdHMobGluZSk6CiAgICBjaGFyX2NvdW50cyA9IENvdW50ZXIobGluZSkKICAgIHJldHVybiAyIGluIGNoYXJfY291bnRzLnZhbHVlcygpCgoKZGVmIG1haW4oKToKICAgIHByaW50KCdVc2UgQ3RybCArIEMgdG8gZXhpdCB0aGUgcHJvZ3JhbS4nKQogICAgdHJ5OgogICAgICAgIHdoaWxlIFRydWU6CiAgICAgICAgICAgIGxpbmUgPSBpbnB1dCgpLnN0cmlwKCkKICAgICAgICAgICAgaWYgaGFzX2NoYXJfd2l0aF9leGFjdGx5X3R3b19yZXBlYXRzKGxpbmUpOgogICAgICAgICAgICAgICAgcHJpbnQobGluZSkKICAgIGV4Y2VwdCBFT0ZFcnJvcjoKICAgICAgICBwYXNzCiAgICBleGNlcHQgS2V5Ym9hcmRJbnRlcnJ1cHQ6CiAgICAgICAgcGFzcwoKCm1haW4oKQoK