If x = y and y = z , print any of them , update prev1 prev2 , prev3 and move ahead in each array
if ( ar1 [ i ] == ar2 [ j ] && ar2 [ j ] == ar3 [ k ] ) { cout << ar1 [ i ] << " ▁ " ; prev1 = ar1 [ i ] ; prev2 = ar2 [ j ] ; prev3 = ar3 [ k ] ; i ++ ; j ++ ; k ++ ; }