#include <bits/stdc++.h>
using namespace std;
void threestring() {
  string a, b, c;
  getline(cin, a);
  getline(cin, b);
  getline(cin, c);
  for (int i = 0; i < a.length(); i++) {
    if (c[i] == a[i] || c[i] == b[i]) {
      if (i == a.length() - 1) {
        cout << "yes" << endl;
      }
    } else {
      cout << "no" << endl;
      break;
    }
  }
}
int main() {
  int n;
  cin >> n;
  cin.ignore();
  for (int i = 0; i < n; i++) {
    threestring();
  }
}
