#include <bits/stdc++.h>
using namespace std;
long long n, x, y, dx, dy, t;
long long m1[6][6], m2[6][6];
long long I[6][6];
long long a[6][6] = {{2, 1, 1, 1, 0, 0}, {1, 2, 1, 1, 0, 0},
                     {1, 0, 1, 0, 0, 0}, {0, 1, 0, 1, 0, 0},
                     {0, 0, 1, 1, 1, 0}, {0, 0, 0, 0, 1, 1}};
void mul(long long a[6][6], long long b[6][6], long long c[6][6]) {
  for (int i = 0; i < 6; ++i)
    for (int j = 0; j < 6; ++j) a[i][j] = 0;
  for (int i = 0; i < 6; ++i)
    for (int j = 0; j < 6; ++j)
      for (int k = 0; k < 6; ++k) a[i][j] = (a[i][j] + b[i][k] * c[k][j]) % n;
}
void pwr(long long a[6][6], long long t) {
  if (t == 0) {
    for (int i = 0; i < 6; ++i)
      for (int j = 0; j < 6; ++j) a[i][j] = I[i][j];
    return;
  }
  long long aux[6][6], b[6][6], c[6][6], d[6][6];
  for (int i = 0; i < 6; ++i)
    for (int j = 0; j < 6; ++j) aux[i][j] = a[i][j];
  for (int i = 0; i < 6; ++i)
    for (int j = 0; j < 6; ++j) b[i][j] = a[i][j];
  pwr(b, t / 2);
  for (int i = 0; i < 6; ++i)
    for (int j = 0; j < 6; ++j) c[i][j] = b[i][j];
  mul(d, b, c);
  if (t % 2 == 1)
    mul(a, d, aux);
  else
    for (int i = 0; i < 6; ++i)
      for (int j = 0; j < 6; ++j) a[i][j] = d[i][j];
}
int main() {
  cin >> n >> x >> y >> dx >> dy >> t;
  if (n == 1) {
    cout << "1 1\n";
    return 0;
  }
  dx = ((dx % n) + n) % n;
  dy = ((dy % n) + n) % n;
  m1[0][0] = x;
  m1[0][1] = y;
  m1[0][2] = dx;
  m1[0][3] = dy;
  m1[0][4] = 1;
  m1[0][5] = 1;
  for (int i = 0; i < 6; ++i) I[i][i] = 1;
  pwr(a, t);
  mul(m2, m1, a);
  if (m2[0][0] == 0) m2[0][0] = n;
  if (m2[0][1] == 0) m2[0][1] = n;
  cout << m2[0][0] << ' ' << m2[0][1] << '\n';
}
