#include <algorithm>
#include <vector>
#include <string>

#include <cstdio>
#include <cstring>
#include <cmath>

using namespace std;

const int MAX = 52;

int n, D;

int X[ MAX ];
int Y[ MAX ];

long long V[ 2*MAX ];
vector< pair< int, long long > > Sol;

inline long long visina( int a, int b, int x )
{
    return Y[a] + ( long long )( Y[b] - Y[a] ) / ( X[b] - X[a] ) * ( x - X[a] );
}

long long get( int x )
{
    for( int i = 1; i < n; ++i )
        if( X[i-1] <= x && x <= X[i] )
            return visina( i-1, i, x );

    if( x < X[0] ) return visina( 0, 1, x );
    return visina( n-2, n-1, x );
}

void ispisi( int x )
{
    for( int i = -D; i <= D; ++i )
        V[i+D] = get( x + i );

    sort( V, V+2*D+1 );
    Sol.push_back( pair< int, long long >( x, V[D] ) );
}

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

    for( int i = 0; i < n; ++i )
        scanf( "%d %d", X + i, Y + i );

    scanf( "%d", &D );

    int pos = X[0] - D - 1;

    for( int i = 0; i < n; ++i ) {
        if( pos < X[i] - D ) pos = X[i] - D;
        for( ; pos <= X[i] + D; ++pos ) ispisi( pos );
    }

    printf( "%d\n", Sol.size() );

    for( int i = 0; i < ( int )Sol.size(); ++i )
        printf( "%d %lld\n", Sol[i].first, Sol[i].second );

    return 0;
}

