import std.stdio, std.range, std.conv, std.string;
import std.algorithm.comparison, std.algorithm.iteration, std.algorithm.mutation, std.algorithm.searching, std.algorithm.setops, std.algorithm.sorting;

struct Strut{
    long A;
    long B;
}

void main()
{
    long[] input = readln().split.to!(long[]);
    long A = input[0];
    long B = input[1];
    if(B-A < 100)
    {
        long res;
        foreach(i; A..B+1)
        {
            res ^= i;
            writeln(res);
        }
        return;
    }
    if(A%2==0)
    {
        long res;
        foreach(i; (B-A+1)%4..B+1)
        {
            res ^= i;
        }
        writeln(res);
        return;
    }
    if(A%2==1)
    {
        long res;
        foreach(i; B-(B-A+1)%4..B+1)
        {
            res ^= i;
        }
        res ^= A;
        writeln(res);
    }
}