n=0
a=[]
a<<(n=gets.to_i) until n==-1
for i in 0..a.size-1
  puts a[i] unless a[i]==-1
end