#include <bits/stdc++.h>

using namespace std;

const int maxn = 1000 + 12;
vector < pair <int, int> > a;

int main()
{
    int n, t;
    cin >> n >> t;
    for(int i = 0; i < n; i ++){
        int x, l;
        cin >> x >> l;
        a.push_back(make_pair(x - (l / 2), x + (l / 2)));
    }
    sort(a.begin(), a.end());
    int ans = 2;
    for(int i = 0; i < n - 1; i ++){
        if(a[i + 1].first - t == a[i].second)
            ans ++;
        else if(a[i + 1].first - t > a[i].second)
            ans += 2;
    }
    cout << ans;
    return 0;
}


#include <string>
#include <algorithm>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <utility>
#include <vector>
#include <fstream>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;

typedef tuple<ll,ll> int2;
typedef tuple<ll,ll,ll> int3;
typedef tuple<ll,ll,ll,ll> int4;

#define all(v) (v).begin(), (v).end()
#define est(v,e) (find(all(v), (e)) != (v).end())
#define pb push_back
#define eb emplace_back
#define SZ(a) ((ll)((a).size()))
#define For(i,a,b) for(ll i=(a);i<(b);++i)
#define rep(i,n) For(i,0,n)
#define tag(i,v) rep(i,SZ(v))
#define trace(x)  cerr << #x << " = " << (x) << endl
#define tracev(x) cerr << #x << " = "; tag(__i, x) { cerr << x[__i] << ","; } cerr << endl
#define initv(typ, v, n) vector<typ> v; rep(i,n) { typ tmp; cin >> tmp; v.pb(tmp); }
#define fst get<0>
#define snd get<1>
#define thd get<2>

const ll inf = 1LL << 60;
ll toInt(string s) {ll res;stringstream ss;ss<<s;ss>>res;return res;}

int main(void) {

  #define int long long

  #if 0
  #ifdef ONLINE_JUDGE
  ifstream ifile("input.txt");
  if(ifile) freopen("input.txt", "rt", stdin);
  if(ifile) freopen("output.txt", "wt", stdout);
  #endif
  #endif

  int n,t;

  cin >> n >> t;

  vector<int2> x;

  rep(i,n){
    int tmp, tmp2;
    cin >> tmp >> tmp2;
    x.eb(tmp, tmp2);
  }

  x.eb(-inf,1);
  x.eb(inf,1);

  sort(all(x), [](int2 x, int2 y){ return fst(x) - fst(y) < 0; });

  #if 1

  int ans = 0;

  rep(i,n+1){

    int2 e = x[i];
    int2 r = x[i+1];
    int tmp = snd(r)+snd(e);
    int between = fst(r) - fst(e) - (tmp/2+tmp%2);
    //trace(fst(r));
    //trace(fst(e));
    if(between > t)
      ans += 2;
    else if(between == t)
      ans += 1;
  }

  cout << (ans-2) << endl;
  #endif

  return 0;

}


#include <string>
#include <algorithm>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <utility>
#include <vector>
#include <fstream>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;

typedef tuple<ll,ll> int2;
typedef tuple<ll,ll,ll> int3;
typedef tuple<ll,ll,ll,ll> int4;

#define all(v) (v).begin(), (v).end()
#define est(v,e) (find(all(v), (e)) != (v).end())
#define pb push_back
#define eb emplace_back
#define SZ(a) ((ll)((a).size()))
#define For(i,a,b) for(ll i=(a);i<(b);++i)
#define rep(i,n) For(i,0,n)
#define tag(i,v) rep(i,SZ(v))
#define trace(x)  cerr << #x << " = " << (x) << endl
#define tracev(x) cerr << #x << " = "; tag(__i, x) { cerr << x[__i] << ","; } cerr << endl
#define initv(typ, v, n) vector<typ> v; rep(i,n) { typ tmp; cin >> tmp; v.pb(tmp); }
#define fst get<0>
#define snd get<1>
#define thd get<2>

const ll inf = 1LL << 60;
ll toInt(string s) {ll res;stringstream ss;ss<<s;ss>>res;return res;}

int main(void) {

  #define int long long

  #if 0
  #ifdef ONLINE_JUDGE
  ifstream ifile("input.txt");
  if(ifile) freopen("input.txt", "rt", stdin);
  if(ifile) freopen("output.txt", "wt", stdout);
  #endif
  #endif

  int n,t;

  cin >> n >> t;

  vector<int2> x;

  rep(i,n){
    int tmp, tmp2;
    cin >> tmp >> tmp2;
    x.eb(tmp, tmp2);
  }

  x.eb(-inf,1);
  x.eb(inf,1);

  sort(all(x), [](int2 x, int2 y){ return fst(x) - fst(y) < 0; });

  #if 1

  int ans = 0;

  rep(i,n+1){

    int2 e = x[i];
    int2 r = x[i+1];
    int tmp = snd(r)+snd(e);
    int between = 2 * (fst(r) - fst(e)) - tmp;
    //trace(fst(r));
    //trace(fst(e));
    if(between > 2*t)
      ans += 2;
    else if(between == 2*t)
      ans += 1;
  }

  cout << (ans-2) << endl;
  #endif

  return 0;

}


