public synchronized void agree(String x){
	int r = 0;
	int m = 0;
	int n = getNo();
	while( true) {
	    r++;
	    int c = ( r % n) + 1;
	    
	    unicast(new Message(pid,c,VAL,x+SEP+r));


	    if ( pid == c ) {
		String v = handleRecv();
		continue;
		//the d thing is done in handleRecv
	    }
	    
	    Cont cont = collect(c);
	    if ( cont.ret ){
		x = cont.v;
		if (cont.d){
		    Utils.out(pid, "decided " +x );
		    if ( m  == c ){
			return;
		    }else if ( m == 0) {
			m = c;
		    }
		}
		
	    }

		    
	}
    }