// by ξ
// program sky  :)

#include <bits/stdc++.h>

#define Rin register int
#define oo (c=getchar())
#define For(i,l,r) for(int _r=r,i=l;i<=_r;++i)
#define rep(i,l,r) for(int _r=r,i=l;i<_r;++i)
#define dto(i,r,l) for(int _l=l,i=r;i>=_l;--i)
#define pb push_back
#define clr(a) memset(a,0,sizeof a)
#define cpy(a,b) memcpy(a,b,sizeof a)

using namespace std;

typedef double db;
typedef vector<int> VI;

int n,m,K,N,d,safe[511],dang[511],id[511];
VI Ed[511];
db X[111],Y[111],E[111],T[511],pr[511],W[511],M[111][111],Q[111][111],A[511][511],B[511][511];

inline int IN(){
	char c;Rin x=0;for(;oo<48;);
	for(;c>47;oo)x=x*10+c-48;return x;
}

inline void Init(){
	For(i,1,N){
		++A[i][i];
		for(int v:Ed[safe[i]])if(id[v])
			A[i][id[v]]-=pr[v];
	}
	For(i,1,N)B[i][i]=1;
	For(i,1,N){
		if(fabs(A[i][i])<1e-9){
			For(j,i+1,N)if(fabs(A[j][i])>1e-9){
				For(k,1,N)swap(A[i][k],A[j][k]),swap(B[i][k],B[j][k]);
				break;
			}
		}
		db x=1/A[i][i];
		For(j,1,N)A[i][j]*=x,B[i][j]*=x;
		For(j,1,N)if(i^j && fabs(A[j][i])>1e-9){
			x=A[j][i];
			For(k,1,N)A[j][k]-=A[i][k]*x,B[j][k]-=B[i][k]*x;
		}
	}
}

inline void gao(int S){
	clr(E);clr(W);clr(T);
	if(S==1)T[1]=1;
	else for(int v:Ed[S])if(id[v])T[id[v]]=pr[S];
	For(i,1,N)For(k,1,N)W[i]+=B[i][k]*T[k];
	For(i,1,d)
	for(int v:Ed[dang[i]])
	if(v==S)E[i]+=pr[S];
	else if(id[v])E[i]+=W[id[v]]*pr[v];
}

inline void Cst(){
	gao(1);
	For(i,1,d)X[i]=E[i];
	For(i,1,d){
		gao(dang[i]);
		For(j,1,d)M[j][i]+=E[j];
	}
}

inline void mul(){
	cpy(Q,M);clr(M);
	For(i,1,d)For(k,1,d)if(Q[i][k])
	For(j,1,d)M[i][j]+=Q[i][k]*Q[k][j];
}

inline void prod(){
	cpy(Y,X);clr(X);
	For(i,1,d)For(k,1,d)X[i]+=M[i][k]*Y[k];
}

int main(){
	n=IN();m=IN();K=IN();
	For(i,1,n)if(IN())dang[++d]=i;else safe[id[i]=++N]=i;
	For(i,1,m){
		int u=IN(),v=IN();
		Ed[u].pb(v);Ed[v].pb(u);
		++pr[u];++pr[v];
	}
	For(i,1,n)pr[i]=1/pr[i];
	Init();
	Cst();
	for(K-=2;K;K>>=1,mul())if(K&1)prod();
	printf("%.10lf\n",X[d]);
}


// by ξ
// program sky  :)

#include <bits/stdc++.h>

#define Rin register int
#define oo (c=getchar())
#define For(i,l,r) for(int _r=r,i=l;i<=_r;++i)
#define rep(i,l,r) for(int _r=r,i=l;i<_r;++i)
#define dto(i,r,l) for(int _l=l,i=r;i>=_l;--i)
#define pb push_back
#define clr(a) memset(a,0,sizeof a)
#define cpy(a,b) memcpy(a,b,sizeof a)

using namespace std;

typedef double db;
typedef vector<int> VI;

int n,m,K,N,d,safe[511],dang[511],id[511],no[511];
VI Ed[511];
db X[111],Y[111],E[111],T[511],pr[511],W[511],M[111][111],Q[111][111],A[511][511],B[511][511];

inline int IN(){
	char c;Rin x=0;for(;oo<48;);
	for(;c>47;oo)x=x*10+c-48;return x;
}

inline void Init(){
	For(i,1,N){
		++A[i][i];
		for(int v:Ed[safe[i]])if(id[v])
			A[i][id[v]]-=pr[v];
	}
	For(i,1,N)B[i][i]=1;
	For(i,1,N){
		if(fabs(A[i][i])<1e-12){
			For(j,i+1,N)if(fabs(A[j][i])>1e-12){
				For(k,1,N)swap(A[i][k],A[j][k]),swap(B[i][k],B[j][k]);
				break;
			}
		}
		db x=1/A[i][i];
		For(j,1,N)A[i][j]*=x,B[i][j]*=x;
		For(j,1,N)if(i^j){
			x=A[j][i];
			For(k,1,N)A[j][k]-=A[i][k]*x,B[j][k]-=B[i][k]*x;
		}
	}
}

inline void gao(int S){
	clr(E);clr(W);clr(T);
	if(S==1)T[1]=1;
	else for(int v:Ed[S])if(id[v])T[id[v]]+=pr[S];else E[no[v]]+=pr[S];
	For(i,1,N)For(k,1,N)W[i]+=B[i][k]*T[k];
	For(i,1,d)
	for(int v:Ed[dang[i]])
		if(id[v])E[i]+=W[id[v]]*pr[v];
}

inline void Cst(){
	gao(1);
	For(i,1,d)X[i]=E[i];
	For(i,1,d){
		gao(dang[i]);
		For(j,1,d)M[j][i]+=E[j];
	}
}

inline void mul(){
	cpy(Q,M);clr(M);
	For(i,1,d)For(k,1,d)
	For(j,1,d)M[i][j]+=Q[i][k]*Q[k][j];
}

inline void prod(){
	cpy(Y,X);clr(X);
	For(i,1,d)For(k,1,d)X[i]+=M[i][k]*Y[k];
}

int main(){
	n=IN();m=IN();K=IN();
	For(i,1,n)if(IN())dang[no[i]=++d]=i;else safe[id[i]=++N]=i;
	For(i,1,m){
		int u=IN(),v=IN();
		Ed[u].pb(v);Ed[v].pb(u);
		++pr[u];++pr[v];
	}
	For(i,1,n)pr[i]=1/pr[i];
	Init();
	Cst();
	for(K-=2;K;K>>=1,mul())if(K&1)prod();
	printf("%.10lf\n",X[d]);
}


// by ξ
// program sky  :)

#include <bits/stdc++.h>

#define Rin register int
#define oo (c=getchar())
#define For(i,l,r) for(int _r=r,i=l;i<=_r;++i)
#define rep(i,l,r) for(int _r=r,i=l;i<_r;++i)
#define dto(i,r,l) for(int _l=l,i=r;i>=_l;--i)
#define pb push_back
#define clr(a) memset(a,0,sizeof a)
#define cpy(a,b) memcpy(a,b,sizeof a)

using namespace std;

typedef double db;
typedef vector<int> VI;

int n,m,K,N,d,safe[511],dang[511],id[511];
VI Ed[511];
db X[111],Y[111],E[111],T[511],pr[511],W[511],M[111][111],Q[111][111],A[511][511],B[511][511];

inline int IN(){
	char c;Rin x=0;for(;oo<48;);
	for(;c>47;oo)x=x*10+c-48;return x;
}

inline void Init(){
	For(i,1,N){
		++A[i][i];
		for(int v:Ed[safe[i]])if(id[v])
			A[i][id[v]]-=pr[v];
	}
	For(i,1,N)B[i][i]=1;
	For(i,1,N){
		if(fabs(A[i][i])<1e-9){
			For(j,i+1,N)if(fabs(A[j][i])>1e-9){
				For(k,1,N)swap(A[i][k],A[j][k]),swap(B[i][k],B[j][k]);
				break;
			}
		}
		db x=1/A[i][i];
		For(j,1,N)A[i][j]*=x,B[i][j]*=x;
		For(j,1,N)if(i^j && fabs(A[j][i])>1e-9){
			x=A[j][i];
			For(k,1,N)A[j][k]-=A[i][k]*x,B[j][k]-=B[i][k]*x;
		}
	}
}

inline void gao(int S){
	clr(E);clr(W);clr(T);
	if(S==1)T[1]=1;
	else for(int v:Ed[S])if(id[v])T[id[v]]+=pr[S];
	For(i,1,N)For(k,1,N)W[i]+=B[i][k]*T[k];
	For(i,1,d)
	for(int v:Ed[dang[i]]){
		if(v==S && S^1)E[i]+=pr[S];
		if(id[v])E[i]+=W[id[v]]*pr[v];
	}
}

inline void Cst(){
	gao(1);
	For(i,1,d)X[i]=E[i];
	For(i,1,d){
		gao(dang[i]);
		For(j,1,d)M[j][i]+=E[j];
	}
}

inline void mul(){
	cpy(Q,M);clr(M);
	For(i,1,d)For(k,1,d)
	For(j,1,d)M[i][j]+=Q[i][k]*Q[k][j];
}

inline void prod(){
	cpy(Y,X);clr(X);
	For(i,1,d)For(k,1,d)X[i]+=M[i][k]*Y[k];
}

int main(){
	n=IN();m=IN();K=IN();
	For(i,1,n)if(IN())dang[++d]=i;else safe[id[i]=++N]=i;
	For(i,1,m){
		int u=IN(),v=IN();
		Ed[u].pb(v);Ed[v].pb(u);
		++pr[u];++pr[v];
	}
	For(i,1,n)pr[i]=1/pr[i];
	Init();
	Cst();
	for(K-=2;K;K>>=1,mul())if(K&1)prod();
	printf("%.10lf\n",X[d]);
}


#include <iostream>
#include <cstdio>
#include <vector>
#include <cstring>

#define pb push_back
#define MAX_N 510
#define MAX_A 110

struct Matrix{
	int n, m;
	double a[MAX_A][MAX_A];
	Matrix(int n, int m) : n(n), m(m){
		memset(a, 0, sizeof(a));
	}
	double *operator [](int x){
		return a[x];
	}
};

Matrix operator *(Matrix x, Matrix y){
	Matrix z(x.n, y.m);
	for(int i = 1; i <= x.n; i++)
		for(int k = 1; k <= x.m; k++)
			for(int j = 1; j <= y.m; j++)
				z[i][j] += x[i][k] * y[k][j];
	return z;
}

Matrix ksm(Matrix x, int y){
	Matrix z(x.n, x.n);
	for(int i = 1; i <= x.n; i++)
		z[i][i] = 1;
	for(; y; y >>= 1, x = x * x)
		if(y & 1) z = x * z;
	return z;
}

int n, m, K, deg[MAX_N], a[MAX_A], typ[MAX_N];
double A[MAX_N][MAX_N + MAX_A];
std::vector<int> to[MAX_N];

int main(){
	scanf("%d%d%d", &n, &m, &K);
	for(int i = 1; i <= n; i++){
		scanf("%d", &typ[i]);
		if(typ[i]) a[++a[0]] = i;
	}
	for(int i = 1, x, y; i <= m; i++){
		scanf("%d%d", &x, &y);
		deg[x]++, deg[y]++;
		to[x].pb(y), to[y].pb(x);
	}
	for(int i = 1; i <= n; i++){
		if(!typ[i]){
			for(auto j: to[i])
				A[i][j] += 1.0 / deg[i];
			A[i][i] = -1;
		}else{
			A[i][i] = 1;
			for(int j = 1; j <= a[0]; j++) if(a[j] == i)
				A[i][n+j] = 1;
		}
	}
	int lim = a[0] + n;
	double t;
	for(int i = 1; i <= n; i++){
		t = A[i][i];
		for(int j = 1; j <= lim; j++)
			A[i][j] /= t;
		for(int j = i + 1; j <= n; j++){
			t = A[j][i] / A[i][i];
			for(int k = 1; k <= lim; k++)
				A[j][k] -= A[i][k] * t;
		}
	}
	for(int i = n; i; i--)
		for(int j = i - 1; j; j--)
			for(int k = n + 1; k <= lim; k++)
				A[j][k] -= A[j][i] * A[i][k];
	Matrix x(1, a[0]), y(a[0], a[0]);
	for(int i = 1; i <= a[0]; i++)
		x[1][i] = A[1][n + i];
	for(int i = 1; i <= a[0]; i++)
		for(int j = 1; j <= a[0]; j++){
			for(auto k: to[a[i]])
				y[i][j] += A[k][n + j];
			y[i][j] /= deg[a[i]];
		}
	x = x * ksm(y, K - 2);
	printf("%.6lf\n", x[1][a[0]]);
	return 0;
}//hello//hello


#include"bits/stdc++.h"
#define LL long long
#define PII pair<int,int>
#define PPI pair<PII,int>
#define PIP pair<int,PII>
#define PPP pair<PII,PII>
#define X first
#define Y second
#define INF 1000000007
#define FOR(a,b,c) for(int a=b;a<=c;a++)
#define FO_(a,b,c) for(int a=b;a>=c;a--)
#define REP(i,u,v) for(int i=H[u],v=to[i];i;i=nxt[i],v=to[i])
using namespace std;
typedef double dou;
const int N = 1010;

int val[N],n;
vector<int> ch[N];

dou a[N][N];
dou b[N][N];
void solve(int _) {
	FOR(i,1,n) FOR(j,0,n) a[i][j] = 0;
	FOR(u,1,n) {
		a[u][u] = 1;
		dou d = 1. / ch[u].size();
		FOR(i,0,(int)ch[u].size()-1) {
			int v = ch[u][i];
			if(v == _ ) a[u][0]+= d;
			if(!val[v]) a[u][v]+=-d;
		}
	}
	FOR(i,1,n) {
		int l = i;
		FOR(j,i+1,n) if(abs(a[j][i]) > abs(a[l][i])) l = j;
		FOR(k, 0, n) swap(a[i][k],a[l][k]);
		FOR(j,i+1,n) {
			dou m = a[j][i] / a[i][i];
			FOR(k,0,n) a[j][k] -= a[i][k] * m;
		}
	}
	FO_(i,n,1) {
		a[i][0]/= a[i][i];
		a[i][i] = 1;
		FOR(j,1,i-1) {
			dou m = a[j][i];
			FOR(k,0,n) a[j][k] -= a[i][k] * m;
		}
	}
//FOR(i,1,n){FOR(j,0,n)printf("%lf ",a[i][j]);puts("");}puts("");
	FOR(i,1,n) b[i][_] = a[i][0];
}