// https://pp.vk.me/c540102/v540102394/7cd5/J2NXxBbvBrM.jpg
#pragma GCC optimize("O500")
#pragma comment(linker, "/STACK:1677777216")
#pragma warning(default :4)
#define _CRT_SECURE_NO_DEPRECATE
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <string>
#include <string.h>
#include <utility>
#include <set>
#include <map>
#include <vector>
#include <stack>
#include <ctime>
#include <queue>
#include <cmath>
#include <deque>
#include <list>
#include <sstream>
#include <bitset>
#include <complex>
#include <functional>
#include <numeric>
//#include <array>
//#include <unordered_set>
//#include <unordered_map>
#include <cassert>
#include <iomanip>
#define mp make_pair
#define FOR(i,a,b) for(int i=(a),_b(b);i<_b;++i)
#define FORD(i,a,b) for(int i=(a),_b(b);i>=_b;--i)
#define FORA(e,c) for(auto e:c)
#define REP(i,n) FOR(i,0,n)
#define CL(x) memset(x, 0, sizeof(x))
#define SINF(x) memset(x, 0x3F, sizeof(x))
#define SVAL(x, y) memset(x, y, sizeof(x))
#define CP(t, f) memcpy(t, f, sizeof(f));
#define CPS(t, f, s) memcpy(t, f, s*sizeof(f[0]))
#define ALL(a) (a).begin(), (a).end()
#define ALLR(a) (a).rbegin(), (a).rend()
#define FIN freopen("in.txt", "r", stdin);
#define FINOUT freopen("in.txt", "w", stdout);
#define FOUT freopen("out.txt", "w", stdout);
#define y1 ____y1
using namespace std;
typedef const int CI;
typedef long long ll;
typedef unsigned long long ull;
//typedef __float128 ld;
//typedef long double ld;
typedef double ld;
typedef vector<int> VINT;
typedef vector<ld> VLD;
typedef vector<ll> VLL;
typedef vector<vector<int> > VVINT;
typedef pair<int, int> PII;
typedef pair<int, PII> PIII;
typedef pair<PII, PII> PIIII;
typedef pair<ll, ll> PLL;
typedef pair<ld, ld> PLD;
typedef pair<ld, ld> ptp;
typedef complex<ld> Cn;
typedef vector<PII> VPII;
typedef vector<PLL> VPLL;
typedef vector<PIII> VPIII;
typedef unsigned int uint;
const ld eps=1e-12;
//const int INF = 1000000001;
const int oo=0x3F3F3F3F;
const ll ooLL=0x3F3F3F3F3F3F3F3FLL;
const int MOD=1000000007;
template<typename T> T sqr(T x) { return x*x; }
template<typename T> void debpr(const T &);
template<typename T1, typename T2> void debpr(const pair<T1, T2> &);
template<typename T1, typename T2> void debpr(const vector<T1, T2> &);
template<typename T> void debpr(const set<T> &);
template<typename T1, typename T2> void debpr(const map<T1, T2> &);
template<typename T> void prcont(T be, T en, const string &st, const string &fi, const string &mi) { debpr(st); bool ft=0; while (be!=en) { if (ft) debpr(mi); ft=1; debpr(*be); ++be; } debpr(fi); }
template<typename T> void debpr(const T &a) {
#ifdef EgQrauETGh
    cerr<<a;
#endif
}
template<typename T1, typename T2> void debpr(const pair<T1, T2> &p) { debpr("("); debpr(p.first); debpr(", "); debpr(p.second); debpr(")"); }
template<typename T1, typename T2> void debpr(const vector<T1, T2> &a) { prcont(a.begin(), a.end(), "[", "]", ", "); }
template<typename T> void debpr(const set<T> &a) { prcont(a.begin(), a.end(), "{", "}", ", "); }
template<typename T1, typename T2> void debpr(const map<T1, T2> &a) { prcont(a.begin(), a.end(), "{", "}", ", "); }
void deb() {};
template<typename T1> void deb(const T1 &t1) { debpr(t1); debpr('\n'); }
template<typename T1, typename T2> void deb(const T1 &t1, const T2 &t2) { debpr(t1); debpr(' '); debpr(t2); debpr('\n'); }
template<typename T1, typename T2, typename T3> void deb(const T1 &t1, const T2 &t2, const T3 &t3) { debpr(t1); debpr(' '); debpr(t2); debpr(' '); debpr(t3); debpr('\n'); }
template<typename T1, typename T2, typename T3, typename T4> void deb(const T1 &t1, const T2 &t2, const T3 &t3, const T4 &t4) { debpr(t1); debpr(' '); debpr(t2); debpr(' '); debpr(t3); debpr(' '); debpr(t4); debpr('\n'); }
const ld PI=acos(-1.);
ll Round(double x) { return x<0?x-.5:x+.5; }
template <typename T> void ass(bool v, const T &x, string m="Fail") { if (!v) { deb(m); deb(x); throw; } }
#ifdef EgQrauETGh
#  include <intrin.h>
#  define __builtin_popcount __popcnt
#endif
int main()
{
#ifdef EgQrauETGh
    FIN; ld tm=clock();
#else
    //freopen("polycomp.in", "r", stdin); freopen("polycomp.out", "w", stdout);
#endif
    void run(); run();
#ifdef EgQrauETGh
    cerr<<setprecision(9)<<fixed;
    deb((clock()-tm)/CLOCKS_PER_SEC);
#endif
    return 0;
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

int n, t;
PII p[1001];
void run()
{
    scanf("%d %d", &n, &t);
    REP(i, n) scanf("%d %d", &p[i].first, &p[i].second), p[i].first*=2;
    sort(p, p+n);
    int rs=2;
    REP(i, n-1)
    {
        int d=p[i+1].first-p[i+1].second-p[i].first-p[i].second-t-t;
        if (d>=0) ++rs;
        if (d>0) ++rs;
    }
    printf("%d\n", rs);
}


#include<bits/stdc++.h>
using namespace std;

vector<pair<int,int> > v;

int main() {
    int n,t;
    cin>>n>>t;
    for(int i=0;i<n;i++) {
        int x,y;
        cin>>x>>y;
        y=(y+1)/2;
        v.push_back({x-y,x+y});
    }
    sort(v.begin(),v.end());
    int ans=2;
    for(int i=1;i<(int)v.size();i++) {
        int x=v[i].first-v[i-1].second;
        if(x>=t) ans+=(x+t-1)/t;
    }
    return cout<<ans<<endl,0;
}


#include<bits/stdc++.h>
using namespace std;

int a[3000];

int main() {
    int n,t;
    cin>>n>>t;
    for(int i=0;i<n;i++) {
        int x,y;
        cin>>x>>y;
        x+=1000;
        y/=2;
        for(int j=x-y+1;j<=x+y-1;j++) a[j]=1;
    }
    int ans=2,i=0, N=3000-1;
    while(a[i]==0) i++;
    while(a[N]==0) N--;
    for(; i<N;i++) {
        int tmp=0;
        while(a[i]==0) tmp++,i++;
        ans+=tmp/t;
    }
    cout<<ans<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

vector<pair<int,int> > v;

int main() {
    int n,t;
    cin>>n>>t;
    for(int i=0;i<n;i++) {
        int x,y;
        cin>>x>>y;
        if(y==1) y=0;
        else y=(y+1)/2;
        v.push_back({x-y,x+y});
    }
    sort(v.begin(),v.end());
    int ans=2;
    for(int i=1;i<(int)v.size();i++) {
        int x=v[i].first-v[i-1].second;
        if(x==t) ans++;
        else if(x>t) ans+=2;
    }
    return cout<<ans<<endl,0;
}


#include<bits/stdc++.h>
using namespace std;

vector<pair<double,double> > v;

int main() {
    int n,t;
    cin>>n>>t;
    for(int i=0;i<n;i++) {
        double x,y;
        cin>>x>>y;
        y=(y)/2;
        v.push_back({x-y,x+y});
    }
    sort(v.begin(),v.end());
    int ans=2;
    for(int i=1;i<(int)v.size();i++) {
        double x=v[i].first-v[i-1].second;
        if(x==t) ans++;
        else if(x>t) ans+=2;
    }
    return cout<<ans<<endl,0;
}


#include<bits/stdc++.h>
using namespace std;

vector<pair<int,int> > v;

int main() {
    int n,t;
    cin>>n>>t;
    for(int i=0;i<n;i++) {
        int x,y;
        cin>>x>>y;
        y=(y+1)/2;
        v.push_back({x-y,x+y});
    }
    sort(v.begin(),v.end());
    int ans=2;
    for(int i=1;i<(int)v.size();i++) {
        int x=v[i].first-v[i-1].second;
        if(x==t) ans++;
        else if(x>t) ans+=2;
    }
    return cout<<ans<<endl,0;
}


#include <stdio.h>
#include <stdlib.h>

int x[1101], a[1101];

int main ()
{
	int n, i, j, t, ans = 0;
	scanf ("%d %d", &n, &t);
	for (i=1;i<=n;++i)
		scanf ("%d %d", &x[i], &a[i]);
	for (i =-4400;i<=4400;++i)
	{
		int b = 0;
		for (j=1;j<=n;++j)
		{
			int k=abs(x[j]*2-i);
			if (k == t + a[j])
				b=1;
			else if (k < t + a[j])
				break;
		}
		if (j > n)
			ans+=b;
	}
	printf ("%d\n", ans);
	return 0;
}


#include <stdio.h>
#include <stdlib.h>
int main ()
{
	int x[1100], a[1100];
	int n, i, j, t, ans = 0;
	scanf ("%d %d", &n, &t);
	for (i=0;i<n;i++)
		scanf ("%d %d",&x[i],&a[i]);
	for (i =-4400;i<=4400;i++)
	{
		int b = 0;
		for(j=0;j<n;j++)
		{
			int k = abs (x[j] * 2 - i);
			if (k == t + a[j])
				b = 1;
			else if (k < t + a[j])
				break;
		}
		if (j > n)
			ans += b;
	}
	printf ("%d\n", ans);
	return 0;
}


#include<stdio.h>
#include<stdlib.h>
int cmp(const void *a,const void *b)
{
    if(*(float *)a>*(float *)b)
    return 1;
    else
    return -1;
}
int main()
{
    int i,n,s=2;
    float p[1000][2],x,a,t;
    scanf("%d%f",&n,&t);
    for(i=0;i<n;i++)
    {
        scanf("%f%f",&x,&a);
        p[i][0]=x-a/2;
        p[i][1]=x+a/2;
    }
    qsort(p,n,2*sizeof(float),cmp);
    for(i=0;i<n-1;i++)
    {
        if((p[i+1][0]-p[i][1])==t)
        s++;
        else if((p[i+1][0]-p[i][1])>t)
        s+=2;
    }
    printf("%d",s);
    return 0;
}


#include <stdio.h>
#include <stdlib.h>

typedef struct
{
    float left;
    float right;
}House;

int n;
float t;
House *h;
int possibility;

void sort()
{
    int i =0;
    int j = 0;
    House temp;
    possibility = 0;

    for (i = 0; i<n; i++)
        for (j = i+1;j <n; j++)
            if (h[i].right > h[j].right)
            {
                temp = h[i];
                h[i] = h[j];
                h[j]= temp;
            }
}

int main(int argc, const char * argv[]) {
    scanf("%d %f", &n, &t);
    h = malloc(n*sizeof(House));

    int i = 0;
    float c = 0;
    float l = 0;

    for (i =0; i <n; i++)
    {
        scanf("%f %f",&c, &l);
        h[i].left = c - l/2;
        h[i].right = c + l/2;
    }

    sort();

    possibility = 2;
    float distance =0;
    for (i = 1; i <= n-1; i++)
    {
        distance = h[i].left - h[i-1].right;
        if (distance > t)
            possibility += 2;
        else
            if (distance == t)
                possibility += 1;
    }

    printf("%d", possibility);
    return 0;
}


#include <stdio.h>
#include <stdlib.h>

typedef struct {
     int x;
     int a;
} house;

int cmp(const void *a, const void *b)
{
     return ((house *)a)->x - ((house *)b)->x;
}

int main()
{
     int n, t, sum = 2, i;
     house h[1000];

     scanf("%d %d", &n, &t);

     for (i = 0; i < n; i++) scanf("%d %d", &h[i].x, &h[i].a);

     qsort(h, n, sizeof(house), cmp);

     for (i = 0; i < n - 1; i++) {
	  int f = 0;

	  if (h[i].x + h[i].a / 2.0 + t <= h[i + 1].x - h[i + 1].a / 2.0) {
	       sum++; f++;
	  }

	  if (h[i + 1].x - h[i + 1].a / 2.0 - t >= h[i].x + h[i].a / 2.0) {
			 sum++; f++;
	  }

	  if (f == 2) {
	       if (h[i].x + h[i].a / 2.0 + t == h[i + 1].x - h[i + 1].a / 2.0) {
		    sum--;
	       }
	  }
     }

     printf("%d\n", sum);

     return 0;
}


#include<stdio.h>
#include<stdlib.h>

struct house {
  int x, a;
} *h;

int compare(const void *a, const void *b){
  struct house *pa = (struct house *) a;
  struct house *pb = (struct house *) b;
  return (*pa).x - (*pb).x;
}

int main(){
  int n, t, i, cnt = 2;
  scanf("%d%d", &n, &t);
  h = malloc(sizeof(struct house) * n);
  for (i=0; i<n; i++)
    scanf("%d%d", &h[i].x, &h[i].a);
  qsort(h, n, sizeof(struct house), compare);
  for (i=1; i<n; i++){
    double l = h[i - 1].x + (double) h[i - 1].a / 2;
    double r = h[i].x - (double) h[i].a / 2;
    if (r - l >= t){
      cnt++;
      if (r - l > t) cnt++;
    }
  }
  printf("%d\n", cnt);
}


//      Cottage Village.c
//
//      Copyright 2012 Administrator <cpy@ubuntu>
//
//      This program is free software; you can redistribute it and/or modify
//      it under the terms of the GNU General Public License as published by
//      the Free Software Foundation; either version 2 of the License, or
//      (at your option) any later version.
//
//      This program is distributed in the hope that it will be useful,
//      but WITHOUT ANY WARRANTY; without even the implied warranty of
//      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//      GNU General Public License for more details.
//
//      You should have received a copy of the GNU General Public License
//      along with this program; if not, write to the Free Software
//      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
//      MA 02110-1301, USA.

#include <stdio.h>
#include <stdlib.h>

struct village
{
    int x;
    double a;
} v[1000];

int cmp(const void *x, const void *y)
{
    struct village *p = (struct village *)x;
    struct village *q = (struct village *)y;
    return p->x - q->x;
}

void func(int n, int t)
{
    int i, ans = 2;
    qsort(v, n, sizeof(struct village), cmp);
    for (i = 0; i < n - 1; i ++)
    {
        if (v[i].x + v[i].a / 2 + t < v[i + 1].x - v[i + 1].a / 2)
        {
            ans += 2;
        }
        else if (v[i].x + v[i].a / 2 + t == v[i + 1].x - v[i + 1].a / 2)
        {
            ans ++;
        }
    }
    printf("%d\n", ans);
}

int main(int argc, char **argv)
{
    int n, t, i;
    while (scanf("%d%d", &n, &t) == 2)
    {
        for (i = 0; i < n; i ++)
        {
            scanf("%d%lf", &v[i].x, &v[i].a);
        }
        func(n, t);
    }
    return 0;
}


#include <stdio.h>
#include <stdlib.h>

struct house {
	int x, a;
} *h;

int compare(const void *a, const void *b) {
	struct house *pa = (struct house *) a;
	struct house *pb = (struct house *) b;

	return pa->x - pb->x;
}

int main() {
	int n, t;
	int i, cnt = 2;

	scanf("%d%d", &n, &t);
	h = malloc(sizeof(*h) * n);
	for (i = 0; i < n; i++)
		scanf("%d%d", &h[i].x, &h[i].a);

	qsort(h, n, sizeof(*h), compare);
	for (i = 1; i < n; i++) {
		double l = h[i - 1].x + (double) h[i - 1].a / 2;
		double r = h[i].x - (double) h[i].a / 2;

		if (r - l >= t) {
			cnt++;
			if (r - l > t)
				cnt++;
		}
	}
	printf("%d\n", cnt);
	return 0;
}


#include <stdio.h>
#include <stdlib.h>

int x[1000],a[1000],q[1000];

int cmp(const void *a,const void *b) {
	return x[*(int *)a]-x[*(int *)b];
}

int main() {
	int n,t,i;
	scanf("%d %d\n",&n,&t);
	for (i=0;i<n;i++) scanf("%d %d\n",&x[i],&a[i]);
	for (i=0;i<n;i++) q[i]=i;
	qsort(q,n,sizeof *q,cmp);
	int cnt=2;
	for (i=1;i<n;i++)
		if (2*(x[q[i]]-x[q[i-1]])>a[q[i]]+a[q[i-1]]+2*t) cnt+=2;
		else if (2*(x[q[i]]-x[q[i-1]])==a[q[i]]+a[q[i-1]]+2*t) cnt++;
	printf("%d\n",cnt);
	return 0;
}


#include<stdio.h>
float a[1005][2];
int cmp(const void *a ,const void *b)
{
	float *x = (float *)a ;
	float *y = (float *)b ;
	return (x[0]>=y[0]?1:-1) ;
}
int main()
{
	int i , k , t , n , x , y;
	float j;
	scanf("%d%d",&n,&t);
	for(i = 0 ; i<n ; i++)
	{
		scanf("%d%d",&x,&y);
		a[i][0] = (float)x -(float)y/2.0;
		a[i][1] = (float)x +(float)y/2.0;
	}
	qsort(a,n,2*sizeof(int),cmp);
	/*for(i = 0 ; i<n ; i++)
	{
		printf("%f %f\n",a[i][0],a[i][1]);
	}*/
	k = 0;
	if(n==1)
	{
		printf("2\n");
	}
	else
	{
		k = 2 ;
		for(i = 1 ; i<n ; i++)
		{
			j = a[i][0] - a[i-1][1];
			if(j>=t)
			{
				k++;
				if(j>t)
				k++;
			}
		}
		printf("%d\n",k);
	}
	return 0;
}


#include<stdio.h>
#include<math.h>
int main()
{
    int n,t,count=0,i,p,q,r,s;
    double diff;
    scanf("%d %d",&n,&t);
    int a[n],b[n];

    for(i=0;i<n;i++)
        scanf("%d %d",&a[i],&b[i]);

    for(i=0;i<n-1;i++){
            p=fabs(a[i]); q=fabs(a[i+1]); r=b[i]; s=b[i+1];

        if(p>q)
            diff=(p-r/2.0)-(q+s/2.0);
            else
                diff=(q-s/2.0)-(p+r/2.0);

            if(a[i]<0&&a[i+1]>0)
                diff+=2;
            else if(a[i+1]<0&&a[i]>0)
                diff+=2;
                                                            //printf("diff = %.2lf\n",diff);
            if(diff>t)
                count+=2;
            else if(diff==t)
                count++;
    }
    printf("%d\n",count+2);

    return 0;
}


#include<stdio.h>
#include<math.h>
int main()
{
    int n,t,j,count=0,i,p,q,r,s,temp_a,temp_b;
    double diff;
    scanf("%d %d",&n,&t);
    int a[n],b[n];

    for(i=0;i<n;i++)
        scanf("%d %d",&a[i],&b[i]);

    for(i=0;i<n-1;i++){
        for(j=i+1;j<n;j++){
            if(a[i]>a[j]){
                temp_a=a[i];
                temp_b=b[i];
                a[i]=a[j];
                b[i]=b[j];
                a[j]=temp_a;
                b[j]=temp_b;
            }
        }
    }
    for(i=0;i<n-1;i++){
            diff=a[i+1]-a[i]-(b[i]/2.0)-(b[i+1]/2.0);
            if(diff>t)
                count+=2;
            else if(diff==t)
                count++;
    }
    printf("%d\n",count+2);

    return 0;
}


#include<stdio.h>
#include<math.h>
int main()
{
    int n,t,j,count=0,i,p,q,r,s,temp_a,temp_b;
    double diff;
    scanf("%d %d",&n,&t);
    int a[n],b[n];

    for(i=0;i<n;i++)
        scanf("%d %d",&a[i],&b[i]);

    for(i=0;i<n-1;i++){
        for(j=i+1;j<n;j++){
            if(a[i]>a[j]){
                temp_a=a[i];
                temp_b=b[i];
                a[i]=a[j];
                b[i]=b[j];
                a[j]=temp_a;
                b[j]=temp_b;
            }
        }
    }
    for(i=0;i<n;i++)
        printf("a:%d b:%d    ",a[i],b[i]);
    printf("\n");

    for(i=0;i<n-1;i++){
            diff=a[i+1]-a[i]-(b[i]/2.0)-(b[i+1]/2.0);
            printf("%lf  ",diff);
            if(diff>t)
                count+=2;
            else if(diff==t)
                count++;
    }
    printf("%d\n",count+2);

    return 0;
}


#include<stdio.h>
#include<math.h>
int main()
{
    int n,t,j,count=0,i,p,q,r,s,temp_a,temp_b;
    double diff;
    scanf("%d %d",&n,&t);
    int a[n],b[n];

    for(i=0;i<n;i++)
        scanf("%d %d",&a[i],&b[i]);

    for(i=0;i<n-1;i++){
        for(j=i+1;j<n;j++){
            if(a[i]>a[j]){
                temp_a=a[i];
                temp_b=b[i];
                a[i]=a[j];
                b[i]=b[j];
                a[j]=temp_a;
                b[j]=temp_b;
            }
        }
    }

    for(i=0;i<n-1;i++){
            p=fabs(a[i]); q=fabs(a[i+1]); r=b[i]; s=b[i+1];

        if(p>q)
            diff=(p-r/2.0)-(q+s/2.0);
            else
                diff=(q-s/2.0)-(p+r/2.0);

            if(a[i]<0&&a[i+1]>0)
                diff+=2;
            else if(a[i+1]<0&&a[i]>0)
                diff+=2;
                                                            //printf("diff = %.2lf\n",diff);
            if(diff>t)
                count+=2;
            else if(diff==t)
                count++;
    }
    printf("%d\n",count+2);

    return 0;
}


#include <stdio.h>
#include <stdlib.h>

typedef struct sHOUSE{
    int x, a;
    struct sHOUSE *prev, *next;
} sHOUSE;

typedef struct sHOUSES{
    sHOUSE *first, *last;
} sHOUSES;

int main()
{
    sHOUSES houses;
    sHOUSE *moving;
    houses.first = (sHOUSE *)malloc(sizeof(sHOUSE));
    houses.last = (sHOUSE *)malloc(sizeof(sHOUSE));
    houses.first->prev = houses.last->next = NULL;
    houses.first->next = houses.last;
    houses.last->prev = houses.first;
    unsigned long int possible = 0;
    int i, n, t;
    scanf("%d %d", &n, &t);
    for(i = 0; i < n; i++){
        sHOUSE *newhouse = (sHOUSE *)malloc(sizeof(sHOUSE));
        scanf("%d %d", &newhouse->x, &newhouse->a);
        for(moving = houses.first->next; moving->x<newhouse->x && moving != houses.last; moving = moving->next)
            ;
        newhouse->prev = moving->prev; newhouse->next = moving;
        moving->prev->next = newhouse; moving->prev = newhouse;
    }
    for(moving = houses.first->next; moving != houses.last->prev; moving = moving->next){
        int delta2x = 2*(moving->next->x -moving->x)-moving->a-moving->next->a;
        if(2*t>delta2x)
            ;
        else if(2*t==delta2x)
            possible++;
        else
            possible += 2;
    }
    printf("%lu", possible+2);
    return 0;
}


#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>
int main()
{
    long long int i=0,j,k,m,n,rem,div,val,previous;
    double dis,middle,x,portion,present_left,past_right,space;
    scanf("%lld %lf",&n,&dis);

    scanf("%lf %lf",&middle,&x);

    portion=x/2;
    past_right=portion+middle;
    while(--n){
        scanf("%lf %lf",&middle,&x);
        portion=x/2;
        present_left=middle-portion;
        space=present_left-past_right;
        if(space>dis)i=i+2;
        else if(space==dis) i++;
        //printf("%lf %lf %lf\n",past_right,present_left,space);
        past_right=middle+portion;
    }
    printf("%lld\n",i+2);
    return 0;
}
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>
int main()
{
    long long int i=0,j,k,m,n,rem,div,val,previous;
    double dis,middle,x,portion,present_left,past_right,space;
    scanf("%lld %lf",&n,&dis);

    scanf("%lf %lf",&middle,&x);

    portion=x/2;
    past_right=portion+middle;
    while(--n){
        scanf("%lf %lf",&middle,&x);
        portion=x/2;
        present_left=middle-portion;
        space=present_left-past_right;
        if(space>dis)i=i+2;
        else if(space==dis) i++;
        //printf("%lf %lf %lf\n",past_right,present_left,space);
        past_right=middle+portion;
    }
    printf("%lld\n",i+2);
    return 0;
}


#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>
int main()
{
    long long int i,j,k,m,n,rem,div,val,count=0;
    double dis,portion,present_left,past_right,space;

    struct des{

        double middle,x;
    }stu[1004],tem;
    scanf("%lld %lf",&n,&dis);

    for(i=0;i<n;i++)
    {
        scanf("%lf %lf",&stu[i].middle,&stu[i].x);
    }
    for(i=0;i<n;i++)
        for(j=i+1;j<n;j++)
    {
        if(stu[i].middle>stu[j].middle)
        {
            tem=stu[i];
            stu[i]=stu[j];
            stu[j]=tem;
        }
    }

    portion=stu[0].x/2;
    past_right=portion+stu[0].middle;
    for(i=1;i<n;i++)
    {
        portion=stu[i].x/2;
        present_left=stu[i].middle-portion;
        space=present_left-past_right;
        if(space>dis)count=count+2;
        else if(space==dis) count++;

        past_right=stu[i].middle+portion;
    }
    printf("%lld\n",count+2);
    return 0;
}


#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>
int main()
{
    long long int i=0,j,k,m,n,rem,div,val,previous;
    double dis,middle,x,portion,present_left,past_right,space;
    scanf("%lld %lf",&n,&dis);

    scanf("%lf %lf",&middle,&x);

    portion=x/2;
    past_right=portion+middle;
    while(--n){
        scanf("%lf %lf",&middle,&x);
        portion=x/2;
        present_left=middle-portion;
        space=present_left-past_right;
        if(space>dis)i=i+2;
        else if(space==dis) i++;
        past_right=middle+portion;
    }
    printf("%lld\n",i+2);
    return 0;
}


/* Cottage Village */

#include <stdio.h>

#define MAX 10

int main(void)
{
  double xaxis[2][MAX+1] = {{0},{0}}; // xaxis[0] - negative xaxis[1] - positive
  int n,t;
  scanf("%d %d",&n,&t);

  int center;
  double edge;
  while(n--)
    {
      scanf("%d %lf",&center,&edge);
      if(center >= 0)
	xaxis[1][center] = edge;
      else
	xaxis[0][-center] = edge;
    }
  int i, temp = 0;
  int sum = 0;
  for(i=MAX;i>0;i--)
    {
      if (xaxis[0][i] != 0)
	{
	  temp = i;
	  break;
	}
    }
  for(;i>0;i--)
    {
      if (xaxis[0][i] != 0)
	{
	  if ((temp - i) > ((xaxis[0][temp] + xaxis[0][i])/2+t))
	    sum += 2;
	  if ((temp - i) == ((xaxis[0][temp] + xaxis[0][i])/2+t))
	    sum++ ;
	  temp = i;
	}
    }
  int minus = temp;

  temp = -1;
  for(i=MAX;i>=0;i--)
    {
      if (xaxis[1][i] != 0)
	{
	  temp = i;
	  break;
	}
    }
  for(;i>=0;i--)
    {
      if (xaxis[1][i] != 0)
	{
	  if((temp - i) > ((xaxis[1][temp] + xaxis[1][i])/2+t))
	    sum += 2;
	  if((temp - i) == ((xaxis[1][temp] + xaxis[1][i])/2+t))
	    sum ++;
	  temp = i;
	}
    }

  int pos = temp;
  if( minus == 0 || pos == -1)
    {
      printf ("%d\n",sum + 2);
      return 0;
    }
  if( (pos + minus) > ((xaxis[1][pos] + xaxis[0][minus])/2 + t))
    sum += 2;

  printf ("%d\n",sum + 2);
  return 0;
}


/* Cottage Village */

#include <stdio.h>

#define MAX 2000

int main(void)
{
  double xaxis[MAX+1] = {0}; // xaxis[0] - negative xaxis[1] - positive
  int n,t;
  scanf("%d %d",&n,&t);

  int center;
  double edge;
  while(n--)
    {
      scanf("%d %lf",&center,&edge);
      xaxis[center+1000] = edge;
    }
  int i, temp = 0;
  int sum = 0;
  for(i=0;i<=MAX;i++)
    {
      if (xaxis[i] != 0)
	{
	  temp = i;
	  break;
	}
    }
  for(;i<=MAX;i++)
    {
      if (xaxis[i] != 0)
	{
	  if ((i - temp) > ((xaxis[temp] + xaxis[i])/2+t))
	    sum += 2;
	  if ((i - temp) == ((xaxis[temp] + xaxis[i])/2+t))
	    sum++ ;
	  temp = i;
	}
    }
  printf ("%d\n",sum + 2);
  return 0;
}


#include <stdio.h>

int cmpfunc(const void* elem1, const void* elem2)
{
    if(*(const float*)elem1 < *(const float*)elem2)
        return -1;
    return *(const float*)elem1 > *(const float*)elem2;
}

int main(void) {
    int n, t, i;
    scanf("%d%d", &n, &t);

    float centers[n];
    float edges[2*n];

    for (i = 0; i < n; i ++) {
        int temp;
        scanf("%f%d", &centers[i], &temp);
        edges[2*i] = centers[i] - temp/2.0;
        edges[2*i + 1] = centers[i] + temp/2.0;
    }

    //qsort(centers, n, sizeof(float), cmpfunc);
    qsort(edges, 2*n, sizeof(float), cmpfunc);

    int ans = 2;

    for (i = 1; i < 2*n - 1; i = i+2) {
        if (fabs(edges[i+1] - edges[i]) > t) ans = ans + 2;
        else if (fabs(edges[i+1] - edges[i]) == t) ans ++;
        else continue;
    }

    printf("%d\n", ans);

    return 0;
}


#include <stdio.h>
#include <stdlib.h>

typedef struct House {
  int center;
  int side;
} House;

double distance(const House h1,const House h2) {
  return (h2.center - (double)h2.side/2) - (h1.center + (double)h1.side/2);
}

int compare_houses(const void *v1, const void *v2) {
  House *h1 = (House*)v1;
  House *h2 = (House*)v2;

  if(h1->center < h2->center)
	return -1;
  else if(h1->center > h2->center)
	return +1;
  else
	return 0;
}

int main(int argc, char* argv[]) {

#ifdef DEBUG
  while(1) {
	printf("\nGive input:\n");
	if(feof(stdin)) break;
#endif
	int n, t;
	scanf("%d %d", &n, &t);
#ifdef DEBUG
	printf("n, t = %d, %d\n", n, t);
#endif

	House *houses = malloc(n*sizeof(House));
	int i;
	for(i=0; i<n;i++) {
	  scanf("%d %d", &houses[i].center, &houses[i].side);
	}

#ifdef DEBUG
	printf("houses = [");
	for(i=0; i<n;i++)
	  printf("(%d, %d)", houses[i].center, houses[i].side);
	printf("]\n\n");
#endif

	qsort(houses, n, sizeof(House), compare_houses);
#ifdef DEBUG
	printf("houses = [");
	for(i=0; i<n;i++)
	  printf("(%d, %d)", houses[i].center, houses[i].side);
	printf("]\n\n");
#endif
	int positions = 0;
	/* int i; */
	for(i = 0; i < n-1; i++) {
	  double dist = distance(houses[i], houses[i+1]);
	  if(dist < t)
		continue;
	  else if(dist == t)
		positions++;
	  else
		positions += 2;
	}

#ifdef DEBUG
	printf("Possible positions: ");
#endif
	printf("%d\n", positions + 2);

	free(houses);
#ifdef DEBUG
  }
#endif
  return 0;
}


#include <stdio.h>
#include <stdlib.h>

typedef struct House {
  int center;
  int side;
} House;

int distance(const House h1,const House h2) {
  return (h2.center - h2.side/2) - (h1.center + h1.side/2);
}

int compare_houses(const void *v1, const void *v2) {
  House *h1 = (House*)v1;
  House *h2 = (House*)v2;

  if(h1->center < h2->center)
	return -1;
  else if(h1->center > h2->center)
	return +1;
  else
	return 0;
}

int main(int argc, char* argv[]) {
  /* while(!feof(stdin)) { */
	/* printf("\nGive input:\n"); */
	int n, t;
	scanf("%d %d", &n, &t);
	House *houses = malloc(n*sizeof(House));
	int i;
	for(i=0; i<n;i++) {
	  scanf("%d %d", &houses[i].center, &houses[i].side);
	}

	qsort(houses, n, sizeof(House), compare_houses);
	int positions = 0;
	/* int i; */
	for(i = 0; i < n-1; i++) {
	  int dist = distance(houses[i], houses[i+1]);
	  if(dist < t)
		continue;
	  else if(dist == t)
		positions++;
	  else
		positions += 2;
	}

	printf("%d\n", positions + 2);
	free(houses);
  /* } */
  return 0;
}


#include <stdio.h>
#include <stdlib.h>

typedef struct House {
  int center;
  int side;
} House;

int distance(const House h1,const House h2) {
  return (h2.center - h2.side/2) - (h1.center + h1.side/2);
}

int main(int argc, char* argv[]) {
  /* while(!feof(stdin)) { */
	/* printf("\nGive input:\n"); */
	int n, t;
	scanf("%d %d", &n, &t);
	House *houses = malloc(n*sizeof(House));
	int i;
	for(i=0; i<n;i++) {
	  scanf("%d %d", &houses[i].center, &houses[i].side);
	}

	int positions = 0;
	/* int i; */
	for(i = 0; i < n-1; i++) {
	  int dist = distance(houses[i], houses[i+1]);
	  if(dist < t)
		continue;
	  else if(dist == t)
		positions++;
	  else
		positions += 2;
	}

	printf("%d\n", positions + 2);
	free(houses);
  /* } */
  return 0;
}


#include <stdio.h>
#include <stdlib.h>

typedef struct House {
  int center;
  int side;
} House;

int distance(const House h1,const House h2) {
  return (h2.center - h2.side/2) - (h1.center + h1.side/2);
}

int main(int argc, char* argv[]) {
  while(!feof(stdin)) {
	printf("\nGive input:\n");
	int n, t;
	scanf("%d %d", &n, &t);
	House *houses = malloc(n*sizeof(House));
	int i;
	for(i=0; i<n;i++) {
	  scanf("%d %d", &houses[i].center, &houses[i].side);
	}

	int positions = 0;
	/* int i; */
	for(i = 0; i < n-1; i++) {
	  int dist = distance(houses[i], houses[i+1]);
	  if(dist < t)
		continue;
	  else if(dist == t)
		positions++;
	  else
		positions += 2;
	}

	printf("%d\n", positions + 2);
	free(houses);
  }
  return 0;
}


#include <stdio.h>

typedef struct House {
  int center;
  int side;
} House;

int distance(const House h1,const House h2) {
  return (h2.center - h2.side/2) - (h1.center + h1.side/2);
}

int main(int argc, char* argv[]) {
  while(!feof(stdin)) {
	printf("\nGive input:\n");
	int n, t;
	scanf("%d %d", &n, &t);
	House houses[n];
	for(int i=0; i<n;i++) {
	  scanf("%d %d", &houses[i].center, &houses[i].side);
	}

	int positions = 0;
	for(int i = 0; i < n-1; i++) {
	  int dist = distance(houses[i], houses[i+1]);
	  if(dist < t)
		continue;
	  else if(dist == t)
		positions++;
	  else
		positions += 2;
	}

	printf("%d\n", positions + 2);
  }
  return 0;
}


#include <stdio.h>
#define N 1005

struct house
{
	double a, b;
};

int cmp(const void *a, const void *b)
{
	struct house *aa = (struct house *)a;
	struct house *bb = (struct house *)b;
	return aa->a - bb->a;
}
int main()
{
	int n, t;
	int x, a;
	int res;
	int i;
	struct house hos[N];
	scanf("%d %d", &n, &t);
	for(i = 0;i < n;i++)
	{
		scanf("%d %d", &x, &a);
		hos[i].a = x - (a * 1.0 / 2);
		hos[i].b = x + (a * 1.0 / 2);
	}
	qsort(hos, n, sizeof(hos[0]), cmp);

	res = 2;
	for(i = 1;i < n;i++)
		if (hos[i].a - hos[i - 1].b > (double)t)
			res += 2;
		else if (hos[i].a - hos[i - 1].b == (double)t)
			res++;
	printf("%d\n", res);
	return 0;
}


#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#define REP(i,a,b) for(i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)

void intIntSort(int d[],int m[],int s){int i=-1,j=s,k,t;if(s<=1)return;k=(d[0]+d[s-1])/2;for(;;){while(d[++i]<k);while(d[--j]>k);if(i>=j)break;t=d[i];d[i]=d[j];d[j]=t;t=m[i];m[i]=m[j];m[j]=t;}intIntSort(d,m,i);intIntSort(d+j+1,m+j+1,s-j-1);}

int main(){
  int i,j,k,l,m,n,t;
  int a[1000],b[1000];
  int res;

  scanf("%d%d",&n,&t);
  rep(i,n) scanf("%d%d",a+i,b+i);
  intIntSort(a,b,n);
  rep(i,n) a[i]*=2;

  res=2;
  REP(i,1,n){
    if(a[i]-b[i]-(a[i-1]+b[i-1])== 2*t) res++;
    if(a[i]-b[i]-(a[i-1]+b[i-1]) > 2*t) res+=2;
  }
  printf("%d\n",res);

  return 0;
}


#include"stdio.h"
#include"stdlib.h"
typedef struct{
	int x;
	int a;
}house;
house h[1010];

int cp(void const*a,void const*b){
	return ((house *)a)->x-((house *)b)->x;
}

main(){
	int n,t;
	int i,j,s=0;
	scanf("%d%d",&n,&t);
	for(i=0;i<n;i++)
		scanf("%d%d",&h[i].x,&h[i].a);
	if(n==1) {printf("2\n");return 0;}
	qsort(h,n,sizeof(h[0]),cp);
	for(i=0;i<n;i++){
		if(i==0) {
			s++;
			if((int)(h[i+1].x-h[i].x-h[i+1].a/2.0-h[i].a/2.0)>=t) s++;
		}
		else {
			if((int)(h[i].x-h[i].a/2.0-h[i-1].x-h[i-1].a/2) > t) s++;
			if(i==n-1) s++;
			else{
				if((int)(h[i+1].x-h[i].x-h[i+1].a/2.0-h[i].a/2.0) >= t) s++;
			}
		}
	}
	printf("%d\n",s);
	return 0;
}


#include"stdio.h"
#include"stdlib.h"
typedef struct{
	int x;
	int a;
}house;
house h[1010];

int cp(void const*a,void const*b){
	return ((house *)a)->x-((house *)b)->x;
}

main(){
	int n,t;
	int i,j,s=0;
	scanf("%d%d",&n,&t);
	for(i=0;i<n;i++)
		scanf("%d%d",&h[i].x,&h[i].a);
	if(n==1) {printf("2\n");return 0;}
	qsort(h,n,sizeof(h[0]),cp);
	for(i=0;i<n;i++){
		if(i==0) {
			s++;
			if(h[i+1].x-h[i].x-h[i+1].a/2.0-h[i].a/2.0>=t) s++;
		}
		else {
			if(h[i].x-h[i-1].x-h[i].a/2.0-h[i-1].a/2.0 > t) s++;
			if(i==n-1) s++;
			else{
				if(h[i+1].x-h[i].x-h[i+1].a/2.0-h[i].a/2.0 >= t) s++;
			}
		}
	}
	printf("%d\n",s);
	return 0;
}


#include"stdio.h"
#include"stdlib.h"
typedef struct{
	int x;
	int a;
}house;
house h[1010];

int cp(void const*a,void const*b){
	return ((house *)a)->x-((house *)b)->x;
}

main(){
	int n,t;
	int i,j,s=0;
	scanf("%d%d",&n,&t);
	for(i=0;i<n;i++)
		scanf("%d%d",&h[i].x,&h[i].a);
	if(n==1) {printf("2\n");return 0;}
	qsort(h,n,sizeof(h[0]),cp);
	for(i=0;i<n;i++){
		if(i==0) {
			s++;
			if((int)(h[i+1].x-h[i].x-h[i+1].a/2.0-h[i].a/2.0)>=t) s++;
		}
		else {
			if((int)(h[i].x-h[i-1].x-h[i].a/2.0-h[i-1].a/2.0) > t) s++;
			if(i==n-1) s++;
			else{
				if((int)(h[i+1].x-h[i].x-h[i+1].a/2.0-h[i].a/2.0) >= t) s++;
			}
		}
	}
	printf("%d\n",s);
	return 0;
}


#include"stdio.h"
#include"stdlib.h"
typedef struct{
	int x;
	int a;
}house;
house h[1010];

int cp(void const*a,void const*b){
	return ((house *)a)->x-((house *)b)->x;
}

main(){
	int n,t;
	int i,j,s=0;
	scanf("%d%d",&n,&t);
	for(i=0;i<n;i++)
		scanf("%d%d",&h[i].x,&h[i].a);
	qsort(h,n,sizeof(h[0]),cp);
	for(i=0;i<n;i++){
		if(i==0) {
			s++;
			if((int)(h[i+1].x-h[i].x-h[i+1].a/2.0-h[i].a/2.0)>=t) s++;
		}
		else {
			if((int)(h[i].x-h[i].a/2.0-h[i-1].x-h[i-1].a/2) > t) s++;
			if(i==n-1) s++;
			else{
				if((int)(h[i+1].x-h[i].x-h[i+1].a/2.0-h[i].a/2.0) >= t) s++;
			}
		}
	}
	printf("%d\n",s);
	return 0;
}


#include <stdlib.h>
#include <stdio.h>

void trier(int tab[][2], int m);

int main(int argc, char *argv[])
{
	int n,t,i;
	int tab[1000][2];
	int amount_possible_positions = 2;
    int min, debut_test, fin_test;
	scanf("%d %d",&n,&t);
	t *= 2;

	for (i = 0; i < n; ++i)
	{
		scanf("%d %d",&tab[i][0],&tab[i][1]);
		tab[i][0] *= 2;
		tab[i][1] *= 2;
	}

	trier(tab,n);
	min = tab[0][0];
	if(min < 0)
	{
		for ( i = 0; i < n; ++i)
	        tab[i][0] -= min;
	}

	for ( i = 0; i < n-1; ++i)
	{
		debut_test = tab[i][0] + tab[i][1]/2;
		fin_test = tab[i+1][0] - tab[i+1][1]/2;
		if (debut_test + t <= fin_test)
		{
			debut_test++;
			amount_possible_positions++;
		}
		if (fin_test - t > debut_test )
		{
			debut_test++;
			amount_possible_positions++;
		}

	}
	printf("%d\n",amount_possible_positions );
}
void trier(int tab[][2], int m)
{

	int i,aux1,aux2,bo = 0;
	while(bo == 0)
	{
		bo = 1;
		for ( i = 0; i < m-1; ++i)
		{
			if(tab[i][0]>tab[i+1][0])
			{
				aux1 = tab[i][0];
				tab[i][0] = tab[i+1][0];
				tab[i+1][0] = aux1;
				aux2 = tab[i][1];
				tab[i][1] = tab[i+1][1];
				tab[i+1][1] = aux2;
				bo = 0;

			}
		}
	}
}


#include <stdlib.h>
#include <stdio.h>

int main(int argc, char *argv[])
{
	int n,t,i;
	int tab[1000][2];
	int amount_possible_positions = 2, debut_test, fin_test;

	scanf("%d %d",&n,&t);

	for (i = 0; i < n; ++i)
		scanf("%d %d",&tab[i][0],&tab[i][1]);

	for ( i = 0; i < n-1; ++i)
	{
		debut_test = tab[i][0] + tab[i][1]/2;
		fin_test = tab[i+1][0] - tab[i+1][1]/2;
		while(debut_test + t <= fin_test)
		{
			debut_test++;
			amount_possible_positions++;
		}

	}
	printf("%d\n",amount_possible_positions );
}


#include <stdlib.h>
#include <stdio.h>

void trier(int tab[][2], int m);

int main(int argc, char *argv[])
{
	int n,t,i;
	int tab[1000][2];
	int amount_possible_positions = 2;
    int min, test;

	scanf("%d %d",&n,&t);
	t *= 2;

	for (i = 0; i < n; ++i)
	{
		scanf("%d %d",&tab[i][0],&tab[i][1]);
		tab[i][0] *= 2;
		tab[i][1] *= 2;
	}

	trier(tab,n);
	min = tab[0][0];
	if(min < 0)		for ( i = 0; i < n; ++i)
	       	 			tab[i][0] -= min;

	for ( i = 0; i < n-1; ++i)
	{
		test = (tab[i+1][0] - tab[i+1][1]/2) - (tab[i][0] + tab[i][1]/2);
		if (test > t) amount_possible_positions += 2;
		if (test == t) amount_possible_positions++;
	}

	printf("%d\n",amount_possible_positions );
}

void trier(int tab[][2], int m)
{

	int i,aux1,aux2,bo = 0;
	while(bo == 0)
	{
		bo = 1;
		for ( i = 0; i < m-1; ++i)
		{
			if(tab[i][0]>tab[i+1][0])
			{
				aux1 = tab[i][0];
				tab[i][0] = tab[i+1][0];
				tab[i+1][0] = aux1;
				aux2 = tab[i][1];
				tab[i][1] = tab[i+1][1];
				tab[i+1][1] = aux2;
				bo = 0;

			}
		}
	}
}


#include <stdio.h>
#include <stdlib.h>

#define LEN 1100
int cmp(int *, int *);
int blo[LEN], sid[LEN], idx[LEN];

int main(void)
{
  int i, j, k, n, t, res = 0;
  scanf("%d%d", &n, &t);
  for(i = 0; i < n; i++){
    scanf("%d%d", blo + i, sid + i);
    blo[i] *= 2;
    sid[i] *= 2;
    idx[i] = i;
  }
  t *= 2;
  qsort(idx, n, sizeof(int), &cmp);
  for(i = 0; i < n; i++){
    j = blo[idx[i - 1]] + sid[idx[i - 1]] / 2 + t + sid[idx[i]] / 2;
    if(j < blo[idx[i]])
      res += 2;
    else if(j == blo[idx[i]])
      res += 1;
  }
  res += 2;
  printf("%d\n", res);
  return 0;
}

int cmp(int *a, int *b)
{
  int i = *a, j = *b;
  return blo[i] - blo[j];
}


#include<stdio.h>
#include<stdlib.h>
int cmp(const void *a,const void *b)
{
    if(*(float *)a>*(float *)b)
    return 1;
    else
    return -1;
}
int main()
{
    int i,n,s=2;
    float p[1000][2],x,a,t;
    scanf("%d%f",&n,&t);
    for(i=0;i<n;i++)
    {
        scanf("%f%f",&x,&a);
        p[i][0]=x-a/2;
        p[i][1]=x+a/2;
    }
    qsort(p,n,2*sizeof(float),cmp);
    for(i=0;i<n-1;i++)
    {
        if((p[i+1][0]-p[i][1])==t)
        s++;
        else if((p[i+1][0]-p[i][1])>t)
        s+=2;
    }
    printf("%d",s);
    return 0;
}


#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define MAXN 1005

struct node
{
    int x, a;
};

int main ()
{
    int N, T;
    scanf("%d %d",&N,&T);
    T *= 2;
    static struct node a[MAXN];
    int i;
    for (i = 0; i < N; i++)
    {
        scanf("%d %d",&(a[i].x),&(a[i].a));
        a[i].x *= 2;
        a[i].a *= 2;
    }
    int pos;
    int res = 0;
    for (pos = -10005; pos <= 10005; pos++)
    {
        char touch = 0;
        char over = 0;
        int l = pos - (T / 2);
        int r = pos + (T / 2);
        for (i = 0; i < N; i++)
        {
            int nl, nr;
            nl = a[i].x - (a[i].a / 2);
            nr = a[i].x + (a[i].a / 2);
            if (!((nl > r) || (l > nr)))
            {
                if ((nl == r) || (l == nr)) touch = 1;
                else if ((nl < r) || (l < nr))
                {
                    over = 1;
                    break;
                }
            }
        }
        if ((touch) && (!over)) res++;
    }
    printf("%d\n",res);
    return 0;
}


import java.util.*;

public class Trying
{
    public static void main (String[] args)
    {
        Scanner enter = new Scanner(System.in);
        int n = enter.nextInt(), t = enter.nextInt(),pos = 0, max = 0,
        available[] = new int[n*2], xa[][] = new int [n][2];
        for(int i = 0 ; i < n ; i++)
        {
            for(int j = 0 ; j < 2 ; j++)
            {
                xa[i][j] = enter.nextInt();
            }
            available[pos] = xa[i][0] - xa[i][1]/2;
            pos++;
            available[pos] = xa[i][1]/2 + xa[i][0];
            pos++;
        }
        for(int i = 1 ; i <= 2*n-2 ; i++)
        {
            if(available[i+1] - available[i] > t)
                max++;
            else if(available[i+1] - available[i] == t)
            {i++;max++;}
        }
        System.out.println(max+2);
    }
}


import java.util.*;

public class Trying
{
    public static void main (String[] args)
    {
        Scanner enter = new Scanner(System.in);
        int n = enter.nextInt(), t = enter.nextInt(), pos = 0;
        double available[] = new double[n*2], xa[][] = new double [n][2],
        max = 0;
        for(int i = 0 ; i < n ; i++)
            for(int j = 0 ; j < 2 ; j++)
                xa[i][j] = enter.nextInt();
        max = 1 ;
        while(max != 1001)
        {
            max = 1001;
            for(int i = 0 ; i < n-1 ; i++)
            {
                if(xa[i][0] > xa[i+1][0])
                {
                    max = xa[i][0];
                    xa[i][0] = xa[i+1][0];
                    xa[i+1][0] = max ;
                    max = xa[i][1];
                    xa[i][1] = xa[i+1][1];
                    xa[i+1][1] = max ;
                }
            }
        }
        for(int i = 0 ; i < n ; i++)
        {
            available[pos] = xa[i][0] - xa[i][1]/2;
            pos++;
            available[pos] = xa[i][1]/2 + xa[i][0];
            pos++;
        }
        max = 0;
        for(int i = 1 ; i <= 2*n-2 ; i+=2)
        {
            if(available[i+1] - available[i] > t)
                max+=2;
            else if(available[i+1] - available[i] == t)
                max++;
        }
        System.out.println((int)max+2);
    }
}


import java.util.*;

public class Trying
{
    public static void main (String[] args)
    {
        Scanner enter = new Scanner(System.in);
        int n = enter.nextInt(), t = enter.nextInt(),pos = 0, max = 0,
        available[] = new int[n*2], xa[][] = new int [n][2];
        for(int i = 0 ; i < n ; i++)
        {
            for(int j = 0 ; j < 2 ; j++)
            {
                xa[i][j] = enter.nextInt();
            }
            available[pos] = xa[i][0] - xa[i][1]/2;
            pos++;
            available[pos] = xa[i][1]/2 + xa[i][0];
            pos++;
        }
        for(int i = 1 ; i <= 2*n-2 ; i++)
        {
            if(available[i+1] - available[i] >= t)
                max++;
        }
        System.out.println(max+2);
    }
}


import java.util.*;

public class Trying
{
    public static void main (String[] args)
    {
        Scanner enter = new Scanner(System.in);
        int n = enter.nextInt(), t = enter.nextInt(),pos = 0, max = 0,
        available[] = new int[n*2], xa[][] = new int [n][2];
        for(int i = 0 ; i < n ; i++)
        {
            for(int j = 0 ; j < 2 ; j++)
            {
                xa[i][j] = enter.nextInt();
            }
            available[pos] = xa[i][0] - xa[i][1]/2;
            pos++;
            available[pos] = xa[i][1]/2 + xa[i][0];
            pos++;
        }
        for(int i = 1 ; i < 2*n-2 ; i++)
        {
            if(available[i+1] - available[i] >= t)
                max++;
        }
        System.out.println(max+2);
    }
}


import java.util.*;
import java.util.Arrays;
import java.io.IOException;
import java.lang.*;
import java.math.BigDecimal;
import java.util.Scanner;
/* Name of the class has to be "Main" only if the class is public. */
public class Main {

	static class House implements Comparable<House>
	{
		int x, a;
		House (int x, int a)
		{
			this.x = x;
			this.a=a;
		}
		@Override public int compareTo(House h)
		{
			return x - h.x;
		}
	}
public static Scanner scanner = new Scanner(System.in);

	public static void main(String[] args) throws IOException
	{
		int numberOfLines = scanner.nextInt(); //n
		int sideT = scanner.nextInt(); //t
		House[] hh = new House[numberOfLines];

		//int center =0;
		//int sideLength =0;
		int pp=2; //possible positions

		for(int j=0; j<numberOfLines;j++)
		{
		 int x= scanner.nextInt(); //x
			int a= scanner.nextInt(); //a
 			hh[j] = new House(x, a);
		}
		Arrays.sort(hh);
		for(int i =1; i<numberOfLines;i++)
		{
			int gap = (hh[i].x - hh[i-1].x - sideT) * 2 - (hh[i].a + hh[i-1].a);
			if(gap > 0)
				pp += 2;
			else if(gap ==0)
				pp++;
		}
		System.out.println(pp);

	    }

}


import java.util.Scanner;
public class Ishu
{
    	public static void main(String[] args)
    	{
	 Scanner scan=new Scanner(System.in);
	 int n,t,i,sum=0;
	 float l,r;
	 int[][] a=new int[2][1000];
	 n=scan.nextInt();
	 t=scan.nextInt();
	 for(i=0;i<n;++i)
		{
		 a[0][i]=scan.nextInt();
	 	 a[1][i]=scan.nextInt();
		}
	 for(i=1;i<n;++i)
		{
		 r=(float)a[0][i]-(float)a[1][i]/2;
		 l=(float)a[0][i-1]+(float)a[1][i-1]/2;
		 if(r-l==(float)t)
			++sum;
		 else if(r-l>(float)t)
			sum+=2;
		}
	 System.out.println((sum+2));
 	}
}


import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int t = in.nextInt();
        HashMap<Integer, Integer> houses = new HashMap<>();//x, a
        for (int i = 0; i < n; i++) {
            int xi = in.nextInt();//center
            int ai = in.nextInt();//side_length
            houses.put(xi, ai);
        }
        TreeSet<Integer> keys = new TreeSet<>(houses.keySet());
        boolean first = false;
        int lastKey = 0;
        int numPlacements = 2;
        for(int key: keys){
            if(!first){
                first = true;
                lastKey = key;
            }
            else {
                int xDiff = key - lastKey - t;
                int aDiff = houses.get(key) + houses.get(lastKey);
                if(xDiff * 2 - aDiff > 0){
                    numPlacements += 2;
                }
                else if(xDiff * 2 - aDiff == 0){
                    numPlacements++;
                }
                lastKey = key;
            }
        }
        System.out.println(numPlacements);
    }
}


