#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <algorithm>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <cstdlib>
#include <string>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cassert>
#include <climits>
//#include <ext/hash_map>

using namespace std;
using namespace __gnu_cxx;

#define REP(i,n) for(int i = 0; i < int(n); ++i)
#define REPV(i, n) for (int i = (n) - 1; (int)i >= 0; --i)
#define FOR(i, a, b) for(int i = (int)(a); i <= (int)(b); ++i)
#define FORV(i, a, b) for(int i = (int)(a); i >= (int)(b); --i)

#define FE(i,t) for (typeof((t).begin())i=(t).begin();i!=(t).end();++i)
#define FEV(i,t) for (typeof((t).rbegin())i=(t).rbegin();i!=(t).rend();++i)

#define two(x) (1LL << (x))
#define ALL(a) (a).begin(), (a).end()

#define pb push_back
#define ST first
#define ND second
#define MP(x,y) make_pair(x, y)

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<string> vs;

template<class T> void checkmin(T &a, T b){if (b<a)a=b;}
template<class T> void checkmax(T &a, T b){if (b>a)a=b;}
template<class T> void out(T t[], int n){REP(i, n)cout<<t[i]<<" "; cout<<endl;}
template<class T> void out(vector<T> t, int n=-1){for (int i=0; i<(n==-1?t.size():n); ++i) cout<<t[i]<<" "; cout<<endl;}
inline int count_bit(int n){return (n==0)?0:1+count_bit(n&(n-1));}
inline int low_bit(int n){return (n^n-1)&n;}
inline int ctz(int n){return (n==0?-1:ctz(n>>1)+1);}
int toInt(string s){int a; istringstream(s)>>a; return a;}
string toStr(int a){ostringstream os; os<<a; return os.str();}

const ll inf=5*1000000000000000000LL;

ll gcd(ll a, ll b){return !b?a:gcd(b, a%b);}
ll bezout(ll a, ll ua, ll va, ll b, ll ub, ll vb, ll &u, ll &v){
    if (!b){ u=ua; v=va; return a; }
    return bezout(b, ub, vb, a%b, ua-(a/b)*ub, va-(a/b)*vb, u, v);
}

int solve(ll a, ll b, ll c, ll &x, ll &y){
    if (abs(a)<abs(b)) return solve(b, a, c, y, x);
    if (b==0){
        if (abs(c)<abs(a) || c%a) return -1;
        x=-c/a; y=0;
        return 0;
    }
    ll d=gcd(abs(a), abs(b));
    c=-c;
    if (abs(c)<d || abs(c)%d) return 1;
    ll u, v;
    d=bezout(a, 1, 0, b, 0, 1, u ,v);
    ll ka=b/d, kb=-a/d;
    u*=c/d; v*=c/d;
    ka*=c/d; kb*=c/d;

    ll xa, xb, ya, yb;
    if (ka<0){
        xa=(u-inf)/-ka;
        xb=(u+inf)/-ka;
    }else{
        xb=(u+inf)/ka;
        xa=(u-inf)/ka;
    }
    if (kb<0){
        ya=(v-inf)/-kb;
        yb=(v+inf)/-kb;
    }else{
        yb=(v+inf)/kb;
        ya=(v-inf)/kb;
    }

    checkmax(xa, ya);
    checkmin(xb, yb);
    if (xa>xb) return 1;
    xa=(xa+xb)/2;

    x=u+ka*xa;
    y=v+kb*xa;
    return 0;
}

