#include <bits/stdc++.h>
using namespace std;
bool debug = 1;
int n, m, k;
int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0};
long long ln, lk, lm;
int mod;
struct Matrix {
  int n, m;
  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}, {1, 1, 1, 1, 1, 0}, {2, 2, 2, 2, 1, 1},
  };
  Matrix() {}
  Matrix(int n, int m) : n(n), m(m) {}
  Matrix operator*(Matrix b) {
    Matrix o = Matrix(n, b.m);
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < b.m; j++) {
        o.a[i][j] = 0;
        for (int k = 0; k < m; k++) {
          o.a[i][j] = (o.a[i][j] + (a[i][k] * b.a[k][j]) % mod) % mod;
        }
      }
    }
    return o;
  }
  Matrix pow(long long p) {
    Matrix o = Matrix(n, m);
    Matrix b = *this;
    for (int i = 0; i < n; i++)
      for (int j = 0; j < m; j++) o.a[i][j] = (i == j);
    while (p > 0) {
      if (p & 1) o = o * b;
      b = b * b;
      p >>= 1;
    }
    return o;
  }
};
int main() {
  long long sx, sy, dx, dy, t;
  cin >> n >> sx >> sy >> dx >> dy >> t;
  mod = n;
  Matrix mt = Matrix(6, 6);
  Matrix b = mt.pow(t);
  sx--;
  sy--;
  long long x = sx * b.a[0][0] % n + sy * b.a[1][0] % n + dx * b.a[2][0] % n +
                dy * b.a[3][0] % n + b.a[5][0] % n;
  long long y = sx * b.a[0][1] % n + sy * b.a[1][1] % n + dx * b.a[2][1] % n +
                dy * b.a[3][1] % n + b.a[5][1] % n;
  x %= n;
  y %= n;
  printf("%lld %lld\n", (x + n) % n + 1, (y + n) % n + 1);
  return 0;
}