import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int t = in.nextInt();
        HashMap<Integer, Integer> houses = new HashMap<>();//x, a
        for (int i = 0; i < n; i++) {
            int xi = in.nextInt();//center
            int ai = in.nextInt();//side_length
            houses.put(xi, ai);
        }
        TreeSet<Integer> keys = new TreeSet<>(houses.keySet());
        boolean first = false;
        int lastKey = 0;
        int numPlacements = 2;
        for(int key: keys){
            if(!first){
                first = true;
                lastKey = key;
            }
            else {
                int xDiff = Math.abs(key - lastKey - t);
                int aDiff = Math.abs(houses.get(key) - houses.get(lastKey));
                if(xDiff * 2 - aDiff > 0){
                    numPlacements += 2;
                }
                else if(xDiff * 2 - aDiff == 0){
                    numPlacements++;
                }
                lastKey = key;
            }
        }
        System.out.println(numPlacements);
    }
}


#include<stdio.h>
#include<string.h>
char str[11000000];
int main()
{

	char x;
	bool flag=true;
	int i;
	//freopen("input.txt","r",stdin);
	while(gets(str))
	{

		sscanf(str," %c",&x);
		if(x=='#')
		{
			if(flag==false)printf("\n");
			puts(str);
			flag=true;
		}
		/*else if(strlen(str)==0)
		{
			if(flag==true)
			{
				while(gets(str))
				{
					if(strlen(str)==0)continue;
					sscanf(str," %c",&x);
					if(x=='#')
					{
						printf("\n");
						puts(str);
						flag=true;
					}
					else{
						for(i=0;i<strlen(str);i++)
							if(str[i]!=' ')
								printf("%c",str[i]);
						flag=false;
					}
					break;
				}
			}
		}*/
		else
		{
			for(i=0;i<strlen(str);i++)
				if(str[i]!=' ')
					printf("%c",str[i]);
			flag=false;
		}
		//memset(str,0,sizeof(str));
		x=0;
	}
	if(flag==false)
	printf("\n");
	return 0;
}


