char readchar (BufferedReader in) throws IOException
	{	int c;
		while (true)
		{	c=in.read();
			if (c==-1) throw new IOException();
			if (c==13)
			{	if (lastnl==10) lastnl=0;
				else
				{	lastnl=13; return '\n';
				}
			}
			else if (c==10)
			{	if (lastnl==13) lastnl=0;
				else
				{	lastnl=10; return '\n';
				}
			}
			else
			{	lastnl=0;
				return (char)c;
			}
		}
	}