A bag contains 3 types of nuts: almonds, cashews, and walnuts. The total weight of the nuts is 500 grams. The weight of the cashews is twice the weight of the walnuts, and the weight of the almonds is 50 grams more than the weight of the walnuts. What is the weight of the walnuts? Let's think step by step and output the final answer within \boxed{}.
user