#include <bits/stdc++.h>
using namespace std;
long long x, y, vx, vy, d, e, t, n;
long long matrix[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}};
vector<vector<long long> > M[2];
vector<long long> multiply(vector<vector<long long> > A, vector<long long> x) {
  vector<long long> ret(6, 0);
  for (int i = 0; i < 6; i++) {
    for (int j = 0; j < 6; j++) {
      ret[i] += A[i][j] * x[j];
      ret[i] %= n;
    }
  }
  return ret;
}
vector<vector<long long> > square(vector<vector<long long> > A) {
  vector<vector<long long> > ret(6, vector<long long>(6, 0));
  for (int i = 0; i < 6; i++)
    for (int j = 0; j < 6; j++)
      for (int k = 0; k < 6; k++) {
        ret[i][j] += A[i][k] * A[k][j];
        ret[i][j] %= n;
      }
  return ret;
}
int main() {
  for (int i = 0; i < 2; i++)
    M[i] = vector<vector<long long> >(6, vector<long long>(6, 0));
  for (int i = 0; i < 6; i++)
    for (int j = 0; j < 6; j++) M[0][i][j] = matrix[i][j];
  cin >> n >> x >> y >> vx >> vy >> t;
  vector<long long> ini(6, 0);
  while (vx < 0) vx += n;
  vx %= n;
  while (vy < 0) vy += n;
  vy %= n;
  ini[0] = x - 1;
  ini[1] = y - 1;
  ini[2] = vx;
  ini[3] = vy;
  ini[4] = 2;
  ini[5] = 1;
  vector<long long> ret;
  int idx = 0;
  while (t) {
    if (1 & t) {
      ret = multiply(M[idx], ini);
      ini = ret;
    }
    M[1 ^ idx] = square(M[idx]);
    idx ^= 1;
    t >>= 1;
  }
  cout << ini[0] + 1 << " " << ini[1] + 1 << endl;
  return 0;
}
