#include <bits/stdc++.h>
const int MOD = 1000000007;
const int N = 10 + 5;
using namespace std;
struct Matrix {
  long long s[N][N];
};
Matrix e;
Matrix x;
long long mod;
Matrix mul(Matrix A, Matrix B, long long n) {
  Matrix temp;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++) temp.s[i][j] = 0;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++)
      for (int k = 1; k <= n; k++)
        temp.s[i][j] =
            ((temp.s[i][j] + A.s[i][k] * B.s[k][j]) % mod + mod) % mod;
  return temp;
}
Matrix quickPower(Matrix a, long long b, long long n) {
  Matrix ans = e;
  while (b) {
    if (b & 1) ans = mul(ans, a, n);
    a = mul(a, a, n);
    b >>= 1;
  }
  return ans;
}
long long n, sx, sy, dx, dy, t;
long long y[N];
void init() {
  for (int i = 1; i <= 6; i++) e.s[i][i] = 1;
  x.s[1][1] = 2;
  x.s[1][2] = 1;
  x.s[1][3] = 1;
  x.s[1][4] = 0;
  x.s[1][5] = 1;
  x.s[1][6] = 2;
  x.s[2][1] = 1;
  x.s[2][2] = 2;
  x.s[2][3] = 0;
  x.s[2][4] = 1;
  x.s[2][5] = 1;
  x.s[2][6] = 2;
  x.s[3][1] = 1;
  x.s[3][2] = 1;
  x.s[3][3] = 1;
  x.s[3][4] = 0;
  x.s[3][5] = 1;
  x.s[3][6] = 2;
  x.s[4][1] = 1;
  x.s[4][2] = 1;
  x.s[4][3] = 0;
  x.s[4][4] = 1;
  x.s[4][5] = 1;
  x.s[4][6] = 2;
  x.s[5][1] = 0;
  x.s[5][2] = 0;
  x.s[5][3] = 0;
  x.s[5][4] = 0;
  x.s[5][5] = 1;
  x.s[5][6] = 1;
  x.s[6][1] = 0;
  x.s[6][2] = 0;
  x.s[6][3] = 0;
  x.s[6][4] = 0;
  x.s[6][5] = 0;
  x.s[6][6] = 1;
  y[1] = sx - 1;
  y[2] = sy - 1;
  y[3] = dx;
  y[4] = dy;
  y[5] = 0;
  y[6] = 1;
}
int main() {
  while (scanf("%lld%lld%lld%lld%lld%lld", &n, &sx, &sy, &dx, &dy, &t) != EOF) {
    if (t == 0)
      printf("%lld %lld", sx, sy);
    else {
      mod = n;
      init();
      Matrix res = quickPower(x, t, 6);
      long long ex = 0, ey = 0;
      for (int i = 1; i <= 6; i++)
        ex = ((ex + res.s[1][i] * y[i]) % mod + mod) % mod;
      for (int i = 1; i <= 6; i++)
        ey = ((ey + res.s[2][i] * y[i]) % mod + mod) % mod;
      printf("%lld %lld\n", ex + 1, ey + 1);
    }
  }
  return 0;
}
