#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Oct  3 14:23:49 2018

@author: elodieedouard
"""
rail = []
P = int(input("Entrez nombre de wagons plein : \n" ))
V = int(input("Entrez nombre de wagons vide : \n" ))

for i in range(P):
    rail.append("P")
rail.append("E")
for i in range(V):
    rail.append("V")
print(rail, "Situation initial")
rail.remove("E")

rail.append("E") 
c = V
print(rail, "Avant l'échange, nombre de déplacement", c)
j=P-1
for i in range(P):
    rail.remove(rail[j])
    rail.append("P")
    j=j-1
    c+=1
    print(rail, "Déplacement n°",c)
    