#include <bits/stdc++.h>
using namespace std;
const int mxN = 1e5;
int n, m, p[mxN];
vector<int> adj[mxN], ans;
bool vis[mxN];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  while (t-- > 0) {
    long long int x, y, z;
    cin >> x >> y >> z;
    if (x == y && y == z && x == z) {
      cout << "YES" << endl;
      cout << x << " " << x << " " << x << endl;
    } else if (x == z && y < z) {
      cout << "YES" << endl;
      cout << x << " " << y << " " << 1 << endl;
    } else if (x == y && x > z) {
      cout << "YES" << endl;
      cout << z << " " << y << " " << 1 << endl;
    } else if (y == z && x < z) {
      cout << "YES" << endl;
      cout << x << " " << x << " " << z << endl;
    } else {
      cout << "NO" << endl;
    }
  }
  return 0;
}
