#include using namespace std; typedef long long ll; typedef pair P; #define REP(i,n) for(int i=0;i > b(1000, vector

(2000)); int dx[]={1,0,0}; int dy[]={0,1,-1}; bool f=false; void dfs(int x,int y,int c){ if(c>250000) return; if(abs(y-500)>2*q) return; if(x>2*q) return; if(x==2*q && y==500){ f=true; return; } vi[x][y]=1; vi[x+2*p][y]=1; REP(i,3){ int X=x+dx[i],Y=y+dy[i]; if(vi[X][Y]==1 || (X+2*p==2*q && Y==500)) continue; b[X][Y].first=x; b[X][Y].second=y; dfs(X,Y,c+1); } } vector

g(int x,int y){ vector

path; path.push_back(P(x,y)); int s=x,t=y; while(1){ int v=b[s][t].first,u=b[s][t].second; path.push_back(P(v,u)); if(v==0 && u==500) break; s=v; t=u; } reverse(path.begin(),path.end()); return path; } int main(void){ cin.tie(nullptr); ios_base::sync_with_stdio(false); int i,j,k; cin >> p >> q; dfs(0,500,0); // (0,0) if(f){ vector

ans=g(2*q,500); int n=ans.size(); cout <<"Possible" << endl; cout << n-1 << endl; REP(i,n) cout << ans[i].first << ' ' << ans[i].second-500 << '\n'; }else{ cout <<"Imossible" << endl; } return 0; }