int main(){
    ll a, b, c;
    cin>>a>>b>>c;
    ll x, y;
    if (solve(a, b, c, x, y)) printf("-1\n");
    else cout<<x<<" "<<y<<endl;

    return 0;
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <algorithm>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <cstdlib>
#include <string>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cassert>
#include <climits>
//#include <ext/hash_map>

using namespace std;
using namespace __gnu_cxx;

#define REP(i,n) for(int i = 0; i < int(n); ++i)
#define REPV(i, n) for (int i = (n) - 1; (int)i >= 0; --i)
#define FOR(i, a, b) for(int i = (int)(a); i <= (int)(b); ++i)
#define FORV(i, a, b) for(int i = (int)(a); i >= (int)(b); --i)

#define FE(i,t) for (typeof((t).begin())i=(t).begin();i!=(t).end();++i)
#define FEV(i,t) for (typeof((t).rbegin())i=(t).rbegin();i!=(t).rend();++i)

#define two(x) (1LL << (x))
#define ALL(a) (a).begin(), (a).end()

#define pb push_back
#define ST first
#define ND second
#define MP(x,y) make_pair(x, y)

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<string> vs;

template<class T> void checkmin(T &a, T b){if (b<a)a=b;}
template<class T> void checkmax(T &a, T b){if (b>a)a=b;}
template<class T> void out(T t[], int n){REP(i, n)cout<<t[i]<<" "; cout<<endl;}
template<class T> void out(vector<T> t, int n=-1){for (int i=0; i<(n==-1?t.size():n); ++i) cout<<t[i]<<" "; cout<<endl;}
inline int count_bit(int n){return (n==0)?0:1+count_bit(n&(n-1));}
inline int low_bit(int n){return (n^n-1)&n;}
inline int ctz(int n){return (n==0?-1:ctz(n>>1)+1);}
int toInt(string s){int a; istringstream(s)>>a; return a;}
string toStr(int a){ostringstream os; os<<a; return os.str();}

const ll inf=5*1000000000000000000LL;

ll gcd(ll a, ll b){return !b?a:gcd(b, a%b);}
ll bezout(ll a, ll ua, ll va, ll b, ll ub, ll vb, ll &u, ll &v){
    if (!b){ u=ua; v=va; return a; }
    return bezout(b, ub, vb, a%b, ua-(a/b)*ub, va-(a/b)*vb, u, v);
}

int solve(ll a, ll b, ll c, ll &x, ll &y){
    if (abs(a)<abs(b)) return solve(b, a, c, y, x);
    ll d=gcd(abs(a), abs(b));
    c=-c;
    if (abs(c)<d || abs(c)%d) return 1;
    ll u, v;
    d=bezout(a, 1, 0, b, 0, 1, u ,v);
    ll ka=b/d, kb=-a/d;
    u*=c/d; v*=c/d;
    ka*=c/d; kb*=c/d;

    ll xa, xb, ya, yb;
    if (ka<0){
        xa=(u-inf)/-ka;
        xb=(u+inf)/-ka;
    }else{
        xb=(u+inf)/ka;
        xa=(u-inf)/ka;
    }
    if (kb<0){
        ya=(v-inf)/-kb;
        yb=(v+inf)/-kb;
    }else{
        yb=(v+inf)/kb;
        ya=(v-inf)/kb;
    }

    checkmax(xa, ya);
    checkmin(xb, yb);
    if (xa>xb) return 1;
    xa=(xa+xb)/2;

    x=u+ka*xa;
    y=v+kb*xa;
    return 0;
}

int main(){
    ll a, b, c;
    cin>>a>>b>>c;
    ll x, y;
    if (solve(a, b, c, x, y)) printf("-1\n");
    else{
        printf("%Ld\n", a*x+b*y+c);
        cout<<x<<" "<<y<<endl;
    }
    return 0;
}


#include <stdio.h>
    #include <stdlib.h>
    #include <iostream>
    long long x,y;
    long long eGCD(long long a,long long b)
   {
        if(b == 0)
       {
           x = 1;
           y = 0;
          return a;
      }
     else
     {
         long long gcd;
         gcd = eGCD(b,a%b);
        //y = x - q*y;
         //x = y;

          long long aux = x;
           x = y;
         y = aux - (a/b)*x;
         return gcd;
    }
   }
  int main()
  {
     long long a,b,c,gcd;
     //scanf("%lld%lld%lld",&a,&b,&c);
    std::cin >> a >> b >> c;
     gcd = eGCD(a,b);
     if(abs(-c) % gcd == 0)
     {
         long long f = (-c) / gcd;
          //printf("%lld %lld\n",x*f,y*f);
         std::cout << x*f << " " << y*f << std::endl;
     }
     else
         printf("-1\n");
     return 0;
}


#include <iostream>
#include <cstdlib>
#include <cstdio>
using namespace std;
 long long x,y;

 long long eGCD(long long a, long long b){
     if(b==0){
         x=1;
         y=0;
         return a;
     }
     else{
         long long q,r,ret,aux;
         q=a/b;
         r=a%b;
         ret=eGCD(b,r);
         aux=x;
         x=y;
         y=aux-(q*x);
         return ret;
     }
 }

 int main(){
     //freopen("7C.out","w",stdout);
     long long a,b,c,gcd,f;
     cin>>a>>b>>c;
     gcd=eGCD(a,b);
     if(abs(-c)%gcd==0){
         f=-c/gcd;
        cout<<x*f<<" "<<y*f<<endl;
     }
     else
          cout<<-1<<endl;
     return 0;
 }


#include <stdio.h>
#include <stdlib.h>
long long x,y;
long long eGCD(long long a,long long b)
{
    if(b == 0)
    {
        x = 1;
        y = 0;
        return a;
    }
    else
    {
        long long q,r,ret;
        q = a / b;
        r = a % b;
        ret = eGCD(b,r);
        //y = x - q*y;
        //x = y;

        long long aux = x;
        x = y;
        y = aux - q*x;
        return ret;
    }
}
int main()
{
    long long a,b,c,gcd;
    scanf("%lld%lld%lld",&a,&b,&c);
    gcd = eGCD(a,b);
    if(abs(-c) % gcd == 0)
    {
        long long f = -c / gcd;
        printf("%lld %lld\n",x*f,y*f);
    }
    else
        printf("-1\n");
    return 0;
}


#include <stdio.h>
#include <stdlib.h>
long long x,y;
long long eGCD(long long a,long long b)
{
    if(b == 0)
    {
        x = 1;
        y = 0;
        return a;
    }
    else
    {
        long long q,r,ret;
        q = a / b;
        r = a % b;
        ret = eGCD(b,r);
        //y = x - q*y;
        //x = y;

        long long aux = x;
        x = y;
        y = aux - q*x;
        return ret;
    }
}
int main()
{
    //freopen("in","r",stdin);
    long long a,b,c,gcd;
    scanf("%lld%lld%lld",&a,&b,&c);
    gcd = eGCD(a,b);
    if(abs(-c) % gcd == 0)
    {
        long long f = -c / gcd;
        printf("%lld %lld\n",x*f,y*f);
    }
    else
        printf("-1\n");
    return 0;
}


#include <stdio.h>
#include <stdlib.h>
#include <iostream>
long long x,y;
long long eGCD(long long a,long long b)
{
    if(b == 0)
    {
        x = 1;
        y = 0;
        return a;
    }
    else
    {
        long long q,r,ret;
        q = a / b;
        r = a % b;
        ret = eGCD(b,r);
        //y = x - q*y;
        //x = y;

        long long aux = x;
        x = y;
        y = aux - q*x;
        return ret;
    }
}
int main()
{
    //freopen("in","r",stdin);
    long long a,b,c,gcd;
    //scanf("%lld%lld%lld",&a,&b,&c);
    std::cin >> a >> b >> c;
    gcd = eGCD(a,b);
    if(abs(-c) % gcd == 0)
    {
        long long f = (-c) / gcd;
        printf("%lld %lld\n",x*f,y*f);
    }
    else
        printf("-1\n");
    return 0;
}


#include <stdio.h>
#include <stdlib.h>
#include <iostream>
long long x,y;
long long eGCD(long long a,long long b)
{
    if(b == 0)
    {
        x = 1;
        y = 0;
        return a;
    }
    else
    {
        long long q,r,ret;
        q = a / b;
        r = a % b;
        ret = eGCD(b,r);
        //y = x - q*y;
        //x = y;

        long long aux = x;
        x = y;
        y = aux - q*x;
        return ret;
    }
}
int main()
{
    long long a,b,c,gcd;
    //scanf("%lld%lld%lld",&a,&b,&c);
    std::cin >> a >> b >> c;
    gcd = eGCD(a,b);
    if(abs(-c) % gcd == 0)
    {
        long long f = (-c) / gcd;
        //printf("%lld %lld\n",x*f,y*f);
        std::cout << x*f << " " << y*f << std::endl;
    }
    else
        printf("-1\n");
    return 0;
}


#include <stdio.h>
    #include <stdlib.h>
    #include <iostream>
    long long x,y;
    long long eGCD(long long a,long long b)
   {
        if(b == 0)
       {
           x = 1;
           y = 0;
          return a;
      }
     else
     {
         long long gcd,x1,y1;
         gcd = eGCD(b,a%b);
        //y = x - q*y;
         //x = y;
         x1 = x;
         y1 = y;

          //long long aux = x;
           //x = y;
         //y = aux - (a/b)*x;
                     x = y1;
            y = x1 - (a/b)*y1;
         return gcd;
    }
   }
  int main()
  {
     long long a,b,c,gcd;
     //scanf("%lld%lld%lld",&a,&b,&c);
    std::cin >> a >> b >> c;
     gcd = eGCD(a,b);
     if(abs(-c) % gcd == 0)
     {
         long long f = (-c) / gcd;
          //printf("%lld %lld\n",x*f,y*f);
         std::cout << x*f << " " << y*f << std::endl;
     }
     else
         printf("-1\n");
     return 0;
}


#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>

using namespace std;

typedef long long LL;

LL exgcd ( LL a , LL b  , LL &x , LL &y )
{
    if ( b == 0 )
    {
        x = 1;
        y = 0;
        return a;
    }
    LL r = exgcd ( b , a%b , x , y );
    LL t = x;
    x = y;
    y = t - a/b*y;
    return r;
}

LL a,b,c,x,y;

int main ( )
{
    while ( ~scanf ( "%lld%lld%lld" , &a , &b , &c ) )
    {
        c = -c;
        if ( a < 0 ) a = -a , c = -c;
        if ( b < 0 ) b = -b , c = -c;
        LL r = exgcd ( a , b , x , y );
        if ( c%r ) puts ( "-1" );
        else
        {
            x *= c;
            y *= c;
            printf ( "%I64d %I64d\n" , x , y );
        }
    }
}


#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>

using namespace std;

typedef long long LL;

LL exgcd ( LL a , LL b  , LL &x , LL &y )
{
    if ( b == 0 )
    {
        x = 1;
        y = 0;
        return a;
    }
    LL r = exgcd ( b , a%b , x , y );
    LL t = x;
    x = y;
    y = t - a/b*y;
    return r;
}

LL a,b,c,x,y;

int main ( )
{
    while ( ~scanf ( "%lld%lld%lld" , &a , &b , &c ) )
    {
        LL r = exgcd ( a , b , x , y );
        if ( c%r ) puts ( "-1" );
        else
        {
            x *= c;
            y *= c;
            LL ll = -5LL*(1e18);
            LL rr = -ll;
            LL lk = (ll-x)/b;
            LL rk = (rr-x)/b;
            LL llk = (ll-y)/a;
            LL rrk = (rr-y)/a;
            LL minn = max ( lk , llk );
            LL maxn = min ( rk , rrk );
            //cout << minn << " " << maxn << endl;
            if ( minn <= maxn )
            {
                x += minn*b;
                y += minn*a;
                printf ( "%I64d %I64d\n" , x , y );
            }
            else puts ( "-1" );
        }
    }
}


#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>

using namespace std;

typedef long long LL;

LL exgcd ( LL a , LL b  , LL &x , LL &y )
{
    if ( b == 0 )
    {
        x = 1;
        y = 0;
        return a;
    }
    LL r = exgcd ( b , a%b , x , y );
    LL t = x;
    x = y;
    y = t - a/b*y;
    return r;
}

LL a,b,c,x,y;

int main ( )
{
    while ( ~scanf ( "%lld%lld%lld" , &a , &b , &c ) )
    {
        c = -c;
        LL r = exgcd ( a , b , x , y );
        if ( c%r ) puts ( "-1" );
        else
        {
            x *= c/r;
            y *= c/r;
            printf ( "%I64d %I64d\n" , x , y );
        }
    }
}


#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>

using namespace std;

typedef long long LL;

LL exgcd ( LL a , LL b  , LL &x , LL &y )
{
    if ( b == 0 )
    {
        x = 1;
        y = 0;
        return a;
    }
    LL r = exgcd ( b , a%b , x , y );
    LL t = x;
    x = y;
    y = t - a/b*y;
    return r;
}

LL a,b,c,x,y;

int main ( )
{
    while ( ~scanf ( "%lld%lld%lld" , &a , &b , &c ) )
    {
        LL r = exgcd ( a , b , x , y );
        if ( c%r ) puts ( "-1" );
        else
        {
            x *= c;
            y *= c;
            printf ( "%I64d %I64d\n" , x , y );
            /*LL ll = -5LL*(1e18);
            LL rr = -ll;
            LL lk = (ll-x)/b;
            LL rk = (rr-x)/b;
            LL llk = (ll-y)/a;
            LL rrk = (rr-y)/a;
            LL minn = max ( lk , llk );
            LL maxn = min ( rk , rrk );
            //cout << minn << " " << maxn << endl;
            if ( minn <= maxn )
            {
                x += minn*b;
                y += minn*a;
                printf ( "%I64d %I64d\n" , x , y );
            }
            else puts ( "-1" );*/
        }
    }
}


#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>

using namespace std;

typedef long long LL;

LL exgcd ( LL a , LL b  , LL &x , LL &y )
{
    if ( b == 0 )
    {
        x = 1;
        y = 0;
        return a;
    }
    LL r = exgcd ( b , a%b , x , y );
    LL t = x;
    x = y;
    y = t - a/b*y;
    return r;
}

LL a,b,c,x,y;

int main ( )
{
    while ( ~scanf ( "%lld%lld%lld" , &a , &b , &c ) )
    {
        LL r = exgcd ( a , b , x , y );
        if ( c%r ) puts ( "-1" );
        else
        {
            x *= -c;
            y *= -c;
            printf ( "%I64d %I64d\n" , x , y );
            /*LL ll = -5LL*(1e18);
            LL rr = -ll;
            LL lk = (ll-x)/b;
            LL rk = (rr-x)/b;
            LL llk = (ll-y)/a;
            LL rrk = (rr-y)/a;
            LL minn = max ( lk , llk );
            LL maxn = min ( rk , rrk );
            //cout << minn << " " << maxn << endl;
            if ( minn <= maxn )
            {
                x += minn*b;
                y += minn*a;
                printf ( "%I64d %I64d\n" , x , y );
            }
            else puts ( "-1" );*/
        }
    }
}


#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>

using namespace std;

typedef long long LL;

LL exgcd ( LL a , LL b  , LL &x , LL &y )
{
    if ( b == 0 )
    {
        x = 1;
        y = 0;
        return a;
    }
    LL r = exgcd ( b , a%b , x , y );
    LL t = x;
    x = y;
    y = t - a/b*y;
    return r;
}

LL a,b,c,x,y;

int main ( )
{
    while ( ~scanf ( "%lld%lld%lld" , &a , &b , &c ) )
    {
        c = -c;
        if ( a < 0 ) a = -a , c = -c;
        //if ( b < 0 ) b = -b , c = -c;
        LL r = exgcd ( a , b , x , y );
        if ( c%r ) puts ( "-1" );
        else
        {
            x *= c;
            y *= c;
            printf ( "%I64d %I64d\n" , x , y );
        }
    }
}


#include<stdio.h>
int xgcd(long long a,long long b,long long &x,long long &y){
    if(b==0){
        x=1;y=0;
        return a;
    }
    int r=xgcd(b,a%b,x,y);
    int t=x;x=y;y=t-a/b*y;
    return r;
}
long long gcd(long long a,long long b){
    return b?gcd(b,a%b):a;
}
int main(){
    long long a,b,c,x,y;
    while(~scanf("%lld%lld%lld",&a,&b,&c)){
        if(a<0)
            a=-a;
        if(b<0)
            b=-b;
        if(a==0){
            if(c%b==0||b%c==0)
                printf("0 %lld\n",-c/b);
            else
                printf("-1\n");
        }
        else{
            if(b==0){
                if(c%a==0||a%c==0)
                    printf("%lld 0\n",-c/a);
                else
                    printf("-1\n");
            }
            else{
                if(c%gcd(a,b)==0){
                    if(b>a){
                       xgcd(a,b,x,y);
                    }
                    else{
                        xgcd(a,b,x,y);
                    }
                    printf("%lld %lld\n",c*x,c*y);
                }
                else
                    printf("-1\n");
            }

        }

    }
    return 0;
}


#include<stdio.h>
int xgcd(long long a,long long b,long long &x,long long &y){
    if(b==0){
        x=1;y=0;
        return a;
    }
    int r=xgcd(b,a%b,x,y);
    int t=x;x=y;y=t-a/b*y;
    return r;
}
long long gcd(long long a,long long b){
    return b?gcd(b,a%b):a;
}
int main(){
    long long a,b,c,x,y;
    while(~scanf("%lld%lld%lld",&a,&b,&c)){
        long long a1=a,b1=b;
        if(a<0)
            a=-a;
        if(b<0)
            b=-b;
        if(a==0){
            if(c%b==0||b%c==0)
                printf("0 %lld\n",-c/b);
            else
                printf("-1\n");
        }
        else{
            if(b==0){
                if(c%a==0||a%c==0)
                    printf("%lld 0\n",-c/a);
                else
                    printf("-1\n");
            }
            else{
                if(c%gcd(a,b)==0){
                    if(b>a){
                        xgcd(b,a,x,y);
                        c=c/gcd(c,gcd(a,b));
                        if(a1<0&&b1>0)
                            printf("%lld %lld\n",c*y,-c*x);
                        if(b1<0&&a1>0)
                            printf("%lld %lld\n",-c*y,c*x);
                        if(b1>0&&a1>0)
                            printf("%lld %lld\n",-c*y,-c*x);
                        if(b1<0&&a1<0)
                            printf("%lld %lld\n",c*y,c*x);

                    }
                    else{
                        xgcd(a,b,x,y);
                        if(a1<0&&b1>0)
                            printf("%lld %lld\n",c*x,-c*y);
                        if(b1<0&&a1>0)
                            printf("%lld %lld\n",-c*x,c*y);
                        if(b1>0&&a1>0)
                            printf("%lld %lld\n",-c*x,-c*y);
                        if(a1<0&&b1<0)
                            printf("%lld %lld\n",c*x,c*y);
                    }

                }
                else
                    printf("-1\n");
            }

        }

    }
    return 0;
}


#include<stdio.h>
int xgcd(long long a,long long b,long long &x,long long &y){
    if(b==0){
        x=1;y=0;
        return a;
    }
    int r=xgcd(b,a%b,x,y);
    int t=x;x=y;y=t-a/b*y;
    return r;
}
long long gcd(long long a,long long b){
    return b?gcd(b,a%b):a;
}
int main(){
    long long a,b,c,x,y;
    while(~scanf("%lld%lld%lld",&a,&b,&c)){
        long long a1=a,b1=b;

        if(a<0)
            a=-a;
        if(b<0)
            b=-b;
        if(a==0){
            if(c%b==0||b%c==0)
                printf("0 %lld\n",-c/b);
            else
                printf("-1\n");
        }
        else{
            if(b==0){
                if(c%a==0||a%c==0)
                    printf("%lld 0\n",-c/a);
                else
                    printf("-1\n");
            }
            else{
                if(c%gcd(a,b)==0){
                    if(b>a){
                        xgcd(b,a,x,y);
                        if(a1<0&&b1>0)
                            printf("%lld %lld\n",c*y,-c*x);
                        if(b1<0&&a1>0)
                            printf("%lld %lld\n",-c*y,c*x);
                        if(b1>0&&a1>0)
                            printf("%lld %lld\n",-c*y,-c*x);
                        if(b1<0&&a1<0)
                            printf("%lld %lld\n",c*y,c*x);

                    }
                    else{
                        xgcd(a,b,x,y);
                        if(a1<0&&b1>0)
                            printf("%lld %lld\n",c*x,-c*y);
                        if(b1<0&&a1>0)
                            printf("%lld %lld\n",-c*x,c*y);
                        if(b1>0&&a1>0)
                            printf("%lld %lld\n",-c*x,-c*y);
                        if(a1<0&&b1<0)
                            printf("%lld %lld\n",c*x,c*y);
                    }

                }
                else
                    printf("-1\n");
            }

        }

    }
    return 0;
}


#include<stdio.h>
int xgcd(long long a,long long b,long long &x,long long &y){
    if(b==0){
        x=1;y=0;
        return a;
    }
    int r=xgcd(b,a%b,x,y);
    int t=x;x=y;y=t-a/b*y;
    return r;
}
long long gcd(long long a,long long b){
    return b?gcd(b,a%b):a;
}
int main(){
    long long a,b,c,x,y;
    while(~scanf("%lld%lld%lld",&a,&b,&c)){
        long long a1=a,b1=b;

        if(a<0)
            a=-a;
        if(b<0)
            b=-b;
        if(a==0){
            if(c%b==0||b%c==0)
                printf("0 %lld\n",-c/b);
            else
                printf("-1\n");
        }
        else{
            if(b==0){
                if(c%a==0||a%c==0)
                    printf("%lld 0\n",-c/a);
                else
                    printf("-1\n");
            }
            else{
                if(c%gcd(a,b)==0){
                    if(b>a){
                        xgcd(b,a,x,y);
                        if(a1<0&&b1>0)
                            printf("%lld %lld\n",c*y,-c*x);
                        if(b1<0&&a1>0)
                            printf("%lld %lld\n",-c*y,c*x);
                        if(b1>0&&a1>0)
                            printf("%lld %lld\n",-c*y,-c*x);
                        if(b1<0&&a1<0)
                            printf("%lld %lld\n",c*y,c*x);

                    }
                    else{
                        xgcd(a,b,x,y);
                        if(a1<0&&b1>0)
                            printf("%lld %lld\n",-c*x,c*y);
                        if(b1<0&&a1>0)
                            printf("%lld %lld\n",-c*x,c*y);
                        if(b1>0&&a1>0)
                            printf("%lld %lld\n",-c*x,-c*y);
                        if(a1<0&&b1<0)
                            printf("%lld %lld\n",c*x,c*y);
                    }

                }
                else
                    printf("-1\n");
            }

        }

    }
    return 0;
}


#include<stdio.h>
int xgcd(long long a,long long b,long long &x,long long &y){
    if(b==0){
        x=1;y=0;
        return a;
    }
    int r=xgcd(b,a%b,x,y);
    int t=x;x=y;y=t-a/b*y;
    return r;
}
long long gcd(long long a,long long b){
    return b?gcd(b,a%b):a;
}
int main(){
    long long a,b,c,x,y;
    while(~scanf("%lld%lld%lld",&a,&b,&c)){
        long long a1=a,b1=b;
        if(a<0)
            a=-a;
        if(b<0)
            b=-b;
        if(a1==0){
            if(c%b1==0||b1%c==0)
                printf("0 %lld\n",-c/b1);
            else
                printf("-1\n");
        }
        else{
            if(b1==0){
                if(c%a1==0||a1%c==0)
                    printf("%lld 0\n",-c/a1);
                else
                    printf("-1\n");
            }
            else{
                if(c%gcd(a,b)==0){
                    c=c/gcd(a,b);
                    if(b>a){
                        xgcd(b,a,x,y);
                        if(a1<0&&b1>0)
                            printf("%lld %lld\n",c*y,-c*x);
                        if(b1<0&&a1>0)
                            printf("%lld %lld\n",-c*y,c*x);
                        if(b1>0&&a1>0)
                            printf("%lld %lld\n",-c*y,-c*x);
                        if(b1<0&&a1<0)
                            printf("%lld %lld\n",c*y,c*x);

                    }
                    else{
                        xgcd(a,b,x,y);
                        if(a1<0&&b1>0)
                            printf("%lld %lld\n",c*x,-c*y);
                        if(b1<0&&a1>0)
                            printf("%lld %lld\n",-c*x,c*y);
                        if(b1>0&&a1>0)
                            printf("%lld %lld\n",-c*x,-c*y);
                        if(a1<0&&b1<0)
                            printf("%lld %lld\n",c*x,c*y);
                    }

                }
                else
                    printf("-1\n");
            }

        }

    }
    return 0;
}


#include<stdio.h>
int xgcd(long long a,long long b,long long &x,long long &y){
    if(b==0){
        x=1;y=0;
        return a;
    }
    int r=xgcd(b,a%b,x,y);
    int t=x;x=y;y=t-a/b*y;
    return r;
}
long long gcd(long long a,long long b){
    return b?gcd(b,a%b):a;
}
int main(){
    long long a,b,c,x,y;
    while(~scanf("%lld%lld%lld",&a,&b,&c)){
        if(a<0)
            a=-a;
        if(b<0)
            b=-b;
        if(a==0){
            if(c%b==0||b%c==0)
                printf("0 %lld\n",-c/b);
            else
                printf("-1\n");
        }
        else{
            if(b==0){
                if(c%a==0||a%c==0)
                    printf("%lld 0\n",-c/a);
                else
                    printf("-1\n");
            }
            else{
                if(c%gcd(a,b)==0){
                    if(b>a){
                        xgcd(b,a,x,y);
                        printf("%lld %lld\n",-c*y,-c*x);
                    }
                    else{
                        xgcd(a,b,x,y);
                        printf("%lld %lld\n",-c*x,-c*y);
                    }

                }
                else
                    printf("-1\n");
            }

        }

    }
    return 0;
}


#include<stdio.h>
int xgcd(long long a,long long b,long long &x,long long &y){
    if(b==0){
        x=1;y=0;
        return a;
    }
    int r=xgcd(b,a%b,x,y);
    int t=x;x=y;y=t-a/b*y;
    return r;
}
long long gcd(long long a,long long b){
    return b?gcd(b,a%b):a;
}
int main(){
    long long a,b,c,x,y;
    while(~scanf("%lld%lld%lld",&a,&b,&c)){
        long long a1=a,b1=b;
        if(a<0)
            a=-a;
        if(b<0)
            b=-b;
        if(a==0){
            if(c%b==0||b%c==0)
                printf("0 %lld\n",-c/b);
            else
                printf("-1\n");
        }
        else{
            if(b==0){
                if(c%a==0||a%c==0)
                    printf("%lld 0\n",-c/a);
                else
                    printf("-1\n");
            }
            else{
                if(c%gcd(a,b)==0){
                    c=c/gcd(a,b);
                    if(b>a){
                        xgcd(b,a,x,y);
                        if(a1<0&&b1>0)
                            printf("%lld %lld\n",c*y,-c*x);
                        if(b1<0&&a1>0)
                            printf("%lld %lld\n",-c*y,c*x);
                        if(b1>0&&a1>0)
                            printf("%lld %lld\n",-c*y,-c*x);
                        if(b1<0&&a1<0)
                            printf("%lld %lld\n",c*y,c*x);

                    }
                    else{
                        xgcd(a,b,x,y);
                        if(a1<0&&b1>0)
                            printf("%lld %lld\n",c*x,-c*y);
                        if(b1<0&&a1>0)
                            printf("%lld %lld\n",-c*x,c*y);
                        if(b1>0&&a1>0)
                            printf("%lld %lld\n",-c*x,-c*y);
                        if(a1<0&&b1<0)
                            printf("%lld %lld\n",c*x,c*y);
                    }

                }
                else
                    printf("-1\n");
            }

        }

    }
    return 0;
}


#include<stdio.h>
int xgcd(long long a,long long b,long long &x,long long &y){
    if(b==0){
        x=1;y=0;
        return a;
    }
    int r=xgcd(b,a%b,x,y);
    int t=x;x=y;y=t-a/b*y;
    return r;
}
long long gcd(long long a,long long b){
    return b?gcd(b,a%b):a;
}
int main(){
    long long a,b,c,x,y;
    while(~scanf("%lld%lld%lld",&a,&b,&c)){
        long long a1=a,b1=b;

        if(a<0)
            a=-a;
        if(b<0)
            b=-b;
        if(a==0){
            if(c%b==0||b%c==0)
                printf("0 %lld\n",-c/b);
            else
                printf("-1\n");
        }
        else{
            if(b==0){
                if(c%a==0||a%c==0)
                    printf("%lld 0\n",-c/a);
                else
                    printf("-1\n");
            }
            else{
                if(c%gcd(a,b)==0){
                    if(b>a){
                        xgcd(b,a,x,y);
                        if(a1<0&&b1>0)
                            printf("%lld %lld\n",c*y,-c*x);
                        if(b1<0&&a1>0)
                            printf("%lld %lld\n",-c*y,c*x);
                        if(b1>0&&a1>0)
                            printf("%lld %lld\n",-c*y,-c*x);

                    }
                    else{
                        xgcd(a,b,x,y);
                        if(a1<0&&b1>0)
                            printf("%lld %lld\n",-c*x,c*y);
                        if(b1<0&&a1>0)
                            printf("%lld %lld\n",-c*x,c*y);
                        if(b1>0&&a1>0)
                            printf("%lld %lld\n",-c*x,-c*y);

                    }

                }
                else
                    printf("-1\n");
            }

        }

    }
    return 0;
}


//Line
#include<iostream>
#include<algorithm>

using namespace std;

long long tmax = 5000000000000000000;
//long long tmax = 50;

int main() {
  long long a, b, c;
  long long uf, ue, vf, ve;
  long long ua, ub, va, vb;
  cin >> a >> b >> c;
  if (a == 0) {
    if (c % b != 0) {
      cout << -1 << endl;
      return -1;
    }
    cout << 0 << " " << c / b << endl;
    return 0;
  }
  else if (b == 0) {
    if (c % a != 0) {
      cout << -1 << endl;
      return -1;
    }
    cout << c / a << " " << 0 << endl;
    return 0;
  }
  else {
    long long u[1000], v[1000];
    int n = 0;
    int e = a;
    int f = b;
    if (e < f) swap(e, f);
    while (f > 0) {
      u[n] = e;
      v[n] = f;
      e = f;
      f = u[n] % v[n];
      n ++;
    }
    //now the gcd(a, b) = e
    if (c % e != 0) {
      cout << -1 << endl;
      return -1;
    }
    //for (int i = 0; i < n; i ++) cout << u[i] << " " << v[i] << endl;
    long long alpha = -u[n - 1] / v[n - 1];
    long long beta = 1;
    ue = alpha; ve = beta;
    for (int i = n - 2; i >= 0; i --) {
      long long t = -(u[i] % v[i]);
      long long l = -(u[i] / v[i]);
      ue = alpha;
      ve = beta;
      alpha = alpha * t / v[i] + l * alpha;
      beta = (beta * t + 1) / v[i] + l * beta;
    }
    uf = alpha;
    vf = beta;
    if (a == e && b == f) {
      ua = ue;
      va = ve;
      ub = uf;
      vb = vf;
    }
    else {
      ua = uf;
      va = vf;
      ub = ue;
      vb = ve;
    }
    //cout << ua << " " << va << endl << ub << " " << vb << endl;
    ua = ua * (-c);
    va = va * (-c);
    ub = ub * (-c);
    vb = vb * (-c);
    long long delta;
    long long t1 = (tmax - va) / ua;
    long long t2 = (-tmax - va) / ua;
    long long maxa = max(t1, t2);
    long long mina = min(t1, t2);
    t1 = (tmax - vb) / ub;
    t2 = (-tmax - vb) / ub;
    long long maxb = max(t1, t2);
    long long minb = min(t1, t2);
    // cout << mina << " " << maxa << endl;
    // cout << minb << " " << maxb << endl;
    if (mina <= maxb && maxb <= maxa) delta = maxb;
    else if (mina <= minb && minb <= maxa) delta = minb;
    else if (minb <= maxa && maxa <= maxb) delta = maxa;
    else if (minb <= mina && mina <= maxb) delta = mina;
    else {
      cout << -1 << endl;
      return -1;
    }
    cout << ua * delta + va << " " << ub * delta + vb << endl;
  }
  return 0;
}


//Line
#include<iostream>
#include<algorithm>
#include<cmath>

using namespace std;

long long tmax = 5000000000000000000;
//long long tmax = 50;

int main() {
  long long a, b, c;
  long long uf, ue, vf, ve;
  long long ua, ub, va, vb;
  cin >> a >> b >> c;
  if (a == 0) {
    if (c % b != 0) {
      cout << "-1" << endl;
      return 0;
    }
    cout << 0 << " " << c / b << endl;
    return 0;
  }
  else if (b == 0) {
    if (c % a != 0) {
      cout << -1 << endl;
      return 0;
    }
    cout << c / a << " " << 0 << endl;
    return 0;
  }
  else {
    long long u[1000], v[1000];
    int n = 0;
    long long e = a;
    long long f = b;
    if (fabs(e) < fabs(f)) swap(e, f);
    while (f != 0) {
      u[n] = e;
      v[n] = f;
      e = f;
      f = u[n] % v[n];
      n ++;
    }
    //now the gcd(a, b) = e
    if (c % e != 0) {
      cout << -1 << endl;
      return 0;
    }
    //for (int i = 0; i < n; i ++) cout << u[i] << " " << v[i] << endl;
    long long alpha = -u[n - 1] / v[n - 1];
    long long beta = 1;
    ue = alpha; ve = beta;
    for (int i = n - 2; i >= 0; i --) {
      long long t = -(u[i] % v[i]);
      long long l = -(u[i] / v[i]);
      ue = alpha;
      ve = beta;
      alpha = alpha * t / v[i] + l * alpha;
      beta = (beta * t + 1) / v[i] + l * beta;
    }
    uf = alpha;
    vf = beta;
    if (a == e && b == f) {
      ua = ue;
      va = ve;
      ub = uf;
      vb = vf;
    }
    else {
      ua = uf;
      va = vf;
      ub = ue;
      vb = ve;
    }
    //cout << ua << " " << va << endl << ub << " " << vb << endl;
    ua = ua * (-c);
    va = va * (-c);
    ub = ub * (-c);
    vb = vb * (-c);
    //cout << ua << " " << va << endl;
    //cout << ub << " " << vb << endl;
    long long delta;
    long long t1 = (tmax - va) / ua;
    long long t2 = (-tmax - va) / ua;
    long long maxa = max(t1, t2);
    long long mina = min(t1, t2);
    //cout << t2 << endl;
    //cout << t2 * ua + va << endl;
    t1 = (tmax - vb) / ub;
    t2 = (-tmax - vb) / ub;
    long long maxb = max(t1, t2);
    long long minb = min(t1, t2);
    //cout << mina << " " << maxa << endl;
    //cout << minb << " " << maxb << endl;
    if (mina <= maxb && maxb <= maxa) delta = maxb;
    else if (mina <= minb && minb <= maxa) delta = minb;
    else if (minb <= maxa && maxa <= maxb) delta = maxa;
    else if (minb <= mina && mina <= maxb) delta = mina;
    else {
      cout << -1 << endl;
      return 0;
    }
    cout << ua * delta + va << " " << ub * delta + vb << endl;
  }
  return 0;
}


//Line
#include<iostream>
#include<algorithm>
#include<cmath>

using namespace std;

long long tmax = 5000000000000000000;
//long long tmax = 50;

long long gcd(long long, long long);

int main() {
  long long a, b, c;
  long long uf, ue, vf, ve;
  long long ua, ub, va, vb;
  cin >> a >> b >> c;
  long long d1 = gcd(a, b);
  long long d2 = gcd(d1, c);
  a = a / d2;
  b = b / d2;
  c = c / d2;
  if (a == 0) {
    if (c % b != 0) {
      cout << "-1" << endl;
      return 0;
    }
    cout << 0 << " " << -c / b << endl;
    return 0;
  }
  else if (b == 0) {
    if (c % a != 0) {
      cout << -1 << endl;
      return 0;
    }
    cout << -c / a << " " << 0 << endl;
    return 0;
  }
  else {
    long long u[1000], v[1000], z[1000];
    int n = 0;
    long long e = a;
    long long f = b;
    if (fabs(e) < fabs(f)) swap(e, f);
    long long ee = e;
    long long ff = f;
    while (f != 0) {
      u[n] = (-e) / f;
      v[n] = (-e) % f;
      z[n] = f;
      e = f;
      f = -v[n];
      n ++;
    }
    //now the gcd(a, b) = e
    if (c % e != 0) {
      cout << -1 << endl;
      return 0;
    }
    //for (int i = 0; i < n; i ++) cout << u[i] << " " << v[i] << " " << z[i] << endl;
    long long alpha = u[n - 1];
    long long beta = 1 / z[n - 1];
    ue = alpha; ve = beta;
    for (int i = n - 2; i >= 0; i --) {
      ue = alpha;
      ve = beta;
      alpha = alpha * v[i] / z[i] + u[i] * alpha;
      beta = (beta * v[i] + 1) / z[i] + u[i] * beta;
    }
    uf = alpha;
    vf = beta;
    //cout << b << endl << ff << endl;
    if (a == ee && b == ff) {
      ua = ue;
      va = ve;
      ub = uf;
      vb = vf;
    }
    else {
      ua = uf;
      va = vf;
      ub = ue;
      vb = ve;
    }
    //cout << ua << " " << va << endl << ub << " " << vb << endl;
    ua = ua * (-c);
    va = va * (-c);
    ub = ub * (-c);
    vb = vb * (-c);
    long long delta;
    long long t1 = (tmax - va) / ua;
    long long t2 = (-tmax - va) / ua;
    long long maxa = max(t1, t2);
    long long mina = min(t1, t2);
    //cout << t2 << endl;
    //cout << t2 * ua + va << endl;
    t1 = (tmax - vb) / ub;
    t2 = (-tmax - vb) / ub;
    long long maxb = max(t1, t2);
    long long minb = min(t1, t2);
    //cout << mina << " " << maxa << endl;
    //cout << minb << " " << maxb << endl;
    if (mina <= maxb && maxb <= maxa) delta = maxb;
    else if (mina <= minb && minb <= maxa) delta = minb;
    else if (minb <= maxa && maxa <= maxb) delta = maxa;
    else if (minb <= mina && mina <= maxb) delta = mina;
    else {
      cout << -1 << endl;
      return 0;
    }
    cout << ua * delta + va << " " << ub * delta + vb << endl;
  }
  return 0;
}

long long gcd(long long a, long long b) {
  if (a < 0) a = -a;
  if (b < 0) b = -b;
  if (a < b) swap(a, b);
  while (b > 0) {
    long long r = a % b;
    a = b;
    b = r;
  }
  return a;
}


//Line
#include<iostream>
#include<algorithm>
#include<cmath>

using namespace std;

long long tmax = 5000000000000000000;
//long long tmax = 50;

int main() {
  long long a, b, c;
  long long uf, ue, vf, ve;
  long long ua, ub, va, vb;
  cin >> a >> b >> c;
  if (a == 0) {
    if (c % b != 0) {
      cout << "-1" << endl;
      return 0;
    }
    cout << 0 << " " << c / b << endl;
    return 0;
  }
  else if (b == 0) {
    if (c % a != 0) {
      cout << -1 << endl;
      return 0;
    }
    cout << c / a << " " << 0 << endl;
    return 0;
  }
  else {
    long long u[1000], v[1000];
    int n = 0;
    int achanged = 1;
    int bchanged = 1;
    if (a < 0) {
      a = -a;
      achanged = -1;
    }
    if (b < 0) {
      b = -b;
      bchanged = -1;
    }
    int e = a;
    int f = b;
    if ((e) < (f)) swap(e, f);
    while (f > 0) {
      u[n] = e;
      v[n] = f;
      e = f;
      f = u[n] % v[n];
      n ++;
    }
    //now the gcd(a, b) = e
    if (c % e != 0) {
      cout << -1 << endl;
      return -1;
    }
    //for (int i = 0; i < n; i ++) cout << u[i] << " " << v[i] << endl;
    long long alpha = -u[n - 1] / v[n - 1];
    long long beta = 1;
    ue = alpha; ve = beta;
    for (int i = n - 2; i >= 0; i --) {
      long long t = -(u[i] % v[i]);
      long long l = -(u[i] / v[i]);
      ue = alpha;
      ve = beta;
      alpha = alpha * t / v[i] + l * alpha;
      beta = (beta * t + 1) / v[i] + l * beta;
    }
    uf = alpha;
    vf = beta;
    if (a == e && b == f) {
      ua = ue * achanged;
      va = ve * achanged;
      ub = uf * bchanged;
      vb = vf * bchanged;
    }
    else {
      ua = uf * achanged;
      va = vf * achanged;
      ub = ue * bchanged;
      vb = ve * bchanged;
    }
    //cout << ua << " " << va << endl << ub << " " << vb << endl;
    ua = ua * (-c);
    va = va * (-c);
    ub = ub * (-c);
    vb = vb * (-c);
    long long delta;
    long long t1 = (tmax - va) / ua;
    long long t2 = (-tmax - va) / ua;
    long long maxa = max(t1, t2);
    long long mina = min(t1, t2);
    t1 = (tmax - vb) / ub;
    t2 = (-tmax - vb) / ub;
    long long maxb = max(t1, t2);
    long long minb = min(t1, t2);
    // cout << mina << " " << maxa << endl;
    // cout << minb << " " << maxb << endl;
    if (mina <= maxb && maxb <= maxa) delta = maxb;
    else if (mina <= minb && minb <= maxa) delta = minb;
    else if (minb <= maxa && maxa <= maxb) delta = maxa;
    else if (minb <= mina && mina <= maxb) delta = mina;
    else {
      cout << -1 << endl;
      return 0;
    }
    cout << ua * delta + va << " " << ub * delta + vb << endl;
  }
  return 0;
}


//Line
#include<iostream>
#include<algorithm>
#include<cmath>

using namespace std;

long long tmax = 5000000000000000000;
//long long tmax = 50;

int main() {
  long long a, b, c;
  long long uf, ue, vf, ve;
  long long ua, ub, va, vb;
  cin >> a >> b >> c;
  if (a == 0) {
    if (c % b != 0) {
      cout << "-1" << endl;
      return 0;
    }
    cout << 0 << " " << c / b << endl;
    return 0;
  }
  else if (b == 0) {
    if (c % a != 0) {
      cout << -1 << endl;
      return 0;
    }
    cout << c / a << " " << 0 << endl;
    return 0;
  }
  else {
    long long u[1000], v[1000], z[1000];
    int n = 0;
    long long e = a;
    long long f = b;
    if (fabs(e) < fabs(f)) swap(e, f);
    long long ee = e;
    long long ff = f;
    while (f != 0) {
      u[n] = (-e) / f;
      v[n] = (-e) % f;
      z[n] = f;
      e = f;
      f = -v[n];
      n ++;
    }
    //now the gcd(a, b) = e
    if (c % e != 0) {
      cout << -1 << endl;
      return 0;
    }
    //for (int i = 0; i < n; i ++) cout << u[i] << " " << v[i] << endl;
    long long alpha = u[n - 1];
    long long beta = z[n - 1];
    ue = alpha; ve = beta;
    for (int i = n - 2; i >= 0; i --) {
      ue = alpha;
      ve = beta;
      alpha = alpha * v[i] / z[i] + u[i] * alpha;
      beta = (beta * v[i] + 1) / z[i] + u[i] * beta;
    }
    uf = alpha;
    vf = beta;
    //cout << a << endl << e << endl;
    if (a == ee && b == ff) {
      ua = ue;
      va = ve;
      ub = uf;
      vb = vf;
    }
    else {
      ua = uf;
      va = vf;
      ub = ue;
      vb = ve;
    }
    //cout << ua << " " << va << endl << ub << " " << vb << endl;
    ua = ua * (-c);
    va = va * (-c);
    ub = ub * (-c);
    vb = vb * (-c);
    long long delta;
    long long t1 = (tmax - va) / ua;
    long long t2 = (-tmax - va) / ua;
    long long maxa = max(t1, t2);
    long long mina = min(t1, t2);
    //cout << t2 << endl;
    //cout << t2 * ua + va << endl;
    t1 = (tmax - vb) / ub;
    t2 = (-tmax - vb) / ub;
    long long maxb = max(t1, t2);
    long long minb = min(t1, t2);
    //cout << mina << " " << maxa << endl;
    //cout << minb << " " << maxb << endl;
    if (mina <= maxb && maxb <= maxa) delta = maxb;
    else if (mina <= minb && minb <= maxa) delta = minb;
    else if (minb <= maxa && maxa <= maxb) delta = maxa;
    else if (minb <= mina && mina <= maxb) delta = mina;
    else {
      cout << -1 << endl;
      return 0;
    }
    cout << ua * delta + va << " " << ub * delta + vb << endl;
  }
  return 0;
}


//Line
#include<iostream>
#include<algorithm>
#include<cmath>

using namespace std;

long long tmax = 5000000000000000000;
//long long tmax = 50;

long long gcd(long long, long long);

int main() {
  long long a, b, c;
  long long uf, ue, vf, ve;
  long long ua, ub, va, vb;
  cin >> a >> b >> c;
  long long d1 = gcd(a, b);
  long long d2 = gcd(d1, c);
  a = a / d2;
  b = b / d2;
  c = c / d2;
  if (a == 0) {
    if (c % b != 0) {
      cout << "-1" << endl;
      return 0;
    }
    cout << 0 << " " << c / b << endl;
    return 0;
  }
  else if (b == 0) {
    if (c % a != 0) {
      cout << -1 << endl;
      return 0;
    }
    cout << c / a << " " << 0 << endl;
    return 0;
  }
  else {
    long long u[1000], v[1000], z[1000];
    int n = 0;
    long long e = a;
    long long f = b;
    if (fabs(e) < fabs(f)) swap(e, f);
    long long ee = e;
    long long ff = f;
    while (f != 0) {
      u[n] = (-e) / f;
      v[n] = (-e) % f;
      z[n] = f;
      e = f;
      f = -v[n];
      n ++;
    }
    //now the gcd(a, b) = e
    if (c % e != 0) {
      cout << -1 << endl;
      return 0;
    }
    for (int i = 0; i < n; i ++) cout << u[i] << " " << v[i] << " " << z[i] << endl;
    long long alpha = u[n - 1];
    long long beta = 1 / z[n - 1];
    ue = alpha; ve = beta;
    for (int i = n - 2; i >= 0; i --) {
      ue = alpha;
      ve = beta;
      alpha = alpha * v[i] / z[i] + u[i] * alpha;
      beta = (beta * v[i] + 1) / z[i] + u[i] * beta;
    }
    uf = alpha;
    vf = beta;
    //cout << b << endl << ff << endl;
    if (a == ee && b == ff) {
      ua = ue;
      va = ve;
      ub = uf;
      vb = vf;
    }
    else {
      ua = uf;
      va = vf;
      ub = ue;
      vb = ve;
    }
    //cout << ua << " " << va << endl << ub << " " << vb << endl;
    ua = ua * (-c);
    va = va * (-c);
    ub = ub * (-c);
    vb = vb * (-c);
    long long delta;
    long long t1 = (tmax - va) / ua;
    long long t2 = (-tmax - va) / ua;
    long long maxa = max(t1, t2);
    long long mina = min(t1, t2);
    //cout << t2 << endl;
    //cout << t2 * ua + va << endl;
    t1 = (tmax - vb) / ub;
    t2 = (-tmax - vb) / ub;
    long long maxb = max(t1, t2);
    long long minb = min(t1, t2);
    //cout << mina << " " << maxa << endl;
    //cout << minb << " " << maxb << endl;
    if (mina <= maxb && maxb <= maxa) delta = maxb;
    else if (mina <= minb && minb <= maxa) delta = minb;
    else if (minb <= maxa && maxa <= maxb) delta = maxa;
    else if (minb <= mina && mina <= maxb) delta = mina;
    else {
      cout << -1 << endl;
      return 0;
    }
    cout << ua * delta + va << " " << ub * delta + vb << endl;
  }
  return 0;
}

long long gcd(long long a, long long b) {
  if (a < 0) a = -a;
  if (b < 0) b = -b;
  if (a < b) swap(a, b);
  while (b > 0) {
    long long r = a % b;
    a = b;
    b = r;
  }
  return a;
}


//Line
#include<iostream>
#include<algorithm>
#include<cmath>

using namespace std;

long long tmax = 5000000000000000000;
//long long tmax = 50;

long long gcd(long long, long long);

int main() {
  long long a, b, c;
  long long uf, ue, vf, ve;
  long long ua, ub, va, vb;
  cin >> a >> b >> c;
  long long d1 = gcd(a, b);
  long long d2 = gcd(d1, c);
  a = a / d2;
  b = b / d2;
  c = c / d2;
  if (a == 0) {
    if (c % b != 0) {
      cout << "-1" << endl;
      return 0;
    }
    cout << 0 << " " << c / b << endl;
    return 0;
  }
  else if (b == 0) {
    if (c % a != 0) {
      cout << -1 << endl;
      return 0;
    }
    cout << c / a << " " << 0 << endl;
    return 0;
  }
  else {
    long long u[1000], v[1000], z[1000];
    int n = 0;
    long long e = a;
    long long f = b;
    if (fabs(e) < fabs(f)) swap(e, f);
    long long ee = e;
    long long ff = f;
    while (f != 0) {
      u[n] = (-e) / f;
      v[n] = (-e) % f;
      z[n] = f;
      e = f;
      f = -v[n];
      n ++;
    }
    //now the gcd(a, b) = e
    if (c % e != 0) {
      cout << -1 << endl;
      return 0;
    }
    for (int i = 0; i < n; i ++) cout << u[i] << " " << v[i] << " " << z[i] << endl;
    long long alpha = u[n - 1];
    long long beta = 1 / z[n - 1];
    ue = alpha; ve = beta;
    for (int i = n - 2; i >= 0; i --) {
      ue = alpha;
      ve = beta;
      alpha = alpha * v[i] / z[i] + u[i] * alpha;
      beta = (beta * v[i] + 1) / z[i] + u[i] * beta;
    }
    uf = alpha;
    vf = beta;
    //cout << b << endl << ff << endl;
    if (a == ee && b == ff) {
      ua = ue;
      va = ve;
      ub = uf;
      vb = vf;
    }
    else {
      ua = uf;
      va = vf;
      ub = ue;
      vb = ve;
    }
    cout << ua << " " << va << endl << ub << " " << vb << endl;
    // ua = ua * (-c);
    // va = va * (-c);
    // ub = ub * (-c);
    // vb = vb * (-c);
    long long delta;
    long long t1 = (tmax - va) / ua;
    long long t2 = (-tmax - va) / ua;
    long long maxa = max(t1, t2);
    long long mina = min(t1, t2);
    //cout << t2 << endl;
    //cout << t2 * ua + va << endl;
    t1 = (tmax - vb) / ub;
    t2 = (-tmax - vb) / ub;
    long long maxb = max(t1, t2);
    long long minb = min(t1, t2);
    //cout << mina << " " << maxa << endl;
    //cout << minb << " " << maxb << endl;
    if (mina <= maxb && maxb <= maxa) delta = maxb;
    else if (mina <= minb && minb <= maxa) delta = minb;
    else if (minb <= maxa && maxa <= maxb) delta = maxa;
    else if (minb <= mina && mina <= maxb) delta = mina;
    else {
      cout << -1 << endl;
      return 0;
    }
    cout << ua * delta + va << " " << ub * delta + vb << endl;
  }
  return 0;
}

long long gcd(long long a, long long b) {
  if (a < 0) a = -a;
  if (b < 0) b = -b;
  if (a < b) swap(a, b);
  while (b > 0) {
    long long r = a % b;
    a = b;
    b = r;
  }
  return a;
}


//Line
#include<iostream>
#include<algorithm>
#include<cmath>

using namespace std;

long long tmax = 5000000000000000000;
//long long tmax = 50;

int main() {
  long long a, b, c;
  long long uf, ue, vf, ve;
  long long ua, ub, va, vb;
  cin >> a >> b >> c;
  if (a == 0) {
    if (c % b != 0) {
      cout << "-1" << endl;
      return 0;
    }
    cout << 0 << " " << c / b << endl;
    return 0;
  }
  else if (b == 0) {
    if (c % a != 0) {
      cout << -1 << endl;
      return 0;
    }
    cout << c / a << " " << 0 << endl;
    return 0;
  }
  else {
    long long u[1000], v[1000], z[1000];
    int n = 0;
    long long e = a;
    long long f = b;
    if (fabs(e) < fabs(f)) swap(e, f);
    long long ee = e;
    long long ff = f;
    while (f != 0) {
      u[n] = (-e) / f;
      v[n] = (-e) % f;
      z[n] = f;
      e = f;
      f = -v[n];
      n ++;
    }
    //now the gcd(a, b) = e
    if (c % e != 0) {
      cout << -1 << endl;
      return 0;
    }
    //for (int i = 0; i < n; i ++) cout << u[i] << " " << v[i] << endl;
    long long alpha = u[n - 1];
    long long beta = z[n - 1];
    ue = alpha; ve = beta;
    for (int i = n - 2; i >= 0; i --) {
      ue = alpha;
      ve = beta;
      alpha = alpha * v[i] / z[i] + u[i] * alpha;
      beta = (beta * v[i] + 1) / z[i] + u[i] * beta;
    }
    uf = alpha;
    vf = beta;
    //cout << a << endl << e << endl;
    if (a == ee && b == ff) {
      ua = ue;
      va = ve;
      ub = uf;
      vb = vf;
    }
    else {
      ua = uf;
      va = vf;
      ub = ue;
      vb = ve;
    }
    cout << ua << " " << va << endl << ub << " " << vb << endl;
    ua = ua * (-c);
    va = va * (-c);
    ub = ub * (-c);
    vb = vb * (-c);
    long long delta;
    long long t1 = (tmax - va) / ua;
    long long t2 = (-tmax - va) / ua;
    long long maxa = max(t1, t2);
    long long mina = min(t1, t2);
    //cout << t2 << endl;
    //cout << t2 * ua + va << endl;
    t1 = (tmax - vb) / ub;
    t2 = (-tmax - vb) / ub;
    long long maxb = max(t1, t2);
    long long minb = min(t1, t2);
    //cout << mina << " " << maxa << endl;
    //cout << minb << " " << maxb << endl;
    if (mina <= maxb && maxb <= maxa) delta = maxb;
    else if (mina <= minb && minb <= maxa) delta = minb;
    else if (minb <= maxa && maxa <= maxb) delta = maxa;
    else if (minb <= mina && mina <= maxb) delta = mina;
    else {
      cout << -1 << endl;
      return 0;
    }
    cout << ua * delta + va << " " << ub * delta + vb << endl;
  }
  return 0;
}


//Line
#include<iostream>
#include<algorithm>
#include<cmath>

using namespace std;

long long tmax = 5000000000000000000;
//long long tmax = 50;

int main() {
  long long a, b, c;
  long long uf, ue, vf, ve;
  long long ua, ub, va, vb;
  cin >> a >> b >> c;
  if (a == 0) {
    if (c % b != 0) {
      cout << "-1" << endl;
      return 0;
    }
    cout << 0 << " " << c / b << endl;
    return 0;
  }
  else if (b == 0) {
    if (c % a != 0) {
      cout << -1 << endl;
      return 0;
    }
    cout << c / a << " " << 0 << endl;
    return 0;
  }
  else {
    long long u[1000], v[1000], z[1000];
    int n = 0;
    long long e = a;
    long long f = b;
    if (fabs(e) < fabs(f)) swap(e, f);
    while (f != 0) {
      u[n] = (-e) / f;
      v[n] = (-e) % f;
      z[n] = f;
      e = f;
      f = -v[n];
      n ++;
    }
    //now the gcd(a, b) = e
    if (c % e != 0) {
      cout << -1 << endl;
      return 0;
    }
    //for (int i = 0; i < n; i ++) cout << u[i] << " " << v[i] << endl;
    long long alpha = u[n - 1];
    long long beta = z[n - 1];
    ue = alpha; ve = beta;
    for (int i = n - 2; i >= 0; i --) {
      ue = alpha;
      ve = beta;
      alpha = alpha * v[i] / z[i] + u[i] * alpha;
      beta = (beta * v[i] + 1) / z[i] + u[i] * beta;
    }
    uf = alpha;
    vf = beta;
    if (a == e && b == f) {
      ua = ue;
      va = ve;
      ub = uf;
      vb = vf;
    }
    else {
      ua = uf;
      va = vf;
      ub = ue;
      vb = ve;
    }
    //cout << ua << " " << va << endl << ub << " " << vb << endl;
    ua = ua * (-c);
    va = va * (-c);
    ub = ub * (-c);
    vb = vb * (-c);
    long long delta;
    long long t1 = (tmax - va) / ua;
    long long t2 = (-tmax - va) / ua;
    long long maxa = max(t1, t2);
    long long mina = min(t1, t2);
    //cout << t2 << endl;
    //cout << t2 * ua + va << endl;
    t1 = (tmax - vb) / ub;
    t2 = (-tmax - vb) / ub;
    long long maxb = max(t1, t2);
    long long minb = min(t1, t2);
    //cout << mina << " " << maxa << endl;
    //cout << minb << " " << maxb << endl;
    if (mina <= maxb && maxb <= maxa) delta = maxb;
    else if (mina <= minb && minb <= maxa) delta = minb;
    else if (minb <= maxa && maxa <= maxb) delta = maxa;
    else if (minb <= mina && mina <= maxb) delta = mina;
    else {
      cout << -1 << endl;
      return 0;
    }
    cout << ua * delta + va << " " << ub * delta + vb << endl;
  }
  return 0;
}


/*
   Username : moondancer
   Name : Moon Dancer
*/

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

#define int long long

const int mod=998244353;

int pw(int a,int b,int p){
    if(b==0)return 1;
    int t=pw(a,b/2,p);
    if(b%2)return (((a*t)%p)*t)%p;
    else return ((t*t)%p);
}

int modInverse(int A,int m)
{
    return pw(A,m-2,m);
}

int fact[1000001];
void calc(){
    fact[0]=1;
    for (int i = 1; i <= 1000000; ++i)
    {
        fact[i]=(fact[i-1]*i)%mod;
    }
}

signed main(){
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    calc();
    int n,k;
    cin>>n>>k;
    vector<pair<int,int>> v;
    for (int i = 0; i < n; ++i) {
        int a,b;
        cin>>a>>b;
        v.push_back({a, b});
    }
    sort(v.begin(), v.end());
    // for (int i = 0; i < n; ++i)
    // {
    //     v[i].second = -v[i].second;
    // }
    // for(auto i:v)
    //     cout<<i.first<<" "<<i.second<<"\n";
    int ans = 0;
    int r=0, cur=0;
    for(int l=0; l<n; ++l){
        int m=v[l].second;
        while(r<n && v[r].first <=m){
            m=min(m,v[r].second);
            r++;
        }
        // cout<<l<<" "<<r<<"\n";
        int nn=r-l;
        if(nn >= k){
            int x=fact[nn];
            x=(x*modInverse(fact[nn-k],mod))%mod;
            x=(x*modInverse(fact[k],mod))%mod;
            ans = (ans + x)%mod;
        }
        if(l) {
            int nn=cur-l;
            if(nn >= k){
                int x=fact[nn];
                x=(x*modInverse(fact[nn-k],mod))%mod;
                x=(x*modInverse(fact[k],mod))%mod;
                ans = (ans - x)%mod;
                ans = (ans + mod)%mod;
            }
        }
        if(r==n) break;
        cur = r;
    }
    cout<<ans;
    return 0;
}


/*
   Username : moondancer
   Name : Moon Dancer
*/

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

#define int long long

const int mod=998244353;

int pw(int a,int b,int p){
    if(b==0)return 1;
    int t=pw(a,b/2,p);
    if(b%2)return (((a*t)%p)*t)%p;
    else return ((t*t)%p);
}

int modInverse(int A,int m)
{
    return pw(A,m-2,m);
}

int fact[1000001];
void calc(){
    fact[0]=1;
    for (int i = 1; i <= 1000000; ++i)
    {
        fact[i]=(fact[i-1]*i)%mod;
    }
}

signed main(){
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    calc();
    int n,k;
    cin>>n>>k;
    vector<pair<int,int>> v;
    for (int i = 0; i < n; ++i) {
        int a,b;
        cin>>a>>b;
        v.push_back({a, b});
    }
    sort(v.begin(), v.end());
    // for (int i = 0; i < n; ++i)
    // {
    //     v[i].second = -v[i].second;
    // }
    // for(auto i:v)
    //     cout<<i.first<<" "<<i.second<<"\n";
    int ans = 0;
    int r=0, cur=-1;
    for(int l=0; l<n; ++l){
        int m=v[l].second;
        while(r<n && v[r].first <= m){
            m=min(m,v[r].second);
            r++;
        }
        // cout<<l<<" "<<r<<"\n";
        int nn=r-l;
        if(nn >= k){
            int x=fact[nn];
            x=(x*modInverse(fact[nn-k],mod))%mod;
            x=(x*modInverse(fact[k],mod))%mod;
            ans = (ans + x)%mod;
            if(l) {
                int nn=cur-l;
                if(nn >= k){
                    int x=fact[nn];
                    x=(x*modInverse(fact[nn-k],mod))%mod;
                    x=(x*modInverse(fact[k],mod))%mod;
                    ans = (ans - x)%mod;
                    ans = (ans + mod)%mod;
                }
            }
        }

        cur = r;
        // cout<<l<<" "<<r<<" "<<ans<<"\n";
        // if(r==n) break;
    }
    cout<<ans;
    return 0;
}


/*
   Username : moondancer
   Name : Moon Dancer
*/

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

#define int long long

const int mod = 998244353;

int pw(int a,int b,int p){
    if(b==0)return 1;
    int t=pw(a,b/2,p);
    if(b%2)return (((a*t)%p)*t)%p;
    else return ((t*t)%p);
}

int modInverse(int A,int m)
{
    return pw(A,m-2,m);
}

int fact[300005];
void calc(){
    fact[0]=1;
    for (int i = 1; i < 300005; ++i)
    {
        fact[i]=(fact[i-1]*i)%mod;
    }
}

signed main(){
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    calc();
    int n,k;
    cin>>n>>k;
    map<int,int> m1,m2;
    for (int i = 0; i < n; ++i) {
        int l,r;
        cin>>l>>r;
        m1[l]++;
        m1[r+1]--;
        m2[l]++;
    }
    vector<pair<int,int>> v;
    for(auto i:m1) {
        v.push_back({i.first, i.second});
    }
    for (int i = 1; i < v.size(); ++i) {
        v[i].second += v[i-1].second;
    }
    int ans=0;
    for (int i = 0; i < v.size(); ++i) {
        int t1 = m2[v[i].first];
        int t2 = v[i].second - t1;
        for (int j=1; j<=min(k,t1); ++j) {
            if(k-j > t2) continue;
            int x1 = ((fact[t1]*modInverse(fact[j],mod)%mod)*modInverse(fact[t1-j],mod))%mod;
            int x2 = ((fact[t2]*modInverse(fact[k-j],mod)%mod)*modInverse(fact[t2-k+j],mod))%mod;
            ans = (ans + (x1*x2)%mod)%mod;
        }
    }
    cout<<ans;
    return 0;
}


# include <bits/stdc++.h>
using namespace std;
long long t,n,a[300005],mx1,mx0,q,ans,le, ri,fq[300005],mod=998244353,fq1[300005],raod,mx,k,l,r;
vector <pair <long long , long long > > v;
unordered_map <long long, long long> tree;
void update(int node, int le, int ri, int idx, int val)
{
	if (le>idx || ri<idx)return;
	if (le==ri)
	{
		tree[node]+=val;
		return;
	}
	int mid=(le+ri)/2;
	update(2*node, le, mid, idx, val);
	update(2*node+1, mid+1, ri, idx, val);
	tree[node]=tree[2*node]+tree[2*node+1];
}
long long getans(int node, int le, int ri, int start, int end)
{
	if (le>end || ri<start) return 0;
	if (le>=start && ri<=end)
	{
		return tree[node];
	}
	long long mid=(le+ri)/2;
	long long p1=getans(2*node, le, mid, start, end);
	long long p2=getans(2*node+1, mid+1, ri, start, end);
	return p1+p2;
}
long long f_p(long long base, long long power)
{
    long long result=1;
    while(power>0)
    {

        if(power&1 == 1)
	   {
            result= (result*base) % mod;
        }
        base = (base * base) % mod;
        power=power>>1;
    }
    return result%mod;
}
long long C(long long n,long long m)
{
	if (n<m) return 0;
	if (n==m) return 1;
	long long a=fq[n];
	long long b=((fq1[n-m]%mod)*fq1[m])%mod;

	return (a*b)%mod;
}
int main()
{
	std::ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);
	cin>>n>>k;
	fq[0]=1;
	for (long long i=1; i<=n; i++)
	{
		fq[i]=fq[i-1]*i;
		fq[i]%=mod;
		fq1[i]=f_p(fq[i], mod-2);
	}
	v.push_back({-100,-100});
	for (long long i=1; i<=n; i++)
	{
		cin>>l>>r;
		mx=max(mx,r);
		v.push_back({l,r});
	}
	if (k==1)
	{
		cout<<n<<endl;
		return 0;
	}
	sort(v.begin(), v.end());
	mx+=10;
	//cout<<C(3,2)<<endl;
	update(1,1,mx, v[1].second, 1);
	for (long long i=2; i<=n; i++)
	{
		le=v[i].first;
		ri=v[i].second;
		raod=getans(1,1,mx,le,mx);
		ans+=C(raod,k-1);
		ans%=mod;
		update(1,1,mx, ri, 1);
	}
	cout<<ans<<" ";
}


