Our bear's forest has a checkered field. The checkered field is an n × n table, the rows are numbered from 1 to n from top to bottom, the columns are numbered from 1 to n from left to right. Let's denote a cell of the field on the intersection of row x and column y by record (x, y). Each cell of the field contains growing raspberry, at that, the cell (x, y) of the field contains x + y raspberry bushes.

The bear came out to walk across the field. At the beginning of the walk his speed is (dx, dy). Then the bear spends exactly t seconds on the field. Each second the following takes place:

  * Let's suppose that at the current moment the bear is in cell (x, y). 
  * First the bear eats the raspberry from all the bushes he has in the current cell. After the bear eats the raspberry from k bushes, he increases each component of his speed by k. In other words, if before eating the k bushes of raspberry his speed was (dx, dy), then after eating the berry his speed equals (dx + k, dy + k). 
  * Let's denote the current speed of the bear (dx, dy) (it was increased after the previous step). Then the bear moves from cell (x, y) to cell (((x + dx - 1) mod n) + 1, ((y + dy - 1) mod n) + 1). 
  * Then one additional raspberry bush grows in each cell of the field. 



You task is to predict the bear's actions. Find the cell he ends up in if he starts from cell (sx, sy). Assume that each bush has infinitely much raspberry and the bear will never eat all of it.

Input

The first line of the input contains six space-separated integers: n, sx, sy, dx, dy, t (1 ≤ n ≤ 109; 1 ≤ sx, sy ≤ n; - 100 ≤ dx, dy ≤ 100; 0 ≤ t ≤ 1018).

Output

Print two integers — the coordinates of the cell the bear will end up in after t seconds.

Examples

Input

5 1 2 0 1 2


Output

3 1

Input

1 1 1 -1 -1 2


Output

1 1

Note

Operation a mod b means taking the remainder after dividing a by b. Note that the result of the operation is always non-negative. For example, ( - 1) mod 3 = 2.

In the first sample before the first move the speed vector will equal (3,4) and the bear will get to cell (4,1). Before the second move the speed vector will equal (9,10) and he bear will get to cell (3,1). Don't forget that at the second move, the number of berry bushes increased by 1.

In the second sample before the first move the speed vector will equal (1,1) and the bear will get to cell (1,1). Before the second move, the speed vector will equal (4,4) and the bear will get to cell (1,1). Don't forget that at the second move, the number of berry bushes increased by 1.
public class E {

	private final static boolean autoflush = false;

	long [][] A = {
			{ 1, 0, 0, 0, 0, 0 },
			{ 1, 1, 0, 0, 0, 0 },
			{ 2, 1, 2, 1, 1, 0 },
			{ 2, 1, 1, 2, 0, 1 },
			{ 2, 1, 1, 1, 1, 0 },
			{ 2, 1, 1, 1, 0, 1 }
	};

	public E () {
		int N = sc.nextInt();
		int X = sc.nextInt() - 1;
		int Y = sc.nextInt() - 1;
		int VX = sc.nextInt();
		int VY = sc.nextInt();
		long T = sc.nextLong();

		long [] V = { 1, 0, X, Y, VX, VY };
		long [] W = prod(pow(A, T, N), V, N);
		exit(W[2] + 1, W[3] + 1);
	}

	long [] prod(long [][] A, long [] V, long mod) {
		long [][] W = new long [V.length][1];
		for (int i : rep(V.length))
			W[i][0] = V[i];
		long [][] X = prod(A, W, mod);
		long [] res = new long [X.length];
		for (int i : rep(X.length))
			res[i] = X[i][0];
		return res;
	}

	long [][] sum (long [][] A, long [][] B, long mod) {
		int M = A.length, K = A[0].length, N = B[0].length;
		assert(K == B.length);
		long [][] res = new long [M][N];

		for (int i = 0; i < M; ++i)
			for (int j = 0; j < N; ++j)
				res[i][j] = mod(A[i][j] + B[i][j], mod);
		return res;
	}