#include<stdio.h>
#include<string.h>
char str[11000];
int main()
{

	char x;
	bool flag=true;
	int i;
	//freopen("input.txt","r",stdin);
	while(gets(str))
	{

		sscanf(str," %c",&x);
		if(x=='#')
		{
			if(flag==false)printf("\n");
			puts(str);
			flag=true;
		}
		/*else if(strlen(str)==0)
		{
			if(flag==true)
			{
				while(gets(str))
				{
					if(strlen(str)==0)continue;
					sscanf(str," %c",&x);
					if(x=='#')
					{
						printf("\n");
						puts(str);
						flag=true;
					}
					else{
						for(i=0;i<strlen(str);i++)
							if(str[i]!=' ')
								printf("%c",str[i]);
						flag=false;
					}
					break;
				}
			}
		}*/
		else
		{
			int len=strlen(str);
			for(i=0;i<len;i++)
				if(str[i]!=' ')
					printf("%c",str[i]);
			flag=false;
		}
		//memset(str,0,sizeof(str));
		x=0;
	}
	if(flag==false)
	printf("\n");
	return 0;
}


#include<stdio.h>
#include<string.h>
char str[1100000];
char ans[1100000];
int main()
{

	char x;
	bool flag=true;
	int i;
	//freopen("input.txt","r",stdin);
	while(gets(str))
	{

		sscanf(str," %c",&x);
		if(x=='#')
		{
			if(flag==false)printf("\n");
			puts(str);
			flag=true;
		}
		/*else if(strlen(str)==0)
		{
			if(flag==true)
			{
				while(gets(str))
				{
					if(strlen(str)==0)continue;
					sscanf(str," %c",&x);
					if(x=='#')
					{
						printf("\n");
						puts(str);
						flag=true;
					}
					else{
						for(i=0;i<strlen(str);i++)
							if(str[i]!=' ')
								printf("%c",str[i]);
						flag=false;
					}
					break;
				}
			}
		}*/
		else
		{
			int len=strlen(str);
			for(i=0;i<len;i++)
				if(str[i]!=' ')
					printf("%c",str[i]);
			flag=false;
		}
		//memset(str,0,sizeof(str));
		x=0;
	}
	if(flag==false)
	printf("\n");
	return 0;
}