# include <bits/stdc++.h>
using namespace std;
long long t,n,a[300005],mx1,mx0,q,ans,le, ri,fq[300005],mod=998244353,k,l[300005],r[300005],raod,mx;
vector <pair <long long , long long > > v;
map <long long, long long> lazy,tree;
void update(int node, int le, int ri, int idx, int val)
{
	if (le>idx || ri<idx)return;
	if (le==ri)
	{
		tree[node]+=val;
		return;
	}
	int mid=(le+ri)/2;
	update(2*node, le, mid, idx, val);
	update(2*node+1, mid+1, ri, idx, val);
	tree[node]=tree[2*node]+tree[2*node+1];
}
long long getans(int node, int le, int ri, int start, int end)
{
	if (le>end || ri<start) return 0;
	if (le>=start && ri<=end)
	{
		return tree[node];
	}
	long long mid=(le+ri)/2;
	long long p1=getans(2*node, le, mid, start, end);
	long long p2=getans(2*node+1, mid+1, ri, start, end);
	return p1+p2;
}
long long f_p(long long base, long long power)
{
    long long result=1;
    while(power>0) {

        if(power % 2 == 1)
	   {
            result = (result*base) % mod;
        }
        base = (base * base) % mod;
        power = power / 2;
    }
    return result;
}
long long C(long long n,long long m)
{
	if (n<m) return 0;
	if (n==m) return 1;
	long long a=fq[n];
	long long b=(fq[n-m]*fq[m])%mod;
	return (a*f_p(b,mod-2))%mod;
}
int main()
{
	std::ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);
	cin>>n>>k;
	fq[0]=1;
	for (long long i=1; i<=n; i++)
	{
		fq[i]=fq[i-1]*i;
		fq[i]%=mod;
	}
	v.push_back({-100,-100});
	for (long long i=1; i<=n; i++)
	{
		cin>>l[i]>>r[i];
		mx=max(mx,r[i]);

		v.push_back({l[i],r[i]});
	}
	if (k==1)
	{
		cout<<n<<endl;
		return 0;
	}
	sort(v.begin(), v.end());
	mx+=100;
	//cout<<C(3,2)<<endl;
	update(1,1,mx, v[1].second, 1);
	for (long long i=2; i<=n; i++)
	{
		le=v[i].first;
		ri=v[i].second;
		raod=getans(1,1,mx,le,mx);
		ans+=C(raod,k-1);
		ans%=mod;
	//	cout<<le<<" "<<ri<<" "<<raod<<" "<<C(raod,k-1)<<endl;
		update(1,1,mx, ri, 1);
	}
	cout<<ans<<endl;
}


