a guest Jul 22nd, 2019 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. echo "Вася Пупкин, Андрей Покупкин, Шуткин Марат, Пупкин Вася" | python -c 'exec """\nimport sys\n\ndef process(line):\n    data = [[x.capitalize() for x in i.strip().lower().split()] for i in line.split(",")]\n\n    st = set()\n    for item in data:\n        name = "{0} {1}".format(item[0], item[1])\n        rev = "{0} {1}".format(item[1], item[0])\n\n        if name not in st and rev not in st:\n            st.add(name)\n    return st\n\nfor line in sys.stdin:\n    print(", ".join(process(line)))\n"""'
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand