gets a=$<.read.split"" 2012.times{|i|$>.<<~/n/?a[i<1007?i*2:2012-i*2]:i>2010?"":a[i./i%2<1?2:-2]}