------
## 最终结论
```python
def can_make_equal(a, b, c):
    n = len(a)
    for i in range(n):
        if not (c[i] == a[i] or c[i] == b[i]):
            return "NO"
    return "YES"

t = int(input().strip())
for _ in range(t):
    a = input().strip()
    b = input().strip()
    c = input().strip()
    print(can_make_equal(a, b, c))
```