using System;
public class Program
{
public static void Main()
Console.WriteLine(replaceSpace(new char[]{'t',' ','e',' ','s','t',' ',' ',' ',' '},6));
}
public static string replaceSpace(char[] str, int trueLength){
int ptr1 = str.Length-1;
int ptr2 = trueLength - 1;
while(ptr2 > 0){
if(str[ptr2] != ' '){
str[ptr1--] = str[ptr2--];
}else{
str[ptr1--] = '0';
str[ptr1--] = '2';
str[ptr1--] = '%';
ptr2--;
return new string(str);