#include<bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#define mms(a,n) memset(a,0,sizeof((a)[0])*(n))
#define mmp(a,b,n) memcpy(a,b,sizeof((b)[0])*(n))
#define lowbit(x) ((x)&-(x))
#define pb push_back
#define fi first
#define se second
#define debug(...) fprintf(stderr,__VA_ARGS__)
#define lowbit(x) ((x)&-(x))
#define fo(i,l,r) for(register int i=l,_lim_=r;i<=_lim_;i++)
#define fd(i,r,l) for(register int i=r,_lim_=l;i>=_lim_;i--)

using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef pair<int,int> pi;
typedef double db;
typedef long double ldb;

namespace io{
	const int L=(1<<21)+1;
	char ibuf[L],*iS,*iT,obuf[L],*oS=obuf,*oT=obuf+L-1,c,st[55];int f,tp;
	#ifdef whzzt
		#define gc() getchar()
	#else
		#define gc() (iS==iT?(iT=(iS=ibuf)+fread(ibuf,1,L,stdin),(iS==iT?EOF:*iS++)):*iS++)
	#endif
	inline void flush(){fwrite(obuf,1,oS-obuf,stdout);oS=obuf;}
	inline void putc(char x){*oS++=x;if(oS==oT)flush();}
	template<class I>
	inline void gi(I&x){
		for(f=1,c=gc();c<'0'||c>'9';c=gc())if(c=='-')f=-1;
		for(x=0;c<='9'&&c>='0';c=gc())x=x*10+(c&15);x*=f;
	}
	template<class I>
	inline void print(I x){
		if(!x)putc('0');if(x<0)putc('-'),x=-x;
		while(x)st[++tp]=x%10+'0',x/=10;
		while(tp)putc(st[tp--]);
	}
	inline void gs(char*s,int&l){
		for(c=gc();c!='_'&&(c<'a'||c>'z');c=gc());
		for(l=0;c=='_'||c<='z'&&c>='a';c=gc())s[l++]=c;
	}
};
using io::putc;
using io::gi;
using io::gs;
using io::print;

const int N=200005,M=32,L=525005;

int n,q,a[N],mx;
struct LinearBase{
	int a[M],m;
	int find(int k){
		for(int i=1;i<=m;i++)if((k^a[i])<k)k^=a[i];
		return k;
	}
	void ext(int k){
		if(mx>>m){
			if(k=find(k)){
				int j=1;
				while(k<=a[j])j++;
				++m;for(int i=m;i>j;i--)a[i]=a[i-1];
				a[j]=k;
				for(int i=1;i<j;i++)if((k^a[i])<a[i])a[i]^=k;
			}
		}
	}
	friend LinearBase operator+(const LinearBase&a,const LinearBase&b){
		if((1ll<<a.m)>mx)return a;if((1ll<<b.m)>mx)return b;
		LinearBase ret=a;
		for(int i=1;i<=b.m;i++)ret.ext(b.a[i]);
		return ret;
	}
	void clear(){while(m)a[m--]=0;}
}seg[L],ans;

void build(int x,int l,int r){
	if(l==r){
		seg[x].ext(a[l]);
		return;
	}
	int mid=(l+r)>>1,ls=x<<1,rs=ls|1;
	build(ls,l,mid);build(rs,mid+1,r);
	seg[x]=seg[ls]+seg[rs];
}

void modify(int x,int l,int r,int p,int k){
	if(l==r){
		seg[x].a[1]^=k;
		mx=max(mx,seg[x].a[1]);
		if(!seg[x].a[1])seg[x].m=0;else seg[x].m=1;
		return;
	}
	int mid=(l+r)>>1,ls=x<<1,rs=ls|1;
	if(p<=mid)modify(ls,l,mid,p,k);
	else modify(rs,mid+1,r,p,k);
	seg[x]=seg[ls]+seg[rs];
}
void modify(int x,int l,int r,int p,int q,int k){
	if(l==r){
		seg[x].a[1]^=k;
		mx=max(mx,seg[x].a[1]);
		if(!seg[x].a[1])seg[x].m=0;else seg[x].m=1;
		return;
	}
	int mid=(l+r)>>1,ls=x<<1,rs=ls|1;
	if(q<=mid)modify(ls,l,mid,p,q,k);
	else if(p>mid)modify(rs,mid+1,r,p,q,k);
	else modify(ls,l,mid,p,k),modify(rs,mid+1,r,q,k);
	seg[x]=seg[ls]+seg[rs];
}

LinearBase query(int x,int l,int r,int s,int t){
	if(l==s&&r==t)return seg[x];
	int mid=(l+r)>>1,ls=x<<1,rs=ls|1;
	if(t<=mid)return query(ls,l,mid,s,t);
	if(s>mid)return query(rs,mid+1,r,s,t);
	LinearBase w=query(ls,l,mid,s,mid);
	if((1ll<<w.m)>mx)return w;
	return w+query(rs,mid+1,r,mid+1,t);
}

int sum[N];
void add(int x,int u){while(x<=n)sum[x]^=u,x+=lowbit(x);}
int ask(int x){int r=0;while(x)r^=sum[x],x-=lowbit(x);return r;}

int main(){
	gi(n),gi(q);
	for(int i=1,s=0;i<=n;i++)gi(a[i]),add(i,a[i]),add(i+1,a[i]);
	for(int i=n;i>=1;i--)mx=max(mx,a[i]^=a[i-1]);
	build(1,1,n);
	for(int i=1,op,l,r,k;i<=q;i++){
		gi(op);gi(l);gi(r);
		if(op==1){
			gi(k);
			if(r<n)modify(1,1,n,l,r+1,k);else modify(1,1,n,l,k);
			add(l,k);add(r+1,k);
		}else{
			if(l<r)ans=query(1,1,n,l+1,r);else ans.clear();
			ans.ext(ask(l));
			print(1<<ans.m);
			putc('\n');
		}
	}
	io::flush();
	return 0;
}


#include<bits/stdc++.h>
#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#define mms(a,n) memset(a,0,sizeof((a)[0])*(n))
#define mmp(a,b,n) memcpy(a,b,sizeof((b)[0])*(n))
#define lowbit(x) ((x)&-(x))
#define pb push_back
#define fi first
#define se second
#define debug(...) fprintf(stderr,__VA_ARGS__)
#define lowbit(x) ((x)&-(x))
#define fo(i,l,r) for(register int i=l,_lim_=r;i<=_lim_;i++)
#define fd(i,r,l) for(register int i=r,_lim_=l;i>=_lim_;i--)

using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef pair<int,int> pi;
typedef double db;
typedef long double ldb;

namespace io{
	const int L=(1<<21)+1;
	char ibuf[L],*iS,*iT,obuf[L],*oS=obuf,*oT=obuf+L-1,c,st[55];int f,tp;
	#ifdef whzzt
		#define gc() getchar()
	#else
		#define gc() (iS==iT?(iT=(iS=ibuf)+fread(ibuf,1,L,stdin),(iS==iT?EOF:*iS++)):*iS++)
	#endif
	inline void flush(){fwrite(obuf,1,oS-obuf,stdout);oS=obuf;}
	inline void putc(char x){*oS++=x;if(oS==oT)flush();}
	template<class I>
	inline void gi(I&x){
		for(f=1,c=gc();c<'0'||c>'9';c=gc())if(c=='-')f=-1;
		for(x=0;c<='9'&&c>='0';c=gc())x=x*10+(c&15);x*=f;
	}
	template<class I>
	inline void print(I x){
		if(!x)putc('0');if(x<0)putc('-'),x=-x;
		while(x)st[++tp]=x%10+'0',x/=10;
		while(tp)putc(st[tp--]);
	}
	inline void gs(char*s,int&l){
		for(c=gc();c!='_'&&(c<'a'||c>'z');c=gc());
		for(l=0;c=='_'||c<='z'&&c>='a';c=gc())s[l++]=c;
	}
};
using io::putc;
using io::gi;
using io::gs;
using io::print;

const int N=200005,M=32,L=525005;

int n,q,a[N],mx;
struct LinearBase{
	int a[M],m;
	int find(int k){
		for(int i=1;i<=m;i++)if((k^a[i])<k)k^=a[i];
		return k;
	}
	void ext(int k){
		if(k=find(k)){
			int j=1;
			while(k<=a[j])j++;
			++m;for(int i=m;i>j;i--)a[i]=a[i-1];
			a[j]=k;
			for(int i=1;i<j;i++)if((k^a[i])<a[i])a[i]^=k;
		}
	}
	friend LinearBase operator+(const LinearBase&a,const LinearBase&b){
		if((1ll<<a.m)>mx)return a;if((1ll<<b.m)>mx)return b;
		LinearBase ret=a;
		for(int i=1;i<=b.m;i++)ret.ext(b.a[i]);
		return ret;
	}
	void clear(){while(m)a[m--]=0;}
}seg[L],ans;

void build(int x,int l,int r){
	if(l==r){
		seg[x].ext(a[l]);
		return;
	}
	int mid=(l+r)>>1,ls=x<<1,rs=ls|1;
	build(ls,l,mid);build(rs,mid+1,r);
	seg[x]=seg[ls]+seg[rs];
}

void modify(int x,int l,int r,int p,int k){
	if(l==r){
		seg[x].a[1]^=k;
		mx=max(mx,seg[x].a[1]);
		if(!seg[x].a[1])seg[x].m=0;else seg[x].m=1;
		return;
	}
	int mid=(l+r)>>1,ls=x<<1,rs=ls|1;
	if(p<=mid)modify(ls,l,mid,p,k);
	else modify(rs,mid+1,r,p,k);
	seg[x]=seg[ls]+seg[rs];
}
void modify(int x,int l,int r,int p,int q,int k){
	if(l==r){
		seg[x].a[1]^=k;
		mx=max(mx,seg[x].a[1]);
		if(!seg[x].a[1])seg[x].m=0;else seg[x].m=1;
		return;
	}
	int mid=(l+r)>>1,ls=x<<1,rs=ls|1;
	if(q<=mid)modify(ls,l,mid,p,k);
	else if(p>mid)modify(rs,mid+1,r,p,k);
	else modify(ls,l,mid,p,k),modify(rs,mid+1,r,q,k);
	seg[x]=seg[ls]+seg[rs];
}

LinearBase query(int x,int l,int r,int s,int t){
	if(l==s&&r==t)return seg[x];
	int mid=(l+r)>>1,ls=x<<1,rs=ls|1;
	if(t<=mid)return query(ls,l,mid,s,t);
	if(s>mid)return query(rs,mid+1,r,s,t);
	LinearBase w=query(ls,l,mid,s,mid);
	if((1ll<<w.m)>mx)return w;
	return w+query(rs,mid+1,r,mid+1,t);
}

int sum[N];
void add(int x,int u){while(x<=n)sum[x]^=u,x+=lowbit(x);}
int ask(int x){int r=0;while(x)r^=sum[x],x-=lowbit(x);return r;}

int main(){
	gi(n),gi(q);
	for(int i=1,s=0;i<=n;i++)gi(a[i]),add(i,a[i]),add(i+1,a[i]);
	for(int i=n;i>=1;i--)mx=max(mx,a[i]^=a[i-1]);
	build(1,1,n);
	for(int i=1,op,l,r,k;i<=q;i++){
		gi(op);gi(l);gi(r);
		if(op==1){
			gi(k);
			if(r<n)modify(1,1,n,l,r+1,k);else modify(1,1,n,l,k);
			add(l,k);add(r+1,k);
		}else{
			if(l<r)ans=query(1,1,n,l+1,r);else ans.clear();
			ans.ext(ask(l));
			print(1<<ans.m);
			putc('\n');
		}
	}
	io::flush();
	return 0;
}


#include<bits/stdc++.h>
#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#define mms(a,n) memset(a,0,sizeof((a)[0])*(n))
#define mmp(a,b,n) memcpy(a,b,sizeof((b)[0])*(n))
#define lowbit(x) ((x)&-(x))
#define pb push_back
#define fi first
#define se second
#define debug(...) fprintf(stderr,__VA_ARGS__)
#define lowbit(x) ((x)&-(x))
#define fo(i,l,r) for(register int i=l,_lim_=r;i<=_lim_;i++)
#define fd(i,r,l) for(register int i=r,_lim_=l;i>=_lim_;i--)

using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef pair<int,int> pi;
typedef double db;
typedef long double ldb;

namespace io{
	const int L=(1<<21)+1;
	char ibuf[L],*iS,*iT,obuf[L],*oS=obuf,*oT=obuf+L-1,c,st[55];int f,tp;
	#ifdef whzzt
		#define gc() getchar()
	#else
		#define gc() (iS==iT?(iT=(iS=ibuf)+fread(ibuf,1,L,stdin),(iS==iT?EOF:*iS++)):*iS++)
	#endif
	inline void flush(){fwrite(obuf,1,oS-obuf,stdout);oS=obuf;}
	inline void putc(char x){*oS++=x;if(oS==oT)flush();}
	template<class I>
	inline void gi(I&x){
		for(f=1,c=gc();c<'0'||c>'9';c=gc())if(c=='-')f=-1;
		for(x=0;c<='9'&&c>='0';c=gc())x=x*10+(c&15);x*=f;
	}
	template<class I>
	inline void print(I x){
		if(!x)putc('0');if(x<0)putc('-'),x=-x;
		while(x)st[++tp]=x%10+'0',x/=10;
		while(tp)putc(st[tp--]);
	}
	inline void gs(char*s,int&l){
		for(c=gc();c!='_'&&(c<'a'||c>'z');c=gc());
		for(l=0;c=='_'||c<='z'&&c>='a';c=gc())s[l++]=c;
	}
};
using io::putc;
using io::gi;
using io::gs;
using io::print;

const int N=200005,M=32,L=525005;

int n,q,a[N],mx;
struct LinearBase{
	int a[M],m;
	int find(int k){
		for(int i=1;i<=m;i++)if((k^a[i])<k)k^=a[i];
		return k;
	}
	void ext(int k){
		if(k=find(k)){
			int j=1;
			while(k<=a[j])j++;
			++m;for(int i=m;i>j;i--)a[i]=a[i-1];
			a[j]=k;
			for(int i=1;i<j;i++)if((k^a[i])<a[i])a[i]^=k;
		}
	}
	friend LinearBase operator+(const LinearBase&a,const LinearBase&b){
		if((1ll<<a.m)>mx)return a;if((1ll<<b.m)>mx)return b;
		LinearBase ret=a;
		for(int i=1;i<=b.m;i++)ret.ext(b.a[i]);
		return ret;
	}
	void clear(){while(m)a[m--]=0;}
}seg[L],ans;

void build(int x,int l,int r){
	if(l==r){
		seg[x].ext(a[l]);
		return;
	}
	int mid=(l+r)>>1,ls=x<<1,rs=ls|1;
	build(ls,l,mid);build(rs,mid+1,r);
	seg[x]=seg[ls]+seg[rs];
}