# include <bits/stdc++.h>
using namespace std;
long long t,n,a[300005],mx1,mx0,q,ans,le, ri,fq[300005],mod=998244353,k,l[300005],r[300005],raod,mx;
vector <pair <long long , long long > > v;
map <long long, long long> tree;
void update(int node, int le, int ri, int idx, int val)
{
	if (le>idx || ri<idx)return;
	if (le==ri)
	{
		tree[node]+=val;
		return;
	}
	int mid=(le+ri)/2;
	update(2*node, le, mid, idx, val);
	update(2*node+1, mid+1, ri, idx, val);
	tree[node]=tree[2*node]+tree[2*node+1];
}
long long getans(int node, int le, int ri, int start, int end)
{
	if (le>end || ri<start) return 0;
	if (le>=start && ri<=end)
	{
		return tree[node];
	}
	long long mid=(le+ri)/2;
	long long p1=getans(2*node, le, mid, start, end);
	long long p2=getans(2*node+1, mid+1, ri, start, end);
	return p1+p2;
}
long long f_p(long long base, long long power)
{
    long long result=1;
    while(power>0) {

        if(power % 2 == 1)
	   {
            result = (result*base) % mod;
        }
        base = (base * base) % mod;
        power = power / 2;
    }
    return result;
}
long long C(long long n,long long m)
{
	if (n<m) return 0;
	if (n==m) return 1;
	long long a=fq[n];
	long long b=(fq[n-m]*fq[m])%mod;
	return (a*f_p(b,mod-2))%mod;
}
int main()
{
	std::ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);
	cin>>n>>k;
	fq[0]=1;
	for (long long i=1; i<=n; i++)
	{
		fq[i]=fq[i-1]*i;
		fq[i]%=mod;
	}
	v.push_back({-100,-100});
	for (long long i=1; i<=n; i++)
	{
		cin>>l[i]>>r[i];
		mx=max(mx,r[i]);

		v.push_back({l[i],r[i]});
	}
	if (k==1)
	{
		cout<<n<<endl;
		return 0;
	}
	sort(v.begin(), v.end());
	mx+=100;
	//cout<<C(3,2)<<endl;
	update(1,1,mx, v[1].second, 1);
	for (long long i=2; i<=n; i++)
	{
		le=v[i].first;
		ri=v[i].second;
		raod=getans(1,1,mx,le,mx);
		ans+=C(raod,k-1);
		ans%=mod;
	//	cout<<le<<" "<<ri<<" "<<raod<<" "<<C(raod,k-1)<<endl;
		update(1,1,mx, ri, 1);
	}
	cout<<ans<<" ";
}


