using System.Collections.Generic;
public static void Main(string[] args) {
Stack<int> p1 = new Stack<int>();
Stack<int> p2 = new Stack<int>();
if (p1.Count == p2.Count) {
Stack<int> temp1 = new Stack<int>(p1);
Stack<int> temp2 = new Stack<int>(p2);
while (temp1.Count > 0 && iguais) {
if (temp1.Pop() != temp2.Pop()) {
Console.WriteLine("As pilhas P1 e P2 são iguais.");
Console.WriteLine("As pilhas P1 e P2 são diferentes.");