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>
using namespace std;
vector<int> x[100010];
vector<int> y[100010];
bool can[100010];
int ssqrt(int s) {
  int x = sqrt(s);
  if (x * x == s)
    return x;
  else
    return -1;
}
void init() {
  for (int i = 1; i < 100010; i++) {
    can[i] = false;
    for (int a = 0; a * a <= i; a++) {
      int b = ssqrt(i - a * a);
      if (b != -1) {
        can[i] = true;
        x[i].push_back(a);
        y[i].push_back(b);
      }
    }
  }
}
int pp[100010];
int qq;
struct Node {
  int x, y;
  double ang;
} p[100010];
bool cmp(Node a, Node b) { return a.ang < b.ang; }
int myabs(int x) { return max(x, -x); }
int main() {
  init();
  int n;
  scanf("%d", &n);
  qq = 0;
  for (int i = 1; i < 100010; i++) {
    if (can[i]) pp[qq++] = i;
    if (qq == n) break;
  }
  int sum = 0;
  for (int i = 0; i < qq; i++) sum += pp[i];
  if (sum & 1) {
    for (int i = pp[qq - 1] + 1; i < 100010; i++)
      if (can[i]) {
        pp[qq] = i;
        break;
      }
    for (int i = qq - 1; i >= 0; i--)
      if ((pp[i] + pp[qq]) & 1) {
        swap(pp[i], pp[qq]);
        break;
      }
  }
  while (1) {
    sort(pp, pp + qq);
    reverse(pp, pp + qq);
    int xx = 0;
    int yy = 0;
    for (int i = 0; i < qq; i++) {
      int len = x[pp[i]].size();
      int j = rand() % len;
      if (myabs(xx + x[pp[i]][j]) < myabs(xx - x[pp[i]][j])) {
        xx += x[pp[i]][j];
        p[i].x = x[pp[i]][j];
      } else {
        xx -= x[pp[i]][j];
        p[i].x = -x[pp[i]][j];
      }
      if (myabs(yy + y[pp[i]][j]) < myabs(yy - y[pp[i]][j])) {
        yy += y[pp[i]][j];
        p[i].y = y[pp[i]][j];
      } else {
        yy -= y[pp[i]][j];
        p[i].y = -y[pp[i]][j];
      }
    }
    if (xx == 0 && yy == 0) break;
  }
  for (int i = 0; i < qq; i++) p[i].ang = atan2(p[i].y, p[i].x);
  sort(p, p + qq, cmp);
  printf("YES\n");
  int xx = 0;
  int yy = 0;
  for (int i = 0; i < qq; i++) {
    xx += p[i].x;
    yy += p[i].y;
    printf("%d %d\n", xx, yy);
  }
  return 0;
}