29 lines
540 B
Plaintext
29 lines
540 B
Plaintext
|
#!/usr/bin/env python
|
||
|
|
||
|
import sys
|
||
|
import random
|
||
|
|
||
|
# maj = True
|
||
|
|
||
|
for line in sys.stdin:
|
||
|
nl = ""
|
||
|
word = ""
|
||
|
grace = True
|
||
|
for c in line:
|
||
|
if c.isalpha():
|
||
|
if grace:
|
||
|
nl += word
|
||
|
nl += c
|
||
|
word = ""
|
||
|
grace = False
|
||
|
else:
|
||
|
word += c
|
||
|
else:
|
||
|
wrd = list(word)
|
||
|
random.shuffle(wrd)
|
||
|
nl += ''.join(wrd)
|
||
|
nl += c
|
||
|
word = ""
|
||
|
grace = True
|
||
|
print(nl, end="")
|