2009 AIME I Problem 14

For t=1,2,3,4, define S_{t}=\sum_{i=1}^{350} a_{i}^{t}, where a_{i} \in\{1,2,3,4\}. If S_{1}=513 and S_{4}=4745, find the minimum possible value for S_{2}.