import java.io.*;

class Record
   {
   public String keyWord;        // the key word
   public String replacement;    // the replacement word; used only in spellCheck 
   public int ctr = 1;
// -------------------------------------------------------------
   public Record(Record newData) // constructor that constructs a copy of the 
				 // given Record
      {
	if(newData.keyWord == null)
		keyWord = null;
	else
		// keyWord points to a copy of the keyWord in newData
		keyWord = new String(newData.keyWord);
	
	if(newData.replacement == null)
		replacement = null;
	else
		// replacement points to a copy of replacement in newData
		replacement = new String(newData.replacement);
      }
// -------------------------------------------------------------
   public Record(String word) // constructor that constructs a Record with the
			      // given key word
      {
	keyWord = new String(word);
	replacement = null;
      }
// -------------------------------------------------------------
   public void print()      		// outputs the key word in this Record
      {
	System.out.println(keyWord);
      }
// -------------------------------------------------------------
   public void print(PrintStream p)      // outputs the key word in this Record
					 // to a PrintStream
      {
	p.println(keyWord + " " + ctr);
      }
   }  // end class Record