void modify(int x,int l,int r,int p,int k){
	if(l==r){
		seg[x].a[1]^=k;
		mx=max(mx,seg[x].a[1]);
		if(!seg[x].a[1])seg[x].m=0;else seg[x].m=1;
		return;
	}
	int mid=(l+r)>>1,ls=x<<1,rs=ls|1;
	if(p<=mid)modify(ls,l,mid,p,k);
	else modify(rs,mid+1,r,p,k);
	seg[x]=seg[ls]+seg[rs];
}
void modify(int x,int l,int r,int p,int q,int k){
	if(l==r){
		seg[x].a[1]^=k;
		mx=max(mx,seg[x].a[1]);
		if(!seg[x].a[1])seg[x].m=0;else seg[x].m=1;
		return;
	}
	int mid=(l+r)>>1,ls=x<<1,rs=ls|1;
	if(q<=mid)modify(ls,l,mid,p,k);
	else if(p>mid)modify(rs,mid+1,r,p,k);
	else modify(ls,l,mid,p,k),modify(rs,mid+1,r,q,k);
	seg[x]=seg[ls]+seg[rs];
}

LinearBase query(int x,int l,int r,int s,int t){
	if(l==s&&r==t)return seg[x];
	int mid=(l+r)>>1,ls=x<<1,rs=ls|1;
	if(t<=mid)return query(ls,l,mid,s,t);
	if(s>mid)return query(rs,mid+1,r,s,t);
	LinearBase w=query(ls,l,mid,s,mid);
	if((1ll<<w.m)>mx)return w;
	return w+query(rs,mid+1,r,mid+1,t);
}

int sum[N];
void add(int x,int u){while(x<=n)sum[x]^=u,x+=lowbit(x);}
int ask(int x){int r=0;while(x)r^=sum[x],x-=lowbit(x);return r;}

int main(){
	gi(n),gi(q);
	for(int i=1,s=0;i<=n;i++)gi(a[i]),add(i,a[i]),add(i+1,a[i]);
	for(int i=n;i>=1;i--)mx=max(mx,a[i]^=a[i-1]);
	build(1,1,n);
	for(int i=1,op,l,r,k;i<=q;i++){
		gi(op);gi(l);gi(r);
		if(op==1){
			gi(k);modify(1,1,n,l,k);
			if(r<n)modify(1,1,n,r+1,k);
			add(l,k);add(r+1,k);
		}else{
			if(l<r)ans=query(1,1,n,l+1,r);else ans.clear();
			ans.ext(ask(l));
			print(1<<ans.m);
			putc('\n');
		}
	}
	io::flush();
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
using LL = int64_t;
using LD = long double;
const LL INF = 0x3f3f3f3f;
const LL mod = 1e9 + 7;

template <typename T>
struct LnBase {
    int sz, szc;
    vector<T> x;
    LnBase() { sz = sizeof(T) << 3; szc = 0; x.resize(sz); }
    void clear() { fill(x.begin(), x.end(), 0); }
    T operator[](int h) const { return x[h]; }
    LnBase<T> operator+ (const LnBase<T>& e) const {
        LnBase<T> tmp = e;
        for (int i = 0; i < sz; i++) tmp.insert(x[i]);
        return tmp;
    }
    LnBase<T>& operator+= (const LnBase<T>& e) {
        for (int i = 0; i < sz; i++) insert(e[i]);
        return *this;
    }
    int insert(T v) {
        for (int i = sz - 1; i >= 0; i--) {
            if (v >> i & 1) {
                if (!x[i]) { x[i] = v; szc++; return i; }
                v ^= x[i];
            }
        }
        return -1;
    }
};

template <typename T>
class zkwSeg {
 private:
     int n;
     struct node { T v; LnBase<T> b; };
     vector<node> tr;
     node op(const node& x, const node& y) {
         node tmp;
         tmp.v = x.v ^ y.v;
         tmp.b = x.b + y.b;
         return tmp;
     }
     void pu(int x) { tr[x] = op(tr[x << 1], tr[x << 1 | 1]); }

 public:
     zkwSeg() {}
     zkwSeg(int n) : n(n) { tr.resize(2 * n); }
     zkwSeg(const vector<T>& a) : zkwSeg(a.size()) {
         for (int i = 0; i < n; i++) tr[n + i].v = a[i], tr[n + i].b.insert(a[i]);
         for (int i = n - 1; i; i--) pu(i);
     }
     void upd(int k, T& x) {
         k += n; tr[k].v ^= x; tr[k].b.clear(); tr[k].b.insert(tr[k].v); k >>= 1;
         while (k) pu(k), k >>= 1;
     }
     T que(int r) {
         int l = 0; T ans = 0;
         for (l += n, r += n; l < r; l >>= 1, r >>= 1) {
             if (l & 1) ans ^= tr[l++].v;
             if (r & 1) ans ^= tr[--r].v;
         }
         return ans;
     }
     LnBase<int> que(int l, int r) {
         LnBase<int> ans;
         for (l += n, r += n; l < r; l >>= 1, r >>= 1) {
             if (l & 1) ans += tr[l++].b;
             if (r & 1) ans += tr[--r].b;
         }
         return ans;
     }
};

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    int n, q;
    cin >> n >> q;
    vector<int> a(n);
    for (auto& i : a) cin >> i;
    for (int i = n - 1; i > 0; i--) a[i] ^= a[i - 1];
    zkwSeg<int> tr(a);
    while (q--) {
        int op, l, r, k;
        cin >> op >> l >> r;
        if (op == 1) {
            cin >> k;
            l--;
            tr.upd(l, k);
            if (r < n) tr.upd(r, k);
        } else {
            auto tmp = tr.que(l, r);
            tmp.insert(tr.que(l));
            cout << (1 << tmp.szc) << '\n';
        }
    }
}


#include <bits/stdc++.h>
using namespace std;
using LL = int64_t;
using LD = long double;
const LL INF = 0x3f3f3f3f;
const LL mod = 1e9 + 7;

template <typename T>
struct LnBase {
    int sz, szc;
    vector<T> x;
    vector<int> y;
    LnBase() { sz = sizeof(T) << 3; szc = 0; x.resize(sz); y.resize(sz); }
    T operator[](int h) const { return x[h]; }
    LnBase<T> operator+ (const LnBase<T>& e) const {
        LnBase<T> tmp = e;
        for (int i = 0; i < sz; i++) tmp.insert(x[i]);
        return tmp;
    }
    int insert(T v) {
        for (int i = sz - 1; i >= 0; i--) {
            if (v >> i & 1) {
                if (!x[i]) { x[i] = v; szc++; return i; }
                v ^= x[i];
            }
        }
        return -1;
    }
};

template <typename T>
class zkwSeg {
 private:
     int n;
     struct node { T v; LnBase<T> b; };
     vector<node> tr;
     node op(const node& x, const node& y) {
         node tmp;
         tmp.v = x.v ^ y.v;
         tmp.b = x.b + y.b;
         return tmp;
     }
     void pu(int x) { tr[x] = op(tr[x << 1], tr[x << 1 | 1]); }

 public:
     zkwSeg() {}
     zkwSeg(int n) : n(n) { tr.resize(2 * n); }
     zkwSeg(const vector<T>& a) : zkwSeg(a.size()) {
         for (int i = 0; i < n; i++) tr[n + i].v = a[i], tr[n + i].b.insert(a[i]);
         for (int i = n - 1; i; i--) pu(i);
     }
     void upd(int k, T& x) {
         k += n; tr[k].v ^= x; tr[k].b = LnBase<int>(); tr[k].b.insert(tr[k].v); k >>= 1;
         while (k) pu(k), k >>= 1;
     }
     T que(int r) {
         int l = 0; T ans = 0;
         for (l += n, r += n; l < r; l >>= 1, r >>= 1) {
             if (l & 1) ans ^= tr[l++].v;
             if (r & 1) ans ^= tr[--r].v;
         }
         return ans;
     }
     LnBase<int> que(int l, int r) {
         LnBase<int> ans;
         for (l += n, r += n; l < r; l >>= 1, r >>= 1) {
             if (l & 1) ans = ans + tr[l++].b;
             if (r & 1) ans = tr[--r].b + ans;
         }
         return ans;
     }
};

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    int n, q;
    cin >> n >> q;
    vector<int> a(n);
    for (auto& i : a) cin >> i;
    for (int i = n - 1; i > 0; i--) a[i] ^= a[i - 1];
    zkwSeg<int> tr(a);
    while (q--) {
        int op, l, r, k;
        cin >> op >> l >> r;
        if (op == 1) {
            cin >> k;
            l--;
            tr.upd(l, k);
            if (r < n) tr.upd(r, k);
        } else {
            auto tmp = tr.que(l, r);
            tmp.insert(tr.que(l));
            cout << (1 << tmp.szc) << '\n';
        }
    }
}


#include <bits/stdc++.h>
using namespace std;
using LL = int64_t;
using LD = long double;
const LL INF = 0x3f3f3f3f;
const LL mod = 1e9 + 7;

template <typename T>
struct LnBase {
    int sz, szc;
    vector<T> x;
    vector<int> y;
    LnBase() { sz = sizeof(T) << 3; szc = -1; x.resize(sz); y.resize(sz); }
    T operator[](int h) const { return x[h]; }
    LnBase<T> operator+ (const LnBase<T>& e) const {
        LnBase<T> tmp;
        for (int i = 0; i < sz; i++) tmp.insert(x[i]), tmp.insert(e[i]);
        return tmp;
    }
    int insert(T v) {
        for (int i = sz - 1; i >= 0; i--) {
            if (v >> i & 1) {
                if (!x[i]) { x[i] = v; szc = -1; return i; }
                v ^= x[i];
            }
        }
        return -1;
    }
    int find(T v) {
        for (int i = sz - 1; i >= 0; i--) {
            if (v >> i & 1 && x[i]) v ^= x[i];
            if (!v) return 1;
        }
        return 0;
    }
    T Max(T s = 0) {
        for (int i = sz - 1; i >= 0; i--) { s = max(s, s ^ x[i]); }
        return s;
    }
    T Min() {
        for (int i = 0; i < sz; i++) if (x[i]) return x[i];
        return 0;
    }
    T Min(T s) {
        for (int i = sz - 1; i >= 0; i--) { s = min(s, s ^ x[i]); }
        return s;
    }
    void Canonicity() {
        for (int i = sz - 1; i > 0; i--) {
            for (int j = i - 1; j >= 0; j--) {
                if (x[i] >> j & 1) x[i] ^= x[j];
            }
        }
        szc = 0;
        for (int i = 0; i < sz; i++) if (x[i]) y[szc++] = i;
    }
    T Kth(T K) { // <, from 1
        if (szc < 0) Canonicity();
        if (K >= (T)1 << szc) return -1;
        T s = 0;
        for (int i = szc - 1; i >= 0; i--) if (K >> i & 1) s ^= x[y[i]];
        return s;
    }
};

template <typename T>
class zkwSeg {
 private:
     int n;
     struct node { T v; LnBase<T> b; };
     vector<node> tr;
     node op(const node& x, const node& y) {
         node tmp;
         tmp.v = x.v ^ y.v;
         tmp.b = x.b + y.b;
         return tmp;
     }
     void pu(int x) { tr[x] = op(tr[x << 1], tr[x << 1 | 1]); }

 public:
     zkwSeg() {}
     zkwSeg(int n) : n(n) { tr.resize(2 * n); }
     zkwSeg(const vector<T>& a) : zkwSeg(a.size()) {
         for (int i = 0; i < n; i++) tr[n + i].v = a[i], tr[n + i].b.insert(a[i]);
         for (int i = n - 1; i; i--) pu(i);
     }
     void upd(int k, T& x) {
         k += n; tr[k].v ^= x; tr[k].b = LnBase<int>(); tr[k].b.insert(tr[k].v); k >>= 1;
         while (k) pu(k), k >>= 1;
     }
     T que(int r) {
         int l = 0; T ans = 0;
         for (l += n, r += n; l < r; l >>= 1, r >>= 1) {
             if (l & 1) ans ^= tr[l++].v;
             if (r & 1) ans ^= tr[--r].v;
         }
         return ans;
     }
     LnBase<int> que(int l, int r) {
         LnBase<int> ans;
         for (l += n, r += n; l < r; l >>= 1, r >>= 1) {
             if (l & 1) ans = ans + tr[l++].b;
             if (r & 1) ans = tr[--r].b + ans;
         }
         return ans;
     }
};

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    int n, q;
    cin >> n >> q;
    vector<int> a(n);
    for (auto& i : a) cin >> i;
    for (int i = n - 1; i > 0; i--) a[i] ^= a[i - 1];
    zkwSeg<int> tr(a);
    while (q--) {
        int op, l, r, k;
        cin >> op >> l >> r;
        if (op == 1) {
            cin >> k;
            l--;
            tr.upd(l, k);
            if (r < n) tr.upd(r, k);
        } else {
            auto tmp = tr.que(l, r);
            tmp.insert(tr.que(l));
            tmp.Canonicity();
            cout << (1 << tmp.szc) << '\n';
        }
    }
}


#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>
#include <stack>
#include <queue>
#include <set>
#include <map>
using namespace std;
#define MOD
#define ADD(X,Y) ((X) = ((X) + (Y)%MOD) % MOD)
typedef long long i64; typedef vector<int> ivec; typedef vector<string> svec;

vector<int> take_base(vector<int> A)
{
	vector<int> A_ori = A;
	vector<int> ret;
	for (int i = 0; i < A.size(); ++i) {
		if (A[i] == 0) continue;
		ret.push_back(A_ori[i]);
		int core = A[i] & -A[i];
		for (int j = i + 1; j < A.size(); ++j) {
			if (A[j] & core) A[j] ^= A[i];
		}
		if (ret.size() >= 30) break;
	}
	return ret;
}

typedef pair<int, vector<int> > even_base;

even_base merge_even_base(even_base A, even_base B)
{
	vector<int> seq;
	for (int i = 0; i < A.second.size(); ++i) seq.push_back(A.second[i]);
	seq.push_back(B.first ^ A.first);
	for (int i = 0; i < B.second.size(); ++i) seq.push_back(B.second[i] ^ B.first ^ A.first);
	return{ A.first, take_base(seq) };
}

const int DEPTH = 18;
const int OFS = 1 << DEPTH;
int N, Q;
int A[505050];
even_base segtree[1 << 19];
i64 lazy[1 << 19];

void propagate(int p)
{
//	printf("propagate %d: %d\n", p, lazy[p]);
	lazy[p * 2] ^= lazy[p];
	segtree[p * 2].first ^= lazy[p];
	lazy[p * 2 + 1] ^= lazy[p];
	segtree[p * 2 + 1].first ^= lazy[p];
	lazy[p] = 0;
}

void show_even_base(even_base &b)
{
	printf("%d,", b.first);
	for (int v : b.second) printf(" %d", v);
	puts("");
}

