// Arup Guha
// 6/5/2014
// Solution to 2008 UCF High School Programming Contest Problem: Lucas's Letters

import java.util.*;
import java.io.*;

public class letters {

	public static void main(String[] args) throws IOException {

		Scanner fin = new Scanner(new File("letters.in"));

		int numCases = fin.nextInt();

		// Process each case - Java has a method that does this.
		for (int loop=0; loop<numCases; loop++)
			System.out.println(fin.next().replace('l','w'));

		fin.close();
	}
}