#include <bits/stdc++.h>

#define For(i, a, b) for (int i = (int)(a); i < (int)(b); ++i)
#define rFor(i, a, b) for (int i = (int)(a)-1; i >= (int)(b); --i)
#define rep(i, n) For((i), 0, (n))
#define rrep(i, n) rFor((i), (n), 0)
#define fi first
#define se second

using namespace std;

typedef long long lint;
typedef unsigned long long ulint;
typedef pair<int, int> pii;
typedef pair<lint, lint> pll;

template <class T>
bool chmax(T &a, const T &b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
template <class T>
bool chmin(T &a, const T &b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}

template <class T>
T div_floor(T a, T b) {
    if (b < 0) a *= -1, b *= -1;
    return a >= 0 ? a / b : (a + 1) / b - 1;
}
template <class T>
T div_ceil(T a, T b) {
    if (b < 0) a *= -1, b *= -1;
    return a > 0 ? (a - 1) / b + 1 : a / b;
}

template <typename T>
struct coord_comp {
    vector<T> v;
    bool sorted = false;

    coord_comp() {}

    int size() { return v.size(); }

    void add(T x) { v.push_back(x); }

    void build() {
        sort(v.begin(), v.end());
        v.erase(unique(v.begin(), v.end()), v.end());
        sorted = true;
    }

    int get_idx(T x) {
        assert(sorted);
        return lower_bound(v.begin(), v.end(), x) - v.begin();
    }

    T &operator[](int i) { return v[i]; }
};

constexpr lint mod = 1000000007;
constexpr lint INF = mod * mod;
constexpr int MAX = 200010;

int main() {
    int a, b;
    scanf("%d%d", &a, &b);
    rrep(x, b + 1) if (div_floor(b, x) - div_floor(a - 1, x) >= 2) {
        printf("%d\n", x);
        return 0;
    }
}
#include "iostream"
#include "algorithm"
#include "cstring"
#include "cstdio"
#include "cmath"
#include "vector"
#include "map"
#include "set"
#include "queue"
using namespace std;
#define MAXN 222
//#define int long long
#define rep(i, a, b) for (int i = (a), i##end = (b); i <= i##end; ++i)
#define per(i, a, b) for (int i = (a), i##end = (b); i >= i##end; --i)
#define pii pair<int,int>
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define vi vector<int>
#define all(x) (x).begin() , (x).end()
#define mem( a ) memset( a , 0 , sizeof a )
typedef long long ll;
int n , m , k;
const int P = 1e9 + 7;
int A[MAXN];

int Pow( int x , int a ) {
	int ret = 1;
	while( a ) {
		if( a & 1 ) ret = ret * 1ll * x % P;
		x = x * 1ll * x % P , a >>= 1;
	}
	return ret;
}

struct mtrx {
	#define N 100
	int A[103][103] , flg;
	mtrx( ) {
		mem( A );
	}
	int* operator [] ( int x ) { return A[x]; }
	mtrx operator * ( mtrx B ) {
		mtrx as;
		rep( i , 0 , N ) rep( k , 0 , N ) if( A[i][k] ) rep( j , 0 , N ) 
			as[i][j] = ( as[i][j] + A[i][k] * 1ll * B[k][j] ) % P;
		return as;
	}
} tr , cur ;

void Pow( int a ) {
	while( a ) {
		if( a & 1 ) cur = tr * cur;
		a >>= 1 , tr = tr * tr;
	}
}
int deg[MAXN];

void solve() {
	cin >> n >> m >> k;
	int im = Pow( 2 * m , P - 2 );
	rep( i , 1 , n ) scanf("%d",A + i) , cur[i][1] = A[i];
	rep( i , 1 , m ) {
		int u , v;
		scanf("%d%d",&u,&v);
		tr[u][v] = tr[v][u] = im;
		tr[u][u] = ( tr[u][u] + im ) % P;
		tr[v][v] = ( tr[v][v] + im ) % P;
		++ deg[u] , ++ deg[v];
	}
	rep( u , 1 , n ) tr[u][u] += ( m - deg[u] ) * 1ll * Pow( m , P - 2 ) % P;
	Pow( k );
	rep( i , 1 , n ) printf("%d\n",cur[i][1]);
}

signed main() {
//    int T;cin >> T;while( T-- ) solve();
    solve();
}
