3회차: 24/07/08 20:00 ~ 23:00
장소: 공대5호관 301호
계획: 24년 하계 모각코
스터디 주제 : 힙 자료구조를 활용하여 문제 해결하기
https://www.acmicpc.net/problem/1927
스터디 목표 : 백준 알고리즘 문제를 미리 선정하여 해결하기

import sys
import heapq
input = sys.stdin.readline
min_heap = []
for _ in range(int(input())):
n = int(input())
if n == 0:
if len(min_heap):
print(heapq.heappop(min_heap))
else:
print(0)
else:
heapq.heappush(min_heap, n)
