#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0; i<(int)(n); i++)
#define rep1(i, n) for(int i=1; i<=(int)(n); i++)
#define rep2(i, n, m) for(int i=(int)n; i<=(int)m; i++)
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> wi;
typedef vector<ll> vl;
const ll inf=1LL<<60;
const ll mod=1000000007;

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);

  int a, b;
  cin >> a >> b;

  int c=min(a, b), d=abs(a-b);
  vi ans;
  rep1(i, c-1){
  	ans.push_back(i);
  	ans.push_back(-i);
  }
  if(a<=b){
  	int sumb=0;
  	rep2(i, c, c+d){
  		ans.push_back(-i);
  		sumb+=-i;
  	}
  	if(sumb!=0)ans.push_back(-sumb);
  }
  else{
  	int suma=0;
  	rep2(i, c, c+d){
  		ans.push_back(i);
  		suma+=i;
  	}
  	if(suma!=0)ans.push_back(-suma);
  }

  rep(i, a+b){
  	if(i)cout << " ";
  	cout << ans[i];
  }
  cout << endl;

  int cnta=0, cntb=0, sum=0;
  rep(i, a+b){
  	if(ans[i]<0)cntb++;
  	if(ans[i]>0)cnta++;
  	sum+=ans[i];
  }

  return 0;
}
#include<bits/stdc++.h>
using namespace std;

typedef long long ll;

ll n, m;

ll ksm(ll x, ll y, ll mod) {
    x = x % mod;
    ll base = 1;
    while (y) {
        if (y & 1) {
            base = base * x;
            base = base % mod;
        }
        x = x * x % mod;
        y = y / 2;
    }
    return base;
}

int main() {
    cin >> n >> m;
    ll ans = ksm(10, n, m * m);
    ll cnt =ksm(10, n, m);
    cout << (ans - cnt) / m << endl; 

}