int tot;
dou tmp[105][105];
void calc(dou ans[][105],dou mul[][105]) {
	FOR(i,1,tot) FOR(j,1,tot) tmp[i][j] = 0;
	FOR(i,1,tot) FOR(j,1,tot) FOR(k,1,tot) {
		tmp[i][k] += ans[i][j] * mul[j][k];
	}
	FOR(i,1,tot) FOR(j,1,tot) ans[i][j] = tmp[i][j];
}
dou ans[105][105];
dou mul[105][105];
int main() {
	int m,k;
	cin>>n>>m>>k;
	FOR(i,1,n) scanf("%d",val+i);
	FOR(i,1,m) {
		int u,v;
		scanf("%d%d",&u,&v);
		ch[u].push_back(v);
		ch[v].push_back(u);
	}
	FOR(i,1,n) if(val[i])
		solve(i);
	FOR(i,1,n) if(val[i]) val[i] = ++tot;
	FOR(i,1,n) if(val[i]) ans[1][val[i]] = b[1][i];
	FOR(i,1,n) if(val[i])
		FOR(j,1,n) if(val[j])
			mul[val[i]][val[j]] = b[i][j];
	for(k-=2; k; k>>=1) {
		if(k & 1)
			calc(ans,mul);
		calc(mul,mul);
	}
	printf("%.9lf\n",ans[1][tot]);
	return 0;
}


#include"bits/stdc++.h"
#define LL long long
#define PII pair<int,int>
#define PPI pair<PII,int>
#define PIP pair<int,PII>
#define PPP pair<PII,PII>
#define X first
#define Y second
#define INF 1000000007
#define FOR(a,b,c) for(int a=b;a<=c;a++)
#define FO_(a,b,c) for(int a=b;a>=c;a--)
#define REP(i,u,v) for(int i=H[u],v=to[i];i;i=nxt[i],v=to[i])
using namespace std;
typedef double dou;
const int N = 1010;

int val[N];
dou a[N][N];
vector<int> ch[N];
void solve(int n,int m) {
	FOR(u,1,n) {
		a[u][u] = 1;
		dou d = 1. / ch[u].size();
		FOR(i,0,(int)ch[u].size()-1) {
			int v = ch[u][i];
			if(val[v])
				a[u][n+val[v]] += d;
			else
				a[u][v] -= d;
		}
	}
	FOR(i,1,n) {
		FOR(j,i+1,n) {
			dou o = a[j][i] / a[i][i];
			FOR(k,i,m) a[j][k] -= a[i][k] * o;
		}
	}
	FO_(i,n,1) {
		FOR(j,n+1,m) a[i][j] /= a[i][i];
		a[i][i] = 1;
		FOR(j,1,i-1) {
			dou o = a[j][i];
			FOR(k,i,m) a[j][k] -= a[i][k] * o;
		}
	}
}

int tot;
dou tmp[105][105];
void calc(dou ans[][105],dou mul[][105]) {
	FOR(i,1,tot) FOR(j,1,tot) tmp[i][j] = 0;
	FOR(i,1,tot) FOR(j,1,tot) FOR(k,1,tot) {
		tmp[i][k] += ans[i][j] * mul[j][k];
	}
	FOR(i,1,tot) FOR(j,1,tot) ans[i][j] = tmp[i][j];
}
dou ans[105][105];
dou mul[105][105];
int main() {
	int n,m,k;
	cin>>n>>m>>k;
	FOR(i,1,n) scanf("%d",val+i);
	FOR(i,1,m) {
		int u,v;
		scanf("%d%d",&u,&v);
		ch[u].push_back(v);
		ch[v].push_back(u);
	}
	FOR(i,1,n) if(val[i]) val[i] = ++tot;
	solve(n,n+tot);
	FOR(i,1,tot) ans[1][i] = a[1][n+i];
	FOR(i,1,tot) FOR(j,1,n) mul[val[j]][i] = a[j][n+i];
	for(k-=2; k; k>>=1) {
		if(k & 1)
			calc(ans,mul);
		calc(mul,mul);
	}
	printf("%.9lf\n",ans[1][tot]);
	return 0;
}


#include"bits/stdc++.h"
#define LL long long
#define PII pair<int,int>
#define PPI pair<PII,int>
#define PIP pair<int,PII>
#define PPP pair<PII,PII>
#define X first
#define Y second
#define INF 1000000007
#define FOR(a,b,c) for(int a=b;a<=c;a++)
#define FO_(a,b,c) for(int a=b;a>=c;a--)
#define REP(i,u,v) for(int i=H[u],v=to[i];i;i=nxt[i],v=to[i])
using namespace std;
typedef double dou;
const int N = 1010;

int val[N],n;
vector<int> ch[N];

dou a[N][N];
dou b[N][N];
void solve(int _) {
	FOR(i,1,n) FOR(j,0,n) a[i][j] = 0;
	FOR(u,1,n) {
		a[u][u] = 1;
		dou d = 1. / ch[u].size();
		FOR(i,0,(int)ch[u].size()-1) {
			int v = ch[u][i];
			if(v == _ ) a[u][0]+= d;
			if(!val[v]) a[u][v]+=-d;
		}
	}
	FOR(i,1,n) {
		int l = i;
		FOR(j,i+1,n) if(abs(a[j][i]) > abs(a[l][i])) l = j;
		FOR(k, 0, n) swap(a[i][k],a[l][k]);
		FOR(j,i+1,n) {
			dou m = a[j][i] / a[i][i];
			FOR(k,0,n) a[j][k] -= a[i][k] * m;
		}
	}
	FO_(i,n,1) {
		a[i][0]/= a[i][i];
		a[i][i] = 1;
		FOR(j,1,i-1) {
			dou m = a[j][i];
			FOR(k,0,n) a[j][k] -= a[i][k] * m;
		}
	}
	FOR(i,1,n) b[i][_] = a[i][0];
}

int tot;
dou tmp[105][105];
void calc(dou ans[][105],dou mul[][105]) {
	FOR(i,1,tot) FOR(j,1,tot) tmp[i][j] = 0;
	FOR(i,1,tot) FOR(j,1,tot) FOR(k,1,tot) {
		tmp[i][k] += ans[i][j] * mul[j][k];
	}
	FOR(i,1,tot) FOR(j,1,tot) ans[i][j] = tmp[i][j];
}
dou ans[105][105];
dou mul[105][105];
int main() {
	int m,k;
	cin>>n>>m>>k;
	FOR(i,1,n) scanf("%d",val+i);
	FOR(i,1,m) {
		int u,v;
		scanf("%d%d",&u,&v);
		ch[u].push_back(v);
		ch[v].push_back(u);
	}
	FOR(i,1,n) if(val[i]) {
		solve(i);
		if(n==500) return 0;
	}
	FOR(i,1,n) if(val[i]) val[i] = ++tot;
	FOR(i,1,n) if(val[i]) ans[1][val[i]] = b[1][i];
	FOR(i,1,n) if(val[i])
		FOR(j,1,n) if(val[j])
			mul[val[i]][val[j]] = b[i][j];
	for(k-=2; k; k>>=1) {
		if(k & 1)
			calc(ans,mul);
		calc(mul,mul);
	}
	printf("%.9lf\n",ans[1][tot]);
	return 0;
}


#include"bits/stdc++.h"
#define LL long long
#define PII pair<int,int>
#define PPI pair<PII,int>
#define PIP pair<int,PII>
#define PPP pair<PII,PII>
#define X first
#define Y second
#define INF 1000000007
#define FOR(a,b,c) for(int a=b;a<=c;a++)
#define FO_(a,b,c) for(int a=b;a>=c;a--)
#define REP(i,u,v) for(int i=H[u],v=to[i];i;i=nxt[i],v=to[i])
using namespace std;
typedef double dou;
const int N = 1010;

int val[N],n;
vector<int> ch[N];

dou a[N][N];
dou b[N][N];
void solve(int _) {
	FOR(i,1,n) FOR(j,0,n) a[i][j] = 0;
	FOR(u,1,n) {
		a[u][u] = 1;
		dou d = 1. / ch[u].size();
		FOR(i,0,(int)ch[u].size()-1) {
			int v = ch[u][i];
			if(v == _ ) a[u][0]+= d;
			if(!val[v]) a[u][v]+=-d;
		}
	}
	FOR(i,1,n) {
		int l = i;
		FOR(j,i+1,n) if(abs(a[j][i]) > abs(a[l][i])) l = j;
		FOR(k, 0, n) swap(a[i][k],a[l][k]);
		FOR(j,i+1,n) {
			dou m = a[j][i] / a[i][i];
			FOR(k,0,n) a[j][k] -= a[i][k] * m;
		}
	}
	FO_(i,n,1) {
		a[i][0]/= a[i][i];
		a[i][i] = 1;
		FOR(j,1,i-1) {
			dou m = a[j][i];
			FOR(k,0,n) a[j][k] -= a[i][k] * m;
		}
	}
//FOR(i,1,n){FOR(j,0,n)printf("%lf ",a[i][j]);puts("");}puts("");
	FOR(i,1,n) b[i][_] = a[i][0];
}

int tot;
dou tmp[105][105];
void calc(dou ans[][105],dou mul[][105]) {
	FOR(i,1,tot) FOR(j,1,tot) tmp[i][j] = 0;
	FOR(i,1,tot) FOR(j,1,tot) FOR(k,1,tot) {
		tmp[i][k] += ans[i][j] * mul[j][k];
	}
	FOR(i,1,tot) FOR(j,1,tot) ans[i][j] = tmp[i][j];
}
dou ans[105][105];
dou mul[105][105];
int main() {
	freopen("std.in","r",stdin);
	int m,k;
	cin>>n>>m>>k;
	FOR(i,1,n) scanf("%d",val+i);
	FOR(i,1,m) {
		int u,v;
		scanf("%d%d",&u,&v);
		ch[u].push_back(v);
		ch[v].push_back(u);
	}
	FOR(i,1,n) if(val[i])
		solve(i);
	FOR(i,1,n) if(val[i]) val[i] = ++tot;
	FOR(i,1,n) if(val[i]) ans[1][val[i]] = b[1][i];
	FOR(i,1,n) if(val[i])
		FOR(j,1,n) if(val[j])
			mul[val[i]][val[j]] = b[i][j];
	for(k-=2; k; k>>=1) {
		if(k & 1)
			calc(ans,mul);
		calc(mul,mul);
	}
	printf("%.9lf\n",ans[1][tot]);
	return 0;
}


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

#define MAX 502

int n;
int m;
int k;

int flag[MAX];

vector<double> g[MAX];

double deg[MAX];
double cnt[MAX][MAX];

double dist[MAX][MAX];

const int matrix_size = 102;
struct matrix {
	double mat[matrix_size][matrix_size];  //caution!
	matrix() {
		memset(mat, 0, sizeof(mat));
	}
};
matrix operator *(const matrix &a, const matrix &b) {
	matrix r;
	double tmp;
	for (int i = 0; i < matrix_size; i++) {
		for (int j = 0; j < matrix_size; j++) {
			tmp = 0;
			for (int k = 0; k < matrix_size; k++) {
				tmp += (double)(a.mat[i][k]) * b.mat[k][j];
			}
			r.mat[i][j] = tmp;
		}
	}
	return r;
}
matrix operator +(const matrix &a, const matrix &b) {
	matrix r;
	for (int i = 0; i < matrix_size; i++) {
		for (int j = 0; j < matrix_size; j++) {
			r.mat[i][j] += a.mat[i][j] + b.mat[i][j];
		}
	}
	return r;
}
matrix ppow(matrix i, long long int j) {
	if (j == 0) {
		for (int i1 = 0; i1<matrix_size; i1++) {
			for (int j = 0; j<matrix_size; j++) {
				i.mat[i1][j] = (i1 == j);
			}
		}
		return i;
	}
	if (j == 1LL) {
		return i;
	}
	j--;
	matrix r = i;
	while (j) {
		if ((j & 1LL)) {
			r = r*i;
		}
		i = i*i;
		j >>= 1LL;
	}
	return r;
}
vector<int> v;
matrix mat;

int idx[MAX];

int main() {
	cin >> n >> m >> k;
	for (int i = 0; i < n; i++) {
		scanf("%d", &flag[i]);
		if (i == 0 || flag[i]) {
			v.push_back(i);
		}
	}
	for (int i = 0; i < m; i++) {
		int a, b;
		scanf("%d%d", &a, &b);
		a--;
		b--;
		cnt[a][b] += 1;
		cnt[b][a] += 1;
		deg[a]++;
		deg[b]++;
	}
	for (int i = 0; i < n; i++) {
		g[i].assign(n*2, 0);
		g[i][i] = -1;
		if (flag[i] == false) {
			for (int j = 0; j < n; j++) {
				if (flag[j] == false && j != i) {
					g[i][j] = cnt[i][j] / deg[i];
				}
			}
		}
		else {
			g[i][i + n] = 1;
			g[i][i] = 1;
		}
	}
	for (int i = 0; i < n; i++) {
		double mx = 0;
		int id = -1;
		for (int j = i; j < n; j++) {
			mx = max(mx, fabs(g[i][j]));
			if (mx == fabs(g[i][j])) {
				id = j;
			}
		}
		if (mx == 0.0)continue;
		swap(g[i], g[id]);
		double pr = g[i][i];
		for (int j = i + 1; j < n; j++) {
			double rat = g[j][i] / pr;
			for (int k = i; k < n*2; k++) {
				g[j][k] -= rat*g[i][k];
			}
		}
	}
	for (int k = 0; k < n; k++) {
		if (k == 0 || flag[k]) {

		}
		else {
			continue;
		}
		dist[k][k] = 1;
		for (int i = n - 1; i >= 0; i--) {
			if (i == k)continue;
			if (flag[i])continue;
			double r = 0;
			r -= g[i][k+n];
			for (int j = n-1; j > i; j--) {
				r -= dist[k][j] * g[i][j];
			}
			r /= g[i][i];
			g[k][i] = r;
		}
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < n; j++) {
				if (flag[j]) {
					dist[k][j] += dist[k][i] * cnt[i][j] / deg[i];
				}
			}
		}
	}
	int c = -1;
	for (int id : v) {
		c++;
		idx[id] = c;
	}
	for (int id : v) {
		for (int go : v) {
			if (go == 0)continue;
			double &pro = dist[id][go];
			mat.mat[go][id] = pro;
		}
	}
	mat = ppow(mat, k);
	double ans = mat.mat[c][0];
	printf("%.16f\n", ans);
	return 0;
}
エラー


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

