#!/usr/bin/ruby
require 'prime'
a=[3, 6, 6, 28, 28, 36, 36, 36, 120, 120, 120, 120, 120, 120, 120, 300, 300, 528, 528, 630, 630, 630, 630, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 3240, 3240, 3240, 3240, 5460, 5460, 5460, 5460, 5460, 5460, 5460, 5460, 25200, 25200, 25200, 25200, 25200, 25200, 25200, 25200, 25200, 25200, 25200, 25200, 25200, 25200, 25200, 25200, 25200, 25200, 25200, 25200, 25200, 25200, 25200, 25200, 25200, 25200, 25200, 25200, 25200, 25200, 25200, 25200, 25200, 25200, 25200, 25200, 25200, 25200, 25200, 25200, 25200, 25200, 73920, 73920, 73920, 73920, 73920, 73920, 73920, 73920, 73920, 73920, 73920, 73920, 73920, 73920, 73920, 73920, 73920, 73920, 73920, 73920, 73920, 73920, 157080, 157080, 157080, 157080, 157080, 157080, 157080, 157080, 157080, 157080, 157080, 157080, 157080, 157080, 157080, 157080, 437580, 437580, 437580, 437580, 437580, 437580, 437580, 437580, 437580, 437580, 437580, 437580, 437580, 437580, 437580, 437580, 749700, 749700, 749700, 749700, 749700, 749700, 749700, 749700, 749700, 749700, 749700, 749700, 749700, 749700, 749700, 749700, 749700, 749700, 1385280, 1385280, 1385280, 1385280, 1385280, 1385280, 1493856, 1493856, 1493856, 1493856, 1493856, 1493856, 1493856, 1493856, 1493856, 1493856, 1493856, 1493856, 1493856, 1493856, 1493856, 1493856, 1493856, 1493856, 1493856, 1493856, 1493856, 1493856, 1493856, 1493856, 2031120, 2031120, 2031120, 2031120, 2031120, 2031120, 2031120, 2031120, 2031120, 2031120, 2031120, 2031120, 2031120, 2031120, 2031120, 2031120, 2031120, 2031120, 2031120, 2031120, 2031120, 2031120, 2031120, 2031120, 2031120, 2031120, 2031120, 2031120, 2031120, 2031120, 2031120, 2031120, 2031120, 2031120, 2031120, 2031120, 2031120, 2031120, 2031120, 2031120, 2031120, 2031120, 2031120, 2031120, 2031120, 2031120, 2031120, 2031120, 2162160, 2162160, 2162160, 2162160, 2162160, 2162160, 2162160, 2162160, 2162160, 2162160, 2162160, 2162160, 2162160, 2162160, 2162160, 2162160, 2162160, 2162160, 2162160, 2162160, 2162160, 2162160, 2162160, 2162160, 2162160, 2162160, 2162160, 2162160, 2162160, 2162160, 2162160, 2162160, 2162160, 2162160, 2162160, 2162160, 2162160, 2162160, 2162160, 2162160, 2162160, 2162160, 2162160, 2162160, 2162160, 2162160, 2162160, 2162160, 2162160, 2162160, 2162160, 2162160, 2162160, 2162160, 2162160, 2162160, 2162160, 2162160, 2162160, 2162160, 2162160, 2162160, 2162160, 2162160, 2162160, 2162160, 2162160, 2162160, 2162160, 2162160, 2162160, 2162160, 2162160, 2162160, 2162160, 2162160, 2162160, 2162160, 2162160, 2162160, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 17907120, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 76576500, 103672800, 103672800, 103672800, 103672800, 103672800, 103672800, 103672800, 103672800, 103672800, 103672800, 103672800, 103672800, 103672800, 103672800, 103672800, 103672800, 103672800, 103672800, 103672800, 103672800, 103672800, 103672800, 103672800, 103672800, 103672800, 103672800, 103672800, 103672800, 103672800, 103672800, 103672800, 103672800, 103672800, 103672800, 103672800, 103672800, 103672800, 103672800, 103672800, 103672800, 103672800, 103672800, 103672800, 103672800, 103672800, 103672800, 103672800, 103672800, 103672800, 103672800, 103672800, 103672800, 103672800, 103672800, 103672800, 103672800, 103672800, 103672800, 103672800, 103672800, 103672800, 103672800, 103672800, 103672800, 103672800, 103672800, 103672800, 103672800, 103672800, 103672800, 103672800, 103672800, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 236215980, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320, 842161320]
ma=0
e=1
while a.size<1000
	#p a.size
	sum=(t=e*(e+1)/2).prime_division.reduce(1){|s,e|s*=e[1]+1}
	while ma<sum-1
		a[ma]=t
		ma+=1
	end
	e+=1
end
gets.to_i.times{
	p a[gets.to_i-1]
}
__END__
1
500