s = 'May all begings be happy and secure; may their mind be contented'
s_1,s_2 = [i.strip() for i in s.split(';')]
i = 0
a = []
b = []
while i<10:
s_3 = s_1.split(' ')
s_4 = s_2.split(' ')
random.shuffle(s_3)
random.shuffle(s_4)
if (s_3 not in a) or (s_4 not in b):
a.append(s_3)
b.append(s_4)
i += 1
for i in range(len(a)):
with open('new.txt','a+') as f:
f.write(' '.join(a[i])+'; '+' '.join(b[i])+'\n')