	long [][] prod (long [][] A, long [][] B, long mod) {
		int M = A.length, K = A[0].length, N = B[0].length;
		assert(K == B.length);
		long [][] res = new long [M][N];

		for (int i = 0; i < M; ++i)
			for (int j = 0; j < N; ++j)
				for (int k = 0; k < K; ++k)
					res[i][j] = mod(res[i][j] + A[i][k] * B[k][j], mod);
		return res;
	}

	long [][] pow (long [][] A, long e, long mod) {
		long [][] res = id(A.length);
		if (e > 0) {
			int M = 1 + Long.numberOfTrailingZeros(Long.highestOneBit(e));
			long [][][] P = new long[M][][]; P[0] = A;
			for (int i : rep(1, M))
				P[i] = prod(P[i-1], P[i-1], mod);
			for (int i : rep(M))
				if ((e & (1L << i)) != 0)
					res = prod(res, P[i], mod);
		}
		return res;
	}

	long [][] id (int N) {
		long [][] res = new long [N][N];
		for (int i : rep(N))
			res[i][i] = 1;
		return res;
	}

	///////////////////////////////////////////////////////////////////////////
	private static int [] rep(int N) { return rep(0, N); }
	private static int [] rep(int S, int T) { if (T <= S) return new int [0]; int [] res = new int [T-S]; for (int i = S; i < T; ++i) res[i-S] = i; return res; }
	private static long mod(long x, long mod) { return ((x % mod) + mod) % mod; }
	////////////////////////////////////////////////////////////////////////////////////
	private final static MyScanner sc = new MyScanner();
	private static class MyScanner {
		public String next() { newLine(); return line[index++]; }
		public int nextInt() { return Integer.parseInt(next()); }
		public long nextLong() { return Long.parseLong(next()); }
		//////////////////////////////////////////////
		private boolean eol() { return index == line.length; }
		private String readLine() {
			try {
				return r.readLine();
			} catch (Exception e) {
				throw new Error (e);
			}
		}
		private final java.io.BufferedReader r;
		private MyScanner () { this(new java.io.BufferedReader(new java.io.InputStreamReader(System.in))); }
		private MyScanner (java.io.BufferedReader r) {
			try {
				this.r = r;
				while (!r.ready())
					Thread.sleep(1);
				start();
			} catch (Exception e) {
				throw new Error(e);
			}
		}
		private String [] line;
		private int index;
		private void newLine() {
			if (line == null || eol()) {
				line = readLine().split(" ");
				index = 0;
			}
		}
	}
	private static void print (Object o, Object... a) { printDelim(" ", o, a); }
	private static void printDelim (String delim, Object o, Object... a) { pw.println(build(delim, o, a)); }
	private static void exit (Object o, Object... a) { print(o, a); exit(); }
	private static void exit() {
		pw.close();
		System.out.flush();
		System.err.println("------------------");
		System.err.println("Time: " + ((millis() - t) / 1000.0));
		System.exit(0);
	}
	////////////////////////////////////////////////////////////////////////////////////
	private static String build (String delim, Object o, Object... a) {
		StringBuilder b = new StringBuilder();
		append(b, o, delim);
		for (Object p : a)
			append(b, p, delim);
		return b.substring(delim.length());
	}
	private static void append(StringBuilder b, Object o, String delim) {
		if (o.getClass().isArray()) {
			int L = java.lang.reflect.Array.getLength(o);
			for (int i = 0; i < L; ++i)
				append(b, java.lang.reflect.Array.get(o, i), delim);
		} else if (o instanceof Iterable<?>)
			for (Object p : (Iterable<?>)o)
				append(b, p, delim);
		else
			b.append(delim).append(o);
	}
	////////////////////////////////////////////////////////////////////////////////////
	private static void start() { t = millis(); }
	private static java.io.PrintWriter pw = new java.io.PrintWriter(System.out, autoflush);
	private static long t;
	private static long millis() { return System.currentTimeMillis(); }
	public static void main (String[] args) { new E(); exit(); }
}