#include<stdio.h>
#include<string.h>
int main()
{
	char str[200];
	char x;
	bool flag=true;
	int i;
	//freopen("input.txt","r",stdin);
	while(gets(str))
	{
		sscanf(str," %c",&x);
		if(x=='#')
		{
			if(flag==false)printf("\n");
			puts(str);
			flag=true;
		}
		/*else if(strlen(str)==0)
		{
			if(flag==true)
			{
				while(gets(str))
				{
					if(strlen(str)==0)continue;
					sscanf(str," %c",&x);
					if(x=='#')
					{
						printf("\n");
						puts(str);
						flag=true;
					}
					else{
						for(i=0;i<strlen(str);i++)
							if(str[i]!=' ')
								printf("%c",str[i]);
						flag=false;
					}
					break;
				}
			}
		}*/
		else
		{
			for(i=0;i<strlen(str);i++)
				if(str[i]!=' ')
					printf("%c",str[i]);
			flag=false;
		}
		//memset(str,0,sizeof(str));
		x=0;
	}
	if(flag==false)
	printf("\n");
	return 0;
}


#include<stdio.h>
#include<string.h>
int main()
{
	char str[200];
	char x;
	bool flag=true;
	int i;
	//freopen("input.txt","r",stdin);
	while(gets(str))
	{
		sscanf(str," %c",&x);
		if(x=='#')
		{
			if(flag==false)printf("\n");
			puts(str);
			flag=true;
		}
		/*else if(strlen(str)==0)
		{
			if(flag==true)
			{
				while(gets(str))
				{
					if(strlen(str)==0)continue;
					sscanf(str," %c",&x);
					if(x=='#')
					{
						printf("\n");
						puts(str);
						flag=true;
					}
					else{
						for(i=0;i<strlen(str);i++)
							if(str[i]!=' ')
								printf("%c",str[i]);
						flag=false;
					}
					break;
				}
			}
		}*/
		else
		{
			for(i=0;i<strlen(str);i++)
				if(str[i]!=' ')
					printf("%c",str[i]);
			flag=false;
		}
		memset(str,0,sizeof(str));
		x=0;
	}
	if(flag==false)
	printf("\n");
	return 0;
}


#include<stdio.h>
#include<string.h>
char str[1100000];
int main()
{

	char x;
	bool flag=true;
	int i;
	//freopen("input.txt","r",stdin);
	while(gets(str))
	{

		sscanf(str," %c",&x);
		if(x=='#')
		{
			if(flag==false)printf("\n");
			puts(str);
			flag=true;
		}
		/*else if(strlen(str)==0)
		{
			if(flag==true)
			{
				while(gets(str))
				{
					if(strlen(str)==0)continue;
					sscanf(str," %c",&x);
					if(x=='#')
					{
						printf("\n");
						puts(str);
						flag=true;
					}
					else{
						for(i=0;i<strlen(str);i++)
							if(str[i]!=' ')
								printf("%c",str[i]);
						flag=false;
					}
					break;
				}
			}
		}*/
		else
		{
			int len=strlen(str);
			for(i=0;i<len;i++)
				if(str[i]!=' ')
					printf("%c",str[i]);
			flag=false;
		}
		//memset(str,0,sizeof(str));
		x=0;
	}
	if(flag==false)
	printf("\n");
	return 0;
}


#include<stdio.h>
#include<string.h>
int main()
{
	char str[20000];
	char x;
	bool flag=true;
	int i;
	//freopen("input.txt","r",stdin);
	while(gets(str))
	{

		sscanf(str," %c",&x);
		if(x=='#')
		{
			if(flag==false)printf("\n");
			puts(str);
			flag=true;
		}
		/*else if(strlen(str)==0)
		{
			if(flag==true)
			{
				while(gets(str))
				{
					if(strlen(str)==0)continue;
					sscanf(str," %c",&x);
					if(x=='#')
					{
						printf("\n");
						puts(str);
						flag=true;
					}
					else{
						for(i=0;i<strlen(str);i++)
							if(str[i]!=' ')
								printf("%c",str[i]);
						flag=false;
					}
					break;
				}
			}
		}*/
		else
		{
			for(i=0;i<strlen(str);i++)
				if(str[i]!=' ')
					printf("%c",str[i]);
			flag=false;
		}
		//memset(str,0,sizeof(str));
		x=0;
	}
	if(flag==false)
	printf("\n");
	return 0;
}


#include<stdio.h>
#include<string.h>
int main()
{
	char str[200];
	char x;
	bool flag=true;
	int i;
	while(gets(str))
	{
		sscanf(str," %c",&x);
		if(x=='#')
		{
			if(flag==false)printf("\n");
			puts(str);
			flag=true;
		}
		/*else if(strlen(str)==0)
		{
			if(flag==true)
			{
				while(gets(str))
				{
					if(strlen(str)==0)continue;
					sscanf(str," %c",&x);
					if(x=='#')
					{
						printf("\n");
						puts(str);
						flag=true;
					}
					else{
						for(i=0;i<strlen(str);i++)
							if(str[i]!=' ')
								printf("%c",str[i]);
						flag=false;
					}
					break;
				}
			}
		}*/
		else
		{
			for(i=0;i<strlen(str);i++)
				if(str[i]!=' ')
					printf("%c",str[i]);
			flag=false;
		}
		memset(str,0,sizeof(str));
		x=0;
	}
	return 0;
}


/*#include<iostream>
#include<stdio.h>
#include<string>
#include<queue>
#include<math.h>
#include<vector>
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define vpii vector<pii>

using namespace std;
int n,x,y;

int main(){
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	cin >> n >> x >> y;
	int c;
	if(y*n % 100 == 0){
		c = y*n/100 - x;
	}else{
		c = (int)ceil(1.0*y*n/100.0) - x;
	}

	if(c > 0)
		cout << c;
	else
		cout << 0;
	return 0;
}*/
#include<iostream>
#include<stdio.h>
#include<string>
#include<queue>
#include<math.h>
#include<vector>
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define vpii vector<pii>

using namespace std;
int n,x,y;

bool readline(istream &in, string &s){
	s = "";
	char t;
	bool com = 0, first = 1;
	in >> noskipws;

	while(in >> t){
		if(first && t != '\r' && t != '\n' && t != ' ') {
			if(t == '#')
				com = 1;
			else
				com = 0;
			first = false;
		}
		if (t != '\r' && t != '\n')
			s += t;
		else
			break;
	}
	return com;
}

int main(){
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	string a,b;
	bool ca, cb;

	ca = readline(cin, a);
	if(ca){
		//cout << a;
		printf("%s", a.c_str());
	}else{
		for(int i = 0; i < a.length(); i++)
			if(a[i] != ' ')
				cout << a[i];
	}

	while(!cin.eof()){
		cb = readline(cin, b);
		if(!ca && !cb){
			for(int i = 0; i < b.length(); i++)
				if(b[i] != ' ')
					cout << b[i];
		}
		if(!ca && cb || ca && cb){
			cout << '\n' << b;
		}

		if(ca && !cb){
			cout << '\n' ;
			for(int i = 0; i < b.length(); i++)
				if(b[i] != ' ')
					cout << b[i];
		}

		ca = cb;
	}
	cout << endl;

	return 0;
}
/*#include<iostream>
#include <iomanip>
#include<stdio.h>
#include<string>
#include<algorithm>
#include<queue>
#include<math.h>
#include<vector>
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define vpii vector<pii>
#define v second
#define tm first

using namespace std;
int n,a,d;
int t, v;
double ta, tb, va, vb;

vpii troll;

int main(){
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	cin >> n >> a >> d;
	for(int i = 0; i < n; i++){
		cin >> t >> v;
		troll.pb(mp(t,v));
	}

	//sort(troll.begin(), troll. end());

	double ch = sqrt(2.0*d/a);
	if(troll[0].v/a < ch){
		ta = 1.0*troll[0].tm + troll[0].v*1.0/(2*a) + d*1.0/troll[0].v;
	}else{
		ta = troll[0].tm + ch;
	}
	//cout << setprecision(15) << ta << endl;
	printf("%.5lf\n", ta);
	va = troll[0].v;

	for(int i = 1 ; i <n; i++){
		if(troll[i].v > troll[i-1].v ){ // ����� ������
			double inter = (troll[i].v - troll[i-1].v)/(a*2.0) + (troll[i].v*troll[i].tm)/(troll[i].v - troll[i-1].v);
			if(inter < ta){
				printf("%.5lf\n", ta);
			}else{
				if(troll[0].v/a < ch){
					ta = troll[i].tm + troll[i].v*1.0/(2*a) + d*1.0/troll[i].v;
				}else{
					ta = troll[i].tm + ch;
				}
				printf("%.5lf\n", ta);
			}
		}else{
			if(troll[0].v/a < ch){
				ta = troll[i].tm + troll[i].v*1.0/(2*a) + d*1.0/troll[i].v;
			}else{
				ta = troll[i].tm + ch;
			}
			printf("%.5lf\n", ta);
		}
	}

	return 0;
}*/


