#pragma  warning (disable:4996)
#include<iostream>
#include<cstdio>
#include<queue>
#include<cstring>
#include<string>
#include<cmath>
#include<algorithm>
#define MAX 1000000
using namespace std;
int amount[MAX];
int vis[MAX];
int prime[MAX];
int main(){
	//memset(prime, 1, sizeof(prime));
	for (int j = 2; j <= MAX; j++) prime[j] = 1;
	prime[0] = prime[1] = 0;
	for (int i = 2; i*i<= MAX; i++){
		if (prime[i]){
				for (int j = i *i; j <= MAX; j += i){
				prime[j] = 0;
			}
		}
	}
	
	int n, m;
	while (cin >> n>>m){
		if (n==m) cout <<0 << endl;
		else {

		}
	}
	return 0;
}