1. Java, Peter Schnitzler

/*Problem : 193
*Author : Peter Schnitzler
*Status : Accepted
*Runtime : 0.480
*/



import java.util.LinkedList;
import java.util.Scanner;


public class Main
{

public static void main(String[] args) throws Exception
{
Scanner scan = new Scanner(System.in);


int negUses[] = new int [1000000];
int zeroUse = 0;
int posUses[] = new int [1000000];

LinkedList<Integer> numberOrder = new LinkedList<Integer>();

while (scan.hasNextInt())
{
int temp = scan.nextInt();

if (temp > 0)
{
if (posUses[temp - 1] == 0)
{
numberOrder.add(temp);
}

posUses[temp - 1]++;
continue;
}

if (temp < 0)
{
int abs = (temp * -1) + 1;

if (negUses[abs] == 0)
{
numberOrder.add(temp);
}

negUses[abs]++;
continue;
}

if (zeroUse == 0)
{
numberOrder.add(0);
}

zeroUse++;
}


for (Integer i: numberOrder)
{
int count = zeroUse;

if (i > 0)
{
count = posUses[i - 1];
}

if (i < 0)
{
count = negUses[(i*-1) + 1];
}

System.out.println(i + " " + count);
}
}
}