/*#include<iostream>
#include<stdio.h>
#include<string>
#include<queue>
#include<math.h>
#include<vector>
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define vpii vector<pii>

using namespace std;
int n,x,y;

int main(){
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	cin >> n >> x >> y;
	int c;
	if(y*n % 100 == 0){
		c = y*n/100 - x;
	}else{
		c = (int)ceil(1.0*y*n/100.0) - x;
	}

	if(c > 0)
		cout << c;
	else
		cout << 0;
	return 0;
}*/
#include<iostream>
#include<stdio.h>
#include<string>
#include<queue>
#include<math.h>
#include<vector>
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define vpii vector<pii>

using namespace std;
int n,x,y;
char last = '\0';

bool readline(istream &in, string &s){
	s = "";
	char t;
	bool com = 0, first = 1;
	in >> noskipws;
	last = '\0';

	while(in >> t){
		if(first && t != '\r' && t != '\n' && t != ' ') {
			if(t == '#')
				com = 1;
			else
				com = 0;
			first = false;
		}
		if (t != '\r' && t != '\n')
			s += t;
		else{
			last = t;
			break;
		}
	}
	return com;
}

int main(){
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	string a,b;
	int ca, cb;
	cin >> noskipws;

	getline(cin, a); ca = 0;
	for(int i = 0; i < a.length(); i++){
		if(a[i] == ' ') continue;
		if(a[i] == '#') ca = 1; else ca = 0;
		break;
	}

	if(ca){
		cout << a;

	}else{
		for(int i = 0; i < a.length(); i++)
			if(a[i] != ' ')
				cout << a[i];
	}

	while(!cin.eof()){
		getline(cin, b); cb = 0;
		for(int i = 0; i < b.length(); i++){
			if(b[i] == ' ') continue;
			if(b[i] == '#') cb = 1; else cb = 0;
			break;
		}
		if(!ca && !cb){
			for(int i = 0; i < b.length(); i++)
				if(b[i] != ' ')
					cout << b[i];
		}
		if(!ca && cb || ca && cb){
			cout << endl << b;
		}

		if(ca && !cb){
			cout << endl;
			for(int i = 0; i < b.length(); i++)
				if(b[i] != ' ')
					cout << b[i];
		}

		ca = cb;
	}
	if(!cb) cout << endl;

	return 0;
}
/*#include<iostream>
#include <iomanip>
#include<stdio.h>
#include<string>
#include<algorithm>
#include<queue>
#include<math.h>
#include<vector>
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define vpii vector<pii>
#define v second
#define tm first

using namespace std;
int n,a,d;
int t, v;
double ta, tb, va, vb;

vpii troll;

int main(){
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	cin >> n >> a >> d;
	for(int i = 0; i < n; i++){
		cin >> t >> v;
		troll.pb(mp(t,v));
	}

	//sort(troll.begin(), troll. end());

	double ch = sqrt(2.0*d/a);
	if(troll[0].v/a < ch){
		ta = 1.0*troll[0].tm + troll[0].v*1.0/(2*a) + d*1.0/troll[0].v;
	}else{
		ta = troll[0].tm + ch;
	}
	//cout << setprecision(15) << ta << endl;
	printf("%.5lf\n", ta);
	va = troll[0].v;

	for(int i = 1 ; i <n; i++){
		if(troll[i].v > troll[i-1].v ){ // ����� ������
			double inter = (troll[i].v - troll[i-1].v)/(a*2.0) + (troll[i].v*troll[i].tm)/(troll[i].v - troll[i-1].v);
			if(inter < ta){
				printf("%.5lf\n", ta);
			}else{
				if(troll[0].v/a < ch){
					ta = troll[i].tm + troll[i].v*1.0/(2*a) + d*1.0/troll[i].v;
				}else{
					ta = troll[i].tm + ch;
				}
				printf("%.5lf\n", ta);
			}
		}else{
			if(troll[0].v/a < ch){
				ta = troll[i].tm + troll[i].v*1.0/(2*a) + d*1.0/troll[i].v;
			}else{
				ta = troll[i].tm + ch;
			}
			printf("%.5lf\n", ta);
		}
	}

	return 0;
}*/


/*#include<iostream>
#include<stdio.h>
#include<string>
#include<queue>
#include<math.h>
#include<vector>
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define vpii vector<pii>

using namespace std;
int n,x,y;

int main(){
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	cin >> n >> x >> y;
	int c;
	if(y*n % 100 == 0){
		c = y*n/100 - x;
	}else{
		c = (int)ceil(1.0*y*n/100.0) - x;
	}

	if(c > 0)
		cout << c;
	else
		cout << 0;
	return 0;
}*/
#include<iostream>
#include<stdio.h>
#include<string>
#include<queue>
#include<math.h>
#include<vector>
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define vpii vector<pii>

using namespace std;
int n,x,y;
char last = '\0';

bool readline(istream &in, string &s){
	s = "";
	char t;
	bool com = 0, first = 1;
	in >> noskipws;
	last = '\0';

	while(in >> t){
		if(first && t != '\r' && t != '\n' && t != ' ') {
			if(t == '#')
				com = 1;
			else
				com = 0;
			first = false;
		}
		if (t != '\r' && t != '\n')
			s += t;
		else{
			last = t;
			break;
		}
	}
	return com;
}

int main(){
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	string a,b;
	bool ca, cb;

	ca = readline(cin, a);
	if(ca){
		cout << a;
		//printf("%s", a.c_str());
	}else{
		for(int i = 0; i < a.length(); i++)
			if(a[i] != ' ')
				cout << a[i];
	}

	while(!cin.eof()){
		cb = readline(cin, b);
		if(!ca && !cb){
			for(int i = 0; i < b.length(); i++)
				if(b[i] != ' ')
					cout << b[i];
		}
		if(!ca && cb || ca && cb){
			cout << endl << b;
		}

		if(ca && !cb){
			cout << endl;
			for(int i = 0; i < b.length(); i++)
				if(b[i] != ' ')
					cout << b[i];
		}

		ca = cb;
	}
	if(last != '\0') cout << last;

	return 0;
}
/*#include<iostream>
#include <iomanip>
#include<stdio.h>
#include<string>
#include<algorithm>
#include<queue>
#include<math.h>
#include<vector>
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define vpii vector<pii>
#define v second
#define tm first

using namespace std;
int n,a,d;
int t, v;
double ta, tb, va, vb;

vpii troll;

int main(){
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	cin >> n >> a >> d;
	for(int i = 0; i < n; i++){
		cin >> t >> v;
		troll.pb(mp(t,v));
	}

	//sort(troll.begin(), troll. end());

	double ch = sqrt(2.0*d/a);
	if(troll[0].v/a < ch){
		ta = 1.0*troll[0].tm + troll[0].v*1.0/(2*a) + d*1.0/troll[0].v;
	}else{
		ta = troll[0].tm + ch;
	}
	//cout << setprecision(15) << ta << endl;
	printf("%.5lf\n", ta);
	va = troll[0].v;

	for(int i = 1 ; i <n; i++){
		if(troll[i].v > troll[i-1].v ){ // ����� ������
			double inter = (troll[i].v - troll[i-1].v)/(a*2.0) + (troll[i].v*troll[i].tm)/(troll[i].v - troll[i-1].v);
			if(inter < ta){
				printf("%.5lf\n", ta);
			}else{
				if(troll[0].v/a < ch){
					ta = troll[i].tm + troll[i].v*1.0/(2*a) + d*1.0/troll[i].v;
				}else{
					ta = troll[i].tm + ch;
				}
				printf("%.5lf\n", ta);
			}
		}else{
			if(troll[0].v/a < ch){
				ta = troll[i].tm + troll[i].v*1.0/(2*a) + d*1.0/troll[i].v;
			}else{
				ta = troll[i].tm + ch;
			}
			printf("%.5lf\n", ta);
		}
	}

	return 0;
}*/


/*#include<iostream>
#include<stdio.h>
#include<string>
#include<queue>
#include<math.h>
#include<vector>
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define vpii vector<pii>

using namespace std;
int n,x,y;

int main(){
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	cin >> n >> x >> y;
	int c;
	if(y*n % 100 == 0){
		c = y*n/100 - x;
	}else{
		c = (int)ceil(1.0*y*n/100.0) - x;
	}

	if(c > 0)
		cout << c;
	else
		cout << 0;
	return 0;
}*/
#include<iostream>
#include<stdio.h>
#include<string>
#include<queue>
#include<math.h>
#include<vector>
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define vpii vector<pii>

using namespace std;
int n,x,y;
char last = '\0';

bool readline(istream &in, string &s){
	s = "";
	char t;
	bool com = 0, first = 1;
	in >> noskipws;
	last = '\0';

	while(in >> t){
		if(first && t != '\r' && t != '\n' && t != ' ') {
			if(t == '#')
				com = 1;
			else
				com = 0;
			first = false;
		}
		if (t != '\r' && t != '\n')
			s += t;
		else{
			last = t;
			break;
		}
	}
	return com;
}

int main(){
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	string a,b;
	int ca, cb;
	cin >> noskipws;

	getline(cin, a); ca = 0;
	for(int i = 0; i < a.length(); i++){
		if(a[i] == ' ') continue;
		if(a[i] == '#') ca = 1; else ca = 0;
		break;
	}

	if(ca){
		cout << a;

	}else{
		for(int i = 0; i < a.length(); i++)
			if(a[i] != ' ')
				cout << a[i];
	}

	while(!cin.eof()){
		getline(cin, b); cb = 0;
		for(int i = 0; i < b.length(); i++){
			if(b[i] == ' ') continue;
			if(b[i] == '#') cb = 1; else cb = 0;
			break;
		}
		if(!ca && !cb){
			for(int i = 0; i < b.length(); i++)
				if(b[i] != ' ')
					cout << b[i];
		}
		if(!ca && cb || ca && cb){
			cout << endl << b;
		}

		if(ca && !cb){
			cout << endl;
			for(int i = 0; i < b.length(); i++)
				if(b[i] != ' ')
					cout << b[i];
		}

		ca = cb;
	}
	cout << endl;

	return 0;
}
/*#include<iostream>
#include <iomanip>
#include<stdio.h>
#include<string>
#include<algorithm>
#include<queue>
#include<math.h>
#include<vector>
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define vpii vector<pii>
#define v second
#define tm first

using namespace std;
int n,a,d;
int t, v;
double ta, tb, va, vb;

vpii troll;

int main(){
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	cin >> n >> a >> d;
	for(int i = 0; i < n; i++){
		cin >> t >> v;
		troll.pb(mp(t,v));
	}

	//sort(troll.begin(), troll. end());

	double ch = sqrt(2.0*d/a);
	if(troll[0].v/a < ch){
		ta = 1.0*troll[0].tm + troll[0].v*1.0/(2*a) + d*1.0/troll[0].v;
	}else{
		ta = troll[0].tm + ch;
	}
	//cout << setprecision(15) << ta << endl;
	printf("%.5lf\n", ta);
	va = troll[0].v;

	for(int i = 1 ; i <n; i++){
		if(troll[i].v > troll[i-1].v ){ // ����� ������
			double inter = (troll[i].v - troll[i-1].v)/(a*2.0) + (troll[i].v*troll[i].tm)/(troll[i].v - troll[i-1].v);
			if(inter < ta){
				printf("%.5lf\n", ta);
			}else{
				if(troll[0].v/a < ch){
					ta = troll[i].tm + troll[i].v*1.0/(2*a) + d*1.0/troll[i].v;
				}else{
					ta = troll[i].tm + ch;
				}
				printf("%.5lf\n", ta);
			}
		}else{
			if(troll[0].v/a < ch){
				ta = troll[i].tm + troll[i].v*1.0/(2*a) + d*1.0/troll[i].v;
			}else{
				ta = troll[i].tm + ch;
			}
			printf("%.5lf\n", ta);
		}
	}

	return 0;
}*/


/*#include<iostream>
#include<stdio.h>
#include<string>
#include<queue>
#include<math.h>
#include<vector>
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define vpii vector<pii>

using namespace std;
int n,x,y;

int main(){
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	cin >> n >> x >> y;
	int c;
	if(y*n % 100 == 0){
		c = y*n/100 - x;
	}else{
		c = (int)ceil(1.0*y*n/100.0) - x;
	}

	if(c > 0)
		cout << c;
	else
		cout << 0;
	return 0;
}*/
#include<iostream>
#include<stdio.h>
#include<string>
#include<queue>
#include<math.h>
#include<vector>
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define vpii vector<pii>

using namespace std;
int n,x,y;

bool readline(istream &in, string &s){
	s = "";
	char t;
	bool com = 0, first = 1;
	in >> noskipws;

	while(in >> t){
		if(first && t != '\r' && t != '\n' && t != ' ') {
			if(t == '#')
				com = 1;
			else
				com = 0;
			first = false;
		}
		if (t != '\r' && t != '\n')
			s += t;
		else
			break;
	}
	return com;
}

int main(){
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	string a,b;
	bool ca, cb;

	ca = readline(cin, a);
	if(ca){
		//cout << a;
		printf("%s", a.c_str());
	}else{
		for(int i = 0; i < a.length(); i++)
			if(a[i] != ' ')
				cout << a[i];
	}

	while(!cin.eof()){
		cb = readline(cin, b);
		if(!ca && !cb){
			for(int i = 0; i < b.length(); i++)
				if(b[i] != ' ')
					cout << b[i];
		}
		if(!ca && cb || ca && cb){
			cout << '\n' << b;
		}

		if(ca && !cb){
			cout << '\n' ;
			for(int i = 0; i < b.length(); i++)
				if(b[i] != ' ')
					cout << b[i];
		}

		ca = cb;
	}

	return 0;
}
/*#include<iostream>
#include <iomanip>
#include<stdio.h>
#include<string>
#include<algorithm>
#include<queue>
#include<math.h>
#include<vector>
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define vpii vector<pii>
#define v second
#define tm first

using namespace std;
int n,a,d;
int t, v;
double ta, tb, va, vb;

vpii troll;

int main(){
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	cin >> n >> a >> d;
	for(int i = 0; i < n; i++){
		cin >> t >> v;
		troll.pb(mp(t,v));
	}

	//sort(troll.begin(), troll. end());

	double ch = sqrt(2.0*d/a);
	if(troll[0].v/a < ch){
		ta = 1.0*troll[0].tm + troll[0].v*1.0/(2*a) + d*1.0/troll[0].v;
	}else{
		ta = troll[0].tm + ch;
	}
	//cout << setprecision(15) << ta << endl;
	printf("%.5lf\n", ta);
	va = troll[0].v;

	for(int i = 1 ; i <n; i++){
		if(troll[i].v > troll[i-1].v ){ // ����� ������
			double inter = (troll[i].v - troll[i-1].v)/(a*2.0) + (troll[i].v*troll[i].tm)/(troll[i].v - troll[i-1].v);
			if(inter < ta){
				printf("%.5lf\n", ta);
			}else{
				if(troll[0].v/a < ch){
					ta = troll[i].tm + troll[i].v*1.0/(2*a) + d*1.0/troll[i].v;
				}else{
					ta = troll[i].tm + ch;
				}
				printf("%.5lf\n", ta);
			}
		}else{
			if(troll[0].v/a < ch){
				ta = troll[i].tm + troll[i].v*1.0/(2*a) + d*1.0/troll[i].v;
			}else{
				ta = troll[i].tm + ch;
			}
			printf("%.5lf\n", ta);
		}
	}

	return 0;
}*/


