using System;
using System.Collections.Generic;
using System.Linq;
public class Program
{
public static void Main()
Stack<int> a = new Stack<int>();
a.Push(1);
a.Push(2);
a.Push(25);
a.Push(15);
a.Push(5);
int y = 2;
Stack<int> b = new Stack<int>();
while (a.Count > 0)
int t = a.Pop();
if (t != y)
b.Push(t);
}
y = 5;
while (b.Count > 0)
a.Push(b.Pop());
foreach (int num in a.Reverse())
Console.WriteLine(num);