#include <bits/stdc++.h>
using namespace std;
int n;
vector<int> a, b;
vector<vector<long long> > cache;
long long dfs(int left, int right) {
  if (left > right) {
    return 0;
  }
  if (cache[left][right] != -1) {
    return cache[left][right];
  }
  int which = n - (right - left + 1);
  long long ans1 = dfs(left + 1, right) + abs(left - b[which]) * a[b[which]];
  long long ans2 = dfs(left, right - 1) + abs(right - b[which]) * a[b[which]];
  return cache[left][right] = max(ans1, ans2);
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  int l, r;
  for (int i = 0; i < 3; i++) {
    cin >> l >> r;
    cout << "cur = " << (n - (r - l + 1)) << '\n';
  }
}