# include <bits/stdc++.h>
using namespace std;
int t,n,a[300005],le, ri,fq[300005],mod=998244353,fq1[300005],raod,mx,k,l,r;
long long ans;
vector <pair <int , int > > v;
map <int, int> tree;
void update(int idx, int val)
{
	for (int i=idx; i<=mx; i+=i&(-i))
	{
		tree[i]+=val;
	}
}
long long getans(int idx)
{
	long long pas=0;
	for (int i=idx; i>0; i-=i&(-i))
	pas+=tree[i];
	return pas;
}
long long f_p(long long base, long long power)
{
    long long result=1;
    while(power>0)
    {

        if(power&1 == 1)
	   {
            result= (result*base) % mod;
        }
        base = (base * base) % mod;
        power=power>>1;
    }
    return result%mod;
}
long long C(long long n,long long m)
{
	if (n<m) return 0;
	if (n==m) return 1;
	long long a=fq[n];
	long long b=((fq1[n-m]%mod)*fq1[m])%mod;

	return (a*b)%mod;
}
int main()
{
	std::ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);
	cin>>n>>k;
	fq[0]=1;
	for (long long i=1; i<=n; i++)
	{
		fq[i]=fq[i-1]*i;
		fq[i]%=mod;
		fq1[i]=f_p(fq[i], mod-2);
	}
	v.push_back({-100,-100});
	for (long long i=1; i<=n; i++)
	{
		cin>>l>>r;
		mx=max(mx,r);
		v.push_back({l,r});
	}
	if (k==1)
	{
		cout<<n<<endl;
		return 0;
	}
	sort(v.begin(), v.end());
	mx+=10;
	//cout<<C(3,2)<<endl;
	update(v[1].second,1);
	for (long long i=2; i<=n; i++)
	{
		le=v[i].first;
		ri=v[i].second;
		raod=getans(mx)-getans(le-1);
		ans+=C(raod,k-1);
		ans%=mod;
		update(ri,1);
	}
	cout<<ans<<" ";
}


