# include <bits/stdc++.h>
# define fr first
# define sc second
# define mk make_pair
# define pb push_back
# define ll long long

using namespace std;


main()
{
     int a,b,c=0,h;
     cin>>a>>b;
     if (a==b)
     {
         cout<<0;
         return 0;
     }
     if (a==-b){
        cout<<1;
        return 0;
     }
     if (b>a&&a>=0&&b>=0)
     {
         cout<<b-a;
         return 0;
     }
     if (a>b)
     {
         a=-a;
         while (a!=b)
         {
             if (abs(-a-abs(b))<=abs(a+1-abs(b))||a==-b){
                a=-a;
                c++;
             }
               if (a==b)
             {
                 break;
             }
             if (-(a+(abs(abs(a)-abs(b))))==b&&a>0)
             {
                 c+=(abs(abs(a)-abs(b)))+1;
                 a=-(a+(abs(abs(a)-abs(b))));
             }
       if (a==b)
             {
                 break;
             }
             if (abs(-a-abs(b))>=abs(a+1-abs(b))||-a>b){
                a++;
                c++;
             }
             cout<<a<<" ";
         }
         cout<<c+1;
         return 0;
     }
}