/*#include<iostream>
#include<stdio.h>
#include<string>
#include<queue>
#include<math.h>
#include<vector>
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define vpii vector<pii>

using namespace std;
int n,x,y;

int main(){
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	cin >> n >> x >> y;
	int c;
	if(y*n % 100 == 0){
		c = y*n/100 - x;
	}else{
		c = (int)ceil(1.0*y*n/100.0) - x;
	}

	if(c > 0)
		cout << c;
	else
		cout << 0;
	return 0;
}*/
#include<iostream>
#include<stdio.h>
#include<string>
#include<queue>
#include<math.h>
#include<vector>
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define vpii vector<pii>

using namespace std;
int n,x,y;
char last = '\0';

bool readline(istream &in, string &s){
	s = "";
	char t;
	bool com = 0, first = 1;
	in >> noskipws;
	last = '\0';

	while(in >> t){
		if(first && t != '\r' && t != '\n' && t != ' ') {
			if(t == '#')
				com = 1;
			else
				com = 0;
			first = false;
		}
		if (t != '\r' && t != '\n')
			s += t;
		else{
			last = t;
			break;
		}
	}
	return com;
}

int main(){
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	string a,b;
	bool ca, cb;

	ca = readline(cin, a);
	if(ca){
		cout << a;
		//printf("%s", a.c_str());
	}else{
		for(int i = 0; i < a.length(); i++)
			if(a[i] != ' ')
				cout << a[i];
	}

	while(!cin.eof()){
		cb = readline(cin, b);
		if(!ca && !cb){
			for(int i = 0; i < b.length(); i++)
				if(b[i] != ' ')
					cout << b[i];
		}
		if(!ca && cb || ca && cb){
			cout << endl << b;
		}

		if(ca && !cb){
			cout << endl;
			for(int i = 0; i < b.length(); i++)
				if(b[i] != ' ')
					cout << b[i];
		}

		ca = cb;
	}
	if(last != '\0') cout << last;

	return 0;
}
/*#include<iostream>
#include <iomanip>
#include<stdio.h>
#include<string>
#include<algorithm>
#include<queue>
#include<math.h>
#include<vector>
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define vpii vector<pii>
#define v second
#define tm first

using namespace std;
int n,a,d;
int t, v;
double ta, tb, va, vb;

vpii troll;

int main(){
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	cin >> n >> a >> d;
	for(int i = 0; i < n; i++){
		cin >> t >> v;
		troll.pb(mp(t,v));
	}

	//sort(troll.begin(), troll. end());

	double ch = sqrt(2.0*d/a);
	if(troll[0].v/a < ch){
		ta = 1.0*troll[0].tm + troll[0].v*1.0/(2*a) + d*1.0/troll[0].v;
	}else{
		ta = troll[0].tm + ch;
	}
	//cout << setprecision(15) << ta << endl;
	printf("%.5lf\n", ta);
	va = troll[0].v;

	for(int i = 1 ; i <n; i++){
		if(troll[i].v > troll[i-1].v ){ // ����� ������
			double inter = (troll[i].v - troll[i-1].v)/(a*2.0) + (troll[i].v*troll[i].tm)/(troll[i].v - troll[i-1].v);
			if(inter < ta){
				printf("%.5lf\n", ta);
			}else{
				if(troll[0].v/a < ch){
					ta = troll[i].tm + troll[i].v*1.0/(2*a) + d*1.0/troll[i].v;
				}else{
					ta = troll[i].tm + ch;
				}
				printf("%.5lf\n", ta);
			}
		}else{
			if(troll[0].v/a < ch){
				ta = troll[i].tm + troll[i].v*1.0/(2*a) + d*1.0/troll[i].v;
			}else{
				ta = troll[i].tm + ch;
			}
			printf("%.5lf\n", ta);
		}
	}

	return 0;
}*/


/*#include<iostream>
#include<stdio.h>
#include<string>
#include<queue>
#include<math.h>
#include<vector>
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define vpii vector<pii>

using namespace std;
int n,x,y;

int main(){
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	cin >> n >> x >> y;
	int c;
	if(y*n % 100 == 0){
		c = y*n/100 - x;
	}else{
		c = (int)ceil(1.0*y*n/100.0) - x;
	}

	if(c > 0)
		cout << c;
	else
		cout << 0;
	return 0;
}*/
#include<iostream>
#include<stdio.h>
#include<string>
#include<queue>
#include<math.h>
#include<vector>
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define vpii vector<pii>

using namespace std;
int n,x,y;

bool readline(istream &in, string &s){
	s = "";
	char t;
	bool com = 0, first = 1;
	in >> noskipws;
	//in >> t;
	//if (t != '\n')	s += t;
	//if(t == '#') com = 1;

	while(in >> t){
		//in >> t;
		if(first && t != '\n' && t != ' ') {
			if(t == '#')
				com = 1;
			else
				com = 0;
			first = false;
		}
		if (t != '\n')
			s += t;
		else break;
	}
	return com;
}

int main(){
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	string a,b;
	bool ca, cb;

	ca = readline(cin, a);
	if(ca){
		cout << a;
	}else{
		for(int i = 0; i < a.length(); i++)
			if(a[i] != ' ')
				cout << a[i];
	}

	while(!cin.eof()){
		cb = readline(cin, b);
		if(!ca && !cb){
			for(int i = 0; i < b.length(); i++)
				if(b[i] != ' ')
					cout << b[i];
		}
		if(!ca && cb || ca && cb){
			cout << endl << b;
		}

		if(ca && !cb){
			cout << endl;
			for(int i = 0; i < b.length(); i++)
				if(b[i] != ' ')
					cout << b[i];
		}

		ca = cb;
	}

	return 0;
}


/*#include<iostream>
#include<stdio.h>
#include<string>
#include<queue>
#include<math.h>
#include<vector>
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define vpii vector<pii>

using namespace std;
int n,x,y;

int main(){
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	cin >> n >> x >> y;
	int c;
	if(y*n % 100 == 0){
		c = y*n/100 - x;
	}else{
		c = (int)ceil(1.0*y*n/100.0) - x;
	}

	if(c > 0)
		cout << c;
	else
		cout << 0;
	return 0;
}*/
#include<iostream>
#include<stdio.h>
#include<string>
#include<queue>
#include<math.h>
#include<vector>
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define vpii vector<pii>

using namespace std;
int n,x,y;
char last = '\0';

bool readline(istream &in, string &s){
	s = "";
	char t;
	bool com = 0, first = 1;
	in >> noskipws;
	last = '\0';

	while(in >> t){
		if(first && t != '\r' && t != '\n' && t != ' ') {
			if(t == '#')
				com = 1;
			else
				com = 0;
			first = false;
		}
		if (t != '\r' && t != '\n')
			s += t;
		else{
			last = t;
			break;
		}
	}
	return com;
}

int main(){
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	string a,b;
	bool ca, cb;

	ca = readline(cin, a);
	if(ca){
		cout << a;
		//printf("%s", a.c_str());
	}else{
		for(int i = 0; i < a.length(); i++)
			if(a[i] != ' ')
				cout << a[i];
	}

	while(!cin.eof()){
		cb = readline(cin, b);
		if(!ca && !cb){
			for(int i = 0; i < b.length(); i++)
				if(b[i] != ' ')
					cout << b[i];
		}
		if(!ca && cb || ca && cb){
			cout << '\n' << b;
		}

		if(ca && !cb){
			cout << '\n' ;
			for(int i = 0; i < b.length(); i++)
				if(b[i] != ' ')
					cout << b[i];
		}

		ca = cb;
	}
	if(last != '\0') cout << last;

	return 0;
}
/*#include<iostream>
#include <iomanip>
#include<stdio.h>
#include<string>
#include<algorithm>
#include<queue>
#include<math.h>
#include<vector>
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define vpii vector<pii>
#define v second
#define tm first

using namespace std;
int n,a,d;
int t, v;
double ta, tb, va, vb;

vpii troll;

int main(){
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	cin >> n >> a >> d;
	for(int i = 0; i < n; i++){
		cin >> t >> v;
		troll.pb(mp(t,v));
	}

	//sort(troll.begin(), troll. end());

	double ch = sqrt(2.0*d/a);
	if(troll[0].v/a < ch){
		ta = 1.0*troll[0].tm + troll[0].v*1.0/(2*a) + d*1.0/troll[0].v;
	}else{
		ta = troll[0].tm + ch;
	}
	//cout << setprecision(15) << ta << endl;
	printf("%.5lf\n", ta);
	va = troll[0].v;

	for(int i = 1 ; i <n; i++){
		if(troll[i].v > troll[i-1].v ){ // ����� ������
			double inter = (troll[i].v - troll[i-1].v)/(a*2.0) + (troll[i].v*troll[i].tm)/(troll[i].v - troll[i-1].v);
			if(inter < ta){
				printf("%.5lf\n", ta);
			}else{
				if(troll[0].v/a < ch){
					ta = troll[i].tm + troll[i].v*1.0/(2*a) + d*1.0/troll[i].v;
				}else{
					ta = troll[i].tm + ch;
				}
				printf("%.5lf\n", ta);
			}
		}else{
			if(troll[0].v/a < ch){
				ta = troll[i].tm + troll[i].v*1.0/(2*a) + d*1.0/troll[i].v;
			}else{
				ta = troll[i].tm + ch;
			}
			printf("%.5lf\n", ta);
		}
	}

	return 0;
}*/


/*#include<iostream>
#include<stdio.h>
#include<string>
#include<queue>
#include<math.h>
#include<vector>
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define vpii vector<pii>

using namespace std;
int n,x,y;

int main(){
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	cin >> n >> x >> y;
	int c;
	if(y*n % 100 == 0){
		c = y*n/100 - x;
	}else{
		c = (int)ceil(1.0*y*n/100.0) - x;
	}

	if(c > 0)
		cout << c;
	else
		cout << 0;
	return 0;
}*/
#include<iostream>
#include<stdio.h>
#include<string>
#include<queue>
#include<math.h>
#include<vector>
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define vpii vector<pii>

using namespace std;
int n,x,y;

bool readline(istream &in, string &s){
	s = "";
	char t;
	bool com = 0, first = 1;
	in >> noskipws;

	while(in >> t){
		if(first && t != '\r' && t != '\n' && t != ' ') {
			if(t == '#')
				com = 1;
			else
				com = 0;
			first = false;
		}
		if (t != '\r' && t != '\n')
			s += t;
		else
			break;
	}
	return com;
}

int main(){
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	string a,b;
	bool ca, cb;

	ca = readline(cin, a);
	if(ca){
		cout << a;
	}else{
		for(int i = 0; i < a.length(); i++)
			if(a[i] != ' ')
				cout << a[i];
	}

	while(!cin.eof()){
		cb = readline(cin, b);
		if(!ca && !cb){
			for(int i = 0; i < b.length(); i++)
				if(b[i] != ' ')
					cout << b[i];
		}
		if(!ca && cb || ca && cb){
			cout << '\n' << b;
		}

		if(ca && !cb){
			cout << '\n' ;
			for(int i = 0; i < b.length(); i++)
				if(b[i] != ' ')
					cout << b[i];
		}

		ca = cb;
	}

	return 0;
}
/*#include<iostream>
#include <iomanip>
#include<stdio.h>
#include<string>
#include<algorithm>
#include<queue>
#include<math.h>
#include<vector>
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define vpii vector<pii>
#define v second
#define tm first

using namespace std;
int n,a,d;
int t, v;
double ta, tb, va, vb;

vpii troll;

int main(){
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	cin >> n >> a >> d;
	for(int i = 0; i < n; i++){
		cin >> t >> v;
		troll.pb(mp(t,v));
	}

	//sort(troll.begin(), troll. end());

	double ch = sqrt(2.0*d/a);
	if(troll[0].v/a < ch){
		ta = 1.0*troll[0].tm + troll[0].v*1.0/(2*a) + d*1.0/troll[0].v;
	}else{
		ta = troll[0].tm + ch;
	}
	//cout << setprecision(15) << ta << endl;
	printf("%.5lf\n", ta);
	va = troll[0].v;

	for(int i = 1 ; i <n; i++){
		if(troll[i].v > troll[i-1].v ){ // ����� ������
			double inter = (troll[i].v - troll[i-1].v)/(a*2.0) + (troll[i].v*troll[i].tm)/(troll[i].v - troll[i-1].v);
			if(inter < ta){
				printf("%.5lf\n", ta);
			}else{
				if(troll[0].v/a < ch){
					ta = troll[i].tm + troll[i].v*1.0/(2*a) + d*1.0/troll[i].v;
				}else{
					ta = troll[i].tm + ch;
				}
				printf("%.5lf\n", ta);
			}
		}else{
			if(troll[0].v/a < ch){
				ta = troll[i].tm + troll[i].v*1.0/(2*a) + d*1.0/troll[i].v;
			}else{
				ta = troll[i].tm + ch;
			}
			printf("%.5lf\n", ta);
		}
	}

	return 0;
}*/


/*#include<iostream>
#include<stdio.h>
#include<string>
#include<queue>
#include<math.h>
#include<vector>
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define vpii vector<pii>

using namespace std;
int n,x,y;

int main(){
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	cin >> n >> x >> y;
	int c;
	if(y*n % 100 == 0){
		c = y*n/100 - x;
	}else{
		c = (int)ceil(1.0*y*n/100.0) - x;
	}

	if(c > 0)
		cout << c;
	else
		cout << 0;
	return 0;
}*/
#include<iostream>
#include<stdio.h>
#include<string>
#include<queue>
#include<math.h>
#include<vector>
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define vpii vector<pii>

using namespace std;
int n,x,y;
char last = '\0';

bool readline(istream &in, string &s){
	s = "";
	char t;
	bool com = 0, first = 1;
	in >> noskipws;
	last = '\0';

	while(in >> t){
		if(first && t != '\r' && t != '\n' && t != ' ') {
			if(t == '#')
				com = 1;
			else
				com = 0;
			first = false;
		}
		if (t != '\r' && t != '\n')
			s += t;
		else{
			last = t;
			break;
		}
	}
	return com;
}