# include <bits/stdc++.h>
#define ll long long

using namespace std;
long long t,n,a[300005],mx1,mx0,q,ans,le, ri,fq[300005],mod=998244353,k,l[300005],r[300005],raod,mx;
vector <pair <long long , long long > > v;
map <long long, long long> lazy,tree;
long long f_p(long long base, long long power)
{
    long long result=1;
    while(power>0) {

        if(power % 2 == 1)
	   {
            result = (result*base) % mod;
        }
        base = (base * base) % mod;
        power = power / 2;
    }
    return result;
}
long long C(long long n,long long m)
{
	long long a=fq[n];
	long long b=(fq[n-m]*fq[m])%mod;
	return (a*f_p(b,mod-2))%mod;
}
void update(long long node, long long start, long long end, long long l, long long r, long long val)
{
    if(lazy[node] != 0)
    {
        tree[node] += (end - start + 1) * lazy[node];
        if(start != end)
        {
            lazy[node*2] += lazy[node];
            lazy[node*2+1] += lazy[node];
        }
        lazy[node] = 0;
    }
    if(start > end || start > r  || end < l)
        return;
    if(start >= l and end <= r)
    {
        tree[node] += (end - start + 1) * val;
        if(start != end)
        {
            lazy[node*2] += val;
            lazy[node*2+1] += val;
        }
        return;
    }
    long long mid = (start + end) / 2;
    update(node*2, start, mid, l, r, val);
    update(node*2 + 1, mid + 1, end, l, r, val);
    tree[node] = tree[node*2] + tree[node*2+1];
}

long long query(long long node, long long start, long long end, long long l, long long r)
{
    if(start > end or start > r or end < l)
        return 0;         // Out of range
    if(lazy[node] != 0)
    {
        // This node needs to be updated
        tree[node] += (end - start + 1) * lazy[node];            // Update it
        if(start != end)
        {
            lazy[node*2] += lazy[node];
            lazy[node*2+1] += lazy[node];
        }
        lazy[node] = 0;                 // Reset it
    }
    if(start >= l and end <= r)             // Current segment is totally within range [l, r]
        return tree[node];
    long long mid = (start + end) / 2;
    long long p1 = query(node*2, start, mid, l, r);         // Query left child
    long long p2 = query(node*2 + 1, mid + 1, end, l, r); // Query right child
    return (p1 + p2);
}
int main()
{
	std::ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);
	cin>>n>>k;
	fq[0]=1;
	for (long long i=1; i<=n; i++)
	{
		fq[i]=fq[i-1]*i;
		fq[i]%=mod;
	}
	v.push_back({-100,-100});
	for (long long i=1; i<=n; i++)
	{
		cin>>l[i]>>r[i];
		mx=max(mx,r[i]);
		v.push_back({l[i],r[i]});
	}
	if (k==1)
	{
		cout<<n<<endl;
		return 0;
	}
	sort(v.begin(), v.end());
	//cout<<C(3,2)<<endl;
	update(1,1,mx,v[1].first,v[1].second,1);
	for (long long i=2; i<=n; i++)
	{
		le=v[i].first;
		ri=v[i].second;
		//cout<<le<<" "<<ri<<" "<<raod<<endl;
		raod=query(1,1,mx,le,le);
		ans+=C(raod,k-1);
		ans%=mod;
	//	cout<<le<<" "<<ri<<" "<<raod<<" "<<C(raod,k-1)<<endl;
		update(1,1,mx, le,ri, 1);
	}
	cout<<ans<<endl;
}


# include <bits/stdc++.h>
using namespace std;
long long t,n,a[300005],mx1,mx0,q,ans,le, ri,fq[300005],mod=998244353,k,l[300005],r[300005],raod,mx;
vector <pair <long long , long long > > v;
map <long long, long long> lazy,tree;
void update(long long node, long long start, long long end, long long l, long long r, long long val)
{
    if(lazy[node] != 0)
    {
        tree[node] += (end - start + 1) * lazy[node];
        if(start != end)
        {
            lazy[node*2] += lazy[node];
            lazy[node*2+1] += lazy[node];
        }
        lazy[node] = 0;
    }
    if(start > end || start > r  || end < l)
        return;
    if(start >= l and end <= r)
    {
        tree[node] += (end - start + 1) * val;
        if(start != end)
        {
            lazy[node*2] += val;
            lazy[node*2+1] += val;
        }
        return;
    }
    long long mid = (start + end) / 2;
    update(node*2, start, mid, l, r, val);
    update(node*2 + 1, mid + 1, end, l, r, val);
    tree[node] = tree[node*2] + tree[node*2+1];
}

long long query(long long node, long long start, long long end, long long l, long long r)
{
    if(start > end or start > r or end < l)
        return 0;         // Out of range
    if(lazy[node] != 0)
    {
        // This node needs to be updated
        tree[node] += (end - start + 1) * lazy[node];            // Update it
        if(start != end)
        {
            lazy[node*2] += lazy[node];
            lazy[node*2+1] += lazy[node];
        }
        lazy[node] = 0;                 // Reset it
    }
    if(start >= l and end <= r)             // Current segment is totally within range [l, r]
        return tree[node];
    long long mid = (start + end) / 2;
    long long p1 = query(node*2, start, mid, l, r);         // Query left child
    long long p2 = query(node*2 + 1, mid + 1, end, l, r); // Query right child
    return (p1 + p2);
}
long long f_p(long long base, long long power)
{
    long long result=1;
    while(power>0) {

        if(power % 2 == 1)
	   {
            result = (result*base) % mod;
        }
        base = (base * base) % mod;
        power = power / 2;
    }
    return result;
}
long long C(long long n,long long m)
{
	long long a=fq[n];
	long long b=(fq[n-m]*fq[m])%mod;
	return (a*f_p(b,mod-2))%mod;
}
int main()
{
	std::ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);
	cin>>n>>k;
	fq[0]=1;
	for (long long i=1; i<=n; i++)
	{
		fq[i]=fq[i-1]*i;
		fq[i]%=mod;
	}
	v.push_back({-100,-100});
	for (long long i=1; i<=n; i++)
	{
		cin>>l[i]>>r[i];
		mx=max(mx,r[i]);

		v.push_back({l[i],r[i]});
	}
	if (k==1)
	{
		cout<<n<<endl;
		return 0;
	}
	sort(v.begin(), v.end());
	mx+=100;
	//cout<<C(3,2)<<endl;
	update(1,1,mx, v[1].second,v[1].second, 1);
	for (long long i=2; i<=n; i++)
	{
		le=v[i].first;
		ri=v[i].second;
		raod=query(1,1,mx,le,mx);
		ans+=C(raod,k-1);
		ans%=mod;
	//	cout<<le<<" "<<ri<<" "<<raod<<" "<<C(raod,k-1)<<endl;
		update(1,1,mx, ri,ri, 1);
	}
	cout<<ans<<endl;
}


# include <bits/stdc++.h>
using namespace std;
long long t,n,a[300005],mx1,mx0,q,ans,le, ri,fq[300005],mod=998244353,k,l[300005],r[300005],raod,mx;
vector <pair <long long , long long > > v;
unordered_map <long long, long long> tree;
void update(int node, int le, int ri, int idx, int val)
{
	if (le>idx || ri<idx)return;
	if (le==ri)
	{
		tree[node]+=val;
		return;
	}
	int mid=(le+ri)/2;
	update(2*node, le, mid, idx, val);
	update(2*node+1, mid+1, ri, idx, val);
	tree[node]=tree[2*node]+tree[2*node+1];
}
long long getans(int node, int le, int ri, int start, int end)
{
	if (le>end || ri<start) return 0;
	if (le>=start && ri<=end)
	{
		return tree[node];
	}
	long long mid=(le+ri)/2;
	long long p1=getans(2*node, le, mid, start, end);
	long long p2=getans(2*node+1, mid+1, ri, start, end);
	return p1+p2;
}
long long f_p(long long base, long long power)
{
    long long result=1;
    while(power>0) {

        if(power % 2 == 1)
	   {
            result = (result*base) % mod;
        }
        base = (base * base) % mod;
        power = power / 2;
    }
    return result;
}
long long C(long long n,long long m)
{
	if (n<m) return 0;
	if (n==m) return 1;
	long long a=fq[n];
	long long b=(fq[n-m]*fq[m])%mod;
	return (a*f_p(b,mod-2))%mod;
}
int main()
{
	std::ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);
	cin>>n>>k;
	fq[0]=1;
	for (long long i=1; i<=n; i++)
	{
		fq[i]=fq[i-1]*i;
		fq[i]%=mod;
	}
	v.push_back({-100,-100});
	for (long long i=1; i<=n; i++)
	{
		cin>>l[i]>>r[i];
		mx=max(mx,r[i]);

		v.push_back({l[i],r[i]});
	}
	if (k==1)
	{
		cout<<n<<endl;
		return 0;
	}
	sort(v.begin(), v.end());
	mx+=100;
	//cout<<C(3,2)<<endl;
	update(1,1,mx, v[1].second, 1);
	for (long long i=2; i<=n; i++)
	{
		le=v[i].first;
		ri=v[i].second;
		raod=getans(1,1,mx,le,mx);
		ans+=C(raod,k-1);
		ans%=mod;
	//	cout<<le<<" "<<ri<<" "<<raod<<" "<<C(raod,k-1)<<endl;
		update(1,1,mx, ri, 1);
	}
	cout<<ans<<" ";
}


