include<iostream>
using namespace std;
int main() {
	int a, b, r, kouyaku[1001], kazu[1001], kaisuu, s;
	kaisuu = 0;
	while (1) {
		cin >> a >> b;
		if (a == 0 && b == 0) {
			goto a;
		}
		kaisuu = kaisuu + 1;
		s = 0;
	}
	a:;
		for (int i = 1; i <= kaisuu; i++) {
			cout << kouyaku[i] << " " << kazu[i] << endl;
		}
	
}
