#include <bits/stdc++.h>
using namespace std;
const int maxn = 10;
int n;
struct Matrix {
  long long maze[6][6];
  Matrix() { memset(maze, 0, sizeof(maze)); }
  void init() {
    for (int i = 0; i < 4; i++)
      for (int j = 0; j < 5; j++) maze[i][j] = 1;
    maze[0][3] = maze[1][2] = maze[2][3] = maze[3][2] = 0;
    maze[0][0] = maze[1][1] = 2;
    for (int i = 0; i < 4; i++) maze[i][5] = 2;
    maze[4][4] = maze[4][5] = maze[5][5] = 1;
  }
  Matrix operator*(const Matrix& rhs) {
    Matrix ans;
    for (int i = 0; i < 6; i++)
      for (int j = 0; j < 6; j++)
        for (int k = 0; k < 6; k++)
          ans.maze[i][j] =
              (((ans.maze[i][j] + maze[i][k] * rhs.maze[k][j]) % n) + n) % n;
    return ans;
  }
} mat, mat2, mat3, mat_ans;
Matrix qpow(Matrix a, long long t) {
  if (t == 1) return a;
  Matrix ans = qpow(a, t / 2);
  ans = ans * ans;
  if (t & 1) ans = ans * a;
  return ans;
}
int main() {
  int sx, sy, dx, dy;
  long long t;
  scanf("%d%d%d%d%d%I64d", &n, &sx, &sy, &dx, &dy, &t);
  mat.init();
  mat3.maze[0][0] = sx - 1;
  mat3.maze[1][0] = sy - 1;
  mat3.maze[2][0] = dx;
  mat3.maze[3][0] = dy;
  mat3.maze[4][0] = 0;
  mat3.maze[5][0] = 1;
  if (t) {
    mat2 = qpow(mat, t);
    mat_ans = mat2 * mat3;
    printf("%I64d %I64d\n", mat_ans.maze[0][0] + 1, mat_ans.maze[1][0] + 1);
  } else
    printf("%I64d %I64d\n", mat3.maze[0][0] + 1, mat3.maze[1][0] + 1);
  return 0;
}
