Problem: It happened at the times of the Great Berland Empire. Once the Emperor dreamt that the Messenger from the gods ordered to build a temple whose base would be a convex polygon with n angles. Next morning the Emperor gave the command to build a temple whose base was a regular polygon with n angles. The temple was built but soon the Empire was shaken with disasters and crop failures. After an earthquake destroyed the temple, the Emperor understood that he somehow caused the wrath of gods to fall on his people. He ordered to bring the wise man. When the wise man appeared, the Emperor retold the dream to him and asked "Oh the wisest among the wisest, tell me how could I have infuriated the Gods?". "My Lord," the wise man answered. "As far as I can judge, the gods are angry because you were too haste to fulfill their order and didn't listen to the end of the message".

Indeed, on the following night the Messenger appeared again. He reproached the Emperor for having chosen an imperfect shape for the temple. "But what shape can be more perfect than a regular polygon!?" cried the Emperor in his dream. To that the Messenger gave a complete and thorough reply. 

  * All the vertices of the polygon should be positioned in the lattice points. 
  * All the lengths of its sides should be different. 
  * From the possible range of such polygons a polygon which maximum side is minimal possible must be chosen. 



You are an obedient architect who is going to make the temple's plan. Note that the polygon should be simple (having a border without self-intersections and overlapping) and convex, however, it is acceptable for three consecutive vertices to lie on the same line.

Input

The first line contains the single number n (3 ≤ n ≤ 10000).

Output

Print "YES" (without quotes) in the first line if it is possible to build a polygon possessing the needed qualities. In the next n lines print integer coordinates of the polygon vertices in the order in which they would be passed counter clockwise. The absolute value of the coordinates shouldn't exceed 109. No two vertices can coincide. It is permitted to print any of the possible solutions. Print "NO" if to build the polygon is impossible.

Examples

Input

3


Output

YES
0 0
1 0
0 2


Input

3


Output

YES
0 1
-1 0
-1 -1

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
using namespace std;
map<int, pair<int, int>> M;
struct P {
  long long x, y;
  P() : x(0), y(0) {}
  P(long long a, long long b) : x(a), y(b) {}
  P operator+(const P &a) const { return P(x + a.x, y + a.y); }
  P operator-(const P &a) const { return P(x - a.x, y - a.y); }
};
long long cross(P a, P b) { return a.x * b.y - a.y * b.x; }
int main() {
  for (int i = 0; i <= 300; i++)
    for (int j = i; j <= 300; j++)
      if (i + j != 0 && M.find(i * i + j * j) == M.end())
        M[i * i + j * j] = {i, j};
  int n;
  scanf("%d", &n);
  vector<pair<int, pair<int, int>>> A;
  for (auto x : M) A.push_back(x);
  A.resize(n + 1);
  long long S = 0;
  for (int i = 0; i <= n - 1; i++) S += A[i].first;
  if (S & 1) {
    for (int i = n - 1; i >= 0; i--)
      if ((A[n].first - A[i].first) & 1) {
        swap(A[i], A[n]);
        break;
      }
  }
  A.resize(n);
  assert(A[0].second.first == 0 && A[0].second.second == 1);
  S = 0;
  for (auto [l, it] : A) S += it.first;
  if (S & 1) swap(A[0].second.first, A[0].second.second);
  sort(A.begin(), A.end(),
       [](pair<int, pair<int, int>> a, pair<int, pair<int, int>> b) {
         return a.second.first > b.second.first;
       });
  S = 0;
  for (auto &it : A) {
    int &x = it.second.first;
    if (S > 0)
      x = -x, S += x;
    else
      S += x;
  }
  assert(S == 0);
  sort(A.begin(), A.end(),
       [](pair<int, pair<int, int>> a, pair<int, pair<int, int>> b) {
         return a.second.second > b.second.second;
       });
  for (auto &it : A) {
    int &y = it.second.second;
    if (S > 0)
      y = -y, S += y;
    else
      S += y;
  }
  assert(S == 0);
  vector<P> p;
  for (auto [l, it] : A) p.push_back(P(it.first, it.second));
  sort(p.begin(), p.end(), [](P a, P b) {
    bool upa = a.y > 0 || (a.y == 0 && a.x < 0);
    bool upb = b.y > 0 || (b.y == 0 && b.x < 0);
    if (upa != upb) return upa < upb;
    return cross(a, b) > 0;
  });
  puts("YES");
  P s(0, 0);
  for (auto a : p) {
    s = s + a;
    printf("%lld %lld\n", s.x, s.y);
  }
  return 0;
}