class VariableBaseValue{
 // フィールド //
 private static int base = 10;
 private int value = 2;
 
 VariableBaseValue(int v) {this.value = v;}
 void setBase(int b) { if (base > 10) b = 10; if (base < 2) b = 2; base = b;}
 void setValue(int v) {if (v < 1) value = 1; this.value = v;}
 int getBase () { return base; }
 int getValue() { return value;}
 public String toString() {
 int v = value;
 String s = "";
 do{
 s = (v % base) + s;
 v /= base;
 }while (v > 0);
 return s;
 }
}

class VarBaseValTester{
 public static void main (String args){
 VariableBaseValue
varBaseVals = new VariableBaseValue [3];
 varBaseVals[0] = new VariableBaseValue (0);
 varBaseVals[1] = new VariableBaseValue (20);
 varBaseVals[2] = new VariableBaseValue (100);
 for(int i = 0; i <  varBaseVals.length ; i++)
 System.out.println(varBaseVals[i]);
 System.out.println();
 varBaseVals[0].setBase(2);
 for(int i = 0; i <  varBaseVals.length ; i++) {
 System.out.println(varBaseVals[i]);
 }
 
}
}