#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  while (n--) {
    int x, y, z;
    cin >> x >> y >> z;
    if (x == y && y == z) {
      cout << "YES" << endl;
      cout << x << " " << y << " " << z << endl;
    } else if (x == y && x > z) {
      cout << "YES" << endl;
      cout << x << " " << z << " " << 1 << endl;
    } else if (z == x && z > y) {
      cout << "YES" << endl;
      cout << z << " " << y << " " << 1 << endl;
    } else if (y == z && x < y) {
      cout << "YES" << endl;
      cout << x << " " << y << " " << 1 << endl;
    } else
      cout << "NO" << endl;
  }
}
