#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    bool ok = true;
    string a, b, c;
    cin >> a >> b >> c;
    int n = a.size();
    if (a == c || b == c) {
      cout << "YES\n";
    } else {
      for (int i = 0; i < n; i++) {
        if (a[i] == c[i])
          swap(b[i], c[i]);
        else if (b[i] == c[i])
          swap(a[i], c[i]);
        else {
          ok = false;
          break;
        }
      }
      if (a == b && ok)
        cout << "YES\n";
      else
        cout << "NO\n";
    }
  }
  return 0;
}
