Page Rank

Time Limit: 3000/1500 MS (Java/Others)

Memory Limit: 100000/100000 K (Java/Others)

Description

Evaluation and rank of web pages is a hot topic for many internet companies and researchers. PageRank is a link analysis tool and it assigns a numerical weighting to each element of a hyperlinked set of documents, such as the World Wide Web, with the purpose of "measuring" its relative importance within the set. The algorithm may be applied to any collection of entities with reciprocal quotations and references. The numerical weight that it assigns to any given element E is referred to as the PageRank of E and denoted by . Other factors like Author Rank can contribute to the importance of an entity.

For simplicity, in this problem PageRank vector q is defined as q = Gq, Where , S is the destination-by-source stochastic matrix, U is all one matrix, n is the number of nodes and α is the weight between 0 and 1 (here we use 0.85).

For the example on the right, we have:



Denote the current PageRank vector and the next PageRank vector by qcur and qnext respectively. The process is to compute the iterative powering for finding the first eigenvector.



The computation ends until for some small ε(10-10).

Input

The input contains many test cases.

For each case, there are multiple lines. The first line contains an integer N(N<=3000), which represents the number of pages. Then a N*N zero-one matrix follows. The element Eij (0 <= i, j < N) on the matrix represents whether the i-th page has a hyper link to the j-th page.

Output

Output one line with the eigenvector. The numbers should be separated by a space and be correctly rounded to two decimal places.

Sample Input

4 0111 0011 0001 0100

Sample Output

0.15 1.49 0.83 1.53

Hint

hujie

Source

2014上海全国邀请赛——题目重现(感谢上海大学提供题目)

提交代码