4. Warehouses A and B originally each stored whole bags of grain. If 90 bags are transferred from Warehouse A to Warehouse B, then the number of bags in Warehouse B will be twice that in Warehouse A. If a certain number of bags are transferred from Warehouse B to Warehouse A, then the number of bags in Warehouse A will be 6 times that in Warehouse B. How many bags of grain did Warehouse A originally have at least? $\qquad$ 

保留源文本的换行和格式，直接输出翻译结果。