#define MAX 502

int n;
int m;
int k;

int flag[MAX];

vector<double> g[MAX];

double deg[MAX];
double cnt[MAX][MAX];

double dist[MAX][MAX];

const int matrix_size = 102;
struct matrix {
	double mat[matrix_size][matrix_size];  //caution!
	matrix() {
		memset(mat, 0, sizeof(mat));
	}
};
matrix operator *(const matrix &a, const matrix &b) {
	matrix r;
	double tmp;
	for (int i = 0; i < matrix_size; i++) {
		for (int j = 0; j < matrix_size; j++) {
			tmp = 0;
			for (int k = 0; k < matrix_size; k++) {
				tmp += (double)(a.mat[i][k]) * b.mat[k][j];
			}
			r.mat[i][j] = tmp;
		}
	}
	return r;
}
matrix operator +(const matrix &a, const matrix &b) {
	matrix r;
	for (int i = 0; i < matrix_size; i++) {
		for (int j = 0; j < matrix_size; j++) {
			r.mat[i][j] += a.mat[i][j] + b.mat[i][j];
		}
	}
	return r;
}
matrix ppow(matrix i, long long int j) {
	if (j == 0) {
		for (int i1 = 0; i1<matrix_size; i1++) {
			for (int j = 0; j<matrix_size; j++) {
				i.mat[i1][j] = (i1 == j);
			}
		}
		return i;
	}
	if (j == 1LL) {
		return i;
	}
	j--;
	matrix r = i;
	while (j) {
		if ((j & 1LL)) {
			r = r*i;
		}
		i = i*i;
		j >>= 1LL;
	}
	return r;
}
vector<int> v;
matrix mat;

int idx[MAX];

int main() {
	cin >> n >> m >> k;
	for (int i = 0; i < n; i++) {
		scanf("%d", &flag[i]);
		if (i == 0 || flag[i]) {
			v.push_back(i);
		}
	}
	for (int i = 0; i < m; i++) {
		int a, b;
		scanf("%d%d", &a, &b);
		a--;
		b--;
		cnt[a][b] += 1;
		cnt[b][a] += 1;
		deg[a]++;
		deg[b]++;
	}
	for (int i = 0; i < n; i++) {
		g[i].assign(n*2, 0);
		g[i][i] = -1;
		if (flag[i] == false) {
			for (int j = 0; j < n; j++) {
				if (j != i) {
					g[i][j] = cnt[i][j] / deg[i];
				}
			}
		}
		else {
			g[i][i + n] = 1;
			g[i][i] = 1;
		}
	}
	for (int i = 0; i < n; i++) {
		double mx = 0;
		int id = -1;
		for (int j = i; j < n; j++) {
			mx = max(mx, fabs(g[j][i]));
			if (mx == fabs(g[j][i])) {
				id = j;
			}
		}
		if (mx == 0.0)continue;
		swap(g[i], g[id]);
		double pr = g[i][i];
		for (int j = i + 1; j < n; j++) {
			double rat = g[j][i] / pr;
			for (int k = i; k < n*2; k++) {
				g[j][k] -= rat*g[i][k];
			}
		}
	}
	for (int k = 0; k < n; k++) {
		if (flag[k] == false)continue;
		dist[k][k] = 1;
		for (int i = n - 1; i >= 0; i--) {
			if (flag[i])continue;
			double r = 0;
			r = g[i][k+n];
			for (int j = n-1; j > i; j--) {
				r -= dist[j][k] * g[i][j];
			}
			r /= g[i][i];
			dist[i][k] = r;
		}
		for (int i = 0; i < n; i++) {
			if (flag[i] && i != k) {
				for (int j = 0; j < n; j++) {
					if (i != j) {
						if (j == k || flag[j] == false) {
							dist[i][k] += dist[j][k] * cnt[i][j] / deg[i];
						}
					}
				}
			}
		}
		int i = k;
		dist[i][k] = 0;
		for (int j = 0; j < n; j++) {
			if (i != j) {
				if (j == k || flag[j] == false) {
					dist[i][k] += dist[j][k] * cnt[i][j] / deg[i];
				}
			}
		}
	}
	int c = -1;
	for (int id : v) {
		c++;
		idx[id] = c;
	}
	for (int id : v) {
		for (int go : v) {
			if (go == 0)continue;
			double &pro = dist[id][go];
			mat.mat[idx[go]][idx[id]] = pro;
		}
	}
	mat = ppow(mat, k-1);
	double ans = mat.mat[c][0];
	printf("%.16f\n", ans);
	return 0;
}


#include <cstdio>
#include <cstring>
#include <algorithm>
const int N = 510;
const int NN = 110;
using namespace std;
int read(){
	int x = 0,f = 1,c = getchar();
	while (c<'0' || c>'9') {if (c=='-') f = -1;c = getchar();}
	while (c>='0' && c<='9') x = x*10+c-'0',c = getchar();
	return x*f;
}
struct matrix{double num[NN][NN];} ans,tmp,opt;
double p[N][N],mat[N][N<<1],cnt[N],b[N],res;
int g[N][N],f[N],id[N],n,m,x,y,k,sum,deg[N];
void Gauss(){
	for(int i=1;i<=n;i++) mat[i][i+n]=1;
	for(int i=1;i<=n;i++){
		for(int j=i;j<=n;j++) if(mat[j][i]){
			for(int k=n*2;k>=i;k--) swap(mat[i][k],mat[j][k]);
			break;
		}
		for(int k=n*2;k>=i;k--) mat[i][k]/=mat[i][i];
		for(int j=1;j<=n;j++) if(j!=i){
			for(int k=n*2;k>=i;k--) mat[j][k]-=mat[j][i]*mat[i][k];
		}
	}
}
void mul(matrix &C,matrix A,matrix B){
	for (int i=1;i<=sum;i++)
		for (int j=1;j<=sum;j++){
			tmp.num[i][j] = 0;
			for (int k=1;k<=sum;k++)
				tmp.num[i][j]+=A.num[i][k]*B.num[k][j];
		}
	for (int i=1;i<=sum;i++)
		for (int j=1;j<=sum;j++) C.num[i][j] = tmp.num[i][j];
}
int main(){
	n=read();m=read();k=read();
	for(int i=1;i<=n;i++){
		f[i]=read();
		if(f[i])id[i]=++sum;
	}
	for(int i=1;i<=m;i++){
		x=read();y=read();
		g[x][y]++;g[y][x]++;
		deg[x]++;deg[y]++;
	}
	for(int i=1;i<=n;i++)mat[i][i]+=1;
	for(int i=1;i<=n;i++)for(int j=1;j<=n;j++)
		if(!f[j])mat[i][j]-=1.0/deg[j]*g[j][i];
	Gauss();
	for(int i=1;i<=n;i++){
		for(int j=1;j<=n;j++)
			cnt[j]=1./deg[i]*g[i][j];
		for(int u=1;u<=n;u++){
			b[u]=0;
			for(int v=1;v<=n;v++)
				if(!f[v])
					b[u]+=1./deg[v]*cnt[v]*g[v][u];
		}
		for(int x=1;x<=n;x++){
			p[i][x]=cnt[x];
			for(int y=1;y<=n;y++)
				p[i][x]+=mat[x][y+n]*b[y];
		}
	}
	for(int i=1;i<=n;i++)
		if(f[i])
			ans.num[id[i]][id[i]]=p[1][i];
	for(int i=1;i<=n;i++)if(f[i])
		for(int j=1;j<=n;j++)if(f[j])
			opt.num[id[i]][id[j]]=p[i][j];

	for(k-=2;k;k>>=1,mul(opt,opt,opt))if(k&1)mul(ans,ans,opt);
	for(int i=1;i<=sum;i++)res+=ans.num[i][id[n]];
	printf("%.12lf",res);
}


#include <cstdio>
#include <iostream>
#define max(a, b) ((a) < (b) ? (b) : (a))
using namespace std;
int main() {
    int T;
    while (cin >> T) {

        cin >> T;
        for (int i = 1; i <= T; i++) {
            int x, y, z;
            scanf("%d%d%d", &x, &y, &z);
            // int t1, t2, t3;
            // t1 = max(x, y);
            // t2 = max(x, z);
            // t3 = max(y, z);
            if ((x == y && y > z)) {
                printf("YES\n");
                printf("%d %d %d\n", x, z, 1);
            } else if ((x == z && x > y)) {
                printf("YES\n");
                printf("%d %d %d\n", y, x, 1);
            } else if ((y == z && y > x)) {
                printf("YES\n");
                printf("%d %d %d\n", 1, x, y);
            } else if (z == y && y == x) {
                printf("%d %d %d\n", x, x, x);
            } else {
                cout << "NO" << endl;
            }
        }
    }
    return 0;
}


#include <cstdio>
#include <iostream>
#define max(a, b) ((a) < (b) ? (b) : (a))
using namespace std;
int main() {
    int T;
    while (cin >> T) {
        for (int i = 1; i <= T; i++) {
            long long x, y, z;
            scanf("%lld%lld%lld", &x, &y, &z);
            if ((x == y && x > z)) {
                printf("YES\n");
                printf("%lld %lld %lld\n", x, z, 1);
            } else if ((x == z && x > y)) {
                printf("YES\n");
                printf("%lld %lld %lld\n", y, x, 1);
            } else if ((y == z && y > x)) {
                printf("YES\n");
                printf("%lld %lld %lld\n", 1, x, y);
            } else if (z == y && y == x) {
                printf("%lld %lld %lld\n", x, x, x);
            } else {
                cout << "NO" << endl;
            }
        }
    }
    return 0;
}


#include <cstdio>
#include <iostream>
#define max(a, b) ((a) < (b) ? (b) : (a))
using namespace std;
int main() {
    int T;
    cin >> T;
    for (int i = 1; i <= T; i++) {
        int x, y, z;
        scanf("%d%d%d", &x, &y, &z);
        int t1, t2, t3;
        t1 = max(x, y);
        t2 = max(x, z);
        t3 = max(y, z);
        if ((x == y && y > z)) {
            printf("YES\n");
            printf("%d %d %d\n", x, z, 1);
        } else if ((x == z && x > y)) {
            printf("YES\n");
            printf("%d %d %d\n", x, y, 1);
        } else if ((y == z && y > x)) {
            printf("YES\n");
            printf("%d %d %d\n", y, x, 1);
        } else if (z == y && y == x) {
            printf("%d %d %d\n", x, x, x);
        } else {
            cout << "NO" << endl;
        }
    }
    return 0;
}


#include <cstdio>
#include <iostream>
#define max(a, b) ((a) < (b) ? (b) : (a))
using namespace std;
int main() {
    int T;
    while (cin >> T) {
        for (int i = 1; i <= T; i++) {
            long long x, y, z;
            scanf("%lld%lld%lld", &x, &y, &z);
            if ((x == y && x > z)) {
                printf("YES\n");
                printf("%lld %lld 1\n", x, z);
            } else if ((x == z && x > y)) {
                printf("YES\n");
                printf("%lld %lld 1\n", y, x);
            } else if ((y == z && y > x)) {
                printf("YES\n");
                printf("%lld %lld 1\n", x, y);
            } else if (z == y && y == x) {
                printf("YES\n");
                printf("%lld %lld %lld\n", x, x, x);
            } else {
                cout << "NO" << endl;
            }
        }
    }
    return 0;
}


#include <cstdio>
#include <iostream>
#define max(a, b) ((a) < (b) ? (b) : (a))
using namespace std;
int main() {
    int T;
    while (cin >> T) {
        for (int i = 1; i <= T; i++) {
            long long x, y, z;
            scanf("%lld%lld%lld", &x, &y, &z);
            if ((x == y && x > z)) {
                printf("YES\n");
                printf("%lld %lld %lld\n", x, z, 1);
            } else if ((x == z && x > y)) {
                printf("YES\n");
                printf("%lld %lld %lld\n", y, x, 1);
            } else if ((y == z && y > x)) {
                printf("YES\n");
                printf("%lld %lld %lld\n", 1, x, y);
            } else if (z == y && y == x) {
                printf("YES\n");
                printf("%lld %lld %lld\n", x, x, x);
            } else {
                cout << "NO" << endl;
            }
        }
    }
    return 0;
}


#include <cstdio>
#include <iostream>
#define max(a, b) ((a) < (b) ? (b) : (a))
using namespace std;
int main() {
    int T;
    while (cin >> T) {

        cin >> T;
        for (int i = 1; i <= T; i++) {
            int x, y, z;
            scanf("%d%d%d", &x, &y, &z);
            // int t1, t2, t3;
            // t1 = max(x, y);
            // t2 = max(x, z);
            // t3 = max(y, z);
            if ((x == y && y > z && z != 1)) {
                printf("YES\n");
                printf("%d %d %d\n", x, z, 1);
            } else if ((x == z && x > y && y != 1)) {
                printf("YES\n");
                printf("%d %d %d\n", y, x, 1);
            } else if ((y == z && y > x && x != 1)) {
                printf("YES\n");
                printf("%d %d %d\n", 1, x, y);
            } else if (z == y && y == x) {
                printf("%d %d %d\n", x, x, x);
            } else {
                cout << "NO" << endl;
            }
        }
    }
    return 0;
}


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

int main(){
    int t;
    cin>>t;
    while(t--){
        int x,y,z;
        cin>>x>>y>>z;
        if(x==y&&y==z){
            cout<<"YES"<<endl;
            cout<<x<<" "<<y<<" "<<z<<endl;

        }
        else
        {
            int q=max(max(x,y),max(y,z));
            int r=min(min(x,y),min(y,z));
            if((q==x&&q==y&&q>z)||(q==y&&q==z&&q<x)||(q==z&&q==x&&q>y)){
                cout<<"YES"<<endl;
                cout<<r<<" "<<r<<" "<<q<<endl;
            }
            else
            {
                cout<<"NO"<<endl;
            }
        }
    }
    return 0;
}


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

