#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  long long res = 0;
  char c;
  bool flag = false;
  c = getchar();
  while (!isdigit(c)) {
    flag = (c == '-');
    c = getchar();
  }
  while (isdigit(c)) {
    res = res * 10 + (c ^ 48);
    c = getchar();
  }
  return !flag ? res : -res;
}
const int Max_n = 10;
struct Martix {
  long long h[Max_n][Max_n];
  void clean() { memset(h, 0, sizeof(h)); }
  long long *operator[](int a) { return h[a]; }
  void build() {
    for (int i = 1; i <= 6; ++i) h[i][i] = 1;
  }
};
int n;
long long t;
Martix operator*(Martix a, Martix b) {
  Martix ret;
  ret.clean();
  for (int i = 1; i <= 6; ++i)
    for (int j = 1; j <= 6; ++j)
      for (int k = 1; k <= 6; ++k)
        ret[i][j] += a[i][k] * b[k][j] % n, ret[i][j] %= n;
  return ret;
}
Martix operator^(Martix x, long long y) {
  Martix ret;
  ret.clean(), ret.build();
  while (y) {
    if (y & 1) ret = ret * x;
    x = x * x;
    y >>= 1;
  }
  return ret;
}
long long squ[Max_n][Max_n] = {{},
                               {0, 2, 1, 1, 0, 1, 2},
                               {0, 1, 2, 0, 1, 1, 2},
                               {0, 1, 1, 1, 0, 1, 2},
                               {0, 1, 1, 0, 1, 1, 2},
                               {0, 0, 0, 0, 0, 1, 1},
                               {0, 0, 0, 0, 0, 0, 1}},
          posx, posy, dx, dy;
int main() {
  n = read(), posx = read() - 1, posy = read() - 1, dx = read(), dy = read(),
  t = read();
  Martix change;
  memcpy(change.h, squ, sizeof(squ));
  change = change ^ t;
  long long ansx, ansy;
  ansx = (change[1][1] * posx % n) + (change[1][2] * posy % n) +
         (change[1][3] * dx % n) + (change[1][4] * dy % n) + change[1][6];
  ansy = (change[2][1] * posx % n) + (change[2][2] * posy % n) +
         (change[2][3] * dx % n) + (change[2][4] * dy % n) + change[2][6];
  ansx %= n, ansy %= n, ansx = (ansx + n) % n, ansy = (ansy + n) % n;
  printf("%lld %lld", ansx + 1, ansy + 1);
  return 0;
}