void update(int p, int qL, int qR, int X, int dep = DEPTH)
{
	int pL = p << dep, pR = (p + 1) << dep;
	if (qR <= pL || pR <= qL) return;
	if (qL <= pL && pR <= qR) {
		lazy[p] ^= X;
		segtree[p].first ^= X;
		return;
	}
	propagate(p);
	update(p * 2, qL, qR, X, dep - 1);
	update(p * 2 + 1, qL, qR, X, dep - 1);
	segtree[p] = merge_even_base(segtree[p * 2], segtree[p * 2 + 1]);
//	printf("%d -> ", p);
//	show_even_base(segtree[p]);
}

even_base fold(int p, int qL, int qR, int dep = DEPTH)
{
	int pL = p << dep, pR = (p + 1) << dep;
	if (qR <= pL || pR <= qL) return{ 0, {} };
	if (qL <= pL && pR <= qR) {
		return segtree[p];
	}
	propagate(p);
	return merge_even_base(fold(p * 2, qL, qR, dep - 1), fold(p * 2 + 1, qL, qR, dep - 1));
}

int main()
{
	scanf("%d%d", &N, &Q);
	for (int i = 0; i < N; ++i) {
		scanf("%d", A + i);
	}
	if (!true) {
		N = 200000;
		for (int i = 0; i < N; ++i) A[i] = (1 << 30) - 2 - i;
	}
	for (int i = 0; i < OFS; ++i) {
		if (i < N) segtree[i + OFS] = make_pair(A[i], vector<int>());
		else segtree[i + OFS] = make_pair(0, vector<int>());
	}
	for (int i = OFS - 1; i >= 1; --i) segtree[i] = merge_even_base(segtree[i * 2], segtree[i * 2 + 1]);
//	printf("%d", segtree[1].first);
//	for (int v : segtree[1].second) printf(" %d", v);
//	puts("");

	for (int i = 0; i < Q; ++i) {
		int t;
		scanf("%d", &t);
		if (t == 1) {
			int l, r, k;
			scanf("%d%d%d", &l, &r, &k);
			--l;
			update(1, l + OFS, r + OFS, k);
		} else {
			int l, r;
			scanf("%d%d", &l, &r);
			--l;
			even_base b = fold(1, l + OFS, r + OFS);
			b.second.push_back(b.first);
//			show_even_base(b);
			printf("%d\n", 1 << (take_base(b.second).size()));
		}
	}
	return 0;
}


//You're uninvited..
#include<bits/stdc++.h>

using namespace std;

typedef long long ll;

#define F first
#define S second

const int MAXN = 2e5 + 10;
const int C = 30 + 1;

int n, a[MAXN], fen[MAXN];
vector<int>	weed[4 * MAXN], nl;

void xr(int v, int x){for (v++; v<MAXN; v+=v&-v) fen[v]^=x;}
int getVal(int v){int ret = 0; for (; v; v-=v&-v) ret^=fen[v]; return ret;}
int getA(int v){return a[v]^getVal(v+1);}

void mix(vector<int> &vec){
	int sz = vec.size();
	int cur = 0;
	for (int i = C-1; ~i && cur < sz; i--){
		int ind = max_element(vec.begin()+cur, vec.end()) - vec.begin();
		swap(vec[cur], vec[ind]);
		if (vec[cur]>>i&1){
			for (int j = 0; j < sz; j++)
				if (j^cur && vec[j]>>i&1)
					vec[j]^=vec[cur];
			cur++;
		}
	}
	while (vec.size() && !vec.back())	vec.pop_back();
}

vector<int>	sprout(vector<int> a, vector<int> b){
	vector<int>	ret;
	ret.reserve(a.size() + b.size());
	for (auto x:a)	ret.push_back(x);
	for (auto x:b)	ret.push_back(x);
	mix(ret);
	return ret;
}

void plant(int v, int b, int e){
	if (e - b == 1){
		if (b)
			weed[v].push_back(a[b]^a[b-1]);
		return;
	}

	int mid = b + e >> 1;
	plant(v<<1, b, mid);
	plant(v<<1^1, mid, e);
	weed[v] = sprout(weed[v<<1], weed[v<<1^1]);
}

void water(int v, int b, int e, int pos, int val){
	if (e-b==1){
		weed[v].clear();
		weed[v].push_back(val);
		return;
	}

	int mid = b + e >> 1;
	if (pos < mid)
		water(v<<1, b, mid, pos, val);
	else
		water(v<<1^1, mid, e, pos, val);
	weed[v] = sprout(weed[v<<1], weed[v<<1^1]);
}

vector<int>	smoke(int v, int b, int e, int l, int r){
	if (l <= b && e <= r)	return weed[v];
	if (r <= b || e <= l)	return nl;

	int mid = b+e>>1;
	return sprout(smoke(v<<1, b, mid, l, r), smoke(v<<1^1, mid, e, l, r));
}

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	int q;	cin >> n >> q;
	for (int i = 0; i < n; i++)	cin >> a[i];
	plant(1, 0, n);

	while (q--){
		int type;	cin >> type;
		if (type - 1){
			int l, r;	cin >> l >> r, l--;
			vector<int>	vec = smoke(1, 0, n, l+1, r);
			vec.push_back(getA(l));
			mix(vec);
			cout << (1<<(int)vec.size()) << "\n";
		}
		else{
			int l, r, x;	cin >> l >> r >> x, l--;
			xr(l, x), xr(r, x);
			if (l)
				water(1, 0, n, l, getA(l-1)^getA(l));
			if (r<n)
				water(1, 0, n, r, getA(r-1)^getA(r));
		}
	}
	return 0;
}


#include<bits/stdc++.h>
#include<string>

typedef  long long int ll;
typedef  long double ld;
#define sync ios_base::sync_with_stdio(false); cin.tie(NULL)
#define input(arr,n) for(ll i1=0;i1<n;i1++ )cin>>arr[i1]
#define mod 1000000007
#define F first
#define S second
using namespace std;

int main()
{
    sync;
    int t;
    cin>>t;
    while(t--)
    {
        ll arr[3];
        input(arr,3);
        sort(arr,arr+3);
        if(arr[0]!=arr[3-1])
            cout<<"YES\n"<<arr[3-1]<<" "<<arr[0]<<" "<<0<<"\n";
        else
            cout<<"NO\n";
    }
    return 0;
}


#include<bits/stdc++.h>
#include<string>

typedef  long long int ll;
typedef  long double ld;
#define sync ios_base::sync_with_stdio(false); cin.tie(NULL)
#define input(arr,n) for(ll i1=0;i1<n;i1++ )cin>>arr[i1]
#define mod 1000000007
#define F first
#define S second
using namespace std;

int main()
{
    sync;
    int t;
    cin>>t;
    while(t--)
    {
        ll x,y,z;
        cin>>x>>y>>z;
        if(x!=y && y!=z && x!=z){
            cout<<"NO\n";
            continue;
        }
        if(y<x) swap(x,y);
        if(z<y) swap(z,y);
        if(y==z)
            cout<<"YES\n"<<z<<" "<<y<<" "<<x<<"\n";
        if(x==y && y!=z)
            cout<<"NO\n";
    }
    return 0;
}


#include<bits/stdc++.h>
#include<string>

typedef  long long int ll;
typedef  long double ld;
#define sync ios_base::sync_with_stdio(false); cin.tie(NULL)
#define input(arr,n) for(ll i1=0;i1<n;i1++ )cin>>arr[i1]
#define mod 1000000007
#define F first
#define S second
using namespace std;

int main()
{
    sync;
    int t;
    cin>>t;
    while(t--)
    {
        ll arr[3];
        input(arr,3);
        sort(arr,arr+3);
        if(arr[1]!=arr[3-1])
            cout<<"YES\n"<<arr[3-1]<<" "<<arr[0]<<" "<<1<<"\n";
        else
            cout<<"NO\n";
    }
    return 0;
}


#include<stdio.h>
#include<iostream>
#include<bits/stdc++.h>
#include<vector>
#include<iterator>
#include<algorithm>
#include<iomanip>
#include <string.h>
#define ll long long int
using namespace std;
int main() {
	ll t;
	cin >> t;
	while(t--){
	    ll n,i,a;
	    cin >> n;
	    vector <int> vec,w;

	    for(i=0;i<n*2;i++){
	        cin >> a;
	        vec.push_back(a);
	    }
	    for(i=0; i<n*2; i++){
	        ll v=0;
	        for(ll j=0;j<i;j++){
	            if(vec[i]==vec[j]) v++;
	        }
	        if(v==0)w.push_back(vec[i]);
	    }
	    for(i=0; i < w.size() ;i++){
	        cout << w[i] << " ";
	    }
	    cout << endl;

	}
}


#include<stdio.h>
#include<iostream>
#include<bits/stdc++.h>
#include<vector>
#include<iterator>
#include<algorithm>
#include<iomanip>
#include <string.h>
#define ll long long int
using namespace std;
int main() {
	ll t;
	cin >> t;
	while(t--){
	    ll a,b,c;
	    cin >> a >> b >> c;
	    if(a==b && b==c && c==a){
	        cout << "YES" << endl;
	        cout << a << " " << b << " " << c<<endl;
	   }
	   else if((a < b && a < c) && (b==c))
	   {
	       cout << "YES" << endl;
	       cout << a << " " << a <<  " " << b << endl;
	   }
	   else if(a > b && a == c){
	       cout << "YES" << endl;
	       cout << a << " " << b << " " << c-b << endl;
	   }

	    else{
	        cout << "NO" << endl;
	    }
	}

    return 0;

}


#include<stdio.h>
#include<iostream>
#include<bits/stdc++.h>
#include<vector>
#include<iterator>
#include<algorithm>
#include<iomanip>
#include <string.h>
#define ll long long int
using namespace std;
int main() {
	ll t;
	cin >> t;
	while(t--){
	    ll a,b,c;
	    cin >> a >> b >> c;
	    if(a==b && b==c && c==a){
	        cout << "YES" << endl;
	        cout << max(a,b) << " " << max(b, c) << " " << max(a,c)<<endl;
	   }
	   else if((a < b && a < c) && (b==c))
	   {
	       cout << "YES" << endl;
	       cout << a << " " << b <<  " " << max(a,c)<< endl;
	   }
	   else if(a > b && a == c && c > b){
	       cout << "YES" << endl;
	       cout <<max(a,b) << " " <<  b << " " <<max(a,c)-b << endl;
	   }

	    else{
	        cout << "NO" << endl;
	    }
	}

    return 0;

}


#include<stdio.h>
#include<iostream>
#include<bits/stdc++.h>
#include<vector>
#include<iterator>
#include<algorithm>
#include<iomanip>
#include <string.h>
#define ll long long int
using namespace std;
int main() {
	ll t;
	cin >> t;
	while(t--){
	    ll a,b,c;
	    cin >> a >> b >> c;
	    if(a==b && b==c && c==a){
	        cout << "YES" << endl;
	        cout << a << " " << a << " " << a <<endl;
	   }
	   else if(a < b && a < c && b==c)
	   {
	       cout << "YES" << endl;
	       cout << a << " " << a <<  " " << c << endl;
	   }
	   else if(a > b && b < c && a == c){
	       cout << "YES" << endl;
	       cout << a << " " << b << " " << c-b << endl;
	   }

	    else{
	        cout << "NO" << endl;
	    }
	}

    return 0;

}


#include<stdio.h>
#include<iostream>
#include<bits/stdc++.h>
#include<vector>
#include<iterator>
#include<algorithm>
#include<iomanip>
#include <string.h>
#define ll long long int
using namespace std;
int main() {
	ll t;
	cin >> t;
	while(t--){
	    ll a,b,c;
	    cin >> a >> b >> c;
	    if(a==b){
	        cout << "YES" << endl;
	        cout << a << " " << a << " " << a <<endl;
	   }
	   else if(a > b && b < c && a == c){
	       cout << "YES" << endl;
	       cout << b << " " << b << " " << a  << endl;
	   }
	   else if(a < b && a < c && b==c)
	   {
	       cout << "YES" << endl;
	       cout << a << " " << a <<  " " << b << endl;
	   }
	   else if(a==b && a > c && b > c)
	   {
	       cout << "YES" << endl;
	       cout << c << " " << c <<  " " << a << endl;
	   }
	   else{
	        cout << "NO" << endl;
	    }
	}

    return 0;

}


#include<stdio.h>
#include<iostream>
#include<bits/stdc++.h>
#include<vector>
#include<iterator>
#include<algorithm>
#include<iomanip>
#include <string.h>
#define ll long long int
using namespace std;
int main() {
	ll t;
	cin >> t;
	while(t--){
	    ll a,b,c;
	    cin >> a >> b >> c;
	    if(a==b && b==c && c==a){
	        cout << "YES" << endl;
	        cout << max(a,b) << " " << max(b, c) << " " << max(a,c)<<endl;
	   }
	   else if((a < b && a < c) && (b==c))
	   {
	       cout << "YES" << endl;
	       cout << min(a,b) << " " << min(a,b) <<  " " << max(a,c)<< endl;
	   }
	   else if(a > b && a == c && c > b){
	       cout << "YES" << endl;
	       cout <<max(a,b) << " " <<  min(b,c) << " " <<max(a,c)-min(a,b) << endl;
	   }

	    else{
	        cout << "NO" << endl;
	    }
	}

    return 0;

}


#include<stdio.h>
#include<iostream>
#include<bits/stdc++.h>
#include<vector>
#include<iterator>
#include<algorithm>
#include<iomanip>
#include <string.h>
#define ll long long int
using namespace std;
int main() {
	ll t;
	cin >> t;
	while(t--){
	    ll a,b,c;
	    cin >> a >> b >> c;
	    if(a==b && b==c && c==a){
	        cout << "YES" << endl;
	        cout << a << " " << a << " " << a <<endl;
	   }
	   else if(a > b && b < c && a == c){
	       cout << "YES" << endl;
	       cout << b << " " << b << " " << a  << endl;
	   }
	   else if(a < b && a < c && b==c)
	   {
	       cout << "YES" << endl;
	       cout << a << " " << a <<  " " << b << endl;
	   }
	   else if(a==b && a > c && b > c)
	   {
	       cout << "YES" << endl;
	       cout << c << " " << c <<  " " << a << endl;
	   }
	   else{
	        cout << "NO" << endl;
	    }
	}

    return 0;

}


#include<stdio.h>
#include<iostream>
#include<bits/stdc++.h>
#include<vector>
#include<iterator>
#include<algorithm>
#include<iomanip>
#include <string.h>
#define ll long long int
using namespace std;
int main() {
	ll t;
	cin >> t;
	while(t--){
	    ll a,b,c;
	    cin >> a >> b >> c;
	    if(a==b && b==c && c==a){
	        cout << "YES" << endl;
	        cout << a << " " << b << " " << c<<endl;
	   }
	   else if((a < b && a < c) && (b==c))
	   {
	       cout << "YES" << endl;
	       cout << a << " " << a <<  " " << c << endl;
	   }
	   else if(a > b && a == c){
	       cout << "YES" << endl;
	       cout << a << " " << b << " " << c-b << endl;
	   }

	    else{
	        cout << "NO" << endl;
	    }
	}

    return 0;

}


