#include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 30;
int A[6][6] = {{2, 1, 1, 0, 1, 0}, {1, 2, 0, 1, 1, 0}, {1, 1, 1, 0, 1, 0},
               {1, 1, 0, 1, 1, 0}, {0, 0, 0, 0, 1, 1}, {0, 0, 0, 0, 0, 1}};
int B[6][6], C[6][6];
void mul(int A[6][6], int B[6][6], int C[6][6], int mod) {
  for (int i = 0; i < 6; ++i) {
    for (int j = 0; j < 6; ++j) {
      long long sum = 0;
      for (int k = 0; k < 6; ++k) {
        sum += (long long)A[i][k] * B[k][j] % mod;
      }
      C[i][j] = sum % mod;
    }
  }
}
int main() {
  int n, sx, sy, dx, dy;
  long long t;
  scanf("%d%d%d%d%d%I64d", &n, &sx, &sy, &dx, &dy, &t);
  for (int i = 0; i < 6; ++i) C[i][i] = 1;
  for (; t; t >>= 1) {
    if (t & 1) {
      mul(A, C, B, n);
      memcpy(C, B, sizeof(A));
    }
    mul(A, A, B, n);
    memcpy(A, B, sizeof(A));
  }
  int x = 0;
  x = (x + (long long)C[0][0] * sx % n) % n;
  x = (x + (long long)C[0][1] * sy % n) % n;
  x = (x + (long long)C[0][2] * dx % n) % n;
  x = (x + (long long)C[0][3] * dy % n) % n;
  x = (x + C[0][5]) % n;
  x = (x + n) % n;
  if (x == 0) x = n;
  int y = 0;
  y = (y + (long long)C[1][0] * sx % n) % n;
  y = (y + (long long)C[1][1] * sy % n) % n;
  y = (y + (long long)C[1][2] * dx % n) % n;
  y = (y + (long long)C[1][3] * dy % n) % n;
  y = (y + C[1][5]) % n;
  y = (y + n) % n;
  if (y == 0) y = n;
  printf("%d %d\n", x, y);
  return 0;
}
