#include <bits/stdc++.h>
using namespace std;
using namespace std;
long long MOD;
const long long N = 8;
void copym(long long to[N][N], long long src[N][N], long long n, long long m) {
  for (long long i = 0; i < n; i++)
    for (long long j = 0; j < m; j++) to[i][j] = src[i][j];
}
void printfm(long long A[N][N], long long n, long long m) {
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < m; j++) {
      printf("%I64d%c", A[i][j], (j == m - 1) ? '\n' : ' ');
    }
  }
  printf("\n");
}
void mul(long long A[N][N], long long B[N][N], long long t[N][N], long long n,
         long long m, long long l) {
  long long tmp[N][N];
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < l; j++) {
      tmp[i][j] = 0;
      for (long long k = 0; k < m; k++)
        tmp[i][j] = (tmp[i][j] + A[i][k] * B[k][j] % MOD) % MOD;
    }
  }
  for (long long i = 0; i < n; i++)
    for (long long j = 0; j < l; j++) t[i][j] = tmp[i][j] % MOD;
}
void expo(long long p[N][N], long long e[N][N], long long k, long long n) {
  if (k != 1) {
    for (long long i = 0; i < n; ++i)
      for (long long j = 0; j < n; ++j) e[i][j] = (i == j);
    while (k) {
      if (k & 1) mul(e, p, e, n, n, n);
      mul(p, p, p, n, n, n);
      k >>= 1;
    }
  } else {
    for (long long i = 0; i < n; i++)
      for (long long j = 0; j < n; j++) e[i][j] = p[i][j] % MOD;
  }
}
long long bei[N][N] = {
    {2, 1, 1, 0, 1, 2}, {1, 2, 0, 1, 1, 2}, {1, 1, 1, 0, 1, 2},
    {1, 1, 0, 1, 1, 2}, {0, 0, 0, 0, 1, 1}, {0, 0, 0, 0, 0, 1},
};
long long jieguo[N][N];
long long yikaishi[N][N];
long long daan[N][N];
int main() {
  long long n, sx, sy, dx, dy, t;
  scanf("%I64d%I64d%I64d", &(n), &(sx), &(sy));
  scanf("%I64d%I64d%I64d", &(dx), &(dy), &(t));
  sx--, sy--;
  MOD = n;
  expo(bei, jieguo, t, 8);
  yikaishi[0][0] = sx;
  yikaishi[1][0] = sy;
  yikaishi[2][0] = dx;
  yikaishi[3][0] = dy;
  yikaishi[4][0] = 0;
  yikaishi[5][0] = 1;
  mul(jieguo, yikaishi, daan, 6, 6, 1);
  printf("%I64d %I64d\n", (daan[0][0] + MOD) % MOD + 1,
         (daan[1][0] + MOD) % MOD + 1);
  return 0;
}
