// Enter:
// Public Thing(int x, int y, String blah)
// outputs:
//     this.x = x;
//     this.y = y;
//     this.blah = blah;
// }
// Enter: String name
// outputs:
// /**
//  * Returns the name
//  */
// String getName() {
//     return name;
// }
// 
// /**
//  * Set name to a new value
//  */
// void setName(String name) {
//     this.name = name;
// }

import java.io.*;

public class Accessors {
	public static void main(String args[]) throws Exception {
		BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
		String line;
		
		while(!(line = stdin.readLine()).equals("quit")) {
			String type;
			String variable;
			String variableTitleCased;
			int position;
			
			position = line.indexOf(" ");
			if(position == -1 || position == 0 || line.length() < 3)
				continue;
			
			type = line.substring(0, position);
			variable = line.substring(position+1);
			variableTitleCased = variable.substring(0, 1).toUpperCase() + variable.substring(1, variable.length());
			
			position = line.indexOf("(");
			if(position != -1) {
				line = line.substring(position+1);
				
				while((position = line.indexOf(" ")) != -1) {
					type = line.substring(0, position);
					line = line.substring(position+1);
					
					position = line.indexOf(",");
					if(position == -1)
						position = line.indexOf(")");
					
					variable = line.substring(0, position);
					line = line.substring(position+1);
					if(line.length() >= 1 && line.charAt(0) == ' ')
						line = line.substring(1, line.length());
					
					System.out.println("    " + "this." + variable + " = " + variable + ";");
				}
				System.out.println("}");
			}
			else {
				System.out.println("/**");
				System.out.println(" * Returns the " + variable);
				System.out.println(" */");
				System.out.println(type + " get" + variableTitleCased + "() {");
				System.out.println("    return " + variable + ";");
				System.out.println("}");
				System.out.println("");
				System.out.println("/**");
				System.out.println(" * Set " + variable + " to a new value");
				System.out.println(" */");
				System.out.println("void set" + variableTitleCased + "(" + type + " " + variable + ") {");
				System.out.println("    this." + variable + " = " + variable + ";");
				System.out.println("}");
				System.out.println("");
			}
		}
	}
}