#include<stdio.h>
#include<iostream>
#include<bits/stdc++.h>
#include<vector>
#include<iterator>
#include<algorithm>
#include<iomanip>
#include <string.h>
#define ll long long int
using namespace std;
int main() {
	ll t;
	cin >> t;
	while(t--){
	    ll a,b,c;
	    cin >> a >> b >> c;
	    if(a==b && b==c && c==a){
	        cout << "YES" << endl;
	        cout << a << " " << b << " " << c<<endl;
	   }
	   else if((a < b && a < c) && (b==c))
	   {
	       cout << "YES" << endl;
	       cout << a << " " << a <<  " " << b << endl;
	   }
	   else if(a > b && a == c && c > b){
	       cout << "YES" << endl;
	       cout << a << " " << b << " " << a-b << endl;
	   }

	    else{
	        cout << "NO" << endl;
	    }
	}

    return 0;

}


#include<bits/stdc++.h>
//#include<boost/multiprecision/cpp_int.hpp>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>

#define ull unsigned long long int
#define ll long long
#define FOR(i,n) for(int i = 0;i<n ;i++)
#define ii pair<int,int>
#define vii vector<ii>
#define vi vector<int>
#define mii map<int,int>
#define uii unordered_map<int,int>
#define all(x) x.begin(),x.end()
#define ff first
#define ss second
#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define endl "\n"

#define pb push_back
#define MOD 1e9+7
#define INF 0x3f3f3f3f
#define print(x) cout<<x<<"\n";

//typedef tree<pair<int,int>,null_type,
//less<pair<int,int>>,rb_tree_tag,tree_order_statistics_node_update>   ordered_set;

//(UNCOMMENT WHEN HAVING LOTS OF RECURSIONS)\
#pragma comment(linker, "/stack:200000000")
//(UNCOMMENT WHEN NEEDED)\
#pragma GCC optimize("Ofast,unroll-loops,no-stack-protector,fast-math")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//#pragma GCC optimize("O3")
//uncoment for large int requirement

//using boost::multiprecision::cpp_int;
//using namespace _gnu_pbds;
using namespace std;
struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};
//use it with unordered_map<T,T,custom_hash> safe_map
int dx[]={-1,0,1,0};
int dy[]={0,1,0,-1};

int main()
{fast_io
#ifndef ONLINE_JUDGE
freopen("in.txt","r",stdin);
freopen("out.txt","w",stdout);
#endif
int t;
cin>>t;
while(t--){
int x,y,z;bool ok = true;
cin>>x>>y>>z;
if((x!=y)&&(y!=z)&&(x!=z))
{//cout<<8;
    cout<<"NO"<<endl;
    continue;
}
int a,b,c;
if(x==y and z>x)
ok = false;
else
b=1,a=x,c=z;

if(y==z and x>y)
ok = false;
else
b=y,c=1,a=x;
if(x==z and y>z)
ok = false;
else
b=z,a=1,c=y;

if(ok){
cout<<"YES"<<endl;
cout<<a<<" "<<b<<" "<<c<<endl;}
else
cout<<"NO"<<endl;
}}


#include<bits/stdc++.h>
//#include<boost/multiprecision/cpp_int.hpp>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>

#define ull unsigned long long int
#define ll long long
#define FOR(i,n) for(int i = 0;i<n ;i++)
#define ii pair<int,int>
#define vii vector<ii>
#define vi vector<int>
#define mii map<int,int>
#define uii unordered_map<int,int>
#define all(x) x.begin(),x.end()
#define ff first
#define ss second
#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define endl "\n"

#define pb push_back
#define MOD 1e9+7
#define INF 0x3f3f3f3f
#define print(x) cout<<x<<"\n";

//typedef tree<pair<int,int>,null_type,
//less<pair<int,int>>,rb_tree_tag,tree_order_statistics_node_update>   ordered_set;

//(UNCOMMENT WHEN HAVING LOTS OF RECURSIONS)\
#pragma comment(linker, "/stack:200000000")
//(UNCOMMENT WHEN NEEDED)\
#pragma GCC optimize("Ofast,unroll-loops,no-stack-protector,fast-math")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//#pragma GCC optimize("O3")
//uncoment for large int requirement

//using boost::multiprecision::cpp_int;
//using namespace _gnu_pbds;
using namespace std;
struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};
//use it with unordered_map<T,T,custom_hash> safe_map
int dx[]={-1,0,1,0};
int dy[]={0,1,0,-1};

int main()
{fast_io
#ifndef ONLINE_JUDGE
freopen("in.txt","r",stdin);
freopen("out.txt","w",stdout);
#endif
int t;
cin>>t;
while(t--){
int x,y,z;bool ok = true;
cin>>x>>y>>z;
if((x!=y)&&(y!=z)&&(x!=z))
{//cout<<8;
    cout<<"NO"<<endl;
    continue;
}
int a,b,c;
if(x==y and z>x)
ok = false;
else
b=1,a=x,c=z;

if(y==z and x>y)
ok = false;
else
b=y,c=1,a=x;
if(x==z and y>x)
ok = false;
else
b=1,a=x,c=y;
if(x == y&&z==x &&y==z)
a=x,b=x,c=x;
if(ok){
cout<<"YES"<<endl;
cout<<a<<" "<<b<<" "<<c<<endl;}
else
cout<<"NO"<<endl;
}}


#include<bits/stdc++.h>
//#include<boost/multiprecision/cpp_int.hpp>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>

#define ull unsigned long long int
#define ll long long
#define FOR(i,n) for(int i = 0;i<n ;i++)
#define ii pair<int,int>
#define vii vector<ii>
#define vi vector<int>
#define mii map<int,int>
#define uii unordered_map<int,int>
#define all(x) x.begin(),x.end()
#define ff first
#define ss second
#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define endl "\n"

#define pb push_back
#define MOD 1e9+7
#define INF 0x3f3f3f3f
#define print(x) cout<<x<<"\n";

//typedef tree<pair<int,int>,null_type,
//less<pair<int,int>>,rb_tree_tag,tree_order_statistics_node_update>   ordered_set;

//(UNCOMMENT WHEN HAVING LOTS OF RECURSIONS)\
#pragma comment(linker, "/stack:200000000")
//(UNCOMMENT WHEN NEEDED)\
#pragma GCC optimize("Ofast,unroll-loops,no-stack-protector,fast-math")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//#pragma GCC optimize("O3")
//uncoment for large int requirement

//using boost::multiprecision::cpp_int;
//using namespace _gnu_pbds;
using namespace std;
struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};
//use it with unordered_map<T,T,custom_hash> safe_map
int dx[]={-1,0,1,0};
int dy[]={0,1,0,-1};

int main()
{fast_io
#ifndef ONLINE_JUDGE
freopen("in.txt","r",stdin);
freopen("out.txt","w",stdout);
#endif
int t;
cin>>t;
while(t--){
int x,y,z;bool ok = true;
cin>>x>>y>>z;
if((x!=y)&&(y!=z)&&(x!=z))
{//cout<<8;
    cout<<"NO"<<endl;
    continue;
}
int a,b,c;
if(x==y and z>x)
ok = false;
else
a=x,b=1,c=z;

if(y==z and x>y)
ok = false;
else
a=y,b=1,c=x;
if(x==z and y>x)
ok = false;
else
a=x,b=1,c=y;

if(x == y&&z==x &&y==z)
a=x,b=x,c=x;
if(ok){
cout<<"YES"<<endl;
cout<<a<<" "<<b<<" "<<c<<endl;}
else
cout<<"NO"<<endl;
}}


#include<bits/stdc++.h>
//#include<boost/multiprecision/cpp_int.hpp>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>

#define ull unsigned long long int
#define ll long long
#define FOR(i,n) for(int i = 0;i<n ;i++)
#define ii pair<int,int>
#define vii vector<ii>
#define vi vector<int>
#define mii map<int,int>
#define uii unordered_map<int,int>
#define all(x) x.begin(),x.end()
#define ff first
#define ss second
#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define endl "\n"

#define pb push_back
#define MOD 1e9+7
#define INF 0x3f3f3f3f
#define print(x) cout<<x<<"\n";

//typedef tree<pair<int,int>,null_type,
//less<pair<int,int>>,rb_tree_tag,tree_order_statistics_node_update>   ordered_set;

//(UNCOMMENT WHEN HAVING LOTS OF RECURSIONS)\
#pragma comment(linker, "/stack:200000000")
//(UNCOMMENT WHEN NEEDED)\
#pragma GCC optimize("Ofast,unroll-loops,no-stack-protector,fast-math")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//#pragma GCC optimize("O3")
//uncoment for large int requirement

//using boost::multiprecision::cpp_int;
//using namespace _gnu_pbds;
using namespace std;
struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};
//use it with unordered_map<T,T,custom_hash> safe_map
int dx[]={-1,0,1,0};
int dy[]={0,1,0,-1};

int main()
{fast_io
#ifndef ONLINE_JUDGE
freopen("in.txt","r",stdin);
freopen("out.txt","w",stdout);
#endif
int t;
cin>>t;
while(t--){
int x,y,z;bool ok = true;
cin>>x>>y>>z;
if((x!=y)&&(y!=z)&&(x!=z))
{//cout<<8;
    cout<<"NO"<<endl;
    continue;
}
int a,b,c;
if(x==y and z>x)
ok = false;
else
b=1,a=x,c=z;

if(y==z and x>y)
ok = false;
else
b=y,c=1,a=x;
if(x==z and y>x)
ok = false;
else
b=1,a=x,c=y;

if(ok){
cout<<"YES"<<endl;
cout<<a<<" "<<b<<" "<<c<<endl;}
else
cout<<"NO"<<endl;
}}


#include<bits/stdc++.h>
//#include<boost/multiprecision/cpp_int.hpp>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>

#define ull unsigned long long int
#define ll long long
#define FOR(i,n) for(int i = 0;i<n ;i++)
#define ii pair<int,int>
#define vii vector<ii>
#define vi vector<int>
#define mii map<int,int>
#define uii unordered_map<int,int>
#define all(x) x.begin(),x.end()
#define ff first
#define ss second
#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define endl "\n"

#define pb push_back
#define MOD 1e9+7
#define INF 0x3f3f3f3f
#define print(x) cout<<x<<"\n";

//typedef tree<pair<int,int>,null_type,
//less<pair<int,int>>,rb_tree_tag,tree_order_statistics_node_update>   ordered_set;

//(UNCOMMENT WHEN HAVING LOTS OF RECURSIONS)\
#pragma comment(linker, "/stack:200000000")
//(UNCOMMENT WHEN NEEDED)\
#pragma GCC optimize("Ofast,unroll-loops,no-stack-protector,fast-math")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//#pragma GCC optimize("O3")
//uncoment for large int requirement

//using boost::multiprecision::cpp_int;
//using namespace _gnu_pbds;
using namespace std;
struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};
//use it with unordered_map<T,T,custom_hash> safe_map
int dx[]={-1,0,1,0};
int dy[]={0,1,0,-1};

int main()
{fast_io
#ifndef ONLINE_JUDGE
freopen("in.txt","r",stdin);
freopen("out.txt","w",stdout);
#endif
int t;
cin>>t;
while(t--){
int x,y,z;bool ok = true;
cin>>x>>y>>z;
if((x!=y)&&(y!=z)&&(x!=z))
{//cout<<8;
    cout<<"NO"<<endl;
    continue;
}
int a,b,c;
if(x==y and z>x)
ok = false;
else
b=1,a=x,c=z;

if(y==z and x>y)
ok = false;
else
b=y,c=1,a=x;

if(ok){
cout<<"YES"<<endl;
cout<<a<<" "<<b<<" "<<c<<endl;}
else
cout<<"NO"<<endl;
}}


#include<bits/stdc++.h>
//#include<boost/multiprecision/cpp_int.hpp>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>

#define ull unsigned long long int
#define ll long long
#define FOR(i,n) for(int i = 0;i<n ;i++)
#define ii pair<int,int>
#define vii vector<ii>
#define vi vector<int>
#define mii map<int,int>
#define uii unordered_map<int,int>
#define all(x) x.begin(),x.end()
#define ff first
#define ss second
#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define endl "\n"

#define pb push_back
#define MOD 1e9+7
#define INF 0x3f3f3f3f
#define print(x) cout<<x<<"\n";

//typedef tree<pair<int,int>,null_type,
//less<pair<int,int>>,rb_tree_tag,tree_order_statistics_node_update>   ordered_set;

//(UNCOMMENT WHEN HAVING LOTS OF RECURSIONS)\
#pragma comment(linker, "/stack:200000000")
//(UNCOMMENT WHEN NEEDED)\
#pragma GCC optimize("Ofast,unroll-loops,no-stack-protector,fast-math")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//#pragma GCC optimize("O3")
//uncoment for large int requirement

//using boost::multiprecision::cpp_int;
//using namespace _gnu_pbds;
using namespace std;
struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};
//use it with unordered_map<T,T,custom_hash> safe_map
int dx[]={-1,0,1,0};
int dy[]={0,1,0,-1};

int main()
{fast_io
#ifndef ONLINE_JUDGE
freopen("in.txt","r",stdin);
freopen("out.txt","w",stdout);
#endif
int t;
cin>>t;
while(t--){
int a,b,c;
cin>>a>>b>>c;
int cnt = 0 ;
int mx = max({a,b,c});
if(a==mx)
cnt++;
if(b==mx)
cnt++;
if(c==mx)
cnt++;
if(cnt>=2){
    if(cnt==3)
    {   cout<<"YES\n";
        cout<<mx<<" "<<mx<<" "<<mx<<endl;
        continue;
    }
    if(cnt==2){
        cout<<"YES\n";
        if(a!=mx){
            cout<<a<<" "<<c<<" "<<1<<endl;
        }
        if(b!=mx){
            cout<<b<<" "<<c<<" "<<1<<endl;
        }
        if(c!=mx){
            cout<<c<<" "<<a<<" "<<1<<endl;
        }
    }

}
else
cout<<"NO\n";
}}


#include<bits/stdc++.h>
using namespace std;
/*/-------------------------------- -Defines------------------------------------/*/

//#define int long long
#define float double
#define F first
#define S second
#define pb push_back
#define mp make_pair

#define inf INT_MAX
#define minf INT_MIN

typedef long long ll;
typedef vector<int> intvec;
typedef vector<string> strvec;
typedef vector<char> charvec;
typedef vector<float> floatvec;
typedef pair<int, int> intpair;
typedef stack<int> intstack;
typedef queue<int> intqueue;
typedef map<int, int> intmap;

