#include <bits/stdc++.h>
using namespace std;
const int maxn = 100000;
const int base = 1000;
const double pi = acos(-1.0);
const double inf = 1e20;
long long mod;
int arr[6][6] = {{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}};
struct Matrix {
  long long A[6][6];
  Matrix() {}
  Matrix(int arr[6][6]) {
    for (int i = 0; i < 6; ++i) {
      for (int j = 0; j < 6; ++j) {
        A[i][j] = arr[i][j];
      }
    }
  }
  void init() {
    memset(A, 0, sizeof(A));
    for (int i = 0; i < 6; ++i) {
      A[i][i] = 1;
    }
  }
  void clear() { memset(A, 0, sizeof(A)); }
  void print() {
    for (int i = 0; i < 6; ++i) {
      for (int j = 0; j < 6; ++j) {
        cout << A[i][j] << " ";
      }
      cout << endl;
    }
  }
} tmp, res, E, A;
Matrix& mul(const Matrix& A, const Matrix& B) {
  res.clear();
  int i, j, k;
  for (k = 0; k < 6; ++k) {
    for (i = 0; i < 6; ++i) {
      for (j = 0; j < 6; ++j) {
        res.A[i][j] += A.A[i][k] * B.A[k][j];
        res.A[i][j] %= mod;
      }
    }
  }
  return res;
}
int main() {
  ios::sync_with_stdio(false);
  long long n, sx, sy, dx, dy, t;
  cin >> n >> sx >> sy >> dx >> dy >> t;
  --sx;
  --sy;
  mod = n;
  dx = (dx % mod + mod) % mod;
  dy = (dy % mod + mod) % mod;
  long long X[10] = {sx, sy, dx, dy, 0, 1};
  A.init();
  Matrix tmp(arr);
  while (t) {
    if (t & 1) {
      A = mul(A, tmp);
    }
    tmp = mul(tmp, tmp);
    t >>= 1;
  }
  long long x = 0, y = 0;
  for (int i = 0; i < 6; ++i) {
    x += A.A[0][i] * X[i];
    y += A.A[1][i] * X[i];
    x %= mod;
    y %= mod;
  }
  ++x;
  ++y;
  cout << x << " " << y << endl;
  return 0;
}