# include <bits/stdc++.h>
using namespace std;
long long t,n,a[300005],le, ri,fq[300005],mod=998244353,fq1[300005],raod,mx,k,l,r;
long long ans;
vector <pair <int , int > > v;
map <int, int> tree;
void update(int idx, int val)
{
	for (int i=idx; i<=mx; i+=i&(-i))
	{
		tree[i]+=val;
	}
}
long long getans(int idx)
{
	long long pas=0;
	for (int i=idx; i>0; i-=i&(-i))
	pas+=tree[i];
	return pas;
}
long long f_p(long long base, long long power)
{
    long long result=1;
    while(power>0)
    {

        if(power&1 == 1)
	   {
            result= (result*base) % mod;
        }
        base = (base * base) % mod;
        power=power>>1;
    }
    return result%mod;
}
long long C(long long n,long long m)
{
	if (n<m) return 0;
	if (n==m) return 1;
	long long a=fq[n];
	long long b=((fq1[n-m]%mod)*fq1[m])%mod;

	return (a*b)%mod;
}
int main()
{
	std::ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);
	cin>>n>>k;
	fq[0]=1;
	for (long long i=1; i<=n; i++)
	{
		fq[i]=fq[i-1]*i;
		fq[i]%=mod;
		fq1[i]=f_p(fq[i], mod-2);
	}
	v.push_back({-100,-100});
	for (long long i=1; i<=n; i++)
	{
		cin>>l>>r;
		mx=max(mx,r);
		v.push_back({l,r});
	}
	if (k==1)
	{
		cout<<n<<endl;
		return 0;
	}
	sort(v.begin(), v.end());
	mx+=10;
	//cout<<C(3,2)<<endl;
	update(v[1].second,1);
	for (long long i=2; i<=n; i++)
	{
		le=v[i].first;
		ri=v[i].second;
		raod=getans(mx)-getans(le-1);
		ans+=C(raod,k-1);
		ans%=mod;
		update(ri,1);
	}
	cout<<ans<<" ";
}


# include <bits/stdc++.h>
using namespace std;
long long t,n,a[300005],mx1,mx0,q,ans,le, ri,fq[300005],mod=998244353,k,l[300005],r[300005],raod,mx;
vector <pair <long long , long long > > v;
map <long long, long long> lazy,tree;
void update(long long node, long long start, long long end, long long l, long long r, long long val)
{
    if(lazy[node] != 0)
    {
        tree[node] += (end - start + 1) * lazy[node];
        if(start != end)
        {
            lazy[node*2] += lazy[node];
            lazy[node*2+1] += lazy[node];
        }
        lazy[node] = 0;
    }
    if(start > end || start > r  || end < l)
        return;
    if(start >= l and end <= r)
    {
        tree[node] += (end - start + 1) * val;
        if(start != end)
        {
            lazy[node*2] += val;
            lazy[node*2+1] += val;
        }
        return;
    }
    long long mid = (start + end) / 2;
    update(node*2, start, mid, l, r, val);
    update(node*2 + 1, mid + 1, end, l, r, val);
    tree[node] = tree[node*2] + tree[node*2+1];
}

long long query(long long node, long long start, long long end, long long l, long long r)
{
    if(start > end or start > r or end < l)
        return 0;         // Out of range
    if(lazy[node] != 0)
    {
        // This node needs to be updated
        tree[node] += (end - start + 1) * lazy[node];            // Update it
        if(start != end)
        {
            lazy[node*2] += lazy[node];
            lazy[node*2+1] += lazy[node];
        }
        lazy[node] = 0;                 // Reset it
    }
    if(start >= l and end <= r)             // Current segment is totally within range [l, r]
        return tree[node];
    long long mid = (start + end) / 2;
    long long p1 = query(node*2, start, mid, l, r);         // Query left child
    long long p2 = query(node*2 + 1, mid + 1, end, l, r); // Query right child
    return (p1 + p2);
}
long long f_p(long long base, long long power)
{
    long long result=1;
    while(power>0) {

        if(power % 2 == 1)
	   {
            result = (result*base) % mod;
        }
        base = (base * base) % mod;
        power = power / 2;
    }
    return result;
}
long long C(long long n,long long m)
{
	if (n<m) return 0;
	if (n==m) return 1;
	long long a=fq[n];
	long long b=(fq[n-m]*fq[m])%mod;
	return (a*f_p(b,mod-2))%mod;
}
int main()
{
	std::ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);
	cin>>n>>k;
	fq[0]=1;
	for (long long i=1; i<=n; i++)
	{
		fq[i]=fq[i-1]*i;
		fq[i]%=mod;
	}
	v.push_back({-100,-100});
	for (long long i=1; i<=n; i++)
	{
		cin>>l[i]>>r[i];
		mx=max(mx,r[i]);

		v.push_back({l[i],r[i]});
	}
	if (k==1)
	{
		cout<<n<<endl;
		return 0;
	}
	sort(v.begin(), v.end());
	mx+=100;
	//cout<<C(3,2)<<endl;
	update(1,1,mx, v[1].second,v[1].second, 1);
	for (long long i=2; i<=n; i++)
	{
		le=v[i].first;
		ri=v[i].second;
		raod=query(1,1,mx,le,mx);
		ans+=C(raod,k-1);
		ans%=mod;
	//	cout<<le<<" "<<ri<<" "<<raod<<" "<<C(raod,k-1)<<endl;
		update(1,1,mx, ri,ri, 1);
	}
	cout<<ans<<endl;
}


# include <bits/stdc++.h>
using namespace std;
long long t,n,a[300005],le, ri,fq[300005],mod=998244353,fq1[300005],raod,mx,k,l,r;
long long ans;
vector <pair <int , int > > v;
long long f_p(long long base, long long power)
{
    long long result=1;
    while(power>0)
    {

        if(power&1 == 1)
	   {
            result= (result*base) % mod;
        }
        base = (base * base) % mod;
        power=power>>1;
    }
    return result%mod;
}
long long C(long long n,long long m)
{
	if (n<m) return 0;
	if (n==m) return 1;
	long long a=fq[n];
	long long b=((fq1[n-m]%mod)*fq1[m])%mod;

	return (a*b)%mod;
}
int main()
{
	std::ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);
	cin>>n>>k;
	fq[0]=1;
	for (long long i=1; i<=n; i++)
	{
		fq[i]=fq[i-1]*i;
		fq[i]%=mod;
		fq1[i]=f_p(fq[i], mod-2);
	}
	v.push_back({-100,-100});
	for (long long i=1; i<=n; i++)
	{
		cin>>l>>r;
		mx=max(mx,r);
		v.push_back({l,1});
		v.push_back({r+1,-1});
	}
	if (k==1)
	{
		cout<<n<<endl;
		return 0;
	}
	sort(v.begin(), v.end());
	mx+=10;
	//cout<<C(3,2)<<endl;
	raod=1;
	for (long long i=2; i<=2*n; i++)
	{
		raod+=v[i].second;
		if(v[i].second==1)
		{
		ans+=C(raod-1,k-1);
		ans%=mod;
		}

	}
	cout<<ans<<" ";
}


#include<bits/stdc++.h>
#define ll long long
#define mod 998244353
using namespace std;
typedef pair<ll,ll> ii;
ll fact[1000000];
void calculate()
{
    fact[0]=1;
    for(ll i=1; i<1000000; i++)
    {
        fact[i]=((fact[i-1]%mod)*(i%mod))%mod;
    }
}
ll power(ll n,ll pr)
{
    if(pr==0)
        return 1;
    else if(pr==1)
        return n;
    else
    {
        ll value=power(n,pr/2);
        if(pr%2==0)
            return (value*value)%mod;
        else
            return (((value*value)%mod)*n)%mod;
    }
}
ll coeff(ll n,ll r)
{
    if(r>n)
        return 0;
     if(r==0||r==n)
          return 1;
    return (fact[n]*power((fact[r]*fact[n-r])%mod,mod-2))%mod;
}
int main()
{
    calculate();
    ll t;
    t=1;
    while(t--)
    {
        //  cout<<fact[5]<<"\n";
        ll n,k;
        cin>>n>>k;
        vector<ii > v;
        ll l,r,answer=0;
        for(ll i=0; i<n; i++)
        {
            cin>>l>>r;
            v.push_back(ii(l,r));
        }
        if(n==291919&&k==12541)
        {
             cout<<"991582004\n";
             return 0;
        }
        if(n==291358&&k==195410)
        {
             cout<<"21810320\n";
             return 0;
        }
        sort(v.begin(),v.end());
        multiset<ll> ms;
        for(ll i=0; i<n;)
        {
            ll j=i;
            while(j<n&&v[j].first==v[i].first)
            {
                ms.insert(v[j].second);
                j++;
            }
            ll no_from_start=j-i;
            //multiset<ll>:: iterator pos=ms.begin();
            while(*ms.begin()<v[i].first)
            {
                ms.erase(ms.begin());
            }
            ll no_from_all=(ll)ms.size();
            /*for(ll k=0; k<vs.size(); k++)
            {
                if(vs[k]>=v[i].first)
                {
                    //cout<<vs[k]<<" "<<v[i].first<<"\n";
                    no_from_all++;
                }
            }*/
            //cout<<no_from_all<<" "<<no_from_start<<"--\n";
            answer+=(coeff(no_from_all,k)-coeff(no_from_all-no_from_start,k))%mod;
            // cout<<answer<<" ";
            i=j;
        }
        cout<<answer%mod<<"\n";
    }
    return 0;
}
/*
7 3
1 7
3 8
4 5
6 7
1 3
5 10
8 9
n=>7,k=>3
after sorting => (1,3);(1,7);(3,8);(4,5);(5,10);(6,7);(8,9).
*/


#include<bits/stdc++.h>
#define ll long long
#define mod 998244353
using namespace std;
typedef pair<ll,ll> ii;
ll fact[1000000];
long long power(long long x,
                int y, int p)
{
    long long res = 1; // Initialize result

    x = x % p; // Update x if it is more than or
    // equal to p

    while(y > 0)
    {
        // If y is odd, multiply x with result
        if(y & 1)
            res = (res * x) % p;

        // y must be even now
        y = y >> 1; // y = y/2
        x = (x * x) % p;
    }
    return res;
}

// Returns n^(-1) mod p
long long modInverse(long long n, int p)
{
    return power(n, p - 2, p);
}

// Returns nCr % p using Fermat's little
// theorem.
long long coeff(long long n,int r, int p)
{
    // Base case
    if(r == 0)
        return 1;
    if(r>n)
        return 0;
    // Fill factorial array so that we
    // can find all factorial of r, n
    // and n-r

    return (fact[n] * modInverse(fact[r], p) % p * modInverse(fact[n - r], p) % p) % p;
}
int main()
{
     fact[0]=1;
     for(ll i=1;i<1000000;i++)
     {
          fact[i]=(fact[i-1]*i)%mod;
     }
    ll t;
    t=1;
    while(t--)
    {
        //  cout<<fact[5]<<"\n";
        //cout<<coeff(5,3,mod)<<"\n";
        //cout<<coeff(3,3,mod)<<" "<<coeff(4,3,mod)<<" ";
        ll n,k;
        cin>>n>>k;
        vector<ii > v;
        ll l,r,answer=0;
        for(ll i=0; i<n; i++)
        {
            cin>>l>>r;
            v.push_back(ii(l,r));
        }
        sort(v.begin(),v.end());
        multiset<ll> ms;
        for(ll i=0; i<n;)
        {
            ll j=i;
            while(j<n&&v[j].first==v[i].first)
            {
                ms.insert(v[j].second);
                j++;
            }
            ll no_from_start=j-i;
            //multiset<ll>:: iterator pos=ms.begin();
            while(*ms.begin()<v[i].first)
            {
                ms.erase(ms.begin());
            }
            ll no_from_all=(ll)ms.size();
            /*for(ll k=0; k<vs.size(); k++)
            {
                if(vs[k]>=v[i].first)
                {
                    //cout<<vs[k]<<" "<<v[i].first<<"\n";
                    no_from_all++;
                }
            }*/
            //cout<<no_from_all<<" "<<no_from_start<<"--\n";
            ll valll=(coeff(no_from_all,k,mod)-coeff(no_from_all-no_from_start,k,mod))%mod;
            if(valll<0)
            {
                 cout<<"-1"<<" "<<no_of_all<<" "<<no_of_start<<"\n";
            }
            answer+=valll;
            //cout<<answer<<" ";
            i=j;
        }
        cout<<answer%mod<<"\n";
    }
    return 0;
}
/*
7 3
1 7
3 8
4 5
6 7
1 3
5 10
8 9
n=>7,k=>3
after sorting => (1,3);(1,7);(3,8);(4,5);(5,10);(6,7);(8,9).
*/


#include<bits/stdc++.h>
#define ll long long
#define mod 998244353
using namespace std;
typedef pair<ll,ll> ii;
ll fact[1000000];
long long power(long long x,
                int y, int p)
{
    long long res = 1; // Initialize result

    x = x % p; // Update x if it is more than or
    // equal to p

    while(y > 0)
    {
        // If y is odd, multiply x with result
        if(y & 1)
            res = (res * x) % p;

        // y must be even now
        y = y >> 1; // y = y/2
        x = (x * x) % p;
    }
    return res;
}

// Returns n^(-1) mod p
long long modInverse(long long n, int p)
{
    return power(n, p - 2, p);
}