#define all(A)          A.begin(), A.end()
#define rep(i, n)       int i=-1; while(++i < n)
#define loop(i, n)      for(int i=0; i<n; i++)
#define Loop(i, k, n)   for(int i=k; k<n?i<=n:i>=n; k<n?i++:i--)
#define iterate(it, A)  for(auto it=A.begin(); it!=A.end(); it++)

/*/---------------------------------Code Here-----------------------------------/*/

void solve(){
    int x,y,z; cin>>x>>y>>z;
    int big=max(max(x,y),z);

    int a,b,c;
    if(x==big&&y==big)   a=big;
    else if(y==big&&z==big)  c=big;
    else if(x==big&&z==big)  b=big;
    else{ cout<<"NO\0"<<endl; return;}

    if(a==big){b=z; c=z;}
    else if(c==big){a=x; b=x;}
    else if(b==big){a=y; c=y;}

    cout<<"YES\0"<<endl;
    cout<<a<<" "<<b<<" "<<c<<endl;
}

int32_t main(){
    int T=1; cin>>T;
    Loop(t, 1, T){
        solve();
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
/*/-------------------------------- -Defines------------------------------------/*/

//#define int long long
#define float double
#define F first
#define S second
#define pb push_back
#define mp make_pair

#define inf INT_MAX
#define minf INT_MIN

typedef long long ll;
typedef vector<int> intvec;
typedef vector<string> strvec;
typedef vector<char> charvec;
typedef vector<float> floatvec;
typedef pair<int, int> intpair;
typedef stack<int> intstack;
typedef queue<int> intqueue;
typedef map<int, int> intmap;

#define all(A)          A.begin(), A.end()
#define rep(i, n)       int i=-1; while(++i < n)
#define loop(i, n)      for(int i=0; i<n; i++)
#define Loop(i, k, n)   for(int i=k; k<n?i<=n:i>=n; k<n?i++:i--)
#define iterate(it, A)  for(auto it=A.begin(); it!=A.end(); it++)

/*/---------------------------------Code Here-----------------------------------/*/

void solve(){
    int x,y,z; cin>>x>>y>>z;
    cout<<x<<y<<z<<endl;
    int big=max(max(x,y),z);

    int a,b,c;
    if(x==big&&y==big)   a=big;
    else if(y==big&&z==big)  c=big;
    else if(x==big&&z==big)  b=big;
    else{ cout<<"NO"<<endl; return;}

    if(a==big){b=z; c=z;}
    else if(c==big){a=x; b=x;}
    else if(b==big){a=y; c=y;}

    cout<<"YES"<<endl;
    cout<<a<<" "<<b<<" "<<c<<endl;
}

int32_t main(){
    int T=1; cin>>T;
    Loop(t, 1, T){
        solve();
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
/*/-------------------------------- -Defines------------------------------------/*/

//#define int long long
#define float double
#define F first
#define S second
#define pb push_back
#define mp make_pair

#define inf INT_MAX
#define minf INT_MIN

typedef long long ll;
typedef vector<int> intvec;
typedef vector<string> strvec;
typedef vector<char> charvec;
typedef vector<float> floatvec;
typedef pair<int, int> intpair;
typedef stack<int> intstack;
typedef queue<int> intqueue;
typedef map<int, int> intmap;

#define all(A)          A.begin(), A.end()
#define rep(i, n)       int i=-1; while(++i < n)
#define loop(i, n)      for(int i=0; i<n; i++)
#define Loop(i, k, n)   for(int i=k; k<n?i<=n:i>=n; k<n?i++:i--)
#define iterate(it, A)  for(auto it=A.begin(); it!=A.end(); it++)

/*/---------------------------------Code Here-----------------------------------/*/

void solve(){
   int x,y,z; cin>>x>>y>>z;
   int big=max(max(x,y),z);

   int a,b,c;
   if(x==big&&y==big)   a=big;
   else if(y==big&&z==big)  c=big;
   else if(x==big&&z==big)  b=big;
   else{ cout<<"NO\0"<<endl; return;}

   if(a==big){b=z; c=z;}
   else if(c==big){a=x; b=x;}
   else if(b==big){a=y; c=y;}

   cout<<"YES\0"<<endl;
   cout<<a<<" "<<b<<" "<<c<<endl;
}

int32_t main(){
    int T=1; cin>>T;
    Loop(t, 1, T){
        solve();
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
/*/-------------------------------- -Defines------------------------------------/*/

//#define int long long
#define float double
#define F first
#define S second
#define pb push_back
#define mp make_pair

#define inf INT_MAX
#define minf INT_MIN

typedef long long ll;
typedef vector<int> intvec;
typedef vector<string> strvec;
typedef vector<char> charvec;
typedef vector<float> floatvec;
typedef pair<int, int> intpair;
typedef stack<int> intstack;
typedef queue<int> intqueue;
typedef map<int, int> intmap;

#define all(A)          A.begin(), A.end()
#define rep(i, n)       int i=-1; while(++i < n)
#define loop(i, n)      for(int i=0; i<n; i++)
#define Loop(i, k, n)   for(int i=k; k<n?i<=n:i>=n; k<n?i++:i--)
#define iterate(it, A)  for(auto it=A.begin(); it!=A.end(); it++)

/*/---------------------------------Code Here-----------------------------------/*/

void solve(){
    int x,y,z; cin>>x>>y>>z;
    int big=max(max(x,y),z);

    int a,b,c;
    if(x==big&&y==big)   a=big;
    else if(y==big&&z==big)  c=big;
    else if(x==big&&z==big)  b=big;
    else{ cout<<"NO"<<endl; return;}

    if(a==big){b=z; c=z;}
    else if(c==big){a=x; b=x;}
    else if(b==big){a=y; c=y;}

    cout<<"YES"<<endl;
    cout<<a<<" "<<b<<" "<<c<<endl;
}

int32_t main(){
    int T=1; cin>>T;
    Loop(t, 1, T){
        solve();
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
/*/-------------------------------- -Defines------------------------------------/*/

//#define int long long
#define float double
#define F first
#define S second
#define pb push_back
#define mp make_pair

#define inf INT_MAX
#define minf INT_MIN

typedef long long ll;
typedef vector<int> intvec;
typedef vector<string> strvec;
typedef vector<char> charvec;
typedef vector<float> floatvec;
typedef pair<int, int> intpair;
typedef stack<int> intstack;
typedef queue<int> intqueue;
typedef map<int, int> intmap;

#define all(A)          A.begin(), A.end()
#define rep(i, n)       int i=-1; while(++i < n)
#define loop(i, n)      for(int i=0; i<n; i++)
#define Loop(i, k, n)   for(int i=k; k<n?i<=n:i>=n; k<n?i++:i--)
#define iterate(it, A)  for(auto it=A.begin(); it!=A.end(); it++)

/*/---------------------------------Code Here-----------------------------------/*/

void solve(){
    int x,y,z; cin>>x>>y>>z;
    //cout<<x<<y<<z<<endl;
    int big=max(max(x,y),z);

    int a=0,b=0,c=0;
    if(x==big&&y==big){a=big;}
    else if(y==big&&z==big){c=big;}
    else if(x==big&&z==big){b=big;}
    else{ cout<<"NO"<<endl; return;}

    if(a==big){b=z; c=z;}
    else if(c==big){a=x; b=x;}
    else if(b==big){a=y; c=y;}

    cout<<"YES"<<endl;
    cout<<a<<" "<<b<<" "<<c<<endl;
}

int32_t main(){
    int T=1; cin>>T;
    Loop(t, 1, T){
        solve();
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

template <class T> ostream& operator <<(ostream &os, const vector<T> &V) {
    os << "[ ";
    for(auto v : V) os << v << " ";
    return os << "]";
}

template <class T> ostream& operator <<(ostream &os, const set<T> &S){
    os << "{ ";
    for(auto s:S) os << s << " ";
    return os << "}";
}

template <class T> ostream& operator <<(ostream &os, const unordered_set<T> &S){
    os << "{ ";
    for(auto s:S) os << s << " ";
    return os << "}";
}

template<class L, class R> ostream& operator <<(ostream &os, const pair<L,R> &P) {
    return os << "(" << P.first << "," << P.second << ") ";
}

template<class L, class R> ostream& operator <<(ostream &os, const map<L,R> &M) {
    os << "{ ";
    for(auto m:M) os << "("<<m.first<<":"<<m.second<<") ";
    return os<<"}";
}

template<class T> ostream& operator <<(ostream &os, stack<T> S){
    while(!S.empty()){
        os << S.top() << "\n";
        S.pop();
    }
    return os;
}

template<class T> ostream& operator <<(ostream &os, queue<T> Q){
    while(!Q.empty()){
        os << Q.front() << " ";
        Q.pop();
    }
    return os;
}

/*/-------------------------------- -Defines------------------------------------/*/

#define int long long
#define float double
#define F first
#define S second
#define pb push_back
#define mp make_pair

#define inf INT_MAX
#define minf INT_MIN

typedef long long ll;
typedef vector<int> intvec;
typedef vector<string> strvec;
typedef vector<char> charvec;
typedef vector<float> floatvec;
typedef pair<int, int> intpair;
typedef stack<int> intstack;
typedef queue<int> intqueue;
typedef map<int, int> intmap;

#define all(A)          A.begin(), A.end()
#define rep(i, n)       int i=-1; while(++i < n)
#define loop(i, n)      for(int i=0; i<n; i++)
#define Loop(i, k, n)   for(int i=k; k<n?i<=n:i>=n; k<n?i++:i--)
#define iterate(it, A)  for(auto it=A.begin(); it!=A.end(); it++)

/*/-----------------------------Modular Arithmetic------------------------------/*/

const int mod = 1e9+7;
inline int modulo(int x){
    x = x%mod;
    return x<0? x+mod:x;
}

inline int add(int x, int y){
    x += y;
    return modulo(x);
}

inline int sub(int x, int y){
    x -= y;
    return modulo(x);
}

inline int mul(int x, int y){
    x = x*1ll*y;
    return modulo(x);
}

inline int power(int x, int y){
    if(y==0)    return 1;
    int temp = power(x, y/2);
    temp = mul(temp, temp);
    if(y%2==1)  temp = mul(temp, x);
    return temp;
}

inline int inv(int x){
    return power(x, mod-2);
}

/*/---------------------------------Code Here-----------------------------------/*/

void solve(){
   int x,y,z; cin>>x>>y>>z;
   int big=max(max(x,y),z);

   int a,b,c;
   if(x==big&&y==big)   a=x;
   else if(y==big&&z==big)  c=y;
   else if(x==big&&z==big)  b=x;
   else{ cout<<"NO"<<endl; return;}

   if(a==x){b=z; c=z;}
   else if(c==y){a=x; b=x;}
   else if(b==x){a=y; c=y;}

   cout<<"YES\n"<<a<<" "<<b<<" "<<c<<endl;
}

int32_t main(){
    int T=1; cin>>T;
    Loop(t, 1, T){
        solve();
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
/*/-------------------------------- -Defines------------------------------------/*/

//#define int long long
#define float double
#define F first
#define S second
#define pb push_back
#define mp make_pair

#define inf INT_MAX
#define minf INT_MIN

typedef long long ll;
typedef vector<int> intvec;
typedef vector<string> strvec;
typedef vector<char> charvec;
typedef vector<float> floatvec;
typedef pair<int, int> intpair;
typedef stack<int> intstack;
typedef queue<int> intqueue;
typedef map<int, int> intmap;

#define all(A)          A.begin(), A.end()
#define rep(i, n)       int i=-1; while(++i < n)
#define loop(i, n)      for(int i=0; i<n; i++)
#define Loop(i, k, n)   for(int i=k; k<n?i<=n:i>=n; k<n?i++:i--)
#define iterate(it, A)  for(auto it=A.begin(); it!=A.end(); it++)

/*/---------------------------------Code Here-----------------------------------/*/

void solve(){
    int x,y,z; cin>>x>>y>>z;
    cout<<x<<y<<z<<endl;
    int big=max(max(x,y),z);

    int a=0,b,c;
    if(x==big&&y==big){a=big;}
    else if(y==big&&z==big){c=big;}
    else if(x==big&&z==big){b=big;}
    else{ cout<<"NO"<<endl; return;}

    if(a==big){b=z; c=z;}
    else if(c==big){a=x; b=x;}
    else if(b==big){a=y; c=y;}

    cout<<"YES"<<endl;
    cout<<a<<" "<<b<<" "<<c<<endl;
}

int32_t main(){
    int T=1; cin>>T;
    Loop(t, 1, T){
        solve();
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
/*/-------------------------------- -Defines------------------------------------/*/

//#define int long long
#define float double
#define F first
#define S second
#define pb push_back
#define mp make_pair

#define inf INT_MAX
#define minf INT_MIN

typedef long long ll;
typedef vector<int> intvec;
typedef vector<string> strvec;
typedef vector<char> charvec;
typedef vector<float> floatvec;
typedef pair<int, int> intpair;
typedef stack<int> intstack;
typedef queue<int> intqueue;
typedef map<int, int> intmap;

#define all(A)          A.begin(), A.end()
#define rep(i, n)       int i=-1; while(++i < n)
#define loop(i, n)      for(int i=0; i<n; i++)
#define Loop(i, k, n)   for(int i=k; k<n?i<=n:i>=n; k<n?i++:i--)
#define iterate(it, A)  for(auto it=A.begin(); it!=A.end(); it++)

/*/---------------------------------Code Here-----------------------------------/*/

void solve(){
    int x,y,z; cin>>x>>y>>z;
    //cout<<x<<y<<z<<endl;
    int big=max(max(x,y),z);

    int a=0,b=0,c=0;
    //cout<<a<<" "<<b<<" "<<c<<endl;
    if(x==big&&y==big){a=big;}
    else if(y==big&&z==big){c=big;}
    else if(x==big&&z==big){b=big;}
    else{ cout<<"NO"<<endl; return;}

    if(a==big){b=z; c=z;}
    else if(c==big){a=x; b=x;}
    else if(b==big){a=y; c=y;}

    cout<<"YES"<<endl;
    cout<<a<<" "<<b<<" "<<c<<endl;
}

int32_t main(){
    int T=1; cin>>T;
    Loop(t, 1, T){
        solve();
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
/*/-------------------------------- -Defines------------------------------------/*/

//#define int long long
#define float double
#define F first
#define S second
#define pb push_back
#define mp make_pair

#define inf INT_MAX
#define minf INT_MIN

typedef long long ll;
typedef vector<int> intvec;
typedef vector<string> strvec;
typedef vector<char> charvec;
typedef vector<float> floatvec;
typedef pair<int, int> intpair;
typedef stack<int> intstack;
typedef queue<int> intqueue;
typedef map<int, int> intmap;

#define all(A)          A.begin(), A.end()
#define rep(i, n)       int i=-1; while(++i < n)
#define loop(i, n)      for(int i=0; i<n; i++)
#define Loop(i, k, n)   for(int i=k; k<n?i<=n:i>=n; k<n?i++:i--)
#define iterate(it, A)  for(auto it=A.begin(); it!=A.end(); it++)

/*/---------------------------------Code Here-----------------------------------/*/

void solve(){
    int x,y,z; cin>>x>>y>>z;
    //cout<<x<<y<<z<<endl;
    int big=max(max(x,y),z);

    int a,b,c;
    cout<<a<<" "<<b<<" "<<c<<endl;
    if(x==big&&y==big){a=big;}
    else if(y==big&&z==big){c=big;}
    else if(x==big&&z==big){b=big;}
    else{ cout<<"NO"<<endl; return;}

    if(a==big){b=z; c=z;}
    else if(c==big){a=x; b=x;}
    else if(b==big){a=y; c=y;}

    cout<<"YES"<<endl;
    cout<<a<<" "<<b<<" "<<c<<endl;
}

int32_t main(){
    int T=1; cin>>T;
    Loop(t, 1, T){
        solve();
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
/*/-------------------------------- -Defines------------------------------------/*/

//#define int long long
#define float double
#define F first
#define S second
#define pb push_back
#define mp make_pair

#define inf INT_MAX
#define minf INT_MIN

typedef long long ll;
typedef vector<int> intvec;
typedef vector<string> strvec;
typedef vector<char> charvec;
typedef vector<float> floatvec;
typedef pair<int, int> intpair;
typedef stack<int> intstack;
typedef queue<int> intqueue;
typedef map<int, int> intmap;

#define all(A)          A.begin(), A.end()
#define rep(i, n)       int i=-1; while(++i < n)
#define loop(i, n)      for(int i=0; i<n; i++)
#define Loop(i, k, n)   for(int i=k; k<n?i<=n:i>=n; k<n?i++:i--)
#define iterate(it, A)  for(auto it=A.begin(); it!=A.end(); it++)

/*/---------------------------------Code Here-----------------------------------/*/

void solve(){
   int x,y,z; cin>>x>>y>>z;
   int big=max(max(x,y),z);
   int small=min(min(x,y),z);
   if((big==x&&big==y) || (big==x&&big==z) || (big==y&&big==z))
       cout<<"YES"<<endl<<big<<" "<<small<<" "<<small<<endl;
   else    cout<<"NO"<<endl;

   /*int a,b,c;
   if(x==big&&y==big)   a=big;
   else if(y==big&&z==big)  c=big;
   else if(x==big&&z==big)  b=big;
   else{ cout<<"NO\0"<<endl; return;}

   if(a==big){b=z; c=z;}
   else if(c==big){a=x; b=x;}
   else if(b==big){a=y; c=y;}

   cout<<"YES\0"<<endl;
   cout<<a<<" "<<b<<" "<<c<<endl;*/
}

int32_t main(){
    int T=1; cin>>T;
    Loop(t, 1, T){
        solve();
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
/*/-------------------------------- -Defines------------------------------------/*/

//#define int long long
#define float double
#define F first
#define S second
#define pb push_back
#define mp make_pair

#define inf INT_MAX
#define minf INT_MIN

typedef long long ll;
typedef vector<int> intvec;
typedef vector<string> strvec;
typedef vector<char> charvec;
typedef vector<float> floatvec;
typedef pair<int, int> intpair;
typedef stack<int> intstack;
typedef queue<int> intqueue;
typedef map<int, int> intmap;

#define all(A)          A.begin(), A.end()
#define rep(i, n)       int i=-1; while(++i < n)
#define loop(i, n)      for(int i=0; i<n; i++)
#define Loop(i, k, n)   for(int i=k; k<n?i<=n:i>=n; k<n?i++:i--)
#define iterate(it, A)  for(auto it=A.begin(); it!=A.end(); it++)

/*/---------------------------------Code Here-----------------------------------/*/

void solve(){
    int x,y,z; cin>>x>>y>>z;
    //cout<<x<<y<<z<<endl;
    int big=max(max(x,y),z);

    int a,b,c;
    //cout<<a<<" "<<b<<" "<<c<<endl;
    if(x==big&&y==big){a=big;}
    else if(y==big&&z==big){c=big;}
    else if(x==big&&z==big){b=big;}
    else{ cout<<"NO"<<endl; return;}

    if(a==big){b=z; c=z;}
    else if(c==big){a=x; b=x;}
    else if(b==big){a=y; c=y;}

    cout<<"YES"<<endl;
    cout<<a<<" "<<b<<" "<<c<<endl;
}

int32_t main(){
    int T=1; cin>>T;
    Loop(t, 1, T){
        solve();
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

template <class T> ostream& operator <<(ostream &os, const vector<T> &V) {
    os << "[ ";
    for(auto v : V) os << v << " ";
    return os << "]";
}

template <class T> ostream& operator <<(ostream &os, const set<T> &S){
    os << "{ ";
    for(auto s:S) os << s << " ";
    return os << "}";
}

template <class T> ostream& operator <<(ostream &os, const unordered_set<T> &S){
    os << "{ ";
    for(auto s:S) os << s << " ";
    return os << "}";
}

template<class L, class R> ostream& operator <<(ostream &os, const pair<L,R> &P) {
    return os << "(" << P.first << "," << P.second << ") ";
}

template<class L, class R> ostream& operator <<(ostream &os, const map<L,R> &M) {
    os << "{ ";
    for(auto m:M) os << "("<<m.first<<":"<<m.second<<") ";
    return os<<"}";
}

template<class T> ostream& operator <<(ostream &os, stack<T> S){
    while(!S.empty()){
        os << S.top() << "\n";
        S.pop();
    }
    return os;
}

template<class T> ostream& operator <<(ostream &os, queue<T> Q){
    while(!Q.empty()){
        os << Q.front() << " ";
        Q.pop();
    }
    return os;
}

/*/-------------------------------- -Defines------------------------------------/*/

#define int long long
#define float double
#define F first
#define S second
#define pb push_back
#define mp make_pair

#define inf INT_MAX
#define minf INT_MIN

typedef long long ll;
typedef vector<int> intvec;
typedef vector<string> strvec;
typedef vector<char> charvec;
typedef vector<float> floatvec;
typedef pair<int, int> intpair;
typedef stack<int> intstack;
typedef queue<int> intqueue;
typedef map<int, int> intmap;

#define all(A)          A.begin(), A.end()
#define rep(i, n)       int i=-1; while(++i < n)
#define loop(i, n)      for(int i=0; i<n; i++)
#define Loop(i, k, n)   for(int i=k; k<n?i<=n:i>=n; k<n?i++:i--)
#define iterate(it, A)  for(auto it=A.begin(); it!=A.end(); it++)

/*/-----------------------------Modular Arithmetic------------------------------/*/

const int mod = 1e9+7;
inline int modulo(int x){
    x = x%mod;
    return x<0? x+mod:x;
}

inline int add(int x, int y){
    x += y;
    return modulo(x);
}

inline int sub(int x, int y){
    x -= y;
    return modulo(x);
}

inline int mul(int x, int y){
    x = x*1ll*y;
    return modulo(x);
}

inline int power(int x, int y){
    if(y==0)    return 1;
    int temp = power(x, y/2);
    temp = mul(temp, temp);
    if(y%2==1)  temp = mul(temp, x);
    return temp;
}

inline int inv(int x){
    return power(x, mod-2);
}

/*/---------------------------------Code Here-----------------------------------/*/

void solve(){
   int x,y,z; cin>>x>>y>>z;
   int big=max(max(x,y),z);

   int a,b,c;
   if(x==big&&y==big)   a=x;
   else if(y==big&&z==big)  c=y;
   else if(x==big&&z==big)  b=x;
   else{ cout<<"NO"; return;}

   if(a==x){b=z; c=z;}
   else if(c==y){a=x; b=x;}
   else if(b==x){a=y; c=y;}

   cout<<"YES\n";
   cout<<a<<" "<<b<<" "<<c;
}

int32_t main(){
    int T=1; cin>>T;
    Loop(t, 1, T){
        solve();
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
/*/-------------------------------- -Defines------------------------------------/*/

//#define int long long
#define float double
#define F first
#define S second
#define pb push_back
#define mp make_pair

#define inf INT_MAX
#define minf INT_MIN

typedef long long ll;
typedef vector<int> intvec;
typedef vector<string> strvec;
typedef vector<char> charvec;
typedef vector<float> floatvec;
typedef pair<int, int> intpair;
typedef stack<int> intstack;
typedef queue<int> intqueue;
typedef map<int, int> intmap;

#define all(A)          A.begin(), A.end()
#define rep(i, n)       int i=-1; while(++i < n)
#define loop(i, n)      for(int i=0; i<n; i++)
#define Loop(i, k, n)   for(int i=k; k<n?i<=n:i>=n; k<n?i++:i--)
#define iterate(it, A)  for(auto it=A.begin(); it!=A.end(); it++)

/*/---------------------------------Code Here-----------------------------------/*/

void solve(){
    int x,y,z; cin>>x>>y>>z;
    //cout<<x<<y<<z<<endl;
    int big=max(max(x,y),z);

    int a,b,c;
    if(x==big&&y==big){a=big;}
    else if(y==big&&z==big){c=big;}
    else if(x==big&&z==big){b=big;}
    else{ cout<<"NO"<<endl; return;}

    if(a==big){b=z; c=z;}
    else if(c==big){a=x; b=x;}
    else if(b==big){a=y; c=y;}

    cout<<"YES"<<endl;
    cout<<a<<" "<<b<<" "<<c<<endl;
}

int32_t main(){
    int T=1; cin>>T;
    Loop(t, 1, T){
        solve();
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
/*/-------------------------------- -Defines------------------------------------/*/

//#define int long long
#define float double
#define F first
#define S second
#define pb push_back
#define mp make_pair

#define inf INT_MAX
#define minf INT_MIN

typedef long long ll;
typedef vector<int> intvec;
typedef vector<string> strvec;
typedef vector<char> charvec;
typedef vector<float> floatvec;
typedef pair<int, int> intpair;
typedef stack<int> intstack;
typedef queue<int> intqueue;
typedef map<int, int> intmap;

#define all(A)          A.begin(), A.end()
#define rep(i, n)       int i=-1; while(++i < n)
#define loop(i, n)      for(int i=0; i<n; i++)
#define Loop(i, k, n)   for(int i=k; k<n?i<=n:i>=n; k<n?i++:i--)
#define iterate(it, A)  for(auto it=A.begin(); it!=A.end(); it++)

/*/---------------------------------Code Here-----------------------------------/*/

void solve(){
    int x,y,z; cin>>x>>y>>z;
    //cout<<x<<y<<z<<endl;
    int big=max(max(x,y),z);

    int a=0,b,c;
    if(x==big&&y==big){a=big;}
    else if(y==big&&z==big){c=big;}
    else if(x==big&&z==big){b=big;}
    else{ cout<<"NO"<<endl; return;}

    if(a==big){b=z; c=z;}
    else if(c==big){a=x; b=x;}
    else if(b==big){a=y; c=y;}

    cout<<"YES"<<endl;
    cout<<a<<" "<<b<<" "<<c<<endl;
}

int32_t main(){
    int T=1; cin>>T;
    Loop(t, 1, T){
        solve();
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define ll long long int
#define li long int
#define ld long double
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define W while
#define For(i,s,x) for(i=s;i<x;i++)
#define FOR(i,x) for(i=0;i<x;i++)
#define FoR(i,x) for(i=1;i<=x;i++)
#define fr(i,x) for(i=x;i>=0;i--)
#define pb push_back
#define pp pop_back
#define F first
#define S second
#define mod 1000000007

#define IO ios_base::sync_with_stdio(false);cin.tie(NULL)
#define all(v) v.begin(),v.end()

typedef unsigned long long ull;
typedef pair <int, int> pii;

const int N = 1e5+5;
const int M = 1e5+5;
const int inf = INT_MAX;
const int MOD = 1e7+9;
int main() {
	int t;
	cin>>t;
	W(t--){
	    ll x,y,z,max1=0,max2=0,maxm=0,minm=1000000000,min1=1000000000,min2=1000000000;
	    cin>>x>>y>>z;
	    max1=max(x,y);
	    max2=max(y,z);
	    maxm=max(x,y);

	    min1=min(x,y);
	    min2=min(y,z);
	    minm=min(x,y);
	    int c=0;
	    if(maxm==x){
	        c++;
	    }
	    if(maxm==y){
	        c++;
	   }
	   if(maxm==z){
	        c++;
	   }
	   if(c==3){
	       cout<<"YES"<<endl;
	       cout<<maxm<<" "<<maxm<<" "<<maxm<<endl;
	   }
	   if(c==2){
	       cout<<"YES"<<endl;
	       cout<<maxm<<" "<<minm<<" "<<minm<<endl;
	   }
	   else{
	       cout<<"NO"<<endl;
	   }
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define ll long long int
#define li long int
#define ld long double
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define W while
#define For(i,s,x) for(i=s;i<x;i++)
#define FOR(i,x) for(i=0;i<x;i++)
#define FoR(i,x) for(i=1;i<=x;i++)
#define fr(i,x) for(i=x;i>=0;i--)
#define pb push_back
#define pp pop_back
#define F first
#define S second
#define mod 1000000007

#define IO ios_base::sync_with_stdio(false);cin.tie(NULL)
#define all(v) v.begin(),v.end()

typedef unsigned long long ull;
typedef pair <int, int> pii;

const int N = 1e5+5;
const int M = 1e5+5;
const int inf = INT_MAX;
const int MOD = 1e7+9;
int main() {
	int t;
	cin>>t;
	W(t--){
	    ll x,y,z,max1=0,max2=0,maxm=0,minm=1000000005,min1=1000000005,min2=1000000005;
	    cin>>x>>y>>z;
	    max1=max(x,y);
	    max2=max(y,z);
	    maxm=max(x,y);

	    min1=min(x,y);
	    min2=min(y,z);
	    minm=min(x,y);
	    int c=0;
	    if(maxm==x){
	        c++;
	    }
	    if(maxm==y){
	        c++;
	   }
	   if(maxm==z){
	        c++;
	   }
	   if(c==3){
	       cout<<"YES"<<endl;
	       cout<<maxm<<" "<<maxm<<" "<<maxm<<endl;
	   }
	   else if(c==2){
	       cout<<"YES"<<endl;
	       if(minm==1)
	       cout<<maxm<<" "<<minm<<" "<<minm<<endl;
	       else
	       cout<<maxm<<" "<<minm<<" "<<minm-1<<endl;
	   }
	   else{
	       cout<<"NO"<<endl;
	   }
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define ll long long int
#define li long int
#define ld long double
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define W while
#define For(i,s,x) for(i=s;i<x;i++)
#define FOR(i,x) for(i=0;i<x;i++)
#define FoR(i,x) for(i=1;i<=x;i++)
#define fr(i,x) for(i=x;i>=0;i--)
#define pb push_back
#define pp pop_back
#define F first
#define S second
#define mod 1000000007

#define IO ios_base::sync_with_stdio(false);cin.tie(NULL)
#define all(v) v.begin(),v.end()

typedef unsigned long long ull;
typedef pair <int, int> pii;

const int N = 1e5+5;
const int M = 1e5+5;
const int inf = INT_MAX;
const int MOD = 1e7+9;
int main() {
	int t;
	cin>>t;
	W(t--){
	    ll x,y,z,max1=0,max2=0,maxm=0,minm=1000000005,min1=1000000005,min2=1000000005;
	    cin>>x>>y>>z;
	    max1=max(x,y);
	    max2=max(y,z);
	    maxm=max(x,y);

	    min1=min(x,y);
	    min2=min(y,z);
	    minm=min(x,y);
	    int c=0;
	    if(maxm==x){
	        c++;
	    }
	    if(maxm==y){
	        c++;
	   }
	   if(maxm==z){
	        c++;
	   }
	   if(c==3){
	       cout<<"YES"<<endl;
	       cout<<maxm<<" "<<maxm<<" "<<maxm<<endl;
	   }
	   if(c==2){
	       cout<<"YES"<<endl;
	       if(minm==1)
	       cout<<maxm<<" "<<minm<<" "<<minm<<endl;
	       else
	       cout<<maxm<<" "<<minm<<" "<<minm-1<<endl;
	   }
	   else{
	       cout<<"NO"<<endl;
	   }
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define ll long long int
#define li long int
#define ld long double
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define W while
#define For(i,s,x) for(i=s;i<x;i++)
#define FOR(i,x) for(i=0;i<x;i++)
#define FoR(i,x) for(i=1;i<=x;i++)
#define fr(i,x) for(i=x;i>=0;i--)
#define pb push_back
#define pp pop_back
#define F first
#define S second
#define mod 1000000007

#define IO ios_base::sync_with_stdio(false);cin.tie(NULL)
#define all(v) v.begin(),v.end()

typedef unsigned long long ull;
typedef pair <int, int> pii;

const int N = 1e5+5;
const int M = 1e5+5;
const int inf = INT_MAX;
const int MOD = 1e7+9;
int main() {
	int t;
	cin>>t;
	W(t--){
	    ll x,y,z,max1=0,max2=0,maxm=0,minm=mod,min1=mod,min2=mod;
	    cin>>x>>y>>z;
	    max1=max(x,y);
	    max2=max(y,z);
	    maxm=max(x,y);

	    min1=min(x,y);
	    min2=min(y,z);
	    minm=min(min1,min2);
	    int c=0;
	    if(maxm==x){
	        c++;
	    }
	    if(maxm==y){
	        c++;
	   }
	   if(maxm==z){
	        c++;
	   }
	   if(c==3){
	       cout<<"YES"<<endl;
	       cout<<maxm<<" "<<maxm<<" "<<maxm<<endl;
	   }
	   else if(c==2){
	       cout<<"YESS"<<endl;
	       if(minm==1)
	       cout<<maxm<<" "<<minm<<" "<<minm<<endl;
	       else
	       cout<<maxm<<" "<<minm<<" "<<minm-1<<endl;
	   }
	   else if (c==1){
	       cout<<"NO"<<endl;
	   }
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define ll long long int
#define li long int
#define ld long double
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define W while
#define For(i,s,x) for(i=s;i<x;i++)
#define FOR(i,x) for(i=0;i<x;i++)
#define FoR(i,x) for(i=1;i<=x;i++)
#define fr(i,x) for(i=x;i>=0;i--)
#define pb push_back
#define pp pop_back
#define F first
#define S second
#define mod 1000000007

#define IO ios_base::sync_with_stdio(false);cin.tie(NULL)
#define all(v) v.begin(),v.end()

typedef unsigned long long ull;
typedef pair <int, int> pii;

const int N = 1e5+5;
const int M = 1e5+5;
const int inf = INT_MAX;
const int MOD = 1e7+9;
int main() {
	int t;
	cin>>t;
	W(t--){
	    ll x,y,z,max1=0,max2=0,maxm=0,minm=mod,min1=mod,min2=mod;
	    cin>>x>>y>>z;
	    max1=max(x,y);
	    max2=max(y,z);
	    maxm=max(x,y);

	    min1=min(x,y);
	    min2=min(y,z);
	    minm=min(min1,min2);
	    int c=0;
	    if(maxm==x){
	        c++;
	    }
	    if(maxm==y){
	        c++;
	   }
	   if(maxm==z){
	        c++;
	   }
	   if(c==3){
	       cout<<"YES"<<endl;
	       cout<<maxm<<" "<<maxm<<" "<<maxm<<endl;
	   }
	   else if(c==2){
	       cout<<"YES"<<endl;
	       if(minm==1)
	       cout<<minm<<" "<<minm<<" "<<maxm<<endl;
	       else
	       cout<<minm<<" "<<minm-1<<" "<<maxm<<endl;
	   }
	   else if (c==1){
	       cout<<"NO"<<endl;
	   }
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define ll long long int
#define li long int
#define ld long double
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define W while
#define For(i,s,x) for(i=s;i<x;i++)
#define FOR(i,x) for(i=0;i<x;i++)
#define FoR(i,x) for(i=1;i<=x;i++)
#define fr(i,x) for(i=x;i>=0;i--)
#define pb push_back
#define pp pop_back
#define F first
#define S second
#define mod 1000000007

#define IO ios_base::sync_with_stdio(false);cin.tie(NULL)
#define all(v) v.begin(),v.end()

typedef unsigned long long ull;
typedef pair <int, int> pii;

const int N = 1e5+5;
const int M = 1e5+5;
const int inf = INT_MAX;
const int MOD = 1e7+9;
int main() {
	int t;
	cin>>t;
	W(t--){
	    ll x,y,z,max1=0,max2=0,maxm=0,minm=mod,min1=mod,min2=mod;
	    cin>>x>>y>>z;
	    max1=max(x,y);
	    max2=max(y,z);
	    maxm=max(x,z);

	    min1=min(x,y);
	    min2=min(y,z);
	    minm=min(min1,min2);
	    int c=0;
	    if(maxm==x){
	        c++;
	    }
	    if(maxm==y){
	        c++;
	   }
	   if(maxm==z){
	        c++;
	   }
	   if(c==3){
	       cout<<"YES"<<endl;
	       cout<<maxm<<" "<<maxm<<" "<<maxm<<endl;
	   }
	   else if(c==2){
	       cout<<"YES"<<endl;
	       if(minm==1)
	       cout<<minm<<" "<<minm<<" "<<maxm<<endl;
	       else
	       cout<<minm<<" "<<minm-1<<" "<<maxm<<endl;
	   }
	   else if (c==1){
	       cout<<"NO"<<endl;
	   }
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define ll long long int
#define li long int
#define ld long double
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define W while
#define For(i,s,x) for(i=s;i<x;i++)
#define FOR(i,x) for(i=0;i<x;i++)
#define FoR(i,x) for(i=1;i<=x;i++)
#define fr(i,x) for(i=x;i>=0;i--)
#define pb push_back
#define pp pop_back
#define F first
#define S second
#define mod 1000000007

#define IO ios_base::sync_with_stdio(false);cin.tie(NULL)
#define all(v) v.begin(),v.end()

typedef unsigned long long ull;
typedef pair <int, int> pii;

const int N = 1e5+5;
const int M = 1e5+5;
const int inf = INT_MAX;
const int MOD = 1e7+9;
int main() {
	int t;
	cin>>t;
	W(t--){
	    ll x,y,z,max1=0,max2=0,maxm=0,minm=1000000005,min1=1000000005,min2=1000000005;
	    cin>>x>>y>>z;
	    max1=max(x,y);
	    max2=max(y,z);
	    maxm=max(x,y);

	    min1=min(x,y);
	    min2=min(y,z);
	    minm=min(x,y);
	    int c=0;
	    if(maxm==x){
	        c++;
	    }
	    if(maxm==y){
	        c++;
	   }
	   if(maxm==z){
	        c++;
	   }
	   if(c==3){
	       cout<<"YES"<<endl;
	       cout<<maxm<<" "<<maxm<<" "<<maxm<<endl;
	   }
	   else if(c==2){
	       cout<<"YES"<<endl;
	       if(minm==1)
	       cout<<maxm<<" "<<minm<<" "<<minm<<endl;
	       else
	       cout<<maxm<<" "<<minm<<" "<<minm-1<<endl;
	   }
	   else if (c==1){
	       cout<<"NO"<<endl;
	   }
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define ll long long int
#define li long int
#define ld long double
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define W while
#define For(i,s,x) for(i=s;i<x;i++)
#define FOR(i,x) for(i=0;i<x;i++)
#define FoR(i,x) for(i=1;i<=x;i++)
#define fr(i,x) for(i=x;i>=0;i--)
#define pb push_back
#define pp pop_back
#define F first
#define S second
#define mod 1000000007

#define IO ios_base::sync_with_stdio(false);cin.tie(NULL)
#define all(v) v.begin(),v.end()

typedef unsigned long long ull;
typedef pair <int, int> pii;

const int N = 1e5+5;
const int M = 1e5+5;
const int inf = INT_MAX;
const int MOD = 1e7+9;
int main() {
	int t;
	cin>>t;
	W(t--){
	    ll x,y,z,max1=0,max2=0,maxm=0,minm=mod,min1=mod,min2=mod;
	    cin>>x>>y>>z;
	    max1=max(x,y);
	    max2=max(y,z);
	    maxm=max(max1,max2);

	    min1=min(x,y);
	    min2=min(y,z);
	    minm=min(min1,min2);
	    int c=0;
	    if(maxm==x){
	        c++;
	    }
	    if(maxm==y){
	        c++;
	   }
	   if(maxm==z){
	        c++;
	   }
	   if(c==3){
	       cout<<"YES"<<endl;
	       cout<<maxm<<" "<<maxm<<" "<<maxm<<endl;
	   }
	   else if(c==2){
	       cout<<"YES"<<endl;
	       if(minm==1)
	       cout<<minm<<" "<<minm<<" "<<maxm<<endl;
	       else
	       cout<<minm<<" "<<minm-1<<" "<<maxm<<endl;
	   }
	   else if (c==1){
	       cout<<"NO"<<endl;
	   }
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
ll maxcount(ll x, ll y, ll z)
{
    ll max_val = max( max(x,y) , max(x,z));
    ll count = 0;
    if(x == max_val) count++;
    if(y == max_val) count++;
    if(z == max_val) count++;
    //cout << "count received" << count << endl;
    return count;
}
void solution()
{
    ll a, b, c,    x, y, z;
    cin >> x >> y >> z;
    //cout << x << " " << y << " " << z << " " << endl;
    if(x!=y && y!=z && z!= x) cout << "NO\n";

    else if(maxcount(x,y,z) < 2) cout << "NO\n";

    else
    {
        cout << "YES" << endl;
        cout << x << " " << y << " "<< z << endl;
    }

}

int main()
{
    ll t;
    cin >> t;
    while(t--)
    {
        solution();
    }
}


#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
ll maxcount(ll x, ll y, ll z)
{
    ll max_val = max( max(x,y) , max(x,z));
    ll count = 0;
    if(x == max_val) count++;
    if(y == max_val) count++;
    if(z == max_val) count++;
    //cout << "count received" << count << endl;
    return count;
}
void solution()
{
    ll a, b, c,    x, y, z;
    cin >> x >> y >> z;
    //cout << x << " " << y << " " << z << " " << endl;
    if(x!=y && y!=z && z!= x) cout << "NO\n";

    else if(maxcount(x,y,z) < 2) cout << "NO\n";

    else
    {
        cout << "YES" << endl;
        cout << max(x,y) << " " << min(x,y) << " "<< min(x,y) << endl;
    }

}

int main()
{
    ll t;
    cin >> t;
    while(t--)
    {
        solution();
    }
}


#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
void solution()
{
    ll a, b, c,    x, y, z;
    cin >> x >> y >> z;
    //cout << x << " " << y << " " << z << " " << endl;
    if(x!=y && y!=z && z!= x) cout << "NO\n";

    else if(max(x,y) != max(y,z)) cout << "NO\n";

    else
    {
        cout << "YES" << endl;
        cout << max(x,y) << " " << min(x,y) << " "<< min(x,y) << endl;
    }

}

int main()
{
    ll t;
    cin >> t;
    while(t--)
    {
        solution();
    }
}


#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
ll maxcount(ll x, ll y, ll z)
{
    ll max_val = max( max(x,y) , max(x,z));
    ll count = 0;
    if(x == max_val) count++;
    if(y == max_val) count++;
    if(z == max_val) count++;
    //cout << "count received" << count << endl;
    return count;
}
void solution()
{
    ll a, b, c,    x, y, z;
    cin >> x >> y >> z;
    //cout << x << " " << y << " " << z << " " << endl;
    if(x!=y && y!=z && z!= x) cout << "NO\n";

    else if(maxcount(x,y,z) < 2) cout << "NO\n";

    else
    {
        cout << "YES" << endl;

        int maxv = max(x,y);
        int minv = (min(x,y), min(y,z));
        cout << maxv << " " << minv << " " << minv << endl;

    }

}

int main()
{
    ll t;
    cin >> t;
    while(t--)
    {
        solution();
    }
}


#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
ll maxcount(ll x, ll y, ll z)
{
    ll max_val = max( max(x,y) , max(x,z));
    ll count = 0;
    if(x == max_val) count++;
    if(y == max_val) count++;
    if(z == max_val) count++;
    //cout << "count received" << count << endl;
    return count;
}
void solution()
{
    ll a, b, c,    x, y, z;
    cin >> x >> y >> z;
    //cout << x << " " << y << " " << z << " " << endl;
    if(x!=y && y!=z && z!= x) cout << "NO\n";

    else if(maxcount(x,y,z) < 2) cout << "NO\n";

    else
    {
        cout << "YES" << endl;

        int maxv = max(x,y);
        int minv = min(min(x,y), min(y,z));
        cout << maxv << " " << minv << " " << minv << endl;

    }

}

int main()
{
    ll t;
    cin >> t;
    while(t--)
    {
        solution();
    }
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	long long int t;
	cin>>t;
	while(t--)
    {
        ll x,y,z,a,b,c;
        cin>>x>>y>>z;
        if(y<=x)
        {
          b=x;
          a=y;
          c=y;
        }
        else
        {
            a=x;
            c=y;
            b=x;
        }
        if(max(b,c)!=z)
            cout<<"NO"<<endl;
        if(max(b,c)==z)
        {
            cout<<"YES"<<endl<<a<<" "<<b<<" "<<c<<endl;

        }
    }
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int

int main()
{
    ll t;
    cin>>t;
    while(t--){
            ll ara[4];

    for(int i=1;i<=3;i++)
    {
        cin>>ara[i];
    }
    sort(ara+1,ara+4);
    if(ara[2]!=ara[3]) cout<<"NO"<<endl;
    else
    {
        cout<<"YES"<<endl<<ara[3]<<" "<<ara[1]<<" "<<ara[1]<<endl;
    }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	long long int t;
	cin>>t;
	while(t--)
    {
        ll x,y,z,a,b,c;
        cin>>x>>y>>z;
        if(y<=x)
        {
          b=x;
          a=y;
          if(z<b)
            cout<<"NO"<<endl;
          else
            cout<<"YES"<<endl<<a<<" "<<b<<" "<<b<<endl;
        }
        else
        {
            a=x;
            c=y;
           if(z<c)
            cout<<"NO"<<endl;
           else
            cout<<"YES"<<endl<<a<<" "<<c<<" "<<a<<endl;
        }
       }

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int

int main()
{
    ll t;
    while(t--){
            ll ara[4];

    for(int i=1;i<=3;i++)
    {
        cin>>ara[i];
    }
    sort(ara+1,ara+4);
    if(ara[2]!=ara[3]) cout<<"NO"<<endl;
    else
    {
        cout<<"YES"<<endl<<ara[3]<<" "<<ara[1]<<" "<<ara[1]<<endl;
    }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	long long int t;
	cin>>t;
	while(t--)
    {
        ll x,y,z,a,b,c;
        cin>>x>>y>>z;
        a=x;
        if(y<=a)
        {
            b=y;
            c=y;
        }
        else
        {
            c=y;
            b=a;
        }
        if(max(a,c)!=z)
            cout<<"NO"<<endl;
        if(max(a,c)==z)
        {
            cout<<"YES"<<endl<<a<<" "<<b<<" "<<c;

        }
    }
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	long long int t;
	cin>>t;
	while(t--)
    {
        ll x,y,z,a,b,c;
        cin>>x>>y>>z;
        a=x;
        if(y<=a)
        {
            b=y;
            c=y;
        }
        else
        {
            c=y;
            b=a;
        }
        if(max(a,c)!=z)
            cout<<"NO"<<endl;
        if(max(a,c)==z)
        {
            cout<<"YES"<<endl<<a<<" "<<b<<" "<<c<<endl;

        }
    }
	return 0;
}


#include <iostream>
using namespace std;

int main() {
int t;
cin>>t;
while(t--)
{
	long x,y,z;
	cin>>x>>y>>z;
	if(y!=z)
	{
		cout<<"NO\n";
		continue;
	}
	else
	{
		cout<<"YES\n";
	cout<<x<<" "<<x<<" "<<z<<endl;
}
}
	return 0;
}


#include <iostream>
#include<vector>
using namespace std;

int main() {
int t;
cin>>t;
while(t--)
{
	vector<int>a(3);
	cin>>a[0]>>a[1]>>a[2];
	sort(a,a+3);
	if(a[1]!=a[2])
	{
		cout<<"NO\n";
	}
	else
	{
		cout<<"YES\n";
	cout<<x<<" "<<x<<" "<<z<<endl;
}
}
	return 0;
}


#include <iostream>
using namespace std;

int main() {
int t;
cin>>t;
while(t--)
{
	vector<int>a(3);
	cin>>a[0]>>a[1]>>a[2];
	sort(a,a+3);
	if(a[1]!=a[2])
	{
		cout<<"NO\n";
	}
	else
	{
		cout<<"YES\n";
	cout<<x<<" "<<x<<" "<<z<<endl;
}
}
	return 0;
}


#include <iostream>
#include<bits\stdc++.h>

using namespace std;

int main() {
int t;
cin>>t;
while(t--)
{
	vector<int>a(3);
	cin>>a[0]>>a[1]>>a[2];
	sort(a.begin(),a.end());
	if(a[1]!=a[2])
	{
		cout<<"NO\n";
	}
	else
	{
		cout<<"YES\n";
	cout<<x<<" "<<x<<" "<<z<<endl;
}
}
	return 0;
}


#include <iostream>
using namespace std;

int main() {
int t;
cin>>t;
while(t--)
{
	long x,y,z;
	cin>>x>>y>>z;
	if(y!=z)
	{
		cout<<"NO\n";
	}
	else
	{
		cout<<"YES\n";
	cout<<x<<" "<<x<<" "<<z<<endl;
}
}
	return 0;
}


#include <iostream>
#include<bits.stdc++.h>

using namespace std;

int main() {
int t;
cin>>t;
while(t--)
{
	vector<int>a(3);
	cin>>a[0]>>a[1]>>a[2];
	sort(a.begin(),a.end());
	if(a[1]!=a[2])
	{
		cout<<"NO\n";
	}
	else
	{
		cout<<"YES\n";
	cout<<x<<" "<<x<<" "<<z<<endl;
}
}
	return 0;
}


#include <iostream>
#include<bits/stdc++.h>
using namespace std;

int main() {
int t;
cin>>t;
while(t--)
{
	vector<int>a(3);
	cin>>a[0]>>a[1]>>a[2];
	sort(a,a+3);
	if(a[1]!=a[2])
	{
		cout<<"NO\n";
	}
	else
	{
		cout<<"YES\n";
	cout<<x<<" "<<x<<" "<<z<<endl;
}
}
	return 0;
}


#include <iostream>
#include<bits\stdc++.h>

using namespace std;

int main() {
int t;
cin>>t;
while(t--)
{
	vector<int>a(3);
	cin>>a[0]>>a[1]>>a[2];
	sort(a.begin(),a.end());
	if(a[1]!=a[2])
	{
		cout<<"NO\n";
	}
	else
	{
		cout<<"YES\n";
	cout<<a[0]<<" "<<a[0]<<" "<<a[2]<<endl;
}
}
	return 0;
}


#include <iostream>
using namespace std;

int main() {
int t;
cin>>t;
while(t--)
{
	long x,y,z;
	cin>>x>>y>>z;
	if(y!=z)
	{
		cout<<"NO\n";

	}
	else
	{
		cout<<"YES\n";
	cout<<x<<" "<<x<<" "<<z<<endl;
}
}
	return 0;
}


#include <bits/stdc++.h>
#define speedup ios::sync_with_stdio(false),cin.tie(nullptr),cout.tie(nullptr)
using namespace std;

void solve() {
    int x,y,z;
    cin>>x>>y>>z;
    if(x!=y && y!=z&&z!=x) {
        cout<<"NO\n";
        return ;
    }
    cout<<"YES\n";
    cout<<x<<' '<<y<<' '<<z<<'\n';
}
int main()
{
    speedup;
    int t; cin>>t; while(t--)
    solve();
    return 0;
}


#/* Coder: @SumitRaut
 * Date: 19-08-2020 11:07:58
 */
#include <bits/stdc++.h>
#define speedup ios::sync_with_stdio(false),cin.tie(nullptr),cout.tie(nullptr)
using namespace std;

void solve() {
    int x,y,z;
    cin>>x>>y>>z;
    if(x!=y && y!=z&&z!=x) {
        cout<<"NO\n";
        return ;
    }
    cout<<"YES\n";
    if (y == z)
    {
        cout << 1 << ' ' << x << y << '\n';
        return;
    }
    if(x==y)
    {
        cout << 1 << ' ' << x << z << '\n';
        return;
    }
    cout<<1<<' '<<y<<' '<<z<<'\n';
}
int main()
{
    speedup;
    int t; cin>>t; while(t--)
    solve();
    return 0;
}


/* Coder: @SumitRaut
 * Date: 19-08-2020 11:07:58
 */
#include <bits/stdc++.h>
#define speedup ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr)
using namespace std;

void solve()
{
    long long x, y, z;
    cin >> x >> y >> z;
    if (x != y && y != z && z != x)
    {
        cout << "NO\n";
        return;
    }
    if (y == z)
    {
        if (x > y)
        {
            cout << "NO\n";
        }
        else
            cout << "YES\n"
                 << 1 << ' ' << x <<' '<< y << '\n';
        return;
    }
    if (x == y)
    {
        if (x < z)
            cout << "NO\n";
        cout << "YES\n"
             << 1 << ' ' << z <<' '<< x << '\n';
        return;
    }
    if (y > z)
        cout << "NO\n";
    cout << "YES\n"
         << 1 << ' ' << y << ' ' << z << '\n';
}
int main()
{
    speedup;
    int t;
    cin >> t;
    while (t--)
        solve();
    // system("pause");
    return 0;
}


/* Coder: @SumitRaut
 * Date: 19-08-2020 11:07:58
 */
#include <bits/stdc++.h>
#define speedup ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr)
using namespace std;

void solve()
{
    long long x, y, z;
    cin >> x >> y >> z;
    if (x != y && y != z && z != x)
    {
        cout << "NO\n";
        return;
    }
    if (y == z)
    {
        if (x > y)
        {
            cout << "NO\n";
        }
        else
            cout << "YES\n"
                 << 1 << ' ' << x <<' '<< y << '\n';
        return;
    }
    if (x == y)
    {
        if (x < z)
            cout << "NO\n";
        else
        cout << "YES\n"
             << 1 << ' ' << z <<' '<< x << '\n';
        return;
    }
    if (y > z)
        cout << "NO\n";
    else
    cout << "YES\n"
         << 1 << ' ' << y << ' ' << z << '\n';
}
int main()
{
    speedup;
    int t;
    cin >> t;
    while (t--)
        solve();
    // system("pause");
    return 0;
}


/* Coder: @SumitRaut
 * Date: 19-08-2020 11:07:58
 */
#include <bits/stdc++.h>
#define speedup ios::sync_with_stdio(false),cin.tie(nullptr),cout.tie(nullptr)
using namespace std;

void solve() {
    int x,y,z;
    cin>>x>>y>>z;
    if(x!=y && y!=z&&z!=x) {
        cout<<"NO\n";
        return ;
    }
    cout<<"YES\n";
    if (y == z)
    {
        cout << 1 << ' ' << x << ' ' << y << '\n';
        return;
    }
    if(x==y)
    {
        cout << 1 << ' ' << x << ' ' << z << '\n';
        return;
    }
    cout<<1<<' '<<y<<' '<<z<<'\n';
}
int main()
{
    speedup;
    int t; cin>>t; while(t--)
    solve();
    return 0;
}


/* Coder: @SumitRaut
 * Date: 19-08-2020 11:07:58
 */
#include <bits/stdc++.h>
#define speedup ios::sync_with_stdio(false),cin.tie(nullptr),cout.tie(nullptr)
using namespace std;

void solve() {
    int x,y,z;
    cin>>x>>y>>z;
    if(x!=y && y!=z&&z!=x) {
        cout<<"NO\n";
        return ;
    }
    cout<<"YES\n";
    if (y == z)
    {
        cout << 1 << ' ' << x << y << '\n';
        return;
    }
    if(x==y)
    {
        cout << 1 << ' ' << x << z << '\n';
        return;
    }
    cout<<1<<' '<<y<<' '<<z<<'\n';
}
int main()
{
    speedup;
    int t; cin>>t; while(t--)
    solve();
    return 0;
}


/* Coder: @SumitRaut
 * Date: 19-08-2020 11:07:58
 */
#include <bits/stdc++.h>
#define speedup ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr)
using namespace std;

void solve()
{
    int x, y, z;
    cin >> x >> y >> z;
    if (x != y && y != z && z != x)
    {
        cout << "NO\n";
        return;
    }
    if (y == z)
    {
        if (x > y)
        {
            cout << "NO\n";
        }
        else
            cout << "YES\n"
                 << 1 << ' ' << x <<' '<< y << '\n';
        return;
    }
    if (x == y)
    {
        if (x < z)
            cout << "NO\n";
        cout << "YES\n"
             << 1 << ' ' << x <<' '<< z << '\n';
        return;
    }
    if (y > z)
        cout << "NO\n";
    cout << "YES\n"
         << 1 << ' ' << y << ' ' << z << '\n';
}
int main()
{
    speedup;
    int t;
    cin >> t;
    while (t--)
        solve();
    // system("pause");
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main(int argc, char const *argv[])
{
	int n;
	cin >> n;
	for(int i =0 ;i < n ; i++){
		long x,y,z;
		cin >> x >> y >> z;
		if(((x == y) || (x == z) || (y == z))){
			long arr[] = {x,y,z};
			sort(arr,arr + 3);
			if(arr[2] == arr[1]){
				long mn = min(min(x,y),z);
				long mx = max(max(x,y),z);
				cout << "YES\n";
				cout << mn << " " << mn << " " << mx << endl;
			} else {
				cout << "NO\n";
			}

		} else {
			cout << "NO\n";
		}
	}

	return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main(int argc, char const *argv[])
{
	int n;
	cin >> n;
	for(int i =0 ;i < n ; i++){
		int x,y,z;
		cin >> x >> y >> z;
		if((x == y) || (x == z) || (y == z) && (max(x,y) == max(x,z))){
			int mn = min(min(x,y),z);
			int mx = max(max(x,y),z);
			cout << "YES\n";
			cout << mn << " " << mn << " " << mx << endl;
		} else {
			cout << "NO\n";
		}
	}

	return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main(int argc, char const *argv[])
{
	int n;
	cin >> n;
	for(int i =0 ;i < n ; i++){
		long x,y,z;
		cin >> x >> y >> z;
		if(((x == y) || (x == z) || (y == z)) && (max(x,y) == max(y,z))){
			long mn = min(min(x,y),z);
			long mx = max(max(x,y),z);
			cout << "YES\n";
			cout << mn << " " << mn << " " << mx << endl;
		} else {
			cout << "NO\n";
		}
	}

	return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main(int argc, char const *argv[])
{
	int n;
	cin >> n;
	for(int i =0 ;i < n ; i++){
		int x,y,z;
		cin >> x >> y >> z;
		if((x == y) || (x == z) || (y == z) && (max(x,y) == max(y,z))){
			int mn = min(min(x,y),z);
			int mx = max(max(x,y),z);
			cout << "YES\n";
			cout << mn << " " << mn << " " << mx << endl;
		} else {
			cout << "NO\n";
		}
	}

	return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main(int argc, char const *argv[])
{
	int n;
	cin >> n;
	for(int i =0 ;i < n ; i++){
		long x,y,z;
		cin >> x >> y >> z;
		if(((x == y) || (y == z)) && (max(x,y) == max(y,z))){
			long mn = min(min(x,y),z);
			long mx = max(max(x,y),z);
			cout << "YES\n";
			cout << mn << " " << mn << " " << mx << endl;
		} else {
			cout << "NO\n";
		}
	}

	return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main(int argc, char const *argv[])
{
	int n;
	cin >> n;
	for(int i =0 ;i < n ; i++){
		int x,y,z;
		cin >> x >> y >> z;
		if(((x == y) || (x == z) || (y == z)) && (max(x,y) == max(y,z))){
			int mn = min(min(x,y),z);
			int mx = max(max(x,y),z);
			cout << "YES\n";
			cout << mn << " " << mn << " " << mx << endl;
		} else {
			cout << "NO\n";
		}
	}

	return 0;
}