int main(){
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	string a,b;
	bool ca, cb;

	ca = readline(cin, a);
	if(ca){
		cout << a;
		//printf("%s", a.c_str());
	}else{
		for(int i = 0; i < a.length(); i++)
			if(a[i] != ' ')
				cout << a[i];
	}

	while(!cin.eof()){
		cb = readline(cin, b);
		if(!ca && !cb){
			for(int i = 0; i < b.length(); i++)
				if(b[i] != ' ')
					cout << b[i];
		}
		if(!ca && cb || ca && cb){
			cout << endl << b;
		}

		if(ca && !cb){
			cout << endl;
			for(int i = 0; i < b.length(); i++)
				if(b[i] != ' ')
					cout << b[i];
		}

		ca = cb;
	}
	cout << endl;

	return 0;
}
/*#include<iostream>
#include <iomanip>
#include<stdio.h>
#include<string>
#include<algorithm>
#include<queue>
#include<math.h>
#include<vector>
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define vpii vector<pii>
#define v second
#define tm first

using namespace std;
int n,a,d;
int t, v;
double ta, tb, va, vb;

vpii troll;

int main(){
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	cin >> n >> a >> d;
	for(int i = 0; i < n; i++){
		cin >> t >> v;
		troll.pb(mp(t,v));
	}

	//sort(troll.begin(), troll. end());

	double ch = sqrt(2.0*d/a);
	if(troll[0].v/a < ch){
		ta = 1.0*troll[0].tm + troll[0].v*1.0/(2*a) + d*1.0/troll[0].v;
	}else{
		ta = troll[0].tm + ch;
	}
	//cout << setprecision(15) << ta << endl;
	printf("%.5lf\n", ta);
	va = troll[0].v;

	for(int i = 1 ; i <n; i++){
		if(troll[i].v > troll[i-1].v ){ // ����� ������
			double inter = (troll[i].v - troll[i-1].v)/(a*2.0) + (troll[i].v*troll[i].tm)/(troll[i].v - troll[i-1].v);
			if(inter < ta){
				printf("%.5lf\n", ta);
			}else{
				if(troll[0].v/a < ch){
					ta = troll[i].tm + troll[i].v*1.0/(2*a) + d*1.0/troll[i].v;
				}else{
					ta = troll[i].tm + ch;
				}
				printf("%.5lf\n", ta);
			}
		}else{
			if(troll[0].v/a < ch){
				ta = troll[i].tm + troll[i].v*1.0/(2*a) + d*1.0/troll[i].v;
			}else{
				ta = troll[i].tm + ch;
			}
			printf("%.5lf\n", ta);
		}
	}

	return 0;
}*/


/*#include<iostream>
#include<stdio.h>
#include<string>
#include<queue>
#include<math.h>
#include<vector>
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define vpii vector<pii>

using namespace std;
int n,x,y;

int main(){
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	cin >> n >> x >> y;
	int c;
	if(y*n % 100 == 0){
		c = y*n/100 - x;
	}else{
		c = (int)ceil(1.0*y*n/100.0) - x;
	}

	if(c > 0)
		cout << c;
	else
		cout << 0;
	return 0;
}*/
#include<iostream>
#include<stdio.h>
#include<string>
#include<queue>
#include<math.h>
#include<vector>
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define vpii vector<pii>

using namespace std;
int n,x,y;

bool readline(istream &in, string &s){
	s = "";
	char t;
	bool com = 0, first = 1;
	in >> noskipws;

	while(in >> t){
		if(first && t != '\r' && t != '\n' && t != ' ') {
			if(t == '#')
				com = 1;
			else
				com = 0;
			first = false;
		}
		if (t != '\r' && t != '\n')
			s += t;
		else
			break;
	}
	return com;
}

int main(){
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	string a,b;
	bool ca, cb;

	ca = readline(cin, a);
	if(ca){
		//cout << a;
		printf("%s", a.c_str());
	}else{
		for(int i = 0; i < a.length(); i++)
			if(a[i] != ' ')
				cout << a[i];
	}

	while(!cin.eof()){
		cb = readline(cin, b);
		if(!ca && !cb){
			for(int i = 0; i < b.length(); i++)
				if(b[i] != ' ')
					cout << b[i];
		}
		if(!ca && cb || ca && cb){
			cout << '\n' << b;
		}

		if(ca && !cb){
			cout << '\n' ;
			for(int i = 0; i < b.length(); i++)
				if(b[i] != ' ')
					cout << b[i];
		}

		ca = cb;
	}
	cout << endl;

	return 0;
}
/*#include<iostream>
#include <iomanip>
#include<stdio.h>
#include<string>
#include<algorithm>
#include<queue>
#include<math.h>
#include<vector>
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define vpii vector<pii>
#define v second
#define tm first

using namespace std;
int n,a,d;
int t, v;
double ta, tb, va, vb;

vpii troll;

int main(){
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	cin >> n >> a >> d;
	for(int i = 0; i < n; i++){
		cin >> t >> v;
		troll.pb(mp(t,v));
	}

	//sort(troll.begin(), troll. end());

	double ch = sqrt(2.0*d/a);
	if(troll[0].v/a < ch){
		ta = 1.0*troll[0].tm + troll[0].v*1.0/(2*a) + d*1.0/troll[0].v;
	}else{
		ta = troll[0].tm + ch;
	}
	//cout << setprecision(15) << ta << endl;
	printf("%.5lf\n", ta);
	va = troll[0].v;

	for(int i = 1 ; i <n; i++){
		if(troll[i].v > troll[i-1].v ){ // ����� ������
			double inter = (troll[i].v - troll[i-1].v)/(a*2.0) + (troll[i].v*troll[i].tm)/(troll[i].v - troll[i-1].v);
			if(inter < ta){
				printf("%.5lf\n", ta);
			}else{
				if(troll[0].v/a < ch){
					ta = troll[i].tm + troll[i].v*1.0/(2*a) + d*1.0/troll[i].v;
				}else{
					ta = troll[i].tm + ch;
				}
				printf("%.5lf\n", ta);
			}
		}else{
			if(troll[0].v/a < ch){
				ta = troll[i].tm + troll[i].v*1.0/(2*a) + d*1.0/troll[i].v;
			}else{
				ta = troll[i].tm + ch;
			}
			printf("%.5lf\n", ta);
		}
	}

	return 0;
}*/


/*#include<iostream>
#include<stdio.h>
#include<string>
#include<queue>
#include<math.h>
#include<vector>
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define vpii vector<pii>

using namespace std;
int n,x,y;

int main(){
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	cin >> n >> x >> y;
	int c;
	if(y*n % 100 == 0){
		c = y*n/100 - x;
	}else{
		c = (int)ceil(1.0*y*n/100.0) - x;
	}

	if(c > 0)
		cout << c;
	else
		cout << 0;
	return 0;
}*/
#include<iostream>
#include<stdio.h>
#include<string>
#include<queue>
#include<math.h>
#include<vector>
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define vpii vector<pii>

using namespace std;
int n,x,y;

bool readline(istream &in, string &s){
	s = "";
	char t;
	bool com = 0, first = 1;
	in >> noskipws;

	while(in >> t){
		if(first && t != '\r' && t != '\n' && t != ' ') {
			if(t == '#')
				com = 1;
			else
				com = 0;
			first = false;
		}
		if (t != '\r' && t != '\n')
			s += t;
		else
			break;
	}
	return com;
}

int main(){
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	string a,b;
	bool ca, cb;

	ca = readline(cin, a);
	if(ca){
		cout << a;
	}else{
		for(int i = 0; i < a.length(); i++)
			if(a[i] != ' ')
				cout << a[i];
	}

	while(!cin.eof()){
		cb = readline(cin, b);
		if(!ca && !cb){
			for(int i = 0; i < b.length(); i++)
				if(b[i] != ' ')
					cout << b[i];
		}
		if(!ca && cb || ca && cb){
			cout << '\n' << b;
		}

		if(ca && !cb){
			cout << '\n' ;
			for(int i = 0; i < b.length(); i++)
				if(b[i] != ' ')
					cout << b[i];
		}

		ca = cb;
	}

	return 0;
}


/*#include<iostream>
#include<stdio.h>
#include<string>
#include<queue>
#include<math.h>
#include<vector>
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define vpii vector<pii>

using namespace std;
int n,x,y;

int main(){
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	cin >> n >> x >> y;
	int c;
	if(y*n % 100 == 0){
		c = y*n/100 - x;
	}else{
		c = (int)ceil(1.0*y*n/100.0) - x;
	}

	if(c > 0)
		cout << c;
	else
		cout << 0;
	return 0;
}*/
#include<iostream>
#include<stdio.h>
#include<string>
#include<queue>
#include<math.h>
#include<vector>
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define vpii vector<pii>

using namespace std;
int n,x,y;

bool readline(istream &in, string &s){
	s = "";
	char t;
	bool com = 0, first = 1;
	in >> noskipws;
	//in >> t;
	//if (t != '\n')	s += t;
	//if(t == '#') com = 1;

	while(in >> t){
		//in >> t;
		if(first && t != '\n' && t != ' ') {
			if(t == '#')
				com = 1;
			else
				com = 0;
			first = false;
		}
		if (t != '\n')
			s += t;
		else break;
	}
	return com;
}

int main(){
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	string a,b;
	bool ca, cb;

	ca = readline(cin, a);
	if(ca){
		cout << a;
	}else{
		for(int i = 0; i < a.length(); i++)
			if(a[i] != ' ')
				cout << a[i];
	}

	while(!cin.eof()){
		cb = readline(cin, b);
		if(!ca && !cb){
			for(int i = 0; i < b.length(); i++)
				if(b[i] != ' ')
					cout << b[i];
		}
		if(!ca && cb || ca && cb){
			cout << '\r' << '\n' << b;
		}

		if(ca && !cb){
			cout << '\r' << '\n';
			for(int i = 0; i < b.length(); i++)
				if(b[i] != ' ')
					cout << b[i];
		}

		ca = cb;
	}

	return 0;
}


/*#include<iostream>
#include<stdio.h>
#include<string>
#include<queue>
#include<math.h>
#include<vector>
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define vpii vector<pii>

using namespace std;
int n,x,y;

int main(){
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	cin >> n >> x >> y;
	int c;
	if(y*n % 100 == 0){
		c = y*n/100 - x;
	}else{
		c = (int)ceil(1.0*y*n/100.0) - x;
	}

	if(c > 0)
		cout << c;
	else
		cout << 0;
	return 0;
}*/
#include<iostream>
#include<stdio.h>
#include<string>
#include<queue>
#include<math.h>
#include<vector>
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define vpii vector<pii>

using namespace std;
int n,x,y;

bool readline(istream &in, string &s){
	s = "";
	char t;
	bool com = 0, first = 1;
	in >> noskipws;

	while(in >> t){
		if(first && t != '\r' && t != '\n' && t != ' ') {
			if(t == '#')
				com = 1;
			else
				com = 0;
			first = false;
		}
		if (t != '\r' && t != '\n')
			s += t;
		else break;
	}
	return com;
}

int main(){
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	string a,b;
	bool ca, cb;

	ca = readline(cin, a);
	if(ca){
		cout << a;
	}else{
		for(int i = 0; i < a.length(); i++)
			if(a[i] != ' ')
				cout << a[i];
	}

	while(!cin.eof()){
		cb = readline(cin, b);
		if(!ca && !cb){
			for(int i = 0; i < b.length(); i++)
				if(b[i] != ' ')
					cout << b[i];
		}
		if(!ca && cb || ca && cb){
			cout << '\r' << '\n' << b;
		}

		if(ca && !cb){
			cout << '\r' << '\n';
			for(int i = 0; i < b.length(); i++)
				if(b[i] != ' ')
					cout << b[i];
		}

		ca = cb;
	}

	return 0;
}


/*#include<iostream>
#include<stdio.h>
#include<string>
#include<queue>
#include<math.h>
#include<vector>
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define vpii vector<pii>

using namespace std;
int n,x,y;

int main(){
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	cin >> n >> x >> y;
	int c;
	if(y*n % 100 == 0){
		c = y*n/100 - x;
	}else{
		c = (int)ceil(1.0*y*n/100.0) - x;
	}

	if(c > 0)
		cout << c;
	else
		cout << 0;
	return 0;
}*/
#include<iostream>
#include<stdio.h>
#include<string>
#include<queue>
#include<math.h>
#include<vector>
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define vpii vector<pii>

using namespace std;
int n,x,y;
char last = '\0';

bool readline(istream &in, string &s){
	s = "";
	char t;
	bool com = 0, first = 1;
	in >> noskipws;
	last = '\0';

	while(in >> t){
		if(first && t != '\r' && t != '\n' && t != ' ') {
			if(t == '#')
				com = 1;
			else
				com = 0;
			first = false;
		}
		if (t != '\r' && t != '\n')
			s += t;
		else{
			last = t;
			break;
		}
	}
	return com;
}

int main(){
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	string a,b;
	bool ca, cb;

	ca = readline(cin, a);
	if(ca){
		//cout << a;
		printf("%s", a.c_str());
	}else{
		for(int i = 0; i < a.length(); i++)
			if(a[i] != ' ')
				cout << a[i];
	}

	while(!cin.eof()){
		cb = readline(cin, b);
		if(!ca && !cb){
			for(int i = 0; i < b.length(); i++)
				if(b[i] != ' ')
					cout << b[i];
		}
		if(!ca && cb || ca && cb){
			cout << '\n' << b;
		}

		if(ca && !cb){
			cout << '\n' ;
			for(int i = 0; i < b.length(); i++)
				if(b[i] != ' ')
					cout << b[i];
		}

		ca = cb;
	}
	if(last != '\0') cout << last;

	return 0;
}
/*#include<iostream>
#include <iomanip>
#include<stdio.h>
#include<string>
#include<algorithm>
#include<queue>
#include<math.h>
#include<vector>
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define vpii vector<pii>
#define v second
#define tm first

using namespace std;
int n,a,d;
int t, v;
double ta, tb, va, vb;

vpii troll;

int main(){
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	cin >> n >> a >> d;
	for(int i = 0; i < n; i++){
		cin >> t >> v;
		troll.pb(mp(t,v));
	}

	//sort(troll.begin(), troll. end());

	double ch = sqrt(2.0*d/a);
	if(troll[0].v/a < ch){
		ta = 1.0*troll[0].tm + troll[0].v*1.0/(2*a) + d*1.0/troll[0].v;
	}else{
		ta = troll[0].tm + ch;
	}
	//cout << setprecision(15) << ta << endl;
	printf("%.5lf\n", ta);
	va = troll[0].v;

	for(int i = 1 ; i <n; i++){
		if(troll[i].v > troll[i-1].v ){ // ����� ������
			double inter = (troll[i].v - troll[i-1].v)/(a*2.0) + (troll[i].v*troll[i].tm)/(troll[i].v - troll[i-1].v);
			if(inter < ta){
				printf("%.5lf\n", ta);
			}else{
				if(troll[0].v/a < ch){
					ta = troll[i].tm + troll[i].v*1.0/(2*a) + d*1.0/troll[i].v;
				}else{
					ta = troll[i].tm + ch;
				}
				printf("%.5lf\n", ta);
			}
		}else{
			if(troll[0].v/a < ch){
				ta = troll[i].tm + troll[i].v*1.0/(2*a) + d*1.0/troll[i].v;
			}else{
				ta = troll[i].tm + ch;
			}
			printf("%.5lf\n", ta);
		}
	}

	return 0;
}*/