Problema elementare, ma subdolo… vedi la discussione
Soluzione 1
In senso antiorario: temp ← a ← b ← c ← temp
a = 5
b = 100
c = 30
print(a, b, c) # 5 100 30
temp = a # temp ← 5
a = b # a ← 100
b = c # b ← 30
c = temp # c ← 5
print(a, b, c) # 100 30 5
Soluzione 2
In senso orario: temp ← c ← b ← a ← temp
a = 5
b = 100
c = 30
print(a, b, c) # 5 100 30
temp = c # temp ← 30
c = b # c ← 100
b = a # b ← 5
a = temp # a ← 30
print(a, b, c) # 30 5 100