int main(){
    int t;
    cin>>t;
    while(t--){
        int x,y,z;
        cin>>x>>y>>z;
        if(x==y&&y==z){
            cout<<"YES"<<endl;
            cout<<x<<' '<<y<<' '<<z<<endl;

        }
        else
        {
            int q=max(max(x,y), max(y,z));
            int r=min(min(x,y), min(y,z));
            if((q==x&&q==y&&q>z)||(q==y&&q==z&&q<x)||(q==z&&q==x&&q>y)){
                cout<<"YES"<<endl;
                cout<<r<<' '<<q-r<<' '<<q<<endl;
            }
            else
            {
                cout<<"NO"<<endl;
            }
        }
    }
    return 0;

}


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

int main(){
    int t;
    cin>>t;
    while(t--){
        int x,y,z;
        cin>>x>>y>>z;
        if(x==y&&y==z){
            cout<<"YES"<<endl;
            cout<<x<<' '<<y<<' '<<z<<endl;

        }
        else
        {
            int q=max(max(x,y), max(y,z));
            int r=min(min(x,y), min(y,z));
            if((q==x&&q==y&&q>z)||(q==y&&q==z&&q<x)||(q==z&&q==x&&q>y)){
                cout<<"YES"<<endl;
                cout<<r<<' '<<q-r<<' '<<q<<endl;
            }
            else
            {
                cout<<"NO"<<endl;
            }
        }
    }

}


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

int main()
{
    int t;
    cin>>t;
    while(t--){
        long long int x,y,z ;
        cin>>x>>y>>z ;
        long long int maxm = max(x,y);
        maxm = max(maxm,z);
        long long int a,b,c;
        long long int minm = min(x,y);
        minm = min(minm,z);
        if(maxm==minm){
            cout<<"YES"<<endl;
            cout<<x<<" "<<x<<" "<<x<<endl;
        }
        else if((x!=y)&&(y!=z)&&(x!=z)){
            cout<<"NO"<<endl;
        }
        else{
            a = maxm ;
            b = minm ;
            c = x+y+z-a-b;
            if(c==minm)
                cout<<"NO"<<endl;
            else{
                cout<<"YES"<<endl;
                cout<<a<<" "<<b<<" "<<b<<endl;
            }

        }
    }
    return 0;
}


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

int main(){
    int test;
    cin>>test;
    for (int i=0;i<test;test++){
        int x,y,z;
        cin>>x>>y>>z;
        if(x==y&&y==z){
            cout<<"YES"<<endl;
            cout<<x<<" "<<y<<" "<<z<<endl;

        }
        else
        {
            int q=max(max(x,y),max(y,z));
            int r=min(min(x,y),min(y,z));
            if((q==x&&q==y&&q>z)||(q==y&&q==z&&q<x)||(q==z&&q==x&&q>y)){
                cout<<"YES"<<endl;
                cout<<r<<" "<<r<<" "<<q<<endl;
            }
            else
            {
                cout<<"NO"<<endl;
            }
        }
    }
    return 0;
}


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


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

    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long int n,x;
    cin>>n;
    while(n--)
    {
        int ara[10];
        cin>>ara[0]>>ara[1]>>ara[2];
        sort(ara,ara+3);
        if(ara[0]==ara[1] && ara[1]==ara[2]){
            cout<<"YES"<<endl;
            cout<<ara[0]<<" "<<ara[0]<<" "<<ara[0]<<endl;
        }
        else if(ara[0]!=ara[1] && ara[1]==ara[2]){
            cout<<"YES"<<endl;
            cout<<ara[2]<<" "<<ara[0]<<" "<<ara[0]<<endl;
        }
        else
            cout<<"NO"<<endl;
    }
    return 0;
}


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

    }
    return 0;
}


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

    }
    return 0;
}


#include <iostream>
#include <math.h>
using namespace std;
int main()
{
	int t;
	cin >> t;
	for(int i = 0; i < t; i++){
		int x,y,z;
		cin >> x >> y >> z;
		if(x != y && x != z){
			cout << "NO\n";
		}
		else if( x == y && x > z){
			cout << "YES\n" << z << z <<x;
		}
		else if(x== z && x > y){
			cout << "YES\n" << y << y << x;
		}
		else if(y ==z && y > x){
			cout <<"YES\n" << x << x << y;
		}
		else{
			cout <<"NO\n";
		}
	}
	return 0;
}


#include <iostream>
#include <math.h>
using namespace std;
int main()
{
	int t;
	cin >> t;
	for(int i = 0; i < t; i++){
		int x,y,z;
		cin >> x >> y >> z;
		if(x != y && x != z){
			cout << "NO\n";
		}
		else if( x == y && x > z){
			cout << "YES\n" << z <<" "<< z <<" " <<x << endl;
		}
		else if(x== z && x > y){
			cout << "YES\n" << y <<" "<< y <<" "<< x << endl;
		}
		else if(y ==z && y > x){
			cout <<"YES\n" << x <<" " << x << " "<< y << endl;
		}
		else if ( x == y && x== z){
			cout << "YES\n" << x << " " << y << " " << z << endl;
		}
		else{
			cout << "NO\n";
		}
	}
	return 0;
}


#include <iostream>
#include <math.h>
using namespace std;
int main()
{
	int t;
	cin >> t;
	for(int i = 0; i < t; i++){
		int x,y,z;
		cin >> x >> y >> z;
		if(x != y && x != z && y != z){
			cout << "NO\n";
		}
		else if( x == y && x > z){
			cout << "YES\n" << z <<" "<< z <<" " <<x << endl;
		}
		else if(x== z && x > y){
			cout << "YES\n" << y <<" "<< y <<" "<< x << endl;
		}
		else if(y == z && y > x){
			cout <<"YES\n" << x <<" " << x << " "<< y << endl;
		}
		else if ( x == y && x== z){
			cout << "YES\n" << x << " " << y << " " << z << endl;
		}
		else{
			cout << "NO\n";
		}
	}
	return 0;
}


