public int top() {
		Queue q2 = new ArrayDeque();
		int n = q.size();
		for (int i = 0; i < n - 1; i++) {
			int temp = (Integer) q.poll();
			q2.offer(temp);
		}

		int top = (Integer) q.peek();
		q2.offer(q.poll());
		while (!q2.isEmpty()) {
			q.offer(q2.poll());
		}
		return top;
	}