import java.io.*; import java.util.*; import java.awt.geom.*; /** * Solution to Text Roll * * @author vanb */ public class textroll_vanb { public BufferedReader br; public PrintStream ps; /** * Driver. * @throws Exception */ public void doit() throws Exception { br = new BufferedReader( new InputStreamReader( System.in ) ); //new FileReader( "textroll.judge" ) ); ps = System.out; //new PrintStream( new FileOutputStream( "textroll.solution" ) ); for(;;) { int n = Integer.parseInt( br.readLine().trim() ); if( n==0 ) break; // One line of text char text[]; // The position of the ball int ball = 1; for( int i=0; i