#include<bits/stdc++.h>
#define ll long long
#define ld long double
#define pb push_back
#define pii pair<int,int>
#define pll pair<long long, long long>
using namespace std;

const int mod = 1e9+7;
#define INF INT_MAX

int sum(int x, int y)
{
	return (x+y)%mod;
}

int mult(int x, int y)
{
	return (1ll * x * y)% mod;
}

int fastpow(int val, int pow)
{	
	int res = 1;
	while(pow > 0)
	{
		if(pow % 2 != 0)
			res = mult(res, val);
		val = mult(val, val);
		pow/=2;
	}
	return res;
}

vector<vector<int>> matmult(vector<vector<int>> &mat1, vector<vector<int>> &mat2)
{
	vector<vector<int>> res(mat1.size(),vector<int>(mat1[0].size(),0));
	int m = mat1.size(), n = mat1[0].size();
	for(int i=0;i<m;i++)
	{
		for(int j = 0; j < n; j++)
		{
			for(int k=0;k<n;k++)
			{
				res[i][j] = sum(res[i][j], mult(mat1[i][k], mat2[k][j]));
			}
		}
	}

	return res;
}

vector<vector<int>> matexp(vector<vector<int>> mat, int pow)
{
	vector<vector<int>>res(mat.size(), vector<int>(mat[0].size(),0));
	
	for(int i=0;i<mat.size();i++)
		res[i][i] = 1;
	
	while(pow > 0)
	{
		if(pow%2!=0)
			res  = matmult(res, mat);
		pow/=2;
		if(pow == 0)
			break;
		mat = matmult(mat, mat);

	}

	return res;
}

vector<int> deg(105);

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	int n,m,k;
	cin>>n>>m>>k;
	vector<int> a(n);
	
	int inv_2 = fastpow(2,mod-2);
	int inv_m = fastpow(m,mod-2);
	vector<vector<int>> mat(n, vector<int>(n,0));
	for(int i=0;i<n;i++)
		cin>>a[i];
	
	for(int i=0;i<m;i++)
	{
		int x,y;
		cin>>x>>y;
		x--;
		y--;
		deg[x]++;
		deg[y]++;
		mat[x][y] = mult(inv_2, inv_m);
		mat[y][x] = mult(inv_2, inv_m);

		
	}


	
	for(int i=0;i<n;i++)
	{
		mat[i][i] = mult(sum(mult(2,m), -deg[i]),mult(inv_2,inv_m)); 	
	}
	mat = matexp(mat,k);
	vector<int> res(n);
	for(int i=0;i<n;i++)
	{
		for(int j=0;j<n;j++)
			res[i] = sum(res[i], mult(a[j],mat[j][i]));
	}
	for(int i=0;i<n;i++)
		cout<<res[i]<<"\n";


}

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


//0-indexed
template<typename T>
struct BIT {
    using F = function<T(T,T)>;

    private:
    const int n;
    vector<T> dat;
    const F operation;

    public:
    BIT (const int n_, const F operation_) : n(n_+1), dat(n_+1, 0), operation(operation_) {}
    BIT (const vector<T> vec, const F operation_) : n((int) vec.size()), dat(n+1, 0), operation(operation_) {
        for(int i = 0; i < n; i++) add(i,vec[i]);
    }

    T operator [] (const int i) { return sum(i, i+1); }

    //O(logn)
    inline void add (const int i, const T x) {
        for(int k = i+1; k < n+1; k += k&-k) dat[k] = operation(dat[k], x);
    }

    //O(logn)
    T sum (const int i) {
        T ret = 0;
        for(int k = i; k > 0; k -= k&-k) ret = operation(ret, dat[k]);
        return ret;
    }
    T sum (const int a, const int b) {
        return operation(sum(b), sum(a));
    }
}; 

void ABC185_F_RangeXorQuery(){
    int n, q;
    cin >> n >> q;

    vector<int> a(n);
    for(int i = 0; i < n; i++) cin >> a[i];

    auto Xor = [&](int left, int right) { return left ^ right; };

    BIT<int> tree(a, Xor);

    vector<int> ans;
    for(int i = 0; i < q; i++){
        int t, x, y;
        cin >> t >> x >> y;
        x--;
        if(t == 1) tree.add(x, y);
        else cout << tree.sum(x, y) << endl;
    }
}

void ABC106_D_AtCoderExpress2(){
    int n, m, q;
    cin >> n >> m >> q;

    struct point {
        int left, right, type;
        bool operator < (const point &other) {
            return make_pair(make_pair(left, right),type) > make_pair(make_pair(other.left, other.right), other.type);
        }
    };

    vector<point> obj;
    for(int i = 0; i < m; i++){
        int l,r;
        cin >> l >> r;
        obj.push_back({l, -r, 0});
    }
    for(int i = 0; i < q; i++){
        int l,r;
        cin >> l >> r;
        obj.push_back({l, -r, -i-1});
    }

    sort(obj.begin(),obj.end());

    auto plus = [&](int left, int right) { return left + right; };
 
    BIT<int> tree(n, plus);
    
    int k = obj.size();
    vector<int> ans(q);
    for(int i = 0; i < k; i++){
        if(-obj[i].type) ans[-obj[i].type-1] = tree.sum(-obj[i].right+1);
        else tree.add(-obj[i].right,1);
    }
 
    for(int i = 0; i < q; i++) cout << ans[i] << endl;
 
}

int main(){ABC185_F_RangeXorQuery();}