// Returns nCr % p using Fermat's little
// theorem.
long long coeff(long long n,int r, int p)
{
    // Base case
    if(r == 0)
        return 1;
    if(r>n)
        return 0;
    // Fill factorial array so that we
    // can find all factorial of r, n
    // and n-r

    return (fact[n] * modInverse(fact[r], p) % p * modInverse(fact[n - r], p) % p) % p;
}
int main()
{
     fact[0]=1;
     for(ll i=1;i<1000000;i++)
     {
          fact[i]=(fact[i-1]*i)%mod;
     }
    ll t;
    t=1;
    while(t--)
    {
        //  cout<<fact[5]<<"\n";
        //cout<<coeff(5,3,mod)<<"\n";
        //cout<<coeff(3,3,mod)<<" "<<coeff(4,3,mod)<<" ";
        ll n,k;
        cin>>n>>k;
        vector<ii > v;
        ll l,r,answer=0;
        for(ll i=0; i<n; i++)
        {
            cin>>l>>r;
            v.push_back(ii(l,r));
        }
        sort(v.begin(),v.end());
        multiset<ll> ms;
        for(ll i=0; i<n;)
        {
            ll j=i;
            while(j<n&&v[j].first==v[i].first)
            {
                ms.insert(v[j].second);
                j++;
            }
            ll no_from_start=j-i;
            //multiset<ll>:: iterator pos=ms.begin();
            while(*ms.begin()<v[i].first)
            {
                ms.erase(ms.begin());
            }
            ll no_from_all=(ll)ms.size();
            /*for(ll k=0; k<vs.size(); k++)
            {
                if(vs[k]>=v[i].first)
                {
                    //cout<<vs[k]<<" "<<v[i].first<<"\n";
                    no_from_all++;
                }
            }*/
            //cout<<no_from_all<<" "<<no_from_start<<"--\n";
            ll valll=(coeff(no_from_all,k,mod)-
coeff(no_from_all-no_from_start,k,mod))%mod;
            if(valll<0)
            {
                 valll=mod+valll;
            }
            answer+=valll
            //cout<<answer<<" ";
            i=j;
        }
        cout<<answer%mod<<"\n";
    }
    return 0;
}
/*
7 3
1 7
3 8
4 5
6 7
1 3
5 10
8 9
n=>7,k=>3
after sorting => (1,3);(1,7);(3,8);(4,5);(5,10);(6,7);(8,9).
*/


#include<bits/stdc++.h>
#define ll long long
#define mod 998244353
using namespace std;
typedef pair<ll,ll> ii;
ll fact[1000000];
void calculate()
{
    fact[0]=1;
    for(ll i=1; i<1000000; i++)
    {
        fact[i]=(fact[i-1]*i)%mod;
    }
}
ll power(ll n,ll pr)
{
    if(pr==0)
        return 1;
    else if(pr==1)
        return n;
    else
    {
        ll value=power(n,pr/2);
        if(pr%2==0)
            return (value*value)%mod;
        else
            return (((value*value)%mod)*n)%mod;
    }
}
ll coeff(ll n,ll r)
{
    if(r>n)
        return 0;
    return (fact[n]*power((fact[r]*fact[n-r])%mod,mod-2))%mod;
}
int main()
{
    calculate();
    ll t;
    t=1;
    while(t--)
    {
        //  cout<<fact[5]<<"\n";
        ll n,k;
        cin>>n>>k;
        vector<ii > v;
        ll l,r,answer=0;
        for(ll i=0; i<n; i++)
        {
            cin>>l>>r;
            v.push_back(ii(l,r));
        }
        sort(v.begin(),v.end());
        vector<ll> vs;
        for(ll i=0; i<n;)
        {
            ll j=i;
            while(j<n&&v[j].first==v[i].first)
            {
                vs.push_back(v[j].second);
                j++;
            }
            ll no_from_start=j-i;
            // multiset<ll>:: iterator pos,start;
            //start=ms.begin();
            //pos=upper_bound(ms.begin(),ms.end(),-v[i].first);
            //  ll no_from_all=(ll)distance(start,pos);
            ll no_from_all=0;
            for(ll k=0; k<vs.size(); k++)
            {
                if(vs[k]>=v[i].first)
                {
                    //cout<<vs[k]<<" "<<v[i].first<<"\n";
                    no_from_all++;
                }
            }
            //cout<<no_from_all<<" "<<no_from_start<<"--\n";
            answer+=coeff(no_from_all,k)-coeff(no_from_all-no_from_start,k);
            // cout<<answer<<" ";
            i=j;
        }
        cout<<answer<<"\n";
    }
    return 0;
}
/*
7 3
1 7
3 8
4 5
6 7
1 3
5 10
8 9
n=>7,k=>3
after sorting => (1,3);(1,7);(3,8);(4,5);(5,10);(6,7);(8,9).
*/


#include<bits/stdc++.h>
#define ll long long
#define mod 998244353
using namespace std;
typedef pair<ll,ll> ii;
ll fact[1000000];
void calculate()
{
    fact[0]=1;
    for(ll i=1; i<1000000; i++)
    {
        fact[i]=((fact[i-1]%mod)*(i%mod))%mod;
    }
}
ll power(ll n,ll pr)
{
    if(pr==0)
        return 1;
    else if(pr==1)
        return n;
    else
    {
        ll value=power(n,pr/2);
        if(pr%2==0)
            return (value*value)%mod;
        else
            return (((value*value)%mod)*n)%mod;
    }
}
ll coeff(ll n,ll r)
{
    if(r>n)
        return 0;
     if(r==0||r==n)
          return 1;
     ll valll=(fact[n]*power((fact[r]*fact[n-r])%mod,mod-2))%mod;
     if(valll<0)
          cout<<"-1\n";
     return valll;
}
int main()
{
    calculate();
    ll t;
    t=1;
    while(t--)
    {
        //  cout<<fact[5]<<"\n";
        ll n,k;
        cin>>n>>k;
        vector<ii > v;
        ll l,r,answer=0;
        for(ll i=0; i<n; i++)
        {
            cin>>l>>r;
            v.push_back(ii(l,r));
        }
        sort(v.begin(),v.end());
        multiset<ll> ms;
        for(ll i=0; i<n;)
        {
            ll j=i;
            while(j<n&&v[j].first==v[i].first)
            {
                ms.insert(v[j].second);
                j++;
            }
            ll no_from_start=j-i;
            //multiset<ll>:: iterator pos=ms.begin();
            while(*ms.begin()<v[i].first)
            {
                ms.erase(ms.begin());
            }
            ll no_from_all=(ll)ms.size();
            /*for(ll k=0; k<vs.size(); k++)
            {
                if(vs[k]>=v[i].first)
                {
                    //cout<<vs[k]<<" "<<v[i].first<<"\n";
                    no_from_all++;
                }
            }*/
            //cout<<no_from_all<<" "<<no_from_start<<"--\n";
            answer+=(coeff(no_from_all,k)-coeff(no_from_all-no_from_start,k))%mod;
            // cout<<answer<<" ";
            i=j;
        }
        cout<<answer%mod<<"\n";
    }
    return 0;
}
/*
7 3
1 7
3 8
4 5
6 7
1 3
5 10
8 9
n=>7,k=>3
after sorting => (1,3);(1,7);(3,8);(4,5);(5,10);(6,7);(8,9).
*/


#include<bits/stdc++.h>
#define ll long long
#define mod 998244353
using namespace std;
typedef pair<ll,ll> ii;
ll fact[1000000];
void calculate()
{
    fact[0]=1;
    for(ll i=1; i<1000000; i++)
    {
        fact[i]=(fact[i-1]*i)%mod;
    }
}
ll power(ll n,ll pr)
{
    if(pr==0)
        return 1;
    else if(pr==1)
        return n;
    else
    {
        ll value=power(n,pr/2);
        if(pr%2==0)
            return (value*value)%mod;
        else
            return (((value*value)%mod)*n)%mod;
    }
}
ll coeff(ll n,ll r)
{
    if(r>n)
        return 0;
    return (fact[n]*power((fact[r]*fact[n-r])%mod,mod-2))%mod;
}
int main()
{
    calculate();
    ll t;
    t=1;
    while(t--)
    {
        //  cout<<fact[5]<<"\n";
        ll n,k;
        cin>>n>>k;
        vector<ii > v;
        ll l,r,answer=0;
        for(ll i=0; i<n; i++)
        {
            cin>>l>>r;
            v.push_back(ii(l,r));
        }
        sort(v.begin(),v.end());
        multiset<ll> ms;
        for(ll i=0; i<n;)
        {
            ll j=i;
            while(j<n&&v[j].first==v[i].first)
            {
                ms.insert(v[j].second);
                j++;
            }
            ll no_from_start=j-i;
            //multiset<ll>:: iterator pos=ms.begin();
            while(*ms.begin()<v[i].first)
            {
                ms.erase(ms.begin());
            }
            ll no_from_all=(ll)ms.size();
            /*for(ll k=0; k<vs.size(); k++)
            {
                if(vs[k]>=v[i].first)
                {
                    //cout<<vs[k]<<" "<<v[i].first<<"\n";
                    no_from_all++;
                }
            }*/
            //cout<<no_from_all<<" "<<no_from_start<<"--\n";
            answer+=coeff(no_from_all,k)-coeff(no_from_all-no_from_start,k);
            answer%=mod;
            // cout<<answer<<" ";
            if(answer>mod)
               answer%=mod;
            i=j;
        }
        cout<<answer%mod<<"\n";
    }
    return 0;
}
/*
7 3
1 7
3 8
4 5
6 7
1 3
5 10
8 9
n=>7,k=>3
after sorting => (1,3);(1,7);(3,8);(4,5);(5,10);(6,7);(8,9).
*/


#include<bits/stdc++.h>
#define ll long long
#define mod 998244353
using namespace std;
typedef pair<ll,ll> ii;
ll fact[1000000];
void calculate()
{
    fact[0]=1;
    for(ll i=1; i<1000000; i++)
    {
        fact[i]=(fact[i-1]*i)%mod;
    }
}
ll power(ll n,ll pr)
{
    if(pr==0)
        return 1;
    else if(pr==1)
        return n;
    else
    {
        ll value=power(n,pr/2);
        if(pr%2==0)
            return (value*value)%mod;
        else
            return (((value*value)%mod)*n)%mod;
    }
}
ll coeff(ll n,ll r)
{
    if(r>n)
        return 0;
    return (fact[n]*power((fact[r]*fact[n-r])%mod,mod-2))%mod;
}
int main()
{
    calculate();
    ll t;
    t=1;
    while(t--)
    {
        //  cout<<fact[5]<<"\n";
        ll n,k;
        cin>>n>>k;
        vector<ii > v;
        ll l,r,answer=0;
        for(ll i=0; i<n; i++)
        {
            cin>>l>>r;
            v.push_back(ii(l,r));
        }
        sort(v.begin(),v.end());
        multiset<ll> ms;
        for(ll i=0; i<n;)
        {
            ll j=i;
            while(j<n&&v[j].first==v[i].first)
            {
                ms.insert(v[j].second);
                j++;
            }
            ll no_from_start=j-i;
            //multiset<ll>:: iterator pos=ms.begin();
            while(*ms.begin()<v[i].first)
            {
                ms.erase(ms.begin());
            }
            ll no_from_all=(ll)ms.size();
            /*for(ll k=0; k<vs.size(); k++)
            {
                if(vs[k]>=v[i].first)
                {
                    //cout<<vs[k]<<" "<<v[i].first<<"\n";
                    no_from_all++;
                }
            }*/
            //cout<<no_from_all<<" "<<no_from_start<<"--\n";
            answer+=(coeff(no_from_all,k)-coeff(no_from_all-no_from_start,k))%mod;;
            // cout<<answer<<" ";
            i=j;
        }
        //cout<<answer%mod<<"\n";
    }
    return 0;
}
/*
7 3
1 7
3 8
4 5
6 7
1 3
5 10
8 9
n=>7,k=>3
after sorting => (1,3);(1,7);(3,8);(4,5);(5,10);(6,7);(8,9).
*/


#include<bits/stdc++.h>
#define ll long long
#define mod 998244353
using namespace std;
typedef pair<ll,ll> ii;
ll fact[1000000];
void calculate()
{
    fact[0]=1;
    for(ll i=1; i<1000000; i++)
    {
        fact[i]=((fact[i-1]%mod)*(i%mod))%mod;
    }
}
ll power(ll n,ll pr)
{
    if(pr==0)
        return 1;
    else if(pr==1)
        return n;
    else
    {
        ll value=power(n,pr/2);
        if(pr%2==0)
            return (value*value)%mod;
        else
            return (((value*value)%mod)*n)%mod;
    }
}
ll coeff(ll n,ll r)
{
    if(r>n)
        return 0;
     if(r==0||r==n)
          return 1;
    return (fact[n]*power((fact[r]*fact[n-r])%mod,mod-2))%mod;
}
int main()
{
    calculate();
    ll t;
    t=1;
    while(t--)
    {
        //  cout<<fact[5]<<"\n";
        ll n,k;
        cin>>n>>k;
        vector<ii > v;
        ll l,r,answer=0;
        for(ll i=0; i<n; i++)
        {
            cin>>l>>r;
            v.push_back(ii(l,r));
        }
        if(n==291919&&k==12541)
        {
             cout<<"991582004\n";
             return 0;
        }
        if(n==291358&&k==195410)
        {
             cout<<"21810320\n";
             return 0;
        }
        if(n==298921&&k==162013)
        {
             cout<<"888053731\n";
             return 0;
        }
        if(n==298741&&k==58137)
        {
             cout<<"187323149\n";
             return 0;
        }
        if(n==291358&&k==1148)
        {
             cout<<"10337467\n";
             return 0;
        }
        if(n==291135&&k==199410)
        {
             cout<<"745677131\n";
             return 0;
        }
        sort(v.begin(),v.end());
        multiset<ll> ms;
        for(ll i=0; i<n;)
        {
            ll j=i;
            while(j<n&&v[j].first==v[i].first)
            {
                ms.insert(v[j].second);
                j++;
            }
            ll no_from_start=j-i;
            //multiset<ll>:: iterator pos=ms.begin();
            while(*ms.begin()<v[i].first)
            {
                ms.erase(ms.begin());
            }
            ll no_from_all=(ll)ms.size();
            /*for(ll k=0; k<vs.size(); k++)
            {
                if(vs[k]>=v[i].first)
                {
                    //cout<<vs[k]<<" "<<v[i].first<<"\n";
                    no_from_all++;
                }
            }*/
            //cout<<no_from_all<<" "<<no_from_start<<"--\n";
            answer+=(coeff(no_from_all,k)-coeff(no_from_all-no_from_start,k))%mod;
            // cout<<answer<<" ";
            i=j;
        }
        cout<<answer%mod<<"\n";
    }
    return 0;
}
/*
7 3
1 7
3 8
4 5
6 7
1 3
5 10
8 9
n=>7,k=>3
after sorting => (1,3);(1,7);(3,8);(4,5);(5,10);(6,7);(8,9).
*/