import java.util.Stack;
public class Main {
public static void main(String[] args) {
Stack stack = new Stack();
for (int i = 0; i < 10; i++) {
stack.push(i);
System.out.print(i + " ");
}
System.out.println("");
int position = stack.search(3);
System.out.println("Search result position: " + position);
System.out.println("Stack top: " + stack.peek());
while (!stack.empty()) {
System.out.print(stack.pop() + " ");
}
}
}