#include <bits/stdc++.h>
using namespace std;
void solve() {
  string a[3];
  for (int i = 0; i < 3; i++) cin >> a[i];
  int cnt = 0;
  for (int i = 0; i < a[0].size(); i++)
    if ((a[2][i] == a[0][i] && a[2][i] != a[1][i]) ||
        (a[2][i] == a[1][i] && a[2][i] != a[0][i]) ||
        (a[2][i] == a[1][i] && a[2][i] == a[0][i]))
      cnt++;
  if (cnt == a[0].size())
    cout << "YES\n";
  else
    cout << "NO\n";
}
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  int t;
  cin >> t;
  while (t--) solve();
}
