using System;
public class Program
{
public static void Main()
string a = "Move spaces to the beginning";
int n = a.Length-1;
int count =n;
for(int i=n;i>=0;i--)
if(a[i] != ' ')
a[count--] = a[i];
}