#include<iostream> #include<cmath> #include<cstdio> using namespace std; int main(){ int n,a,b,c,d; char start[25][3],end[25][3]; scanf("%d",&n); for(int i=1;i<=n;i++){ scanf("%s%s",start[i],end[i]); int x = abs(start[i][0]-end[i][0]); int y = abs(start[i][1]-end[i][1]); if(x==0&&y==0){ a = b = c = d = 0; } else{ a = max(x,y); if(x==0||y==0||x==y)b = 1; else b = 2; if(x==0||y==0) c = 1; else c = 2; if((x+y)%2==0){ if(x==y) d = 1; else d = 2; } else d = -1; } printf("%d %d %d ",a,b,c); if(d==-1) printf("Inf\n"); else printf("%d\n",d); } return 0; }