#include <iostream>
#include <math.h>
using namespace std;
int main()
{
	int t;
	cin >> t;
	for(int i = 0; i < t; i++){
		int x,y,z;
		cin >> x >> y >> z;
		if(x != y && x != z){
			cout << "NO\n";
		}
		else if( x == y && x > z){
			cout << "YES\n" << z <<" "<< z <<" " <<x;
		}
		else if(x== z && x > y){
			cout << "YES\n" << y <<" "<< y <<" "<< x;
		}
		else if(y ==z && y > x){
			cout <<"YES\n" << x <<" " << x << " "<< y;
		}
		else if ( x == y && x== z){
			cout << "YES\n" << x << " " << y << " " << z;
		}
		else{
			cout << "NO\n";
		}
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{

       int t;
       cin>>t;
       while(t--)
       {  map<long long,long long>mp;
          long long v;
         for(int i=0;i<3;i++)
         {
             int t;
             cin>>t;
             mp[t]++;
             if(i==1)
             {
                 v=t;
             }
         }
         long long a,b,c;
           if(mp.size()==3)
           {
               cout<<"NO"<<"\n";
           }
           else
           {
               for(auto itr=mp.begin();itr!=mp.end();itr++)
               {
                   if(itr->second==2)
                   {
                       a=itr->first;
                       break;
                   }
               }
               cout<<"YES"<<"\n";
              cout<<"1"<<" "<<a<<" "<<v<<"\n";
           }
       }

           return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{

       int t;
       cin>>t;
       while(t--)
       {  map<long long,long long>mp;
          long long v;
         for(int i=0;i<3;i++)
         {
             int t;
             cin>>t;
             mp[t]++;
         }
         long long a,b,c;
           if(mp.size()==3)
           {
               cout<<"NO"<<"\n";
           }
           else
           {
               for(auto itr=mp.begin();itr!=mp.end();itr++)
               {
                   if(itr->second>=2)
                   {
                       a=itr->first;
                   }
                   else if(itr->second==1)
                   {
                       v=itr->first;
                   }
               }
               if(mp.size()==1)
               {   cout<<"YES"<<"\n";
                   cout<<a<<" "<<a<<" "<<a<<"\n";
                   continue;
               }
               cout<<"YES"<<"\n";
               cout<<v<<" "<<a<<" "<<"1"<<"\n";
           }
           mp.clear();
       }

           return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{

       int t;
       cin>>t;
       while(t--)
       {
            map<long long,long long>mp;
            long long max1=0,flag=0,a,b;
           for(int i=0;i<3;i++)
           {
               long long  t;
               cin>>t;
               mp[t]++;
               if(max1<t)
                max1=t;
           }
           if(mp.size()==3)
           {
               cout<<"NO"<<"\n";
               continue;
           }
           for(auto itr=mp.begin();itr!=mp.end();itr++)
           {
               if(itr->second>=2)
               {
                   if(itr->first==max1)
                   {
                       flag=1;
                       a=itr->first;
                   }
                   else
                   {
                       break;
                   }
               }
               else if(itr->second==1)
               {
                   b=itr->first;
               }
           }
           if(mp.size()==1)
           {   cout<<"YES"<<"\n";
               cout<<a<<" "<<a<<" "<<a<<"\n";
               continue;
           }

           if(flag==0)
           {
               cout<<"NO"<<"\n";

           }
           else
           {   cout<<"YES"<<"\n";
               cout<<a<<" "<<b<<" "<<"1"<<"\n";
           }
       }

           return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{

       int t;
       cin>>t;
       while(t--)
       {  map<long long,long long>mp;
          long long v;
         for(int i=0;i<3;i++)
         {
             int t;
             cin>>t;
             mp[t]++;
         }
         long long a,b,c;
           if(mp.size()==3)
           {
               cout<<"NO"<<"\n";
           }
           else
           {
               for(auto itr=mp.begin();itr!=mp.end();itr++)
               {
                   if(itr->second>=2)
                   {
                       a=itr->first;
                   }
                   else if(itr->second==1)
                   {
                       v=itr->first;
                   }
               }
               if(mp.size()==1)
               {   cout<<"YES"<<"\n";
                   cout<<a<<" "<<a<<" "<<a<<"\n";
                   continue;
               }
               cout<<"YES"<<"\n";
               cout<<a<<" "<<a<<" "<<"1"<<"\n";
           }
           mp.clear();
       }

           return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{

       int t;
       cin>>t;
       while(t--)
       {  map<long long,long long>mp;
          long long v;
         for(int i=0;i<3;i++)
         {
             int t;
             cin>>t;
             mp[t]++;
             if(i==1)
             {
                 v=t;
             }
         }
         long long a,b,c;
           if(mp.size()==3)
           {
               cout<<"NO"<<"\n";
           }
           else
           {
               for(auto itr=mp.begin();itr!=mp.end();itr++)
               {
                   if(itr->second>=2)
                   {
                       a=itr->first;
                       break;
                   }
               }
               cout<<"YES"<<"\n";
              cout<<"1"<<" "<<a<<" "<<v<<"\n";
           }
           mp.clear();
       }

           return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{

       int t;
       cin>>t;
       while(t--)
       {  map<long long,long long>mp;
          long long v;
         for(int i=0;i<3;i++)
         {
             int t;
             cin>>t;
             mp[t]++;
         }
         long long a,b,c;
           if(mp.size()==3)
           {
               cout<<"NO"<<"\n";
           }
           else
           {
               for(auto itr=mp.begin();itr!=mp.end();itr++)
               {
                   if(itr->second>=2)
                   {
                       a=itr->first;
                   }
                   else if(itr->second==1)
                   {
                       v=itr->first;
                   }
               }
               if(mp.size()==1)
               {
                   cout<<a<<" "<<a<<" "<<a<<"\n";
                   continue;
               }
               cout<<"YES"<<"\n";
               cout<<v<<" "<<a<<" "<<"1"<<"\n";
           }
           mp.clear();
       }

           return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{

       int t;
       cin>>t;
       while(t--)
       {  map<long long,long long>mp;
          long long v;
         for(int i=0;i<3;i++)
         {
             int t;
             cin>>t;
             mp[t]++;
         }
         long long a,b,c;
           if(mp.size()==3)
           {
               cout<<"NO"<<"\n";
           }
           else
           {
               for(auto itr=mp.begin();itr!=mp.end();itr++)
               {
                   if(itr->second>=2)
                   {
                       a=itr->first;
                   }
                   else if(itr->second==1)
                   {
                       v=itr->first;
                   }
               }
               if(mp.size()==1)
               {   cout<<"YES"<<"\n";
                   cout<<a<<" "<<a<<" "<<a<<"\n";
                   continue;
               }
               cout<<"YES"<<"\n";
               cout<<v<<" "<<a<<" "<<a<<"\n";
           }
           mp.clear();
       }

           return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
int a[100005];
int main()
{
    int n,i;
    scanf("%d",&n);
    int a,b,c;
    for(i=0;i<n;i++)
    {
        scanf("%d%d%d",&a,&b,&c);
        if(a==b&&b==c)
        {
            cout<<"YES"<<endl<<a<<" "<<b<<" "<<c<<endl;
        }
        else if(a==c&&a>b)
        {
            cout<<"YES"<<endl<<a<<" "<<b<<" "<<1<<endl;
        }
        else if(b==c&&a<c)
        {
            cout<<"YES"<<endl<<a<<" "<<a<<" "<<c/a<<endl;
        }
        else
        {
            cout<<"NO"<<endl;
        }
    }

}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
int main()
{
    int n,i;
    scanf("%d",&n);
    int a,b,c;
    for(i=0;i<n;i++)
    {
        scanf("%d%d%d",&a,&b,&c);
        if(a<b)swap(a,b);
        //if(a>c)swap(a,c);
        if(b>c)swap(b,c);
        if(b==c&&a<=b)
        {
            cout<<"YES"<<a<<" "<<a<<" "<<c<<endl;
        }
        else
        {
            cout<<"NO"<<endl;
        }
    }

}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
//int a[100005];
int main()
{
    int n,i;
    scanf("%d",&n);
    int a[3];
    for(i=0;i<n;i++)
    {
        scanf("%d%d%d",&a[0],&a[1],&a[2]);
        sort(a,a+3);
        if(a[1]!=a[2])
        {
            cout<<"NO"<<endl;
        }
        else
        {
            cout<<"YES"<<a[0]<<" "<<a[0]<<" "<<a[1]<<endl;
        }
    }

}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
int a[100005];
int main()
{
    int n,i;
    scanf("%d",&n);
    int a,b,c;
    for(i=0;i<n;i++)
    {
        scanf("%d%d%d",&a,&b,&c);
        if(a<b)swap(a,b);
        //if(a>c)swap(a,c);
        if(b>c)swap(b,c);
        if(b==c&&a<=b)
        {
            cout<<"YES"<<a<<" "<<a<<" "<<c<<endl;
        }
        else
        {
            cout<<"NO"<<endl;
        }
    }

}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
//int a[100005];
int main()
{
    int n,i;
    scanf("%d",&n);
    int a[3];
    for(i=0;i<n;i++)
    {
        scanf("%d%d%d",&a[0],&a[1],&a[2]);
        sort(a,a+3);
        if(a[1]!=a[2])
        {
            cout<<"NO"<<endl;
        }
        else
        {
            cout<<"YES"<<a[2]<<" "<<a[0]<<" "<<1<<endl;
        }
    }

}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
int a[100005];
int main()
{
    int n,i;
    scanf("%d",&n);
    int a,b,c;
    for(i=0;i<n;i++)
    {
        scanf("%d%d%d",&a,&b,&c);
        if(a==b&&b==c)
        {
            cout<<"YES"<<endl<<a<<" "<<b<<" "<<c<<endl;
        }
        else if(a==c&&a>b)
        {
            cout<<"YES"<<endl<<a<<" "<<b<<" "<<b<<endl;
        }
        else if(b==c&&a<c)
        {
            cout<<"YES"<<endl<<a<<" "<<a<<" "<<c<<endl;
        }
        else
        {
            cout<<"NO"<<endl;
        }
    }

}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
//int a[100005];
int main()
{
    int n,i;
    scanf("%d",&n);
    int a[3];
    for(i=0;i<n;i++)
    {
        scanf("%d%d%d",&a[0],&a[1],&a[2]);
        sort(a,a+3);
        if(a[1]!=a[2])
        {
            cout<<"NO"<<endl;
        }
        else
        {
            cout<<"YES"<<endl<<a[2]<<" "<<a[0]<<" "<<1<<endl;
        }
    }

}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
int a[100005];
int main()
{
    int n,i;
    scanf("%d",&n);
    int a,b,c;
    for(i=0;i<n;i++)
    {
        scanf("%d%d%d",&a,&b,&c);
        if(a<b)swap(a,b);
        //if(a>c)swap(a,c);
        if(b>c)swap(b,c);
        if(a==b&&a==c)
        {
            cout<<"YES"<<endl<<a<<" "<<b<<" "<<c<<endl;
        }
        else if(a==c&&a>b)
        {
            cout<<"YES"<<endl<<a<<' '<<b<<' '<<endl;
        }
    }

}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
//int a[100005];
int main()
{
    int n,i;
    scanf("%d",&n);
    int a,b,c;
    for(i=0;i<n;i++)
    {
        scanf("%d%d%d",&a,&b,&c);
        if(a>b)swap(a,b);
        //if(a>c)swap(a,c);
        if(b>c)swap(b,c);
        if(b==c&&a<=b)
        {
            cout<<"YES"<<a<<" "<<a<<" "<<c<<endl;
        }
        else
        {
            cout<<"NO"<<endl;
        }
    }

}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
int a[100005];
int main()
{
    int n,i;
    scanf("%d",&n);
    int a,b,c;
    for(i=0;i<n;i++)
    {
        scanf("%d%d%d",&a,&b,&c);
        if(a<b)swap(a,b);
        //if(a>c)swap(a,c);
        if(b>c)swap(b,c);
        if(a==b&&a==c)
        {
            cout<<"YES"<<endl<<a<<" "<<b<<" "<<c<<endl;
        }
        else if(a==c&&a>b)
        {
            cout<<"YES"<<endl<<a<<' '<<b<<' '<<endl;
        }
        else
        {
            cout<<"NO"<<endl;
        }
    }

}


#include<iostream>
using namespace std;

int a,b,c;
long int x,y,z;
bool flag;

int Max(int a,int b)
{
    if(a>b)
        return a;
    else
        return b;
}

void Ans()
{
    //checking for no one same!!
    if(x!=y&&x!=z&&y!=z)
        flag=false;

    //check for same num:
    if(x==y&&x==z&&y==z)
    {
        a=x;
        b=x;
        c=x;
        flag=true;
    }

    //if two are similar:
    if(!flag)
    {
        if(x==y)
        {
            a=x;
            b=z;
            c=z;
            flag=true;
        }else if(y==z)
                {
                    a=x;
                    b=x;
                    c=z;
                    flag=true;
                }else if(x==z){
                        a=y;
                        b=x;
                        c=y;
                        flag=true;
                     }
    }

    if(flag)
    {
        if(x==Max(a,b)&&y==Max(a,c)&&z==Max(b,c));
        else
            flag=false;
    }
}

int main()
{
    int testCase;
    cin>>testCase;

    for(int i=0;i<testCase;i++)
    {
        flag = false;
        cin>>x>>y>>z;
        Ans();

        if(flag)
            cout<<"YES"<<endl<<a<<" "<<b<<" "<<c<<endl;
        else
            cout<<"NO"<<endl;
    }
    return 0;
}


#include<iostream>
using namespace std;

int a,b,c;
long int x,y,z;
bool flag;

void Ans()
{
    //checking for no one same!!
    if(x!=y&&x!=z&&y!=z)
        flag=false;

    //check for same num:
    if(x==y&&x==z&&y==z)
    {
        a=x;
        b=x;
        c=x;
        flag=true;
    }

    //if two are similar:
    if(!flag)
    {
        if(x==y)
        {
            a=x;
            if(x>z)
                {
                        c=x-1;
                        b=c-1;
                        flag=true;
                }
        }else if(y==z)
                {
                    c=y;
                    if(y>x)
                    {
                        a=x;
                        b=a;
                        flag=true;
                    }
                }else if(x==z){
                        b=x;
                        if(x>y)
                        {
                            a=x-1;
                            c=a-1;
                            flag=true;
                        }
                     }
    }
}

int main()
{
    int testCase;
    cin>>testCase;

    for(int i=0;i<testCase;i++)
    {
        flag = false;
        cin>>x>>y>>z;
        Ans();

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

    return 0;
}


#include<iostream>
using namespace std;

int a,b,c;
long int x,y,z;
bool flag;

int Max(int a,int b)
{
    if(a>b)
        return a;
    else
        return b;
}

void Ans()
{
    //checking for no one same!!
    if(x!=y&&x!=z&&y!=z)
        flag=false;

    //check for same num:
    if(x==y&&x==z&&y==z)
    {
        a=x;
        b=x;
        c=x;
        flag=true;
    }

    //if two are similar:
    if(!flag)
    {
        if(x==y)
        {
            a=x;
            b=z;
            c=z;
            flag=true;
        }else if(y==z)
                {
                    a=x;
                    b=x;
                    c=z;
                    flag=true;
                }else if(x==z){
                        a=y;
                        b=x;
                        c=y;
                        flag=true;
                     }
    }

    if(flag)
    {
        if(x==Max(a,b)&&y==Max(a,c)&&z==Max(b,c));
        else
            flag=false;
    }
}

int main()
{
    int testCase;
    cin>>testCase;

    for(int i=0;i<testCase;i++)
    {
        flag = false;
        cin>>x>>y>>z;
        Ans();

        if(flag)
            cout<<"YES"<<endl<<a<<" "<<b<<" "<<c<<endl;
        else
            cout<<"NO";
    }
    return 0;
}


#include<iostream>
using namespace std;

int a,b,c;
long int x,y,z;
bool flag;

void Ans()
{
    //checking for no one same!!
    if(x!=y&&x!=z&&y!=z)
        flag=false;

    //check for same num:
    if(x==y&&x==z&&y==z)
    {
        a=x;
        b=x;
        c=x;
        flag=true;
    }

    //if two are similar:
    if(!flag)
    {
        if(x==y)
        {
            a=x;
            if(x>z)
                {
                        c=x-1;
                        b=c-1;
                        flag=true;
                }
        }else if(y==z)
                {
                    c=y;
                    if(y>x)
                    {
                        a=x;
                        b=a;
                        flag=true;
                    }
                }else if(x==z){
                        b=x;
                        if(x>y)
                        {
                            a=x-1;
                            c=a-1;
                            flag=true;
                        }
                     }
    }
}

int main()
{
    int testCase;
    cin>>testCase;

    for(int i=0;i<testCase;i++)
    {
        flag = false;
        cin>>x>>y>>z;
        Ans();

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

    return 0;
}


//============================================================================
// Name        : Setup.cpp
// Author      : Ved Bhatawadekar
// Version     :
// Copyright   : Roll. No. 21407
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
#include <cmath>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <string>
#include <typeinfo>
#include <bits/stdc++.h>
using namespace std;

void swap(int a,int b){
	int temp = a;
	a = b;
	b = temp;
}

int main() {
	long long t;
	cin >> t;
	for (long long i = 0;i<t;i++){
		int x,y,z;
		cin >> x >> y >> z;
		int arr[3] = {x,y,z} ;
		int Max,Min;
		Max = *max_element(arr,arr+3);
		Min = *min_element(arr,arr+3);
		int Count;
		Count = count(arr,arr+3,Max);
		if (Count == 2){
			cout << "YES" << "\n";
			cout << Min << " "<< Min << " "<< Max << "\n";
		}
		else{
			cout << "NO" << "\n";
		}
	}

}


//============================================================================
// Name        : Setup.cpp
// Author      : Ved Bhatawadekar
// Version     :
// Copyright   : Roll. No. 21407
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
#include <cmath>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <string>
#include <typeinfo>
#include <bits/stdc++.h>
using namespace std;

void swap(int a,int b){
	int temp = a;
	a = b;
	b = temp;
}

int main() {
	long long t;
	cin >> t;
	for (long long i = 0;i<t;i++){
		int x,y,z;
		cin >> x >> y >> z;
		int arr[3] = {x,y,z} ;
		int Max,Min;
		Max = *max_element(arr,arr+3);
		Min = *min_element(arr,arr+3);
		int Count;
		Count = count(arr,arr+3,Max);
		if (Count >= 2){
			cout << "YES" << "\n";
			cout << Min << " "<< Min << " "<< Max << "\n";
		}
		else{
			cout << "NO" << "\n";
		}
	}

}


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

int main()
{
    int t;
    while(t--){
        long long int x,y,z ;
        cin>>x>>y>>z ;
        long long int maxm = max(x,y);
        maxm = max(maxm,z);
        long long int a,b,c;
        long long int minm = min(x,y);
        minm = min(minm,z);
        if(maxm==minm){
            cout<<"YES"<<endl;
            cout<<x<<" "<<x<<" "<<x<<endl;
        }
        else if(x!=y&&y!=z&&x!=z){
            cout<<"NO"<<endl;
        }
        else{
            a = maxm ;
            b = minm ;
            c = x+y+z-a-b;
            if(c==minm)
                cout<<"NO"<<endl;
            else{
                cout<<"YES"<<endl;
                cout<<a<<" "<<b<<" "<<c<<endl;
            }

        }
    }
    return 0;
}


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

int main()
{
    int t;
    while(t--){
        long long int x,y,z ;
        cin>>x>>y>>z ;
        long long int maxm = max(x,y);
        maxm = max(maxm,z);
        long long int a,b,c;
        long long int minm = min(x,y);
        minm = min(minm,z);
        if(maxm==minm){
            cout<<"YES"<<endl;
            cout<<x<<" "<<x<<" "<<x<<endl;
        }
        else if((x!=y)&&(y!=z)&&(x!=z)){
            cout<<"NO"<<endl;
        }
        else{
            a = maxm ;
            b = minm ;
            c = x+y+z-a-b;
            if(c==minm)
                cout<<"NO"<<endl;
            else{
                cout<<"YES"<<endl;
                cout<<a<<" "<<c<<" "<<b<<endl;
            }

        }
    }
    return 0;
}


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

int main()
{
    int t;
    cin>>t;
    while(t--){
        long long int x,y,z ;
        cin>>x>>y>>z ;
        long long int maxm = max(x,y);
        maxm = max(maxm,z);
        long long int a,b,c;
        long long int minm = min(x,y);
        minm = min(minm,z);
        if(maxm==minm){
            cout<<"YES"<<endl;
            cout<<x<<" "<<x<<" "<<x<<endl;
        }
        else if((x!=y)&&(y!=z)&&(x!=z)){
            cout<<"NO"<<endl;
        }
        else{
            a = maxm ;
            b = minm ;
            c = x+y+z-a-b;
            if(c==minm)
                cout<<"NO"<<endl;
            else{
                cout<<"YES"<<endl;
                cout<<a<<" "<<b<<" "<<b<<endl;
            }

        }
    }
    return 0;
}


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

int main()
{
    int t;
    while(t--){
        long long int x,y,z ;
        cin>>x>>y>>z ;
        long long int maxm = max(x,y);
        maxm = max(maxm,z);
        long long int a,b,c;
        long long int minm = min(x,y);
        minm = min(minm,z);
        if(maxm==minm){
            cout<<"YES"<<endl;
            cout<<x<<" "<<x<<" "<<x<<endl;
        }
        else if((x!=y)&&(y!=z)&&(x!=z)){
            cout<<"NO"<<endl;
        }
        else{
            a = maxm ;
            b = minm ;
            c = x+y+z-a-b;
            if(c==minm)
                cout<<"NO"<<endl;
            else{
                cout<<"YES"<<endl;
                cout<<a<<" "<<b<<" "<<b<<endl;
            }

        }
    }
    return 0;
}


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

int main()
{
    int t;
    while(t--){
        long long int x,y,z ;
        cin>>x>>y>>z ;
        long long int maxm = max(x,y);
        maxm = max(maxm,z);
        long long int a,b,c;
        long long int minm = min(x,y);
        minm = min(minm,z);
        if(maxm==minm){
            cout<<"YES"<<endl;
            cout<<x<<" "<<x<<" "<<x<<endl;
        }
        else if((x!=y)&&(y!=z)&&(x!=z)){
            cout<<"NO"<<endl;
        }
        else{
            a = maxm ;
            b = minm ;
            c = x+y+z-a-b;
            if(c==minm)
                cout<<"NO"<<endl;
            else{
                cout<<"YES"<<endl;
                cout<<a<<" "<<a<<" "<<b<<endl;
            }

        }
    }
    return 0;
}


#include <iostream>
using namespace std;

int main(){
    int x, y, z;
    int a, b, c;
    int n;
    cin >> n;
    for (int i = 0; i < n; i++){
        cin >> x >> y >> z;

        if (x == y) && (x > z){
            a = x;
            b = z;
            c = z - 1;
            cout << "YES" << endl;
            cout << a << ' ' << b << ' ' << c << endl;
            continue;
        }

        if (x == z) && (x > y){
            a = y;
            b = x;
            c = y - 1;
            cout << "YES" << endl;
            cout << a << ' ' << b << ' ' << c << endl;
            continue;
        }

        if (y == z) && (y > x){
            a = x;
            b = x - 1;
            c = y;
            cout << "YES" << endl;
            cout << a << ' ' << b << ' ' << c << endl;
            continue;
        }

        cout << "NO";
    }
}


#include <iostream>
using namespace std;

int main(){
    int x, y, z;
    int a, b, c;
    int n;
    cin >> n;
    for (int i = 0; i < n; i++){
        cin >> x >> y >> z;

        if (x == y){
            a = x;
            b = z;
            c = z - 1;
            cout << "YES" << endl;
            cout << a << ' ' << b << ' ' << c << endl;
            break;
        }

        if (x == z){
            a = y;
            b = x;
            c = y - 1;
            cout << "YES" << endl;
            cout << a << ' ' << b << ' ' << c << endl;
            break;
        }

        if (y == z){
            a = x;
            b = x - 1;
            c = y;
            cout << "YES" << endl;
            cout << a << ' ' << b << ' ' << c << endl;
            break;
        }

        cout << "NO";
    }
}


#include <iostream>
using namespace std;

int main(){
    int x, y, z;
    int a, b, c;
    int n;
    cin >> n;
    for (int i = 0; i < n; i++){
        cin >> x >> y >> z;

        if (x == y){
            a = x;
            b = z;
            c = z - 1;
            cout << "YES" << endl;
            cout << a << ' ' << b << ' ' << c;
            return 0;
        }

        if (x == z){
            a = y;
            b = x;
            c = y - 1;
            cout << "YES" << endl;
            cout << a << ' ' << b << ' ' << c;
            return 0;
        }

        if (y == z){
            a = x;
            b = x - 1;
            c = y;
            cout << "YES" << endl;
            cout << a << ' ' << b << ' ' << c;
            return 0;
        }

        cout << "NO";
    }
}


#include <iostream>
using namespace std;

int main(){
    int x, y, z;
    int a, b, c;
    int n;
    cin >> n;
    for (int i = 0; i < n; i++){
        cin >> x >> y >> z;

        if ((x == y) && (x > z)){
            a = x;
            b = z;
            c = z - 1;
            cout << "YES" << endl;
            cout << a << ' ' << b << ' ' << c << endl;
            continue;
        }

        if ((x == z) && (x > y)){
            a = y;
            b = x;
            c = y - 1;
            cout << "YES" << endl;
            cout << a << ' ' << b << ' ' << c << endl;
            continue;
        }

        if ((y == z) && (y > x)){
            a = x;
            b = x - 1;
            c = y;
            cout << "YES" << endl;
            cout << a << ' ' << b << ' ' << c << endl;
            continue;
        }

        cout << "NO" << endl;
    }
}


#include <iostream>
using namespace std;

int main(){
    int x, y, z;
    int a, b, c;
    int n;
    cin >> n;
    for (int i = 0; i < n; i++){
        cin >> x >> y >> z;

        if ((x == y) && (x >= z)){
            a = x;
            b = z;
            c = z;
            cout << "YES" << endl;
            cout << a << ' ' << b << ' ' << c << endl;
            continue;
        }

        if ((x == z) && (x >= y)){
            a = y;
            b = x;
            c = y;
            cout << "YES" << endl;
            cout << a << ' ' << b << ' ' << c << endl;
            continue;
        }

        if ((y == z) && (y >= x)){
            a = x;
            b = x;
            c = y;
            cout << "YES" << endl;
            cout << a << ' ' << b << ' ' << c << endl;
            continue;
        }

        cout << "NO" << endl;
    }
}


#include <iostream>
using namespace std;

int main(){
    int x, y, z;
    int a, b, c;
    int n;
    cin >> n;
    for (int i = 0; i < n; i++){
        cin >> x >> y >> z;

        if ((x == y) && (x > z)){
            a = x;
            b = z;
            c = z - 1;
            cout << "YES" << endl;
            cout << a << ' ' << b << ' ' << c << endl;
            continue;
        }

        if ((x == z) && (x > y)){
            a = y;
            b = x;
            c = y - 1;
            cout << "YES" << endl;
            cout << a << ' ' << b << ' ' << c << endl;
            continue;
        }

        if ((y == z) && (y > x)){
            a = x;
            b = x - 1;
            c = y;
            cout << "YES" << endl;
            cout << a << ' ' << b << ' ' << c << endl;
            continue;
        }

        cout << "NO";
    }
}


#include <iostream>
using namespace std;

int main(){
    int x, y, z;
    int a, b, c;
    int n;
    cin >> n;
    for (int i = 0; i < n; i++){
        cin >> x >> y >> z;

        if (x == y){
            a = x;
            b = z;
            c = z - 1;
            cout << "YES" << endl;
            cout << a << ' ' << b << ' ' << c;
            break;
        }

        if (x == z){
            a = y;
            b = x;
            c = y - 1;
            cout << "YES" << endl;
            cout << a << ' ' << b << ' ' << c;
            break;
        }

        if (y == z){
            a = x;
            b = x - 1;
            c = y;
            cout << "YES" << endl;
            cout << a << ' ' << b << ' ' << c;
            break;
        }

        cout << "NO";
    }
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
	int a[4];
	int n;
	cin>>n;
	for(int j=1;j<=n;j++)
	{
		for(int i=1;i<=3;i++)
		{
			cin>>a[i];
		}
		sort(a+1,a+3+1);
		if(a[2]==a[3])
		{
			cout<<"YES\n";
			cout<<a[2]<<" "<<a[1]<<" "<<a[1]<<endl;
		}
		else
		{
			cout<<"NO"<<endl;
		}
	}
	return 0;
 }


#include<bits/stdc++.h>
using namespace std;
int a[3],t;
int main(){
    cin>>t;
    while(t--){
        int maxn;
        cin>>a[0]>>a[1]>>a[2];
        sort(a,a+2);
        if(a[0]<=a[1] && a[1]==a[2]) cout<<"YES"<<endl<<a[2]<<' '<<a[0]<<' '<<1<<endl;
        else cout<<"NO"<<endl;
    }
}


#include<bits/stdc++.h>
using namespace std;
int a[3],t;
int main(){
    cin>>t;
    while(t--){
        cin>>a[0]>>a[1]>>a[2];
        sort(a,a+2);
        if(a[1]==a[2]) cout<<"YES"<<endl<<a[2]<<' '<<a[0]<<' '<<1<<endl;
        else cout<<"NO"<<endl;
    }
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int T;
    cin>>T;
    while(T--)
    {
      int a[3];
      cin>>a[1]>>a[2]>>a[3];
      sort(a+1,a+4);
      if(a[2]==a[3])
      {
        puts("YES");
        printf("%d %d %d\n",a[1],a[2],a[2]);
      }
      else
        puts("NO");
    }
return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <map>
#include <set>
#include <string>
#include <string.h>
#include <stack>
#include <vector>
#include <queue>
#include <stdio.h>
#pragma GCC optimize(2)
namespace ucp{
    typedef long long ll;
    typedef double db;
    typedef long double ld;
    #define mpr make_pair
    #define debug() puts("okkkkkkkk")
    #define scd(a) scanf("%d",&a)
    #define scd2(a,b) scanf("%d%d",&a,&b)
    #define scd3(a,b,c) scanf("%d%d%d",&a,&b,&c)
    #define scl(a) scanf("%lld",&a)
    #define scl2(a,b) scanf("%lld%lld",&a,&b)
    #define scl3(a,b,c) scanf("%lld%lld%lld",&a,&b,&c)
    #define scs(s) scanf("%s",s)
    #define prdln(a) printf("%d\n", a)
    #define prd2ln(a,b) printf("%d %d\n", a, b)
    #define prd3ln(a,b,c) printf("%d %d %d\n", a, b, c)
    #define prlln(a) printf("%lld\n", a)
    #define prl2ln(a,b) printf("%lld %lld\n", a, b)
    #define prl3ln(a,b,c) printf("%lld %lld %lld\n", a, b, c)
    #define prd(a) printf("%d ", a)
    #define prd2(a,b) printf("%d %d ", a, b)
    #define prd3(a,b,c) printf("%d %d %d ", a, b, c)
    #define prl(a) printf("%lld ", a)
    #define prl2(a,b) printf("%lld %lld ", a, b)
    #define prl3(a,b,c) printf("%lld %lld %lld ", a, b, c)
    #define For(i,st,en) for(int i=st;i<en;++i)
    #define For_(i,st,en) for(int i=st;i<=en;++i)
    #define Rep(i,st,en) for(int i=st;i>en;--i)
    #define Rep_(i,st,en) for(int i=st;i>=en;--i)
    #define mem(a) memset(a,0,sizeof(a))
    #define SZ(x) ((int)(x).size())
    #define ALL(x) (x).begin(), (x).end()
    #define lc(i) (i<<1)
    #define rc(i) (i<<1|1)
    #define PII pair<int,int>
    #define fi first
    #define se second
    template<typename T>
    void Min(T& a, T b)
    {
        if (a > b)
            a = b;
    }
    template<typename T>
    void Max(T& a, T b)
    {
        if (a < b)
            a = b;
    }
    inline int read() {
        int sign,data = 0;
        char ch = 0;
        while((ch!='-') && ch < '0'|| ch > '9') ch = getchar();
        if (ch == '-') {
            sign = -1;
            ch = getchar();
        }
        else
            sign = 1;
        while (ch >= '0' && ch <= '9') {
            data = data * 10 + ch - '0';
            ch = getchar();
        }
        return data * sign;
    }
    inline void print(int x)
    {
        if(x / 10)
            print(x / 10);
        putchar(x % 10 + '0');
    }
}
using namespace std;
using namespace ucp;
const int mxint = 0x3f3f3f3f;
const ll mxll = 1e16;
const int lim = 5e5 + 10;
const int maxn = 5000 + 10;
const int maxm = 1e5 + 10;
const ll mod = 1000000007;
const db eps = 1e-7;
int N, M, K;
int main () {
    int t=read();
    while (t--) {
        vector<int> arr;
        for (int i = 0; i < 3; ++i)
            arr.push_back(read());
        sort(ALL(arr));
        if (arr[1]==arr[2]) {
            puts("YES");
            prd3ln(arr[2],arr[0],arr[0]);
        } else {
            puts("NO");
        }
    }
    return 0;
}


//Code by a weak man who named tarjin, and he hopes the code can get more points.
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cstring>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const int NR=1e2;
int t;
int a[NR+5];
int main(void)
{
	scanf("%d",&t);
	while(t--)
	{
		memset(a,999999,sizeof(a));
		scanf("%d%d%d",&a[1],&a[2],&a[3]);
		sort(a+1,a+NR+1);
		if(a[2]!=a[3])
			printf("NO\n");
		else
		{
			printf("YES\n");
			printf("%d %d %d\n",a[1],a[1],a[2]);
		}
	}
	return 0;
}


#include<iostream>
using namespace std;
int main()
{
	int t,a,b,c;
	cin>>t;
	while(t--)
	{
		cin>>a>>b>>c;
		if(a==b&&b==c)cout<<"YES\n",cout<<a<<" "<<a<<" "<<a<<endl;
		else if(b==c&&a<b)cout<<"YES\n",cout<<1<<" "<<a<<" "<<b<<endl;
		else if(a==c&&a>b)cout<<"YES\n",cout<<1<<" "<<a<<" "<<b<<endl;
		else if(a==b&&a>c)cout<<"YES\n",cout<<a<<" "<<c<<" "<<c<<endl;
		else cout<<"NO\n";
	}
	return 0;
}


#include<bits/stdc++.h>
#define fint register int
#define h 5001
#define p 4330543
using namespace std;
int main()
{
	int T;
	cin>>T;
	while(T--)
	{
		int x,y,z;
		cin>>x>>y>>z;
		if(x==y&&x==z)
		cout<<"YES"<<endl<<x<<" "<<y<<" "<<z<<endl;
		else
		if(x==y&&x>=z)//   a       b       c
		cout<<"YES"<<endl<<x<<" "<<z<<" "<<1<<endl;//x=max a,b  y=max a,c  z=max b,c
		else
		if(x==z&&x>=y)
		cout<<"YES"<<endl<<y<<" "<<z<<" "<<1<<endl;
		else
		if(y==z&&y>=x)
		cout<<"YES"<<endl<<x<<" "<<1<<" "<<y<<endl;
		else
		cout<<"NO"<<endl;
	}
	return 0;
}


#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
    int a[4],T;
    cin>>T;
    while(T--)
    {
        cin>>a[1]>>a[2]>>a[3];
        sort(a+1,a+4);
        if(a[2]==a[3])
        {
            cout<<"YES"<<endl<<a[2]<<" "<<a[1]<<" "<<a[1]<<endl;
        }
        else
        {
            cout<<"NO"<<endl;
        }
    }
    return 0;
}


#include <cstdio>
#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
	int t,a[3];
	cin >> t;
	while(t--)
	{
		cin >> a[0] >> a[1] >> a[2];
		sort(a,a+3);
		if(a[2]==a[1])
		{
			cout << "YES" << endl;
			printf("%d %d %d\n",a[0],a[0],a[1]);
		}
		else
		{
			cout << "NO" << endl;
		}
	}

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int T;
int a[10];
int main()
{
	//freopen(".in","r",stdin);
	//freopen(".out","w",stdout);
	cin >> T;
	while (T --)
	{
		for (int i = 1; i <= 3; i ++)
		    cin >> a[i];
		sort(a + 1, a + 3);
		if (a[2]!= a[3]) cout << "NO"<<endl;
		else{
			cout << "YES"<<endl;
			cout << a[1] << " " << a[1] << " " << a[2] << endl;
		}
    }
	return 0;
}


 #include<iostream>
 #include<algorithm>
 using namespace std;
 bool cmp(int a,int b){
 	return a>b;
 }
 int main(){
 	int n;
    cin>>n;
    while (n--)
    {
    	int a[4];
        cin>>a[1]>>a[2]>>a[3];
        sort(a+1, a+1+3,cmp);
        if(a[1]==a[2])
        {
              cout<<"YES"<<endl<<a[1]<<' '<<a[2]<<' '<<a[3];
        }
        else
        {
            cout<<"NO";
        }
    }
    return 0;
 }


#include<bits/stdc++.h>
using namespace std;
struct node
{
	int num,cnt;
}a[5];
int cmp(node a,node b)
{
	return a.num<b.num;
}
int t;
int main()
{
	cin>>t;
	while(t--)
	{
		for(int i=1;i<=3;i++)
		{
			cin>>a[i].num;
			a[i].cnt=i;
		}
		sort(a+1,a+4,cmp);
		if(a[2].num==a[3].num)
		{
			if(a[2].cnt==1&&a[3].cnt==2)
			{
				printf("YES\n%d %d 1\n",a[2].num,a[1].num);
			}
			if(a[2].cnt==2&&a[3].cnt==3)
			{
				printf("YES\n1 %d %d\n",a[1].num,a[2].num);
			}
			if(a[2].cnt==1&&a[3].cnt==3)
			{
				printf("YES\n%d %d 1\n",a[1].num,a[2].num);
			}
		}
		else
		{
			printf("NO\n");
		}
	}
    return 0;
}


#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<string>
#include<algorithm>
#include<queue>
using namespace std;
int x, y, z, t;
int main(){
	scanf("%d", &t);
	while(t--){
		scanf("%d%d%d", &x, &y, &z);
		int maxn = max(x, max(y, z));
		if(x == maxn && y == maxn)
			printf("YES\n%d %d %d\n", x, z, z);
		else if(x == maxn && z == maxn)
			printf("YES\n%d %d %d\n", x, y, y);
		else if(y == maxn && z == maxn)
			printf("YES\n%d %d %d\n", y, x, x);
		else
			printf("NO\n");
	}
	return 0;
}


// Faqih Mualim ITB Bandung --> Jakarta
// Template for Competitive Programming
// Problem A Codeforces 17 July 2020
#include <bits/stdc++.h>
#include <string>
#include <cstdio>
#include <cmath>
#include <math.h>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <ext/pb_ds/assoc_container.hpp>

#define endl "\n"
#define pb push_back
#define popb pop_back
#define ll long long
#define REPPLUS(i,a,n) for(ll i=a;i<=n;i++)
#define REPMIN(i,a,n) for(ll i=a;i>=n;i--)
#define Faqih using
#define itu namespace
#define Ganteng_Titik std;
#define IOS ios::sync_with_stdio(0); cin.tie(0);
Faqih itu Ganteng_Titik
using namespace __gnu_pbds;
typedef tree<int,null_type,less<int>,rb_tree_tag,
tree_order_statistics_node_update> indexed_set;

ll N;
ll arr[100005];
ll mat[100][100];
ll catat[100005];

void test_case()
{
	//Code Here
	int x[3];
	int a,b,c;
	scanf("%d%d%d", &x[0],&x[1],&x[2]);
	sort(x,x+3);
	if((x[1] <= x[2]) && (x[1] == x[2])) {
		a = x[0];
		b = x[0];
		c = x[2];
		printf("YES\n");
		printf("%d %d %d\n", a,b,c);
	}
	else
		printf("NO\n");
}

int main()
{
	IOS
	int t;
	scanf("%d", &t);
	while (t--)
		test_case();
return 0;
}


// Faqih Mualim ITB Bandung --> Jakarta
// Template for Competitive Programming
// Problem A Codeforces 17 July 2020
#include <bits/stdc++.h>
#include <string>
#include <cstdio>
#include <cmath>
#include <math.h>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <ext/pb_ds/assoc_container.hpp>

#define endl "\n"
#define pb push_back
#define popb pop_back
#define ll long long
#define REPPLUS(i,a,n) for(ll i=a;i<=n;i++)
#define REPMIN(i,a,n) for(ll i=a;i>=n;i--)
#define Faqih using
#define itu namespace
#define Ganteng_Titik std;
#define IOS ios::sync_with_stdio(0); cin.tie(0);
Faqih itu Ganteng_Titik
using namespace __gnu_pbds;
typedef tree<int,null_type,less<int>,rb_tree_tag,
tree_order_statistics_node_update> indexed_set;

ll N;
ll arr[100005];
ll mat[100][100];
ll catat[100005];

void test_case()
{
	//Code Here
	ll x[3];
	ll a,b,c;
	scanf("%d%d%d", &x[0],&x[1],&x[2]);
	sort(x,x+3);
//	printf("%d %d %d\n", x[0],x[1],x[2]);
	if((x[0] <= x[1]) && (x[1] == x[2])) {
		a = x[0];
		b = x[0];
		c = x[2];
		printf("YES\n");
		printf("%d %d %d\n", a,b,c);
	}
	else
		printf("NO\n");
}

int main()
{
	IOS
	bool  codeforces =   1     ;
	bool  TLX  =  0     ;
	bool  codejam    =       0     ;
	if (TLX==1) {
		test_case();
	}
	else if (codeforces==1) {
		ll t;
		scanf("%d", &t);
		while (t--)
			test_case();
	}
	else if (codejam==1) {
		ll t;
		cin >> t;
		REPPLUS(j,1,t) {
			cout << "Case #" << j << ": ";
			test_case();
		}
	}

return 0;
}


using namespace std;
#include<bits/stdc++.h>
#define ll long long int
#define ull unsigned long long int
#define INFINITE 1e9 + 5
#define MOD 1000000007
#define MAXN 100001
#define pll pair<ll,ll>
#define pii pair<int,int>
#define debugArray(arr) cout << #arr<<" : "<<endl;for(int i : arr){cout << i <<", ";} cout <<endl;
#define debugVariable(x) cout <<#x<<"="<<x<<"\n";
#define check(x) cout<<"CHECK="<<#x<<"\n";
int main()
{
    ios::sync_with_stdio(false);
	cin.tie(0);
    cout.tie(0);
    int test;
    cin>>test;
    while(test--)
    {
        int arr[3];
        cin>>arr[0]>>arr[1]>>arr[2];
        sort(arr,arr+3);
            if(arr[1]==arr[2])
            {
                cout<<"YES"<<"\n";
                cout<<arr[0]<<" "<<arr[0]<<" "<<arr[2]<<"\n";
            }
            else
            {
                cout<<"NO"<<"\n";
            }

    }
}


// Faqih Mualim ITB Bandung --> Jakarta
// Template for Competitive Programming
// Problem A Codeforces 17 July 2020
#include <bits/stdc++.h>
#include <string>
#include <cstdio>
#include <cmath>
#include <math.h>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <ext/pb_ds/assoc_container.hpp>

#define endl "\n"
#define pb push_back
#define popb pop_back
#define ll long long
#define REPPLUS(i,a,n) for(ll i=a;i<=n;i++)
#define REPMIN(i,a,n) for(ll i=a;i>=n;i--)
#define Faqih using
#define itu namespace
#define Ganteng_Titik std;
#define IOS ios::sync_with_stdio(0); cin.tie(0);
Faqih itu Ganteng_Titik
using namespace __gnu_pbds;
typedef tree<int,null_type,less<int>,rb_tree_tag,
tree_order_statistics_node_update> indexed_set;

ll N;
ll arr[100005];
ll mat[100][100];
ll catat[100005];

void test_case()
{
	//Code Here
	int x[3];
	int a,b,c;
	scanf("%d%d%d", &x[0],&x[1],&x[2]);
	sort(x,x+3);
	if((x[1] == x[2])) {
		a = x[0];
		b = x[0];
		c = x[2];
		printf("YES\n");
		printf("%d %d %d\n", a,b,c);
	}
	else
		printf("NO\n");
}

int main()
{
	IOS
	int t;
	scanf("%d", &t);
	while (t--)
		test_case();
return 0;
}


// Faqih Mualim ITB Bandung --> Jakarta
// Template for Competitive Programming
// Problem A Codeforces 17 July 2020
#include <bits/stdc++.h>
#include <string>
#include <cstdio>
#include <cmath>
#include <math.h>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <ext/pb_ds/assoc_container.hpp>

#define endl "\n"
#define pb push_back
#define popb pop_back
#define ll long long
#define REPPLUS(i,a,n) for(ll i=a;i<=n;i++)
#define REPMIN(i,a,n) for(ll i=a;i>=n;i--)
#define Faqih using
#define itu namespace
#define Ganteng_Titik std;
#define IOS ios::sync_with_stdio(0); cin.tie(0);
Faqih itu Ganteng_Titik
using namespace __gnu_pbds;
typedef tree<int,null_type,less<int>,rb_tree_tag,
tree_order_statistics_node_update> indexed_set;

ll N;
ll arr[100005];
ll mat[100][100];
ll catat[100005];

void test_case()
{
	//Code Here
	ll x[3];
	ll a,b,c;
	scanf("%d%d%d", &x[0],&x[1],&x[2]);
	sort(x,x+3);
	if((x[0] <= x[1]) && (x[1] == x[2])) {
		a = x[0];
		b = x[0];
		c = x[2];
		printf("YES\n");
		printf("%d %d %d\n", a,b,c);
	}
	else
		printf("NO\n");
}

int main()
{
	IOS
	bool  codeforces =   1     ;
	bool  TLX  =  0     ;
	bool  codejam    =       0     ;
	if (TLX==1) {
		test_case();
	}
	else if (codeforces==1) {
		ll t;
		scanf("%d", &t);
		while (t--)
			test_case();
	}
	else if (codejam==1) {
		ll t;
		cin >> t;
		REPPLUS(j,1,t) {
			cout << "Case #" << j << ": ";
			test_case();
		}
	}

return 0;
}


// Faqih Mualim ITB Bandung --> Jakarta
// Template for Competitive Programming
// Problem A Codeforces 17 July 2020
#include <bits/stdc++.h>
#include <string>
#include <cstdio>
#include <cmath>
#include <math.h>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <ext/pb_ds/assoc_container.hpp>

#define endl "\n"
#define pb push_back
#define popb pop_back
#define ll long long
#define REPPLUS(i,a,n) for(ll i=a;i<=n;i++)
#define REPMIN(i,a,n) for(ll i=a;i>=n;i--)
#define Faqih using
#define itu namespace
#define Ganteng_Titik std;
#define IOS ios::sync_with_stdio(0); cin.tie(0);
Faqih itu Ganteng_Titik
using namespace __gnu_pbds;
typedef tree<int,null_type,less<int>,rb_tree_tag,
tree_order_statistics_node_update> indexed_set;

ll N;
ll arr[100005];
ll mat[100][100];
ll catat[100005];

void test_case()
{
	//Code Here
	ll x[3];
	ll a,b,c;
	scanf("%d%d%d", &x[0],&x[1],&x[2]);
	sort(x,x+3);
	if((x[0] <= x[1]) && (x[1] == x[2])) {
		a = x[0];
		b = x[0];
		c = x[2];
		printf("YES\n");
		printf("%d %d %d\n", a,b,c);
	}
	else
		printf("NO\n");
}

int main()
{
	IOS
//	bool  codeforces =   1     ;
//	bool  TLX  =  0     ;
//	bool  codejam    =       0     ;
//	if (TLX==1) {
//		test_case();
//	}
	ll t;
	scanf("%d", &t);
	while (t--)
		test_case();
//	else if (codejam==1) {
//		ll t;
//		cin >> t;
//		REPPLUS(j,1,t) {
//			cout << "Case #" << j << ": ";
//			test_case();
//		}
//	}

return 0;
}


#include <iostream>
using namespace std;
int main ()
{
    int t;
    cin>>t;
    int x,y,z;
    for (int i=0;i<t;i++) {
        cin>>x>>y>>z;
        if (x==y && y=z) {
            cout<<"YES"<<endl;
            cout<<x<<" "<<y<<" "<<z<<endl;
            continue;
        }

        if (x!=y && y!=z && x!=z) {
            cout<<"NO"<<endl;
            continue;
        }

        if (x==y) {
            if (x<z) {
                cout<<"NO"<<endl;
            }
            else {
                cout<<"YES"<<endl;
                cout<<x<<" "<<z<<" "<<x-z<<endl;
            }
            continue;
        }

        if (y==z) {
            if (y<x) {
                cout<<"NO"<<endl;
            }
            else {
                cout<<"YES"<<endl;
                cout<<y<<" "<<x<<" "<<y-x<<endl;
            }
            continue;
        }

        if (x==z) {
            if (y<x) {
                cout<<"NO"<<endl;
            }
            else {
                cout<<"YES"<<endl;
                cout<<x<<" "<<y<<" "<<z-y<<endl;
            }
        }
    }

    return 0;
}


#include <iostream>
using namespace std;
int main ()
{
    int t;
    cin>>t;
    int x,y,z;
    for (int i=0;i<t;i++) {
        cin>>x>>y>>z;
        if (x==y && y==z) {
            cout<<"YES"<<endl;
            cout<<x<<" "<<y<<" "<<z<<endl;
            continue;
        }

        if (x!=y && y!=z && x!=z) {
            cout<<"NO"<<endl;
            continue;
        }

        if (x==y) {
            if (x<z) {
                cout<<"NO"<<endl;
            }
            else {
                cout<<"YES"<<endl;
                cout<<x<<" "<<z<<" "<<z<<endl;
            }
            continue;
        }

        if (y==z) {
            if (y<x) {
                cout<<"NO"<<endl;
            }
            else {
                cout<<"YES"<<endl;
                cout<<y<<" "<<x<<" "<<x<<endl;
            }
            continue;
        }

        if (x==z) {
            if (y>x) {
                cout<<"NO"<<endl;
            }
            else {
                cout<<"YES"<<endl;
                cout<<x<<" "<<y<<" "<<y<<endl;
            }
        }
    }

    return 0;
}


#include <iostream>
using namespace std;
int main ()
{
    int t;
    cin>>t;
    int x,y,z;
    for (int i=0;i<t;i++) {
        cin>>x>>y>>z;
        if (x==y && y==z) {
            cout<<"YES"<<endl;
            cout<<x<<" "<<y<<" "<<z<<endl;
            continue;
        }

        if (x!=y && y!=z && x!=z) {
            cout<<"NO"<<endl;
            continue;
        }

        if (x==y) {
            if (x<z) {
                cout<<"NO"<<endl;
            }
            else {
                cout<<"YES"<<endl;
                cout<<x<<" "<<z<<" "<<x-z<<endl;
            }
            continue;
        }

        if (y==z) {
            if (y<x) {
                cout<<"NO"<<endl;
            }
            else {
                cout<<"YES"<<endl;
                cout<<y<<" "<<x<<" "<<y-x<<endl;
            }
            continue;
        }

        if (x==z) {
            if (y<x) {
                cout<<"NO"<<endl;
            }
            else {
                cout<<"YES"<<endl;
                cout<<x<<" "<<y<<" "<<z-y<<endl;
            }
        }
    }

    return 0;
}


#include <iostream>
using namespace std;
int main ()
{
    int t;
    cin>>t;
    int x,y,z;
    for (int i=0;i<t;i++) {
        cin>>x>>y>>z;
        if (x==y && y==z) {
            cout<<"YES"<<endl;
            cout<<x<<" "<<y<<" "<<z<<endl;
            continue;
        }

        if (x!=y && y!=z && x!=z) {
            cout<<"NO"<<endl;
            continue;
        }

        if (x==y) {
            if (x<z) {
                cout<<"NO"<<endl;
            }
            else {
                cout<<"YES"<<endl;
                cout<<x<<" "<<z<<" "<<x-z<<endl;
            }
            continue;
        }

        if (y==z) {
            if (y<x) {
                cout<<"NO"<<endl;
            }
            else {
                cout<<"YES"<<endl;
                cout<<y<<" "<<x<<" "<<y-z<<endl;
            }
            continue;
        }

        if (x==z) {
            if (y<x) {
                cout<<"NO"<<endl;
            }
            else {
                cout<<"YES"<<endl;
                cout<<x<<" "<<y<<" "<<z-y<<endl;
            }
        }
    }

    return 0;
}


#include <iostream>
using namespace std;
int main ()
{
    int t;
    cin>>t;
    int x,y,z;
    for (int i=0;i<t;i++) {
        cin>>x>>y>>z;
        if (x==y && y==z) {
            cout<<"YES"<<endl;
            cout<<x<<" "<<y<<" "<<z<<endl;
            continue;
        }

        if (x!=y && y!=z && x!=z) {
            cout<<"NO"<<endl;
            continue;
        }

        if (x==y) {
            if (x<z) {
                cout<<"NO"<<endl;
            }
            else {
                cout<<"YES"<<endl;
                cout<<x<<" "<<z<<" "<<x-z<<endl;
            }
            continue;
        }

        if (y==z) {
            if (y<x) {
                cout<<"NO"<<endl;
            }
            else {
                cout<<"YES"<<endl;
                cout<<y<<" "<<x<<" "<<y-x<<endl;
            }
            continue;
        }

        if (x==z) {
            if (y>x) {
                cout<<"NO"<<endl;
            }
            else {
                cout<<"YES"<<endl;
                cout<<x<<" "<<y<<" "<<z-y<<endl;
            }
        }
    }

    return 0;
}


#include<iostream>
using namespace std;
int main()
{
  int t;
  cin>>t;
  while(t--)
  {
    int x,y,z,a,b,c,k;
    bool result=0;
    cin>>x>>y>>z;
    k=max(x,y);
    k=max(k,z);
    for(a=1;a<=k;a++)
    {
       for(b=1;b<=k;b++)
       {
            for(c=1;c<=k;c++)
            {
                if(x==max(a,b)&&y==max(a,c)&&z==max(b,c))
                {
                      result=1;
                      break;
                }
            }
            if(result)
            {
              break;
            }
       }
       if (result)
       {
           break;
       }
    }
    if(result)
    {
         cout<<"YES"<<"\n";
         cout<<a<<" "<<b<<" "<<c<<"\n";
    }
    else
    {
     cout <<"NO"<<"\n";
    }
  }
  return 0;
}


#include <iostream>
using namespace std;

int main()
{
	int t;

    cin>>t;

    while(t--)
    {
        int x,y,z,a,b,c, k;
        bool result = 0;

        cin >>x>>y>>z;

        a=x; b =y ; c =z;
        if (x == max(a,b) && y == max (a,c) && z== max(b,c))
        {
            result = 1;
            if (!result)
            {
                a=1; b =y ; c =z;
                if (x == max(a,b) && y == max (a,c) && z== max(b,c))
                {
                    result = 1;
                }
            }
            if (!result)
            {
                a=x; b =1 ; c =z;
                if (x == max(a,b) && y == max (a,c) && z== max(b,c))
                {
                    result = 1;
                }
            }
            if (!result)
            {
                a=x; b =y ; c =1;
                if (x == max(a,b) && y == max (a,c) && z== max(b,c))
                {
                    result = 1;
                }
            }if (!result)
            {
                a=1; b =1 ; c =z;
                if (x == max(a,b) && y == max (a,c) && z== max(b,c))
                {
                    result = 1;
                }
            }
            if (!result)
            {
                a=x; b =1 ; c =1;
                if (x == max(a,b) && y == max (a,c) && z== max(b,c))
                {
                    result = 1;
                }
            }
            if (!result)
            {
                a=1; b =y ; c =1;
                if (x == max(a,b) && y == max (a,c) && z== max(b,c))
                {
                    result = 1;
                }
            }
        }

        if (!result)
        {
            a=y; b =z ; c =x;
            if (x == max(a,b) && y == max (a,c) && z== max(b,c))
            {
                result = 1;
            }

            if (!result)
            {
                a=1; b =z ; c =x;
                if (x == max(a,b) && y == max (a,c) && z== max(b,c))
                {
                    result = 1;
                }
            }
            if (!result)
            {
                a=y; b =1 ; c =x;
                if (x == max(a,b) && y == max (a,c) && z== max(b,c))
                {
                    result = 1;
                }
            }
            if (!result)
            {
                a=y; b =z ; c =1;
                if (x == max(a,b) && y == max (a,c) && z== max(b,c))
                {
                    result = 1;
                }
            }if (!result)
            {
                a=1; b =1 ; c =x;
                if (x == max(a,b) && y == max (a,c) && z== max(b,c))
                {
                    result = 1;
                }
            }
            if (!result)
            {
                a=y; b =1 ; c =1;
                if (x == max(a,b) && y == max (a,c) && z== max(b,c))
                {
                    result = 1;
                }
            }
            if (!result)
            {
                a=1; b =z ; c =1;
                if (x == max(a,b) && y == max (a,c) && z== max(b,c))
                {
                    result = 1;
                }
            }
        }
        if (!result)
        {
            a=z; b =x ; c =y;
            if (x == max(a,b) && y == max (a,c) && z== max(b,c))
            {
                result = 1;
            }

            if (!result)
            {
                a=1; b =x ; c =y;
                if (x == max(a,b) && y == max (a,c) && z== max(b,c))
                {
                    result = 1;
                }
            }
            if (!result)
            {
                a=z; b =1 ; c =y;
                if (x == max(a,b) && y == max (a,c) && z== max(b,c))
                {
                    result = 1;
                }
            }
            if (!result)
            {
                a=z; b =x ; c =1;
                if (x == max(a,b) && y == max (a,c) && z== max(b,c))
                {
                    result = 1;
                }
            }if (!result)
            {
                a=1; b =1 ; c =y;
                if (x == max(a,b) && y == max (a,c) && z== max(b,c))
                {
                    result = 1;
                }
            }
            if (!result)
            {
                a=z; b =1 ; c =1;
                if (x == max(a,b) && y == max (a,c) && z== max(b,c))
                {
                    result = 1;
                }
            }
            if (!result)
            {
                a=1; b =x ; c =1;
                if (x == max(a,b) && y == max (a,c) && z== max(b,c))
                {
                    result = 1;
                }
            }
        }

        if (result)
        {
            cout << "YES" << '\n';
            cout << a <<' '<< b<< ' '<<c << '\n';
        }
        else
        {
            cout << "NO" << '\n';
        }
    }
	return 0;
}


#include<iostream>
using namespace std;
int main()
{
  int t;
  cin>>t;
  while(t--)
  {
    int x,y,z,a,b,c,k;
    bool result=0;
    cin>>x>>y>>z;
    k=max(x,y);
    k=max(k,z);
    for(a=1;a<=k;a++)
    {
       for(b=1;b<=k;b++)
       {
            for(c=1;c<=k;c++)
            {
                if(x==max(a,b)&&y==max(a,c)&&z==max(b,c))
                {
                      result=1;
                      break;
                }
            }
            if(result)
            {
              break;
            }
       }
       if (result)
       {
           break;
       }
    }
    if(result)
    {
         cout<<"YES"<<"\n";
         cout<<a<<""<<b<<""<<c<<"\n";
    }
    else
    {
     cout <<"NO"<<"\n";
    }
  }
  return 0;
}


#include <iostream>
using namespace std;

int main()
{
	int t;

    cin>>t;

    while(t--)
    {
        int x,y,z,a,b,c, k;
        bool result = 0;

        cin >>x>>y>>z;

        a=x; b =y ; c =z;
        if (x == max(a,b) && y == max (a,c) && z== max(b,c))
        {
            result = 1;
            if (!result)
            {
                a=1; b =y ; c =z;
                if (x == max(a,b) && y == max (a,c) && z== max(b,c))
                {
                    result = 1;
                }
            }
            if (!result)
            {
                a=x; b =1 ; c =z;
                if (x == max(a,b) && y == max (a,c) && z== max(b,c))
                {
                    result = 1;
                }
            }
            if (!result)
            {
                a=x; b =y ; c =1;
                if (x == max(a,b) && y == max (a,c) && z== max(b,c))
                {
                    result = 1;
                }
            }if (!result)
            {
                a=1; b =1 ; c =z;
                if (x == max(a,b) && y == max (a,c) && z== max(b,c))
                {
                    result = 1;
                }
            }
            if (!result)
            {
                a=x; b =1 ; c =1;
                if (x == max(a,b) && y == max (a,c) && z== max(b,c))
                {
                    result = 1;
                }
            }
            if (!result)
            {
                a=1; b =y ; c =1;
                if (x == max(a,b) && y == max (a,c) && z== max(b,c))
                {
                    result = 1;
                }
            }
        }

        if (!result)
        {
            a=y; b =z ; c =x;
            if (x == max(a,b) && y == max (a,c) && z== max(b,c))
            {
                result = 1;
            }

            if (!result)
            {
                a=1; b =z ; c =x;
                if (x == max(a,b) && y == max (a,c) && z== max(b,c))
                {
                    result = 1;
                }
            }
            if (!result)
            {
                a=y; b =1 ; c =x;
                if (x == max(a,b) && y == max (a,c) && z== max(b,c))
                {
                    result = 1;
                }
            }
            if (!result)
            {
                a=y; b =z ; c =1;
                if (x == max(a,b) && y == max (a,c) && z== max(b,c))
                {
                    result = 1;
                }
            }if (!result)
            {
                a=1; b =1 ; c =x;
                if (x == max(a,b) && y == max (a,c) && z== max(b,c))
                {
                    result = 1;
                }
            }
            if (!result)
            {
                a=y; b =1 ; c =1;
                if (x == max(a,b) && y == max (a,c) && z== max(b,c))
                {
                    result = 1;
                }
            }
            if (!result)
            {
                a=1; b =z ; c =1;
                if (x == max(a,b) && y == max (a,c) && z== max(b,c))
                {
                    result = 1;
                }
            }
        }
        if (!result)
        {
            a=z; b =x ; c =y;
            if (x == max(a,b) && y == max (a,c) && z== max(b,c))
            {
                result = 1;
            }

            if (!result)
            {
                a=1; b =x ; c =y;
                if (x == max(a,b) && y == max (a,c) && z== max(b,c))
                {
                    result = 1;
                }
            }
            if (!result)
            {
                a=z; b =1 ; c =y;
                if (x == max(a,b) && y == max (a,c) && z== max(b,c))
                {
                    result = 1;
                }
            }
            if (!result)
            {
                a=z; b =x ; c =1;
                if (x == max(a,b) && y == max (a,c) && z== max(b,c))
                {
                    result = 1;
                }
            }if (!result)
            {
                a=1; b =1 ; c =y;
                if (x == max(a,b) && y == max (a,c) && z== max(b,c))
                {
                    result = 1;
                }
            }
            if (!result)
            {
                a=z; b =1 ; c =1;
                if (x == max(a,b) && y == max (a,c) && z== max(b,c))
                {
                    result = 1;
                }
            }
            if (!result)
            {
                a=1; b =x ; c =1;
                if (x == max(a,b) && y == max (a,c) && z== max(b,c))
                {
                    result = 1;
                }
            }
        }

        if (result)
        {
            cout << "YES" << "\n";
            cout << a <<" "<< b<< " "<<c << "\n";
        }
        else
        {
            cout << "NO" << "\n";

    }
return 0;
}


#include <iostream>
using namespace std;

int main()
{
    int t;

    cin>>t;

    while(t--)
    {
        int x,y,z,a,b,c, k;
        bool result = 0;

        cin >>x>>y>>z;

        k= max(x,y);

        k= max(k,z);

        for (a=1; a<=k ; a++)
        {
            for (b=1; b<=k ; b++)
            {
                for (c=1; c<=k; c++)
                {
                    if ( x == max(a,b) && y == max(a,c) && z == max(b,c))
                    {
                        result = 1;
                        break;

                    }
                }
                if (result)
                {
                    break;
                }
            }
            if (result)
            {
                break;

            }
        }

        if (result)
        {
            cout << "YES" << "\n";
            cout << a <<" "<< b<<" "<<c << "\n";
        }
        else
        {
            cout << "NO" << "\n";
        }
    }

  return 0;
}