#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstdint>
#include <queue>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(0);

    int videoCount, serverCount;
    cin >> videoCount >> serverCount;

    priority_queue<int64_t> servers;

    for (int i = 0; i < serverCount; i++)
        servers.push(0);

    int64_t t, duration;
    while (videoCount--)
    {
        cin >> t >> duration;
        t = max(t, -servers.top()) + duration;

        printf("%I64d\n", x);

        servers.pop();
        servers.push(-t);
    }

    return 0;
}


#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstdint>
#include <queue>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(0);

    int videoCount, serverCount;
    cin >> videoCount >> serverCount;

    priority_queue<int64_t> servers;

    for (int i = 0; i < serverCount; i++)
        servers.push(0);

    int64_t t, duration;
    while (videoCount--)
    {
        cin >> t >> duration;
        t = max(t, -servers.top()) + duration;

        printf("%I64d\n", t);

        servers.pop();
        servers.push(-t);
    }

    return 0;
}


#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstdint>
#include <queue>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(0);

    int videoCount, serverCount;
    cin >> videoCount >> serverCount;

    priority_queue<int64_t> servers;

    for (int i = 0; i < serverCount; i++)
        servers.push(0);

    int64_t t, duration;
    while (videoCount--)
    {
        cin >> t >> duration;
        t = max(t, -servers.top()) + duration;

        cout << t << endl;
        //printf("%I64d\n", t);

        servers.pop();
        servers.push(-t);
    }

    return 0;
}


#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstdint>
#include <queue>
#include <sstream>

using namespace std;

int main()
{
    //ios_base::sync_with_stdio(0);

    int videoCount, serverCount;
    cin >> videoCount >> serverCount;

    priority_queue<int64_t> servers;

    for (int i = 0; i < serverCount; i++)
        servers.push(0);

    ostringstream ss;

    int64_t t, duration;
    while (videoCount--)
    {
        cin >> t >> duration;
        t = max(t, -servers.top()) + duration;

        ss << t << endl;
        //printf("%I64d\n", t);

        servers.pop();
        servers.push(-t);
    }

    cout << ss.str();
    return 0;
}


#include <iostream>
#include <algorithm>
#include <cstdint>
#include <queue>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(0);

    int videoCount, serverCount;
    cin >> videoCount >> serverCount;

    priority_queue<int64_t> servers;

    for (int i = 0; i < serverCount; i++)
        servers.push(0);

    int64_t t, duration;
    while (videoCount--)
    {
        cin >> t >> duration;
        t = max(t, -servers.top()) + duration;

        printf("%I64d\n", x);

        servers.pop();
        servers.push(-t);
    }

    return 0;
}


#include <iostream>
#include <stdio.h>
#include <vector>
#include <algorithm>
#include <cstdint>
#include <memory>

using namespace std;

int main()
{
    int videoCount, serverCount;
    cin >> videoCount >> serverCount;

    auto servers = make_unique<vector<uint32_t>>(serverCount);
    auto results = make_unique<vector<uint32_t>>(videoCount);

    int t, duration;
    for (int i = 0; i < videoCount; i++)
    {
        cin >> t >> duration;

        auto min = min_element(servers->begin(), servers->end());
        if (t > *min)
            *min = t;

        *min += duration;
        (*results)[i] = *min;
    }

    for (const uint32_t& i : *results)
    {
        cout << i << endl;
    }

    getchar();
    return 0;
}


#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstdint>
#include <queue>

using namespace std;

int main()
{
    //ios_base::sync_with_stdio(0);

    int videoCount, serverCount;
    cin >> videoCount >> serverCount;

    priority_queue<int64_t> servers;

    for (int i = 0; i < serverCount; i++)
        servers.push(0);

    int64_t t, duration, min;
    min = INTMAX_MAX;
    for (int i = 0; i < videoCount; i++)
    {
        cin >> t >> duration;

        int64_t tmp = min;
        if (i < serverCount - 1)
            tmp = 0;

        t = max(t, tmp) + duration;

        printf("%I64d\n", t);

        if (t < min)
            min = t;
    }

    return 0;
}


#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstdint>
#include <queue>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(0);

    int videoCount, serverCount;
    cin >> videoCount >> serverCount;

    queue<int64_t> servers;

    for (int i = 0; i < serverCount; i++)
        servers.push(0);

    int64_t t, duration;
    while (videoCount--)
    {
        cin >> t >> duration;
        t = max(t, -servers.top()) + duration;

        printf("%I64d\n", t);

        servers.pop();
        servers.push(-t);
    }

    return 0;
}


#include <iostream>
#include <stdio.h>
#include <vector>
#include <algorithm>
#include <cstdint>

using namespace std;

int main()
{
    int videoCount, serverCount;
    cin >> videoCount >> serverCount;

    vector<uint64_t> servers;
    vector<uint64_t> results;

    int t, duration;
    for (int i = 0; i < videoCount; i++)
    {
        cin >> t >> duration;

        bool findMin = false;
        if (servers.size() < serverCount)
            servers.push_back(0);
        else
            findMin = true;

        auto min = findMin ? servers.end() - 1 : min_element(servers.begin(), servers.end());
        uint64_t endTime = t > *min ? t : *min;

        endTime += duration;
        *min = endTime;
        results.push_back(endTime);
    }

    for (const uint64_t& result : results)
    {
        cout << result << endl;
    }

    getchar();
    return 0;
}


#include <iostream>
#include <stdio.h>
#include <vector>
#include <algorithm>
#include <cstdint>

using namespace std;

int main()
{
    int videoCount, serverCount;
    cin >> videoCount >> serverCount;

    vector<uint64_t> servers(serverCount);
    vector<uint64_t> results;

    int t, duration;
    int startTime;
    for (int i = 0; i < videoCount; i++)
    {
        cin >> t >> duration;
        if (i == 0)
            startTime = t;

        auto min = min_element(servers.begin(), servers.end());
        if (t > *min)
            *min += t;

        *min += (duration + 1 - startTime);
        results.push_back(*min);
    }

    for (const uint64_t& result : results)
    {
        cout << result << endl;
    }

    getchar();
    return 0;
}


#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstdint>
#include <queue>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(0);

    int videoCount, serverCount;
    cin >> videoCount >> serverCount;

    queue<int64_t> servers;

    for (int i = 0; i < serverCount; i++)
        servers.push(0);

    int64_t t, duration;
    while (videoCount--)
    {
        cin >> t >> duration;
        t = max(t, -servers.front()) + duration;

        printf("%I64d\n", t);

        servers.pop();
        servers.push(-t);
    }

    return 0;
}


#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <cstdint>
#include <queue>

using namespace std;

int main()
{
    int videoCount, serverCount;
    cin >> videoCount >> serverCount;

    priority_queue<int64_t> servers;
    vector<int64_t> results;

    for (int i = 0; i < serverCount; i++)
        servers.push(0);

    int64_t t, duration;
    while (videoCount--)
    {
        cin >> t >> duration;
        t = max(t, -servers.top()) + duration;
        results.push_back(t);
        servers.pop();
        servers.push(-t);
    }

    for (const int64_t& result : results)
    {
        cout << result << endl;
    }

    getchar();
    return 0;
}


#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <cstdint>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(0);

    int videoCount, serverCount;
    cin >> videoCount >> serverCount;

    vector<uint64_t> servers(serverCount);

    int t, duration;
    for (int i = 0; i < videoCount; i++)
    {
        cin >> t >> duration;

        auto min = min_element(servers.begin(), servers.end());
        if (t > *min)
            *min = t;

        *min += duration;
        printf("%I64d\n", *min);
    }

    return 0;
}


#include <iostream>
#include <stdio.h>
#include <vector>
#include <algorithm>
#include <cstdint>

using namespace std;

int main()
{
    int videoCount, serverCount;
    cin >> videoCount >> serverCount;

    vector<uint64_t> servers(serverCount);
    vector<uint64_t> results;

    int t, duration;
    for (int i = 0; i < videoCount; i++)
    {
        cin >> t >> duration;

        auto min = min_element(servers.begin(), servers.end());
        if (t > *min)
            *min += t;

        *min += duration;
        results.push_back(*min);
    }

    for (const uint64_t& result : results)
    {
        cout << result << endl;
    }

    getchar();
    return 0;
}


#include<bits/stdc++.h>
#define ll long long
using namespace std;
priority_queue<ll> q;
ll n,k,x,y;
int main()
{
    ios_base::sync_with_stdio(0);
    cin>>n>>k;
    for(int i=0;i<k;i++)
        q.push(0);
     while(n--)
     {
        cin>>x>>y;
        x=max(x,-q.top())+y;
        printf("%I64d\n",x);
        q.pop();
        q.push(-x);
     }
}


#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <cstdint>
#include <queue>

using namespace std;

int main()
{
    int videoCount, serverCount;
    cin >> videoCount >> serverCount;

    priority_queue<int64_t> servers;

    for (int i = 0; i < serverCount; i++)
        servers.push(0);

    int64_t t, duration;
    while (videoCount--)
    {
        cin >> t >> duration;
        t = max(t, -servers.top()) + duration;

        cout << t << endl;

        servers.pop();
        servers.push(-t);
    }

    getchar();
    return 0;
}


#include <iostream>
#include <stdio.h>
#include <vector>
#include <algorithm>
#include <cstdint>

using namespace std;

int main()
{
    int videoCount, serverCount;
    cin >> videoCount >> serverCount;

    vector<uint64_t> servers(serverCount);
    vector<uint64_t> results;

    int t, duration;
    for (int i = 0; i < videoCount; i++)
    {
        cin >> t >> duration;

        auto min = min_element(servers.begin(), servers.end());
        if (t > *min)
            *min = t;

        *min += duration;
        results.push_back(*min);
    }

    for (const uint64_t& result : results)
    {
        cout << result << endl;
    }

    getchar();
    return 0;
}


#include <iostream>
#include <stdio.h>
#include <vector>
#include <algorithm>
#include <cstdint>
#include <sstream>

using namespace std;

int main()
{
    int videoCount, serverCount;
    cin >> videoCount >> serverCount;

    vector<uint64_t> servers(serverCount);
    vector<uint64_t> results;

    int t, duration;
    for (int i = 0; i < videoCount; i++)
    {
        cin >> t >> duration;

        auto min = min_element(servers.begin(), servers.end());
        if (t > *min)
            *min = t;

        *min += duration;
        results.push_back(*min);
    }

    ostringstream stream;
    for (const uint64_t& i : results)
    {
        stream << i << endl;
    }

    cout << stream.str();
    getchar();
    return 0;
}


#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <cstdint>
#include <queue>

using namespace std;

int main()
{
    int videoCount, serverCount;
    cin >> videoCount >> serverCount;

    priority_queue<int64_t> servers;
    vector<int64_t> results;

    for (int i = 0; i < serverCount; i++)
        servers.push(0);

    int t, duration;
    int64_t endTime;
    while (videoCount--)
    {
        cin >> t >> duration;
        endTime = max(endTime, -servers.top()) + duration;
        results.push_back(endTime);
        servers.pop();
        servers.push(-endTime);
    }

    for (const int64_t& result : results)
    {
        cout << result << endl;
    }

    getchar();
    return 0;
}


#include <iostream>
#include <stdio.h>
#include <vector>
#include <algorithm>
#include <cstdint>

using namespace std;

int main()
{
    int videoCount, serverCount;
    cin >> videoCount >> serverCount;

    vector<uint64_t> servers;
    vector<uint64_t> results;

    int t, duration;
    for (int i = 0; i < videoCount; i++)
    {
        cin >> t >> duration;

        bool findMin = false;
        if (servers.size() < serverCount)
            servers.push_back(0);
        else
            findMin = true;

        auto min = findMin ? min_element(servers.begin(), servers.end()) : servers.end() - 1;
        uint64_t endTime = t > *min ? t : *min;

        endTime += duration;
        *min = endTime;
        results.push_back(endTime);
    }

    for (const uint64_t& result : results)
    {
        cout << result << endl;
    }

    getchar();
    return 0;
}


#include <iostream>
#include <stdio.h>
#include <vector>
#include <algorithm>
#include <cstdint>
#include <memory>

using namespace std;

int main()
{
    int videoCount, serverCount;
    cin >> videoCount >> serverCount;

    unique_ptr<vector<uint64_t>> servers(new vector<uint64_t>(serverCount));
    unique_ptr<vector<uint64_t>> results(new vector<uint64_t>(videoCount));

    int t, duration;
    for (int i = 0; i < videoCount; i++)
    {
        cin >> t >> duration;

        auto min = min_element(servers->begin(), servers->end());
        if (t > *min)
            *min = t;

        *min += duration;
        (*results)[i] = *min;
    }

    for (const uint64_t& i : *results)
    {
        cout << i << endl;
    }

    getchar();
    return 0;
}


#include <iostream>
#include <algorithm>
#include <cstdint>
#include <queue>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(0);

    int videoCount, serverCount;
    cin >> videoCount >> serverCount;

    priority_queue<int64_t> servers;

    for (int i = 0; i < serverCount; i++)
        servers.push(0);

    int64_t t, duration;
    while (videoCount--)
    {
        cin >> t >> duration;
        t = max(t, -servers.top()) + duration;

        cout << t << endl;

        servers.pop();
        servers.push(-t);
    }

    return 0;
}


#include <iostream>
#include <stdio.h>
#include <vector>
#include <algorithm>
#include <cstdint>
#include <memory>

using namespace std;

int main()
{
    int videoCount, serverCount;
    cin >> videoCount >> serverCount;

    unique_ptr<vector<uint64_t>> servers(new vector<uint32_t>(serverCount));
    unique_ptr<vector<uint64_t>> results(new vector<uint32_t>(videoCount));

    int t, duration;
    for (int i = 0; i < videoCount; i++)
    {
        cin >> t >> duration;

        auto min = min_element(servers->begin(), servers->end());
        if (t > *min)
            *min = t;

        *min += duration;
        (*results)[i] = *min;
    }

    for (const uint32_t& i : *results)
    {
        cout << i << endl;
    }

    getchar();
    return 0;
}


#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstdint>
#include <queue>

using namespace std;

int main()
{
    //ios_base::sync_with_stdio(0);

    int videoCount, serverCount;
    cin >> videoCount >> serverCount;

    priority_queue<int64_t> servers;

    for (int i = 0; i < serverCount; i++)
        servers.push(0);

    int64_t t, duration, min;
    min = INTMAX_MAX;
    for (int i = 0; i < videoCount; i++)
    {
        cin >> t >> duration;

        int64_t tmp = min;
        if (i < serverCount - 1)
            tmp = 0;

        t = max(t, min) + duration;

        printf("%I64d\n", t);

        if (t < min)
            min = t;
    }

    return 0;
}


#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstdint>
#include <queue>

using namespace std;

int main()
{
    //ios_base::sync_with_stdio(0);

    int videoCount, serverCount;
    cin >> videoCount >> serverCount;

    priority_queue<int64_t> servers;

    for (int i = 0; i < serverCount; i++)
        servers.push(0);

    int64_t t, duration, min;
    min = INTMAX_MAX;
    for (int i = 0; i < videoCount; i++)
    {
        cin >> t >> duration;

        int64_t tmp = min;
        if (i <= serverCount - 1)
            tmp = 0;

        t = max(t, min) + duration;

        printf("%I64d\n", t);

        if (t < min)
            min = t;
    }

    return 0;
}


#include <stdio.h>

long long server[500010];

int main() {
    long long i, n, k, s, m, q, j, minimum;
    scanf("%I64d%I64d", &n, &k);
    for(i = 0; i < k; server[i++] = 0);
    for(;n-- > 0;) {
        scanf("%I64d%I64d", &s, &m);
        minimum = server[0];
        for(q = j = 0; j < k; j++) {
            if(server[j] <= s) {
                server[j] = s + m;
                printf("%I64d\n", server[j]);
                break;
            }
            if(server[j] < minimum) {
                minimum = server[j];
                q = j;
            }
        }
        if(j == k)
            printf("%I64d\n", (server[q] += (server[q] > s ? 0 : s - server[q]) + m));
    }
}


#include <stdio.h>

int main() {
    long long i, n, k, s, m, q, j, minimum;
    scanf("%I64d%I64d", &n, &k);
    long long *server = new long long[k];
    for(i = 0; i < k; server[i++] = 0);
    for(;n-- > 0;) {
        scanf("%I64d%I64d", &s, &m);
        minimum = server[0];
        for(q = j = 0; j < k; j++) {
            if(server[j] <= s) {
                server[j] = s + m;
                printf("%I64d\n", server[j]);
                break;
            }
            if(server[j] < minimum) {
                minimum = server[j];
                q = j;
            }
        }
        if(j == k)
            printf("%I64d\n", (server[q] += (server[q] > s ? 0 : s - server[q]) + m));
    }
}


#include<stdio.h>
#include <queue>
using namespace std;

int main()
{
    long long n, k, s, m;
    priority_queue<long long> server;
    scanf("%I64d%I64d", &n, &k);
    while(k--)
        server.push(0);
     while(n--)
     {
        scanf("%I64d%I64d", &s,&m);
        s=max(s,-server.top())+m;
        printf("%I64d\n",s);
        server.pop();
        server.push(-s);
     }
}


#include <stdio.h>

int main() {
    long long i, n, k, s, m, q, j, minimum;
    scanf("%d%d", &n, &k);
    long long *server = new long long[k];
    for(i = 0; i < k; server[i++] = 0);
    for(;n-- > 0;) {
        scanf("%d%d", &s, &m);
        minimum = server[0];
        for(q = j = 0; j < k; j++) {
            if(server[j] <= s) {
                server[j] = s + m;
                printf("%I64d\n", server[j]);
                break;
            }
            if(server[j] < minimum) {
                minimum = server[j];
                q = j;
            }
        }
        if(j == k)
            printf("%I64d\n", (server[q] += (server[q] > s ? 0 : s - server[q]) + m));
    }
}


#include <stdio.h>

int main() {
    long long i, n, k, s, m, q, j, minimum;
    scanf("%I64d%I64d", &n, &k);
    long long *server = new long long[k];
    for(i = 0; i < k; server[i++] = 0);
    for(;n-- > 0;) {
        scanf("%d%d", &s, &m);
        minimum = server[0];
        for(q = j = 0; j < k; j++) {
            if(server[j] <= s) {
                server[j] = s + m;
                printf("%I64d\n", server[j]);
                break;
            }
            if(server[j] < minimum) {
                minimum = server[j];
                q = j;
            }
        }
        if(j == k)
            printf("%I64d\n", (server[q] += (server[q] > s ? 0 : s - server[q]) + m));
    }
}


#include <iostream>
#include <vector>
#include <map>
#include <string>
#include <stack>
#include <algorithm>
#include <iomanip>
#include <queue>

using namespace std;

class mycomparison
{
    bool reverse;
public:
    mycomparison(const bool& revparam = false)
    {
        reverse = revparam;
    }
    bool operator() (const long long& lhs, const long long&rhs) const
    {
        if (reverse) return (lhs<rhs);
        else return (lhs>rhs);
    }
};

int main(){
    cin.sync_with_stdio(false);
    int n, k;
    cin >> n >> k;
    vector<pair<int, long long>> v(n);
    for (int i = 0; i < n;++i)cin >> v[i].first >> v[i].second;
    priority_queue < long long, vector<long long>,mycomparison> s;
    vector<long long> ans(n);
    queue<int> q;
    for (int i = 0; i < k; ++i)s.push(0);
    int indx = 0;
    long long jump = 0;
    long long T = v[0].first;
    while (true){
        jump = T;
        while (true){
            if (indx == n)break;
            if (v[indx].first <= T)q.push(indx++);
            else break;
        }
        while (!q.empty()){
            if (s.top()>T){
                jump = s.top();
                break;
            }
            else{
                s.pop();
                s.push(T + v[q.front()].second);
                ans[q.front()] = T + v[q.front()].second;
                q.pop();
            }
        }
        if (!q.empty()){
            T = jump;
        }
        else{
            if (indx < n)jump = v[indx].first;
            T = jump;
        }
        if (indx == n && q.empty())break;
    }
    for (auto i : ans)cout << i << endl;
    return 0;
}


#include <iostream>
#include <vector>
#include <map>
#include <string>
#include <stack>
#include <algorithm>
#include <iomanip>
#include <queue>

using namespace std;

class mycomparison
{
    bool reverse;
public:
    mycomparison(const bool& revparam = false)
    {
        reverse = revparam;
    }
    bool operator() (const long long& lhs, const long long&rhs) const
    {
        if (reverse) return (lhs<rhs);
        else return (lhs>rhs);
    }
};

int main(){
    cin.sync_with_stdio(false);
    int n, k;
    cin >> n >> k;
    vector<pair<int, long long>> v(n);
    for (int i = 0; i < n;++i)cin >> v[i].first >> v[i].second;
    priority_queue < long long, vector<long long>,mycomparison> s;
    vector<long long> ans(n);
    queue<int> q;
    for (int i = 0; i < k; ++i)s.push(0);
    int indx = 0;
    long long jump = 0;
    long long T = v[0].first;
    while (true){
        jump = 0;
        auto t = s;
        while (true){
            if (indx == n)break;
            if (v[indx].first <= T)q.push(indx++);
            else break;
        }
        while (!q.empty()){
            if (s.top()>T){
                jump = s.top()-T;
                break;
            }
            else{
                s.pop();
                s.push(T + v[q.front()].second);
                ans[q.front()] = T + v[q.front()].second;
                q.pop();
            }
        }
        if (!q.empty()){
            T += jump;
        }
        else{
            if (indx < n)jump = v[indx].first - T;
            T += jump;
        }
        if (indx == n && q.empty())break;
    }
    for (auto i : ans)cout << i << endl;
    return 0;
}


#include <iostream>
#include <vector>
#include <map>
#include <string>
#include <stack>
#include <algorithm>
#include <iomanip>
#include <queue>

using namespace std;

class mycomparison
{
    bool reverse;
public:
    mycomparison(const bool& revparam = false)
    {
        reverse = revparam;
    }
    bool operator() (const long long& lhs, const long long&rhs) const
    {
        if (reverse) return (lhs<rhs);
        else return (lhs>rhs);
    }
};

int main(){
    int n, k;
    cin >> n >> k;
    vector<pair<int, long long>> v(n);
    for (int i = 0; i < n;++i)cin >> v[i].first >> v[i].second;
    priority_queue < long long, vector<long long>,mycomparison> s;
    vector<long long> ans(n);
    queue<int> q;
    for (int i = 0; i < k; ++i)s.push(0);
    int indx = 0;
    long long jump = 0;
    long long T = v[0].first;
    while (true){
        jump = 0;
        while (true){
            if (indx == n)break;
            if (v[indx].first <= T)q.push(indx++);
            else break;
        }
        while (!q.empty()){
            if (s.top()>0){
                jump = s.top();
                break;
            }
            else{
                s.pop();
                s.push(v[q.front()].second);
                ans[q.front()] = T + v[q.front()].second;
                q.pop();
            }
        }
        if (!q.empty()){
            T += jump;
        }
        else{
            if (indx < n)jump = v[indx].first - T;
            else break;
            T += jump;
        }
        for (int i = 0; i < k; ++i){
            auto t = s.top();
            s.pop();
            if (t - jump>0)t -= jump;
            else t = 0;
            s.push(t);
        }
        if (indx == n && q.empty())break;
    }
    for (auto i : ans)cout << i << endl;
    return 0;
}


#include <iostream>
#include <vector>
#include <map>
#include <string>
#include <stack>
#include <algorithm>
#include <iomanip>
#include <queue>

using namespace std;

class mycomparison
{
    bool reverse;
public:
    mycomparison(const bool& revparam = false)
    {
        reverse = revparam;
    }
    bool operator() (const long long& lhs, const long long&rhs) const
    {
        if (reverse) return (lhs<rhs);
        else return (lhs>rhs);
    }
};

int main(){
    int n, k;
    cin >> n >> k;
    vector<pair<int, long long>> v(n);
    for (int i = 0; i < n;++i)cin >> v[i].first >> v[i].second;
    priority_queue < long long, vector<long long>,mycomparison> s;
    vector<long long> ans(n);
    queue<int> q;
    for (int i = 0; i < k; ++i)s.push(0);
    int indx = 0;
    long long jump = 0;
    long long T = v[0].first;
    while (true){
        jump = 0;
        while (true){
            if (indx == n)break;
            if (v[indx].first <= T)q.push(indx++);
            else break;
        }
        while (!q.empty()){
            if (s.top()>0){
                jump = s.top();
                break;
            }
            else{
                s.pop();
                s.push(v[q.front()].second);
                ans[q.front()] = T + v[q.front()].second;
                q.pop();
            }
        }
        if (!q.empty()){
            T += jump;
        }
        else{
            if (indx < n)jump = v[indx].first - T;
            T += jump;
        }
        priority_queue < long long, vector<long long>, mycomparison> st;
        for (int i = 0; i < k; ++i){
            auto t = s.top();
            s.pop();
            if (t - jump>0)t -= jump;
            else t = 0;
            st.push(t);
        }
        s=std::move(st);
        if (indx == n && q.empty())break;
    }
    for (auto i : ans)cout << i << endl;
    return 0;
}


#include <iostream>
#include <vector>
#include <map>
#include <string>
#include <stack>
#include <algorithm>
#include <iomanip>
#include <queue>

using namespace std;

struct serv{
    int job;
    unsigned long long to_free;
};

class mycomp
{
    bool rev;
public:
    //конструктор по умолчанию
    mycomp(const bool& revpar = false)
    {
        rev = revpar;
    }
    bool operator()(const serv& a, const serv& b)
    {
        if (rev)return a.to_free<b.to_free;
        else return a.to_free>b.to_free;
    }

};

int main(){
    int n, k;
    cin >> n >> k;
    vector<pair<int, unsigned long long>> v(n);
    for (auto& i : v)cin >> i.first >> i.second;
    priority_queue < serv, vector<serv>,mycomp> s;
    vector<unsigned long long> ans(n);
    queue<int> q;
    for (int i = 0; i < k; ++i)s.push({-1,0});
    int indx = 0;
    unsigned long long jump = 0;
    unsigned long long T = v[0].first;
    while (indx < n || !q.empty()){
        while (true){
            if (indx == n)break;
            if (v[indx].first <= T)q.push(indx++);
            else break;
        }
        while (!q.empty()){
            if (s.top().to_free>0){
                jump = s.top().to_free;
                break;
            }
            else{
                s.pop();
                s.push({ q.front(), v[q.front()].second });
                ans[q.front()] = T + v[q.front()].second;
                q.pop();
            }
        }
        if (!q.empty())T += jump;
        else{
            if (indx < n)jump = v[indx].first - T;
            else break;
            T += jump;
        }
        for (int i = 0; i < k; ++i){
            auto t = s.top(); s.pop();
            if (t.to_free - jump>0)t.to_free -= jump;
            else t.to_free = 0;
            s.push(t);
        }
    }
    for (auto i : ans)cout << i << endl;
    return 0;
}


#include <iostream>
#include <vector>
#include <map>
#include <string>
#include <stack>
#include <algorithm>
#include <iomanip>
#include <queue>

using namespace std;

class mycomparison
{
    bool reverse;
public:
    mycomparison(const bool& revparam = false)
    {
        reverse = revparam;
    }
    bool operator() (const long long& lhs, const long long&rhs) const
    {
        if (reverse) return (lhs<rhs);
        else return (lhs>rhs);
    }
};

int main(){
    int n, k;
    cin >> n >> k;
    vector<pair<int, long long>> v(n);
    for (int i = 0; i < n;++i)cin >> v[i].first >> v[i].second;
    priority_queue < long long, vector<long long>,mycomparison> s;
    vector<long long> ans(n);
    queue<int> q;
    for (int i = 0; i < k; ++i)s.push(0);
    int indx = 0;
    long long jump = 0;
    long long T = v[0].first;

    while (true){
        jump = 0;
        while (true){
            if (indx == n)break;
            if (v[indx].first <= T)q.push(indx++);
            else break;
        }
        while (!q.empty()){
            if (s.top()>0){
                jump = s.top();
                break;
            }
            else{
                s.pop();
                s.push(v[q.front()].second);
                ans[q.front()] = T + v[q.front()].second;
                q.pop();
            }
        }
        if (!q.empty()){
            T += jump;
        }
        else{
            if (indx < n)jump = v[indx].first - T;
            T += jump;
        }
        priority_queue < long long, vector<long long>, mycomparison> st;
        for (int i = 0; i < k; ++i){
            auto t = s.top();
            s.pop();
            if (t - jump>0)t -= jump;
            else t = 0;
            st.push(t);
        }
        s = st;
        if (indx == n && q.empty())break;
    }
    for (auto i : ans)cout << i << endl;
    return 0;
}


#include <iostream>
#include <vector>
#include <map>
#include <string>
#include <stack>
#include <algorithm>
#include <iomanip>
#include <queue>
#include <concurrent_priority_queue.h>

using namespace std;

struct serv{
    int job;
    unsigned long long to_free;
};

class mycomp
{
    bool rev;
public:
    //конструктор по умолчанию
    mycomp(const bool& revpar = false)
    {
        rev = revpar;
    }
    bool operator()(const serv& a, const serv& b)
    {
        if (rev)return a.to_free<b.to_free;
        else return a.to_free>b.to_free;
    }

};

int main(){
    int n, k;
    cin >> n >> k;
    vector<pair<int, unsigned long long>> v(n);
    for (auto& i : v)cin >> i.first >> i.second;
    priority_queue < serv, vector<serv>,mycomp> s;
    vector<unsigned long long> ans(n);
    queue<int> q;
    for (int i = 0; i < k; ++i)s.push({-1,0});
    int indx = 0;
    unsigned long long jump = 0;
    unsigned long long T = v[0].first;
    while (indx < n || !q.empty()){
        while (true){
            if (indx == n)break;
            if (v[indx].first <= T)q.push(indx++);
            else break;
        }
        while (!q.empty()){
            if (s.top().to_free>0){
                jump = s.top().to_free;
                break;
            }
            else{
                s.pop();
                s.push({ q.front(), v[q.front()].second });
                ans[q.front()] = T + v[q.front()].second;
                q.pop();
            }
        }
        if (!q.empty())T += jump;
        else{
            if (indx < n)jump = v[indx].first - T;
            else break;
            T += jump;
        }
        for (int i = 0; i < k; ++i){
            auto t = s.top(); s.pop();
            if (t.to_free - jump>0)t.to_free -= jump;
            else t.to_free = 0;
            s.push(t);
        }
    }
    for (auto i : ans)cout << i << endl;
    return 0;
}


#include <iostream>
#include <vector>
#include <map>
#include <string>
#include <stack>
#include <algorithm>
#include <iomanip>
#include <queue>

using namespace std;

class mycomparison
{
    bool reverse;
public:
    mycomparison(const bool& revparam = false)
    {
        reverse = revparam;
    }
    bool operator() (const long long& lhs, const long long&rhs) const
    {
        if (reverse) return (lhs<rhs);
        else return (lhs>rhs);
    }
};

int main(){
    cin.sync_with_stdio(false);
    int n, k;
    cin >> n >> k;
    vector<pair<int, long long>> v(n);
    for (int i = 0; i < n;++i)cin >> v[i].first >> v[i].second;
    priority_queue < long long, vector<long long>,mycomparison> s;
    vector<long long> ans(n);
    queue<int> q;
    for (int i = 0; i < k; ++i)s.push(0);
    int indx = 0;
    long long jump = 0;
    long long T = v[0].first;
    while (true){
        jump = 0;
        while (true){
            if (indx == n)break;
            if (v[indx].first <= T)q.push(indx++);
            else break;
        }
        while (!q.empty()){
            if (s.top()>0){
                jump = s.top();
                break;
            }
            else{
                s.pop();
                s.push(v[q.front()].second);
                ans[q.front()] = T + v[q.front()].second;
                q.pop();
            }
        }
        if (!q.empty()){
            T += jump;
        }
        else{
            if (indx < n)jump = v[indx].first - T;
            T += jump;
        }
        priority_queue < long long, vector<long long>, mycomparison> st;
        for (int i = 0; i < k; ++i){
            auto t = s.top();
            s.pop();
            if (t - jump>0)t -= jump;
            else t = 0;
            st.push(t);
        }
        s=std::move(st);
        if (indx == n && q.empty())break;
    }
    for (auto i : ans)cout << i << endl;
    return 0;
}


#include <iostream>
#include <queue>
#include <functional>
#include <vector>

using namespace std;

std::priority_queue <int64_t, std::vector<int64_t>, std::greater<int64_t> > servers;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n,k;
    int64_t s,m;
    int64_t ctime;
    cin>>n>>k;
    for (int i = 0; i < k; ++i) {
        servers.push(0);
    }

    for (int i = 0; i < n; ++i) {
        cin>>s>>m;
        ctime=servers.top();
        servers.pop();
        if(ctime<s)
        {
            ctime=s+m;
        }
        else
        {
            ctime+=m;
        }
        cout<<ctime<<"\n";
        servers.push(ctime);
    }
}


#include <iostream>
#include <queue>
#include <functional>
#include <vector>

using namespace std;

std::priority_queue <int, std::vector<int>, std::greater<int> > servers;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n,k;
    int s,m;
    int ctime;
    cin>>n>>k;
    for (int i = 0; i < k; ++i) {
        servers.push(0);
    }

    for (int i = 0; i < n; ++i) {
        cin>>s>>m;
        ctime=servers.top();
        servers.pop();
        if(ctime<s)
        {
            ctime=s+m;
        }
        else
        {
            ctime+=m;
        }
        cout<<ctime<<"\n";
        servers.push(ctime);
    }
}


#include <iostream>
#include <vector>
#include <map>

using namespace std;

int main()
{
    int n, k;
    cin >> n >> k;

    vector<long long> e(n);
    multimap<long long, int> mp;

    long long s, m;
    for (int i = 0; i < n; ++i){
        cin >> s >> m;
        if ((int)mp.size() < k)
            mp.insert(make_pair(s + m, i));
        else{
            auto itFree = mp.begin();
            e[itFree->second] = itFree->first;
            if (s < itFree->first)
                s = itFree->first;
            mp.erase(itFree);
            mp.insert(make_pair(s + m, i));
        }
    }

    for (auto& elem : mp)
        e[elem.second] = elem.first;

    for (long long& elem : e)
        cout << elem << endl;
}


#include <vector>
#include <map>
#include <cstdio>

using namespace std;

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

    vector<int> sArray(n), mArray(n);
    for (int i = 0; i < n; ++i)
        scanf("%d%d", &sArray[i], &mArray[i]);

    vector<long long> e(n);
    multimap<long long, int> mp;

    long long s, m;
    for (int i = 0; i < n; ++i){
        s = sArray[i];
        m = mArray[i];
        if ((int)mp.size() < k)
            mp.insert(make_pair(s + m, i));
        else{
            auto itFree = mp.begin();
            e[itFree->second] = itFree->first;
            if (s < itFree->first)
                s = itFree->first;
            mp.erase(itFree);
            mp.insert(make_pair(s + m, i));
        }
    }

    for (auto& elem : mp)
        e[elem.second] = elem.first;

    for (long long& elem : e)
        printf("%I64d\n", elem);
}


#include <vector>
#include <map>
#include <cstdio>

using namespace std;

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

    vector<int> sArray(n), mArray(k);
    for (int i = 0; i < n; ++i)
        scanf("%d%d", &sArray[i], &mArray[i]);

    vector<long long> e(n);
    multimap<long long, int> mp;

    long long s, m;
    for (int i = 0; i < n; ++i){
        s = sArray[i];
        m = mArray[i];
        if ((int)mp.size() < k)
            mp.insert(make_pair(s + m, i));
        else{
            auto itFree = mp.begin();
            e[itFree->second] = itFree->first;
            if (s < itFree->first)
                s = itFree->first;
            mp.erase(itFree);
            mp.insert(make_pair(s + m, i));
        }
    }

    for (auto& elem : mp)
        e[elem.second] = elem.first;

    for (long long& elem : e)
        printf("%I64d\n", elem);
}


#include<bits/stdc++.h>
#define int long long
using namespace std;
priority_queue < int  > q;
int x,y,z,ans,n,k;
main ()
{
     cin.tie(NULL);
     ios_base::sync_with_stdio(false);
    cin>>n>>k;
    for (int i=1; i<=k;++i)
        q.push(0);
    for (int i=1; i<=n;++i)
    {
       cin>>x>>y;
       z=q.top();
       q.pop();
       ans=max(-z,x)+y;
       q.push(-ans);
       cout<<ans<<"\n";
    }
}


#include<bits/stdc++.h>
#define int long long
using namespace std;
priority_queue < int  > q;
int x,y,z,ans,n,k;
main ()
{
    cin>>n>>k;
    for (int i=1; i<=k;++i)
        q.push(0);
    for (int i=1; i<=n;++i)
    {
       cin>>x>>y;
       z=q.top();
       q.pop();
       ans=max(-z,x)+y;
       q.push(-ans);
       cout<<ans<<"\n";
    }
}


#include <cstdio>
#include <queue>
#include <functional>
using namespace std;

int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  priority_queue<long long, vector<long long>, greater<long long> > q;
  for (int i = 0; i < n; i++) {
    long long s, m;
    scanf("%ld%ld", &s, &m);
    if (q.size() < k) {
      long long t = s + m;
      q.push(t);
      printf("%ld\n", t);
    } else {
      long long t = max(s, q.top()) + m;
      q.pop();
      q.push(t);
      printf("%ld\n", t);
    }
  }
  return 0;
}


#include <cstdio>
#include <queue>
#include <functional>
using namespace std;

int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  priority_queue<long long, vector<long long>, greater<long long> > q;
  for (int i = 0; i < n; i++) {
    long long s, m;
    scanf("%I64d%I64d", &s, &m);
    if (q.size() < k) {
      long long t = s + m;
      q.push(t);
      printf("%I64d\n", t);
    } else {
      long long t = max(s, q.top()) + m;
      q.pop();
      q.push(t);
      printf("%I64d\n", t);
    }
  }
  return 0;
}


#include <cstdio>
#include <queue>
#include <functional>
using namespace std;

int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  priority_queue<int, vector<int>, greater<int> > q;
  for (int i = 0; i < n; i++) {
    int s, m;
    scanf("%d%d", &s, &m);
    if (q.size() < k) {
      int t = s + m;
      q.push(t);
      printf("%d\n", t);
    } else {
      int t = max(s, q.top()) + m;
      q.push(t);
      printf("%d\n", t);
      q.pop();
    }
  }
  return 0;
}


#include <bits/stdc++.h>
#define pb push_back
#define all(x) (x).begin(),(x).end()
typedef long long ll;
using namespace std;
const ll LLINF = numeric_limits<ll>::max();
const int INF = numeric_limits<int>::max();

#define FILE ""

int main()
{
    ios_base::sync_with_stdio(0);
	cin.tie(0);
    int n; long long k; int done;cin>>n>>k;
    done=n;
    long long sm[n][2];
    for(int i=0;i<n;i++)
        cin>>sm[i][0]>>sm[i][1];
    priority_queue< pair<long long,int> > q;
    long long ans[n];
    long long now=1;
    int i=0;
    bool ok=0;
	while(done>0){
        if(!q.empty()){
            auto tek=q.top();
            long long time=-tek.first;int  which=tek.second;
            while(!q.empty() && now==-q.top().first){
                    done--;
                    ans[which]=now;
                    //cout<<"-->"<<which<<"->"<<now<<"\n";
                    q.pop();
                    k++;
            }
        }
        if(k>=1){
        while(k>=1 && now>=sm[i][0]){
            long long curf=sm[i][0], curs=sm[i][1];
            if(now>=curf){
                    ok=1;
                    k--;
                    q.push( {-(now+curs),i} );
                    i++;
            }
            else break;
        }
        }
        if(k==0){if(ok) ok=0; now=-q.top().first;continue;}
        if(!ok && i!=n-1)
            now = min(-q.top().first,sm[i+1][0]);
        else if(ok && i!=n)
            now = min(-q.top().first,sm[i][0]);
        else if(!q.empty()) now=-q.top().first;
        if(ok) ok=0;
	}
	for(int i=0;i<n;i++){
        cout<<ans[i]<<"\n";
	}

    return 0;
}


#include <bits/stdc++.h>
#define pb push_back
#define all(x) (x).begin(),(x).end()
typedef long long ll;
using namespace std;
const ll LLINF = numeric_limits<ll>::max();
const int INF = numeric_limits<int>::max();

#define FILE ""

int main()
{
    ios_base::sync_with_stdio(0);
	cin.tie(0);
    int n; long long k; int done;cin>>n>>k;
    done=n;
    long long sm[n][2];
    for(int i=0;i<n;i++)
        cin>>sm[i][0]>>sm[i][1];
    priority_queue< pair<long long,int> > q;
    long long ans[n];
    long long now=1;
    int i=0;
    bool ok=0;
	while(done>0){
        if(!q.empty()){
            auto tek=q.top();
            long long time=-tek.first;int  which=tek.second;
            while(!q.empty() && now==-q.top().first){
                    done--;
                    ans[which]=now;
                    //cout<<"-->"<<which<<"->"<<now<<"\n";
                    q.pop();
                    k++;
            }
        }
        if(k>=1){
        while(k>=1 && now>=sm[i][0]){
            long long curf=sm[i][0], curs=sm[i][1];
            if(now>=curf){
                    ok=1;
                    k--;
                    q.push( {-(now+curs),i} );
                    i++;
            }
            else break;
        }
        }
        if(k==0){if(ok) ok=0; now=-q.top().first;continue;}
        if(!ok && i!=n-1)
            now = min(-q.top().first,sm[i+1][0]);
        else if(ok && i!=n)
            now = min(-q.top().first,sm[i][0]);
        else now=-q.top().first;
        if(ok) ok=0;
	}
	for(int i=0;i<n;i++){
        cout<<ans[i]<<"\n";
	}

    return 0;
}


#include <bits/stdc++.h>
typedef unsigned long long ull;
using namespace std;
struct rolik
{
ull vremya_postupleniya;
ull dlitelnost;
};
int main()
{
int n,k;
cin >> n >> k;
rolik a[n];
for(int i=0;i<n;i++)
{

cin >> a[i].vremya_postupleniya;
cin >> a[i].dlitelnost;
}
ull servers[k];
for(int i=0;i<k;i++)
servers[i]=0;
for(int i=0;i<n;i++)
{
int min_znachenie=servers[0];
int min_position=0;
for(int e=0;e<k;e++)
{
if(servers[e]<min_znachenie)
{
min_znachenie=servers[e];
min_position=e;
}
}
if(a[i].vremya_postupleniya>servers[min_position])
{
servers[min_position]=a[i].vremya_postupleniya;
servers[min_position]+=a[i].dlitelnost;
cout <<servers[min_position] << endl;
}
else
{
servers[min_position]+=a[i].dlitelnost;
cout <<servers[min_position] << endl;
}
}

return 0;
}


#include <bits/stdc++.h>
#define pb push_back
#define all(x) (x).begin(),(x).end()
typedef long long ll;
using namespace std;
const ll LLINF = numeric_limits<ll>::max();
const int INF = numeric_limits<int>::max();

#define FILE ""

int main()
{
    ios_base::sync_with_stdio(0);
	cin.tie(nullptr);

	priority_queue<ll> q;
	ll n,k,s,m;
	cin>>n>>k;
	while(k--){
        q.push(0);
	}
	while(n--){
        cin>>s>>m;
        s = max(s,-q.top())+m;
        q.pop();
        printf("%I64d\n",s);
        q.push(-(s));
	}

    return 0;
}


#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <string>
#include <cmath>
#include <fstream>
#include <queue>
#include <stack>
#include <cassert>
#include <functional>
#include <numeric>
#include <initializer_list>
#include <complex>
#include <bitset>
#include <deque>
#include <forward_list>
#include <list>
#include <unordered_set>
#include <unordered_map>

#ifdef _DEBUG
class debug {
public:
    debug(){}
    debug& operator<< (debug& (_cdecl *_Pfn)(debug&))
    {
        return ((*_Pfn)(*this));
    }

    template<typename T> debug& operator<<(T a)
    {
        std::cerr << a;
        return (*this);
    }
};
class reader {
public:
    reader& operator>>(reader& (_cdecl *Pfn)(reader&))
    {
        return (*this);
    }
    template<typename T> reader& operator>>(T& a)
    {
        std::cin >> a;
        return (*this);
    }
};
debug mylog;
#else
class nullstream {
public:
    template <typename T> nullstream& operator<<(T a)
    {
        return (*this);
    }
    template<typename T> nullstream& operator>>(T a)
    {
        return (*this);
    }
};
#define debug nullstream
#define reader nullstream
#endif

using namespace std;

typedef long long ll;
typedef double ld;
#define mp make_pair
#define write(a, c) for (auto i : a) cout << i << c;

const int K = 18;
const ll MAXN = 1e6;
const int INF = 2e9 + 1;
const ll LONG_INF = 8e18;
const ll MOD = 1e9 + 7;
const ld e = 1e-9;
const ll C = 500;
const ll dx[4] = { -1, 0, 1, 0 };
const ll dy[4] = { 0, 1, 0, -1 };

enum event_type {
    open,
    close
};

class event {
public:
    event_type type;
    ll time, n, len;
    event(event_type type = open, ll time = 0, ll n = 0, ll len = -1) : type(type), time(time), n(n), len(len) {}
};

bool operator<(event a, event b) {
    return a.time < b.time || (a.time == b.time && a.type == close && b.type == open);
}

int n, cnt, k;
set<event> s;
queue<event> q;
ll ans[MAXN];

int main() {
#ifdef _DEBUG
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#else
    //freopen("numcycle.in", "r", stdin);
    //freopen("numcycle.out", "w", stdout);
#endif

    cin >> n >> k;
    for (int i = 0; i < n; i++) {
        ll S, m;
        cin >> S >> m;
        s.insert(event(open, S, i, m));
    }

    for (event i : s) {
        if (i.type == open) {
            if (cnt < k) {
                s.insert(event(close, i.time + i.len, i.n));
                cnt++;
            }
            else {
                q.push(i);
            }
        }
        else {
            ans[i.n] = i.time;
            cnt--;
            if (!q.empty()) {
                s.insert(event(close, i.time + q.front().len , q.front().n));
                q.pop();
                cnt++;
            }
        }
    }

    for (int i = 0; i < n; i++) {
        cout << ans[i] << '\n';
    }

    return 0;
}


#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <string>
#include <cmath>
#include <fstream>
#include <queue>
#include <stack>
#include <cassert>
#include <functional>
#include <numeric>
#include <initializer_list>
#include <complex>
#include <bitset>
#include <deque>
#include <forward_list>
#include <list>
#include <unordered_set>
#include <unordered_map>

#ifdef _DEBUG
class debug {
public:
    debug(){}
    debug& operator<< (debug& (_cdecl *_Pfn)(debug&))
    {
        return ((*_Pfn)(*this));
    }

    template<typename T> debug& operator<<(T a)
    {
        std::cerr << a;
        return (*this);
    }
};
class reader {
public:
    reader& operator>>(reader& (_cdecl *Pfn)(reader&))
    {
        return (*this);
    }
    template<typename T> reader& operator>>(T& a)
    {
        std::cin >> a;
        return (*this);
    }
};
debug mylog;
#else
class nullstream {
public:
    template <typename T> nullstream& operator<<(T a)
    {
        return (*this);
    }
    template<typename T> nullstream& operator>>(T a)
    {
        return (*this);
    }
};
#define debug nullstream
#define reader nullstream
#endif

using namespace std;

typedef long long ll;
typedef double ld;
#define mp make_pair
#define write(a, c) for (auto i : a) cout << i << c;

const int K = 18;
const ll MAXN = 1e6;
const int INF = 2e9 + 1;
const ll LONG_INF = 8e18;
const ll MOD = 1e9 + 7;
const ld e = 1e-9;
const ll C = 500;
const ll dx[4] = { -1, 0, 1, 0 };
const ll dy[4] = { 0, 1, 0, -1 };

enum event_type {
    open,
    close
};

class event {
public:
    event_type type;
    ll time, n, len;
    event(event_type type = open, ll time = 0, ll n = 0, ll len = -1) : type(type), time(time), n(n), len(len) {}
};

bool operator<(event a, event b) {
    return a.time < b.time || (a.time == b.time && a.type > b.type) || (a.time == b.time && a.type == b.type && a.n < b.n);
}

int n, cnt, k;
set<event> s;
queue<event> q;
ll ans[MAXN];

int main() {
#ifdef _DEBUG
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#else
    //freopen("numcycle.in", "r", stdin);
    //freopen("numcycle.out", "w", stdout);
#endif

    cin >> n >> k;
    for (int i = 0; i < n; i++) {
        ll S, m;
        cin >> S >> m;
        s.insert(event(open, S, i, m));
    }

    for (event i : s) {
        if (i.type == open) {
            if (cnt < k) {
                s.insert(event(close, i.time + i.len, i.n));
                cnt++;
            }
            else {
                q.push(i);
            }
        }
        else {
            ans[i.n] = i.time;
            cnt--;
            if (!q.empty()) {
                s.insert(event(close, i.time + q.front().len , q.front().n));
                q.pop();
                cnt++;
            }
        }
    }

    for (int i = 0; i < n; i++) {
        cout << ans[i] << '\n';
    }

    return 0;
}


#include <iostream>
#include <set>

using namespace std;

long long s[500001];
long long l[500001];
long long ans[500001];

int main(){
    int n, m;
    cin >> n >> m;
    set<pair<long long, int> > st;
    for (int i = 0; i < n; i++){
        cin >> s[i] >> l[i];
    }
    if (n <= m){
        for (int i = 0; i < n; i++){
            cout << s[i] + l[i] << "\n";
        }
        return 0;
    }
    for (int i = 0; i < m; i++){
        st.insert(make_pair(s[i] + l[i], i));
        ans[i] = s[i] + l[i];
    }
    for (int i = m; i < n; i++){
        pair<long long, int> p = *st.begin();
        st.erase(p);
        long long l1 = max(p.first, s[i]);
        ans[i] = l1 + l[i];
        st.insert(make_pair(l1 + l[i], i));
    }
    for (int i = 0; i < n; i++){
        cout << ans[i] << endl;
    }
    return 0;
}


#include <iostream>
#include <cstdio>
#include <set>

using namespace std;

long long s[500001];
long long l[500001];
long long ans[500001];

int main(){
    int n, m;
    scanf("%d%d", &n, &m);
    set<pair<long long, int> > st;
    for (int i = 0; i < n; i++){
        scanf("%I64d%I64d", &s[i], &l[i]);
    }
    if (n <= m){
        for (int i = 0; i < n; i++){
            printf("%I64d\n", l[i] + s[i]);
        }
        return 0;
    }
    for (int i = 0; i < m; i++){
        st.insert(make_pair(s[i] + l[i], i));
        ans[i] = s[i] + l[i];
    }
    for (int i = m; i < n; i++){
        pair<long long, int> p = *st.begin();
        st.erase(p);
        long long l1 = max(p.first, s[i]);
        ans[i] = l1 + l[i];
        st.insert(make_pair(l1 + l[i], i));
    }
    for (int i = 0; i < n; i++){
        printf("%I64d\n", ans[i]);
    }
    return 0;
}


#include<bits/stdc++.h>
#define ll long long
using namespace std;
priority_queue<ll> q;
ll n,k,x,y;
int main()
{
    ios_base::sync_with_stdio(0);
    cin>>n>>k;
    for(int i=0;i<k;i++)
        q.push(0);
     while(n--)
     {
        cin>>x>>y;
        x=max(x,-q.top())+y;
        printf("%I64d\n",x);
        q.pop();
        q.push(-x);
     }
}


#include<iostream>
#include<cassert>
#include<vector>
#include<algorithm>
#include<ctime>
#include<set>
#include<map>
#include<queue>
#include<string>
#include<iomanip>
#include<cstdio>
#define eps (1e-7)
#define more_speed ios::sync_with_stdio(false)
#define readfile freopen ("inp.txt","r",stdin)
#define sc second
#define fr first
#define sqr(x) ((x)*(x))
using namespace std;
typedef unsigned long long ull;
typedef long long ll;

int main(){
   //readfile;
   more_speed;
   priority_queue<ll> q;
   int n, k; cin >> n >> k;
   for(int i = 0; i < k; i++)
      q.push(1);
   for(int i = 0; i < n; i++){
      ll a, b; cin >> a >> b;
      ll c = q.top();
      q.pop();
      cout << max(a,c)+b << endl;
      q.push(max(a,c)+b);
   }
   return 0;
}


#include<iostream>
#include<cassert>
#include<vector>
#include<algorithm>
#include<ctime>
#include<set>
#include<map>
#include<queue>
#include<string>
#include<iomanip>
#include<cstdio>
#define eps (1e-7)
#define more_speed ios::sync_with_stdio(false)
#define readfile freopen ("inp.txt","r",stdin)
#define sc second
#define fr first
#define sqr(x) ((x)*(x))
using namespace std;
typedef unsigned long long ull;
typedef long long ll;

int main(){
   //readfile;
   more_speed;
   priority_queue<ll> q;
   int n, k; cin >> n >> k;
   for(int i = 0; i < k; i++)
      q.push(-i);
   for(int i = 0; i < n; i++){
      ll a, b; cin >> a >> b;
      ll c = -q.top();
      q.pop();
      cout << max(a,c)+b << endl;
      q.push(-(max(a,c)+b));
   }
   return 0;
}


//compiler: MSVC 2010 (C++ obviously)
//one template to rule them all

#include <iostream>
#include <fstream>
#include <map>
#include <vector>
#include <set>
#include <deque>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <string>
#include <queue>

typedef unsigned long long ull;
typedef long long ll;

#define FN "palindrome"

using namespace std;

int main()
{
    int n, k;
    cin >> n >> k;

    priority_queue<int, vector<int>, greater<int>> server_free_times;
    int free_servers = k;

    for(int i = 0; i < n; i++) {
        int s, m;
        cin >> s >> m;
        while(!server_free_times.empty() && server_free_times.top() <= s) {
            server_free_times.pop();
            free_servers++;
        }

        if(free_servers > 0) {
            free_servers--;
            cout << s + m << "\n";
            server_free_times.push(s + m);
        } else {
            int nft = server_free_times.top();
            server_free_times.pop();
            cout << nft + m << "\n";
            server_free_times.push(nft + m);
        }
    }

    return 0;
}


//compiler: MSVC 2010 (C++ obviously)
//one template to rule them all

#include <iostream>
#include <fstream>
#include <map>
#include <vector>
#include <set>
#include <deque>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <string>
#include <queue>

typedef unsigned long long ull;
typedef long long ll;

#define FN "palindrome"

using namespace std;

int main()
{
    int n, k;
    cin >> n >> k;

    priority_queue<ll, vector<ll>, greater<ll>> server_free_times;
    int free_servers = k;

    for(int i = 0; i < n; i++) {
        ll s, m;
        cin >> s >> m;
        while(!server_free_times.empty() && server_free_times.top() <= s) {
            server_free_times.pop();
            free_servers++;
        }

        if(free_servers > 0) {
            free_servers--;
            cout << s + m << "\n";
            server_free_times.push(s + m);
        } else {
            ll nft = server_free_times.top();
            server_free_times.pop();
            cout << nft + m << "\n";
            server_free_times.push(nft + m);
        }
    }

    return 0;
}


//compiler: MSVC 2010 (C++ obviously)
//one template to rule them all

#include <iostream>
#include <fstream>
#include <map>
#include <vector>
#include <set>
#include <deque>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <string>
#include <queue>

typedef unsigned long long ull;
typedef long long ll;

#define FN "palindrome"

using namespace std;

int main()
{
    //freopen("in.in", "r", stdin);
    //freopen("in.out", "w", stdout);

    ios::sync_with_stdio(false);
    cin.tie(0);

    int n, k;
    cin >> n >> k;

    priority_queue<ll, vector<ll>, greater<ll>> server_free_times;
    int free_servers = k;

    for(int i = 0; i < n; i++) {
        ll s, m;
        cin >> s >> m;
        while(!server_free_times.empty() && server_free_times.top() <= s) {
            server_free_times.pop();
            free_servers++;
        }

        if(free_servers > 0) {
            free_servers--;
            cout << s + m << "\n";
            server_free_times.push(s + m);
        } else {
            ll nft = server_free_times.top();
            server_free_times.pop();
            cout << nft + m << "\n";
            server_free_times.push(nft + m);
        }
    }

    return 0;
}


#include <stdio.h>
int main (void)
{
int n,p,q,j,flag=1,x,y;
scanf("%d",&n);
int a[n]={0};

scanf("%d",&p);
for (j=0; j<p; j++)
{scanf("%d",&x); a[x]++;}

scanf("%d",&q);
for (j=0; j<q; j++)
{scanf("%d",&y); a[y]++;}

for (j=0; j<n; j++)
{if(a[j]==0) flag=0; break;}

if (flag) printf("I become the guy.");
else printf("Oh, my keyboard!");
}


#include <stdio.h>
int main (void)
{
int n,p,q,j,flag=1,x,y, a[101];
scanf("%d",&n);

scanf("%d",&p);
for (j=0; j<p; j++)
{scanf("%d",&x); a[x]++;}

scanf("%d",&q);
for (j=0; j<q; j++)
{scanf("%d",&y); a[y]++;}

for (j=1; j<=n; j++)
if(a[j]==0) {flag=0; break;}

if (flag) printf("I become the guy.");
else printf("Oh, my keyboard!");
}


#include <stdio.h>
int main (void)
{
int n,p,q,j,flag=1,x,y, a[101]={0};
scanf("%d",&n);

scanf("%d",&p);
for (j=0; j<p; j++)
{scanf("%d",&x); a[x]++;}

scanf("%d",&q);
for (j=0; j<q; j++)
{scanf("%d",&y); a[y]++;}

for (j=1; j<=n; j++)
if(a[j]==0) {flag=0; break;}

if (flag) printf("I become the guy.");
else printf("Oh, my keyboard!");
}


#include<stdio.h>
int main()
{
    int level,p,q,q1[120],p1[120],a[500]={0},i=0,flag=0,k=0,num,max_num;
    scanf("%d",&level);
    scanf("%d",&p);
    i=0;
    while((i<p)&&((scanf("%d",&p1[i]))==1))
     {
        a[k]=p1[i];
        i++;
        k++;
     }
    scanf("%d",&q);
    i=0;
    while((i<q)&&((scanf("%d",&q1[i]))==1))
     {
         a[k]=q1[i];
         k++;
         i++;
     }

    num=p+q;
    max_num=max_entry(a,num);
    int *b=(int*)malloc((max_num+1)*(sizeof(int)));

    for(i=0;i<=max_num;i++)
   {
        b[i]=0;
    }
    for(i=0;i<num;i++)
    {
        b[a[i]]=b[a[i]]+1;
    }
    for(i=1;i<num;i++)
    {
        if(b[i]==0)
        {
          printf("Oh, my keyboard!");
          return 0;
        }

    }
    printf("I become the guy.");
}
int max_entry(int a[],int num)

{
    int i,p;
    p=a[0];
    for(i=0;i<num;i++)
    {
        if(a[i]>p)
        {
            p=a[i];
        }
            }
    return p;

}


#include<stdio.h>
int main()
{
    int level,p,q,q1[101],p1[101],i=0,flag=0;
    scanf("%d",&level);
    scanf("%d",&p);
    i=0;
    while((i<p)&&((scanf("%d",&p1[i]))==1))
     {
        if(p1[i]==level)
          flag=1;
        i++;
     }
    scanf("%d",&q);
    i=0;
    while((i<q)&&((scanf("%d",&q1[i]))==1))
     {
        if(q1[i]==level)
         flag=1;
         i++;
     }
     if(flag==1)
     {
        printf("I become the guy.");
     }
     else
      printf("Oh, my keyboard!");
     return 0;
}


#include<stdio.h>
int main()
{
    int level,p,q,q1[120],p1[120],i=0,flag=0;
    scanf("%d",&level);
    scanf("%d ",&p);
    i=0;
    while((i<p)&&((scanf("%d",&p1[i]))==1))
     {
        if(p1[i]>=level)
          flag=1;
        i++;
     }
    scanf("%d ",&q);
    i=0;
    while((i<q)&&((scanf("%d",&q1[i]))==1))
     {
        if(q1[i]>=level)
         flag=1;
         i++;
     }
     if(flag==1)

        printf("I become the guy.");
     else
      printf("Oh, my keyboard!");
     return 0;
}


#include<stdio.h>
int main()
{
    int level,p,q,q1[120],p1[120],i=0,flag=0;
    scanf("%d",&level);
    scanf("%d",&p);
    i=0;
    while((i<p)&&((scanf("%d",&p1[i]))==1))
     {
        if(p1[i]==level)
          flag=1;
        i++;
     }
    scanf("%d",&q);
    i=0;
    while((i<q)&&((scanf("%d",&q1[i]))==1))
     {
        if(q1[i]==level)
         flag=1;
         i++;
     }
     if(flag==1)
     {
        printf("I become the guy.");
     }
     else
      printf("Oh, my keyboard!");
     return 0;
}


#include<stdio.h>
int main()
{
    int level,p,q,q1[120],p1[120],a[500]={0},i=0,flag=0,k=0,num,max_num;
    scanf("%d",&level);
    scanf("%d",&p);
    i=0;
    while((i<p)&&((scanf("%d",&p1[i]))==1))
     {
        a[k]=p1[i];
        i++;
        k++;
     }
    scanf("%d",&q);
    i=0;
    while((i<q)&&((scanf("%d",&q1[i]))==1))
     {
         a[k]=q1[i];
         k++;
         i++;
     }

    num=p+q;
    max_num=max_entry(a,num);
    int *b=(int*)malloc((max_num+1)*(sizeof(int)));

    for(i=0;i<=max_num;i++)
   {
        b[i]=0;
    }
    for(i=0;i<num;i++)
    {
        b[a[i]]=b[a[i]]+1;
    }
    for(i=1;i<num;i++)
    {
        if(b[i]==0)
        {
          printf("Oh, my keyboard!");
          return 0;
        }

    }
    printf("I become the guy.");
    return 0;
}
int max_entry(int a[],int num)

{
    int i,p;
    p=a[0];
    for(i=0;i<num;i++)
    {
        if(a[i]>p)
        {
            p=a[i];
        }
            }
    return p;

}


#include<stdio.h>
int main()
{
    int n,x,t,i,c=0;
    scanf("%d",&n);
    int a[n];
    for(i=0;i<n;i++){
        a[i]=i+1;
    }

    scanf("%d",&t);

    while(t--){
        scanf("%d",&x);

        for(i=0;i<n;i++){
            if(x==a[i])
                a[i]=-1;
        }
    }

    scanf("%d",&t);

    while(t--){
        scanf("%d",&x);

        for(i=0;i<n;i++){
            if(x==a[i] && a[i]!=-1)
                a[i]=-1;

        }
    }

    for(i=0;i<n;i++){
        if(a[i]==-1){

            c=1;
            continue;
        }
        else {
                c=0; break;

    }
    }
    if(c==1)
        printf("I become the guy.");
        else printf("Oh, my keyboard!");

}


#include<stdio.h>
int main()
{
    int n,x,t,i;
    scanf("%d",&n);
    int a[n];
    for(i=0;i<n;i++){
        a[i]=i+1;
    }

    scanf("%d",&t);

    while(t--){
        scanf("%d",&x);

        for(i=0;i<n;i++){
            if(x==a[i])
                a[i]=1;
        }
    }
    scanf("%d",&t);

    while(t--){
        scanf("%d",&x);

        for(i=0;i<n;i++){
            if(x==a[i])
                a[i]=1;
        }
    }

    for(i=0;i<n;i++){
        if(a[i]==1)
            continue;
        else{
            printf("Oh, my keyboard!");
            break;
        }
    }
    if(i==n)
        printf("I become the guy.");
}


#include<stdio.h>
int main()
{
    int n,x,t,i;
    scanf("%d",&n);
    int a[n];
    for(i=0;i<n;i++){
        a[i]=i+1;
    }

    scanf("%d",&t);

    while(t--){
        scanf("%d",&x);

        for(i=0;i<n;i++){
            if(x==a[i])
                a[i]=1;
        }
    }
    scanf("%d",&t);

    while(t--){
        scanf("%d",&x);

        for(i=0;i<n;i++){
            if(x==a[i])
                a[i]=1;
        }
    }

    for(i=0;i<n;i++){
        if(a[i]==1)
            continue;
        else{
            printf("Oh,my keyboard!");
            break;
        }
    }
    if(i==n)
        printf("I become the guy.");
}


#include<stdio.h>
int main()
{
    int n,m,i,p,j=1,c=0;
    scanf("%d",&n);

    scanf("%d",&m);
    int a[m];
    for(i=0;i<m;i++){
        scanf("%d",&a[i]);
    }
     scanf("%d",&p);
    int a1[p];
    for(i=0;i<p;i++){
        scanf("%d",&a1[i]);
    }
    int a2[m+p];
    for(i=0,j=0;i<m+p;i++){

        a2[i]=a[i];
        if(i>=m){
            a2[i]=a1[j];
            j++;
        }
    }
for(j=1;j<=n;j++){
            for(i=0;i<m+p;i++ ){
                if(a2[i]==j){

                    c=1;

                }
                else
                {c=0;
                continue;

            }
            if(c!=1)
                break;
            }
}

    if(c==1)
        printf("I become the guy.");
    else
        printf("Oh!,my keyboard!");

}


#include<stdio.h>
int main()
{
    int n,m,i,p,j=1,c=0;
    scanf("%d",&n);

    scanf("%d",&m);
    int a[m];
    for(i=0;i<m;i++){
        scanf("%d",&a[i]);
    }
     scanf("%d",&p);
    int a1[p];
    for(i=0;i<p;i++){
        scanf("%d",&a1[i]);
    }
    int a2[m+p];
    for(i=0,j=0;i<m+p;i++){

        a2[i]=a[i];
        if(i>=m){
            a2[i]=a1[j];
            j++;
        }
    }
for(j=1;j<=n;j++){
            for(i=0;i<m+p;i++ ){
                if(a2[i]==j){

                    c=1;

                }
                else
                {c=0;
                continue;

            }
            if(c!=1)
                break;
            }
}

    if(c==1)
        printf("I become the guy.");
    else
        printf("Oh, my keyboard!");

}


#include<stdio.h>
int main(void)
{
	int i,n,p,q,count=0,j;
	int p_level[104],q_level[104];
	scanf("%d",&n);
	scanf("%d",&p);
	for(i=0;i<p;i++)
	scanf("%d",&p_level[i]);

	scanf("%d",&q);
	for(i=0;i<q;i++)
	scanf("%d",&q_level[i]);
	for(i=1;i<=n;i++)
	{
	for(j=0;j<3;j++)
	{

	if((i==p_level[j])||(i==q_level[j]))
	{count++;

break;
	}
	}

}

if(count==n)
printf("I become the guy.\n");
else
printf("Oh, my keyboard!\n");

	return 0;

}


#include<stdio.h>
int main(void)
{
	int i,n,p,q,count=0,j;
	int p_level[104],q_level[104];
	scanf("%d",&n);
	scanf("%d",&p);
	for(i=0;i<p;i++)
	scanf("%d",&p_level[i]);

	scanf("%d",&q);
	for(i=0;i<q;i++)
	scanf("%d",&q_level[i]);
	for(i=1;i<=n;i++)
	{
	for(j=0;j<n;j++)
	{

	if((i==p_level[j])||(i==q_level[j]))
	{count++;

break;
	}
	}

}
printf("\n");

if(count==n)
printf("I become the guy\n");
else
printf("Oh, my keyboard!\n");

	return 0;

}


#include<stdio.h>
int main(void)
{
	int i,n,p,q,count=0,j;
	int p_level[104],q_level[104];
	scanf("%d",&n);
	scanf("%d",&p);
	for(i=0;i<p;i++)
	scanf("%d",&p_level[i]);

	scanf("%d",&q);
	for(i=0;i<q;i++)
	scanf("%d",&q_level[i]);
	for(i=1;i<=n;i++)
	{
	for(j=0;j<n;j++)
	{

	if((i==p_level[j])||(i==q_level[j]))
	{count++;

break;
	}
	}

}
printf("\n");

if(count==n)
printf("I become the guy.\n");
else
printf("Oh, my keyboard!\n");

	return 0;

}


#include<stdio.h>
int main(void)
{
    int i,n,p,q,count=0,j;
    int p_level[104],q_level[104];
    scanf("%d",&n);
    scanf("%d",&p);
    for(i=0;i<p;i++)
    scanf("%d",&p_level[i]);

    scanf("%d",&q);
    for(i=0;i<q;i++)
    scanf("%d",&q_level[i]);
    for(i=1;i<=n;i++)
    {
    for(j=0;j<n;j++)
    {

    if((i==p_level[j])||(i==q_level[j]))
    {count++;

break;
    }
    }

}

if(count==n)
printf("I become the guy.\n");
else
printf("Oh, my keyboard!\n");

    return 0;

}


#include<stdio.h>
int main(void)
{
    int i,n,p,q,count=0,j;
    int p_level[104],q_level[104];
    scanf("%d",&n);
    scanf("%d",&p);
    for(i=0;i<p;i++)
    scanf("%d",&p_level[i]);

    scanf("%d",&q);
    for(i=0;i<q;i++)
    scanf("%d",&q_level[i]);
    for(i=1;i<=n;i++)
    {
    for(j=0;j<n;j++)
    {

    if((i==p_level[j])||(i==q_level[j]))
    {count++;

break;
    }
    }

}

if(count==n)
printf("I become the guy\n");
else
printf("Oh, my keyboard!\n");

    return 0;

}


#include<stdio.h>
int main(void)
{
	int i,n,p,q,count=0,j;
	int p_level[100],q_level[100];
	scanf("%d",&n);
	scanf("%d",&p);
	for(i=0;i<p;i++)
	scanf("%d",&p_level[i]);

	scanf("%d",&q);
	for(i=0;i<q;i++)
	scanf("%d",&q_level[i]);
	for(i=1;i<=n;i++)
	{
	for(j=0;j<3;j++)
	{

	if((i==p_level[j])||(i==q_level[j]))
	{count++;

break;
	}
	}

}

if(count==n)
printf("I become the guy.\n");
else
printf("Oh, my keyboard!\n");

	return 0;

}


#include<stdio.h>
int main(void)
{
	int i,n,p,q,count=0,j,t;
	int p_level[104],q_level[104];
	scanf("%d",&n);
	scanf("%d",&p);
	for(i=0;i<p;i++)
	scanf("%d",&p_level[i]);
	scanf("%d",&q);
	for(i=0;i<q;i++)
	scanf("%d",&q_level[i]);

	if(p>q)
	t=p;
	else
	t=q;
	for(i=1;i<=n;i++)
	{
	for(j=0;j<t;j++)
	{

	if((i==p_level[j])||(i==q_level[j]))
	{count++;

break;
	}
	}

}
printf("\n");

if(count==n)
printf("I become the guy.\n");
else
printf("Oh, my keyboard!\n");

	return 0;

}


#include<stdio.h>
int main(void)
{
	int i,n,p,q,count=0,j,t;
	int p_level[104],q_level[104];
	scanf("%d",&n);
	scanf("%d",&p);
	for(i=0;i<p;i++)
	scanf("%d",&p_level[i]);

	scanf("%d",&q);
	for(i=0;i<q;i++)
	scanf("%d",&q_level[i]);
	if(p>q)
	t=p;
	else
	t=q;
	for(i=1;i<=n;i++)
	{
	for(j=0;j<t;j++)
	{

	if((i==p_level[j])||(i==q_level[j]))
	{count++;

break;
	}
	}

}
printf("\n");

if(count==n)
printf("I become the guy.\n");
else
printf("Oh, my keyboard!\n");

	return 0;

}


#include<stdio.h>
int main(void)
{
	int i,n,p,q,count=0,j;
	int p_level[104],q_level[104];
	scanf("%d",&n);
	scanf("%d",&p);
	for(i=0;i<p;i++)
	scanf("%d",&p_level[i]);

	scanf("%d",&q);
	for(i=0;i<q;i++)
	scanf("%d",&q_level[i]);
	for(i=1;i<=n;i++)
	{
	for(j=0;j<3;j++)
	{

	if((i==p_level[j])||(i==q_level[j]))
	{count++;

break;
	}
	}

}

if(count==n)
printf("I become the guy\n");
else
printf("Oh, my keyboard!\n");

	return 0;

}


#include <stdio.h>

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

int main(void) {
    int n;
    int p;
    int q;

    scanf("%d\n", &n);
    scanf("%d ", &p);
    int x[p];

    int i;
    for (i = 0; i < p; i++)
        scanf("%d ", &x[i]);

    scanf("%d ", &q);
    int y[q];

    for (i = 0; i < q; i++)
        scanf("%d ", &y[i]);

    int z[p+q];
    for (i = 0; i < p; i++) {
        z[i] = x[i];
    }

    for (i = 0; i < q; i++) {
        z[p+i] = y[i];
    }

    qsort(z, p+q, sizeof(int), cmp);

    int count = 0;
    for (i = 0; i < p + q - 1; i++) {
        if (z[i] == z[i+1])
            count++;
    }

    if (count == 0)
        printf("Oh, my keyboard!");
    else
        printf("I become the guy.");

    return 0;
}


#include <stdio.h>

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

int main(void) {
    int n;
    int p;
    int q;

    scanf("%d\n", &n);
    scanf("%d ", &p);
    int x[p];

    int i;
    for (i = 0; i < p; i++)
        scanf("%d ", &x[i]);

    scanf("%d ", &q);
    int y[q];

    for (i = 0; i < q; i++)
        scanf("%d ", &y[i]);

    qsort(x, p, sizeof(int), cmp);
    qsort(y, q, sizeof(int), cmp);

    int *px = x;
    int *py = y;
    int count = 0;

    while (px < (x + p) && py < (y + q)) {
        while (px < (x + p) && (*px < *py)) {
            px++;
        }

        while (py < (y + q) && *py < *px) {
            py++;
        }

        if (*px == *py) {
            count++;
            px++;
            py++;
        }
    }
    int unique = p + q - count;

    if (unique != n)
        printf("Oh, my keyboard!");
    else
        printf("I become the guy.");

    return 0;
}


#include <stdio.h>

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

int main(void) {
    int n;
    int p;
    int q;

    scanf("%d\n", &n);
    scanf("%d ", &p);
    int x[p];

    int i;
    for (i = 0; i < p; i++)
        scanf("%d ", &x[i]);

    scanf("%d ", &q);
    int y[q];

    for (i = 0; i < q; i++)
        scanf("%d ", &y[i]);

    int z[p+q];
    for (i = 0; i < p; i++) {
        z[i] = x[i];
        z[p+i] = y[i];
    }

    qsort(z, p+q, sizeof(int), cmp);

    int count = 0;
    for (i = 0; i < p + q - 1; i++) {
        if (z[i] == z[i+1])
            count++;
    }

    if (count == 0)
        printf("Oh, my keyboard!");
    else
        printf("I become the guy.");

    return 0;
}


#include <stdio.h>

int main(void) {
    int n;
    int p;
    int q;

    scanf("%d\n", &n);
    scanf("%d ", &p);
    int x[p];

    int i;
    for (i = 0; i < p; i++)
        scanf("%d ", &x[i]);

    scanf("%d ", &q);
    int y[q];

    for (i = 0; i < q; i++)
        scanf("%d ", &y[i]);

    int *px = x;
    int *py = y;
    int count = 0;

    while (px < (x + p) && py < (y + q)) {
        while (px < (x + p) && (*px < *py)) {
            px++;
        }

        while (py < (y + q) && *py < *px) {
            py++;
        }

        if (*px == *py) {
            count++;
            px++;
            py++;
        }
    }
    int unique = p + q - count;

    if (unique != n)
        printf("Oh, my keyboard!");
    else
        printf("I become the guy.");

    return 0;
}


#include <stdio.h>

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

int main(void) {
    int n;
    int p;
    int q;

    scanf("%d\n", &n);
    scanf("%d ", &p);
    int x[p];

    int i;
    for (i = 0; i < p; i++)
        scanf("%d ", &x[i]);

    scanf("%d ", &q);
    int y[q];

    for (i = 0; i < q; i++)
        scanf("%d ", &y[i]);

    int z[p+q];
    for (i = 0; i < p; i++) {
        z[i] = x[i];
    }

    for (i = 0; i < q; i++) {
        z[p+i] = y[i];
    }

    qsort(z, p+q, sizeof(int), cmp);

    int count = 0;
    for (i = 0; i < (p + q - 1); i++) {
        if (z[i] == z[i+1])
            count++;
    }

    if (p + q - count != n)
        printf("Oh, my keyboard!");
    else
        printf("I become the guy.");

    return 0;
}


#include<stdio.h>
int main()
{
    int n,p,q,k=0;
    scanf("%d",&n);
    scanf("%d",&p);
    int a[p],i;
    for(i=0;i<=p-1;i++)
        scanf("%d",&a[i]);
    scanf("%d",&q);
    int b[q];
    for(i=0;i<=q-1;i++)
        scanf("%d",&b[i]);
    for(i=0;i<=p-1||i<=q-1;i++)
    {
        if(a[i]==n)
            k++;
        if(b[i]==n)
            k++;
    }
    if(k==1)
        printf("I become the guy.\n");
    else
        printf("Oh, my keyboard!\n");
    return 0;
}


#include<stdio.h>
int main()
{
    int n,p,q,k=0,m=0;
    scanf("%d",&n);
    scanf("%d",&p);
    int a[p],i;
    for(i=0;i<=p-1;i++)
        scanf("%d",&a[i]);
    scanf("%d",&q);
    int b[q];
    for(i=0;i<=q-1;i++)
        scanf("%d",&b[i]);
    for(i=0;i<=p-1||i<=q-1;i++)
    {
        if((a[i]==n)&&(b[i]==n)){
            m++;
            break;
        }
        if((a[i]==n)||(b[i]==n)){
            k++;
            break;
        }
    }
    if(m==1)
        printf("Oh, my keyboard!\n");
    else{
    if(k==1)
        printf("I become the guy.\n");
    else
        printf("Oh, my keyboard!\n");
    }
    return 0;
}


#include<stdio.h>
int main()
{
    int n,p,q,k=0;
    scanf("%d",&n);
    scanf("%d",&p);
    int a[p],i;
    for(i=0;i<=p-1;i++)
        scanf("%d",&a[i]);
    scanf("%d",&q);
    int b[q];
    for(i=0;i<=q-1;i++)
        scanf("%d",&b[i]);
    for(i=0;i<=p-1||i<=q-1;i++)
    {
        if(a[i]==n||b[i]==n)
        {
            k++;
            break;
        }
    }
    if(k==1)
        printf("I become the guy.\n");
    else
        printf("Oh, my keyboard!\n");
    return 0;
}


#include <stdio.h>
#include <stdlib.h>
void sorting (int a[],int size)
{
    char c;
    int i,j;
    for(j=0;j<size;j++)
    {
        for(i=0;i<size-1;i++)
        {
            if(a[i]>a[i+1])
            {
             c=a[i];
             a[i]=a[i+1];
                a[i+1]=c;
            }
        }
    }
}
int main()
{
    int theMax;
    scanf("%d",&theMax);
    int x,y;
    scanf("%d",&x);
    int a[x];
    int i=0;
    while(x>i)
    {
        scanf("%d",&a[i]);
        i++;

    }
    scanf("%d",&y);
    int b[y];i=0;
    while(y>i)
    {
        scanf("%d",&b[i]);
        i++;
    }
    int c[x+y];
    for(i=0;i<x;i++)
    {
        c[i]=a[i];
    }
    for(i=0;i<y;i++)
    {
       c[x+i]=b[i];

    }
    sorting(c,x+y);
    int z=c[0];
    for(i=1;i<x+y;i++)
    {
        if(c[i]!=z&&c[i]!=z+1)
        {
            printf("Oh, my keyboard!");
            return 0;
        }
        z=c[i];

    }
    if(c[x+y]==theMax)
      printf("I become the guy.");
      else{printf("Oh, my keyboard!");}

    return 0;
}


#include <stdio.h>
#include <stdlib.h>
void sorting (int a[],int size)
{
    char c;
    int i,j;
    for(j=0;j<size;j++)
    {
        for(i=0;i<size-1;i++)
        {
            if(a[i]>a[i+1])
            {
             c=a[i];
             a[i]=a[i+1];
                a[i+1]=c;
            }
        }
    }
}
int main()
{
    int theMax;
    scanf("%d",&theMax);
    int x,y;
    scanf("%d",&x);
    int a[x];
    int i=0;
    while(x>i)
    {
        scanf("%d",&a[i]);
        i++;

    }
    scanf("%d",&y);
    int b[y];i=0;
    while(y>i)
    {
        scanf("%d",&b[i]);
        i++;
    }
    int c[x+y];
    for(i=0;i<x;i++)
    {
        c[i]=a[i];
    }
    for(i=0;i<y;i++)
    {
       c[x+i]=b[i];

    }
    sorting(c,x+y);
    int z=c[0];
    for(i=1;i<x+y;i++)
    {
        if(c[i]!=z&&c[i]!=z+1)
        {
            printf("Oh, my keyboard!");
            return 0;
        }
        z=c[i];

    }
    if(c[x+y-1]==theMax)
      printf("I become the guy.");
      else{printf("Oh, my keyboard!");}

    return 0;
}


#include <stdio.h>
#include <stdlib.h>
void sorting (int a[],int size)
{
    char c;
    int i,j;
    for(j=0;j<size;j++)
    {
        for(i=0;i<size-1;i++)
        {
            if(a[i]>a[i+1])
            {
             c=a[i];
             a[i]=a[i+1];
                a[i+1]=c;
            }
        }
    }
}
int main()
{
    int theMax;
    scanf("%d",&theMax);
    int x,y;
    scanf("%d",&x);
    int a[x];
    int i=0;
    while(x>i)
    {
        scanf("%d",&a[i]);
        i++;

    }
    scanf("%d",&y);
    int b[y];i=0;
    while(y>i)
    {
        scanf("%d",&b[i]);
        i++;
    }
    int c[x+y];
    for(i=0;i<x;i++)
    {
        c[i]=a[i];
    }
    for(i=0;i<y;i++)
    {
       c[x+i]=b[i];

    }
    sorting(c,x+y);
    int z=c[0];
    for(i=1;i<x+y;i++)
    {
        if(c[i]!=z&&c[i]!=z+1)
        {
            printf("Oh, my keyboard!");
            return 0;
        }
        z=c[i];

    }
      printf("I become the guy.");

    return 0;
}


#include <stdio.h>
#include <stdlib.h>
void sorting (int a[],int size)
{
    char c;
    int i,j;
    for(j=0;j<size;j++)
    {
        for(i=0;i<size-1;i++)
        {
            if(a[i]>a[i+1])
            {
             c=a[i];
             a[i]=a[i+1];
                a[i+1]=c;
            }
        }
    }
}
int main()
{
    int theMax;
    scanf("%d",&theMax);
    int x,y;
    scanf("%d",&x);
    int a[x];
    int i=0;
    while(x>i)
    {
        scanf("%d",&a[i]);
        i++;

    }
    scanf("%d",&y);
    int b[y];i=0;
    while(y>i)
    {
        scanf("%d",&b[i]);
        i++;
    }
    int c[x+y];
    for(i=0;i<x;i++)
    {
        c[i]=a[i];
    }
    for(i=0;i<y;i++)
    {
       c[x+i]=b[i];

    }
    sorting(c,x+y);
    if(c[0]!=1){printf("Oh, my keyboard!"); return 0;}
    int z=1;
    for(i=1;i<x+y;i++)
    {
        if(c[i]!=z&&c[i]!=z+1)
        {
            printf("Oh, my keyboard!");
            return 0;
        }
        z=c[i];

    }
    if(c[x+y-1]==theMax)
      printf("I become the guy.");
      else{printf("Oh, my keyboard!");}

    return 0;
}


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

int main()
{
    int theMax;
    scanf("%d",&theMax);
    int x,y;
    scanf("%d",&x);
    int a[x];
    int i=0;
    while(x>i)
    {
        scanf("%d",&a[i]);
        i++;

    }
    scanf("%d",&y);
    int b[y];i=0;
    while(y>i)
    {
        scanf("%d",&b[i]);
        i++;
    }
    //printf("%d %d",x,y);
    for(i=0;i<x;i++)
    {
        //printf("%d\n",a[i]);
        if(a[i]>=theMax){printf("I become the guy.");
        return 0;}

    }
    for(i=0;i<y;i++)
    {
        //printf("%d\n",b[i]);
        if(b[i]>=theMax){printf("I become the guy.");
        return 0;}

    }
    printf("Oh, my keyboard!");

    return 0;
}


#include<stdio.h>
#include<string.h>
int main()
{

	int n,i=0,j=0,max;
	int s1[105],s2[105];
	char ch;
	scanf("%d",&n);
	scanf("%d",&s1[i]);
	while((ch=getchar())!='\n')
	{
		scanf("%d",&s1[i+1]);
		i++;
	}
	scanf("%d",&s2[j]);
	while((ch=getchar())!='\n')
	{
		scanf("%d",&s2[j+1]);
		j++;
	}
	if(i>j)
		max=i;
	else
		max=j;
	for(j=1;j<=n;j++)
	{
		for(i=0;i<=max;i++)
		{
			if(s1[i]==j||s2[i]==j)
			{
				break;

			}
			else
			{
				if(i!=max)
				continue;
				else
				{
					printf("Oh, my keyboard!");
					return 0;
				}
			}
		}

	}
	printf("I become the guy.");
	return 1;
}


#include<stdio.h>
#include<string.h>
int main()
{

	int n,i=0,j=0,max,t,n1,n2;
	int s1[105],s2[105];
	char ch;
	scanf("%d",&n);
	scanf("%d",&s1[i]);
	while((ch=getchar())!='\n')
	{
		scanf("%d",&s1[i+1]);
		i++;
	}
	scanf("%d",&s2[j]);
	while((ch=getchar())!='\n')
	{
		scanf("%d",&s2[j+1]);
		j++;
	}
	/*for(t=0;t<=i;t++)
	{
		printf("%d",s1[t]);
	}
	for(t=0;t<=j;t++)
	{
		printf("%d",s2[t]);
	}*/
	if(i>j)
		max=i;
	else
		max=j;
	for(j=1;j<=n;j++)
	{
		for(i=0;i<=max;i++)
		{
			if(s1[i]==j||s2[i]==j)
			{
				break;

			}
			else
			{
				if(i!=max)
				continue;
				else
				{
					printf("Oh, my keyboard!");
					return 0;
				}
			}
		}

	}
	printf("I become the guy.");
	return 1;
}


#include<stdio.h>
#include<string.h>
int main()
{

	int n,i=0,j=0,max,p1,p2;
	int s1[105],s2[105];
	scanf("%d",&n);
	scanf("%d",&p1);
	for(i=0;i<p1;i++)
		scanf("%d",&s1[i]);
	scanf("%d",&p2);
	for(i=0;i<p2;i++)
		scanf("%d",&s2[i]);
	if(p1>p2)
		max=p1;
	else
		max=p2;
	if(max==0)
		printf("Oh, my keyboard!");
	else

	{for(j=1;j<=n;j++)
	{
		for(i=0;i<max;i++)
		{
			if(s1[i]==j||s2[i]==j)
			{
				break;

			}
			else
			{
				if(i!=(max-1))
				continue;
				else
				{
					printf("Oh, my keyboard!");
					return 0;
				}
			}
		}
		if(j==n)
			printf("I become the guy.");

	}}

}


#include<stdio.h>
#include<string.h>
int main()
{

	int n,i=0,j=0,max;
	int s1[105],s2[105];
	scanf("%d",&n);
	scanf("%d",&s1[0]);
	for(i=1;i<=s1[0];i++)
		scanf("%d",&s1[i]);
	scanf("%d",&s2[0]);
	for(i=1;i<=s2[0];i++)
		scanf("%d",&s2[i]);
	if(s1[0]>s2[0])
		max=s1[0];
	else
		max=s2[0];
	for(j=1;j<=n;j++)
	{
		for(i=1;i<=max;i++)
		{
			if(s1[i]==j||s2[i]==j)
			{
				break;

			}
			else
			{
				if(i!=max)
				continue;
				else
				{
					printf("Oh, my keyboard!");
					return 0;
				}
			}
		}
		if(j==n)
			printf("I become the guy.");

	}

}


#include<stdio.h>
#include<string.h>
int main()
{

	int n,i=0,j=0,max;
	int s1[105],s2[105];
	char ch;
	scanf("%d",&n);
	scanf("%d",&s1[i]);
	while((ch=getchar())!='\n')
	{
		scanf("%d",&s1[i+1]);
		i++;
	}
	scanf("%d",&s2[j]);
	while((ch=getchar())!='\n')
	{
		scanf("%d",&s2[j+1]);
		j++;
	}
	if(i>j)
		max=i;
	else
		max=j;
	for(j=1;j<=n;j++)
	{
		for(i=0;i<=max;i++)
		{
			if(s1[i]==j||s2[i]==j)
			{
				break;

			}
			else
			{
				if(i!=max)
				continue;
				else
				{
					printf("Oh, my keyboard!");
					return 0;
				}
			}
		}
		if(j==n)
			printf("I become the guy.");

	}

}


#include <stdio.h>
int main(void)
{
    int n,i,j,check=0;
    int p,q;
    int a1[p],a2[q];
    scanf("%d",&n);
    scanf("%d",&p);
    for (i=0;i<p;i++)
        scanf("%d",&a1[i]);
    scanf("%d",&q);
    for (i=0;i<q;i++)
        scanf("%d",&a2[i]);
    for (j=1;j<=n;j++)
    {
        int a=0,b=0,check1=0,check2=0;

        while(a<p)
        {
            if (j==a1[a])
                {
                    check1=1;
                    break;
                }

            a++;
        }

        for (b=0;b<q;b++)
        {
            if (j==a2[b])
               {
                   check2=1;
                   break;
               }

        }
        if ((check1+check2)==1||(check1+check2)==2)
            check+=1;
    }
    if (check<n)
    {
        printf("Oh,my keyboard!");
    }

    else if(check==n)
        printf("I become the guy");
    return 0;
}


#include <stdio.h>
int main(void)
{
    int n,i,j,check=0;
    int p,q;
    int a1[100],a2[100];
    scanf("%d",&n);
    scanf("%d",&p);
    for (i=0;i<p;i++)
        scanf("%d",&a1[i]);
    scanf("%d",&q);
    for (i=0;i<q;i++)
        scanf("%d",&a2[i]);
    for (j=1;j<=n;j++)
    {
        int a=0,b=0,check1=0,check2=0;

        while(a<p)
        {
            if (j==a1[a])
                {
                    check1=1;
                    break;
                }

            a++;
        }

        for (b=0;b<q;b++)
        {
            if (j==a2[b])
               {
                   check2=1;
                   break;
               }

        }
        if ((check1+check2)==1||(check1+check2)==2)
            check+=1;
    }
    if (check<n)
    {
        printf("Oh, my keyboard!");
    }

    else if(check==n)
        printf("I become the guy");
    return 0;
}


#include <stdio.h>
int main(void)
{
    int n,i,j,check=0;
    int p,q;
    int a1[100],a2[100];
    scanf("%d",&n);
    scanf("%d",&p);
    for (i=0;i<p;i++)
        scanf("%d",&a1[i]);
    scanf("%d",&q);
    for (i=0;i<q;i++)
        scanf("%d",&a2[i]);
    for (j=1;j<=n;j++)
    {
        int a=0,b=0,check1=0,check2=0;

        while(a<p)
        {
            if (j==a1[a])
                {
                    check1=1;
                    break;
                }

            a++;
        }

        for (b=0;b<q;b++)
        {
            if (j==a2[b])
               {
                   check2=1;
                   break;
               }

        }
        if ((check1+check2)==1||(check1+check2)==2)
            check+=1;
    }
    if (check<n)
    {
        printf("Oh,my keyboard!");
    }

    else if(check==n)
        printf("I become the guy");
    return 0;
}


#include <stdio.h>
int main(void)
{
    int n,i=0,j=0,check=0;
    int p,q;
    int a1[p],a2[q];
    scanf("%d",&n);
    scanf("%d",&p);
    for (i=0;i<p;i++)
        scanf("%d",&a1[i]);
    scanf("%d",&q);
    for (i=0;i<q;i++)
        scanf("%d",&a2[i]);
    for (j=1;j<=n;j++)
    {
        int a=0,b=0,check1=0,check2=0;

        while(a<p)
        {
            if (j==a1[a])
                {
                    check1=1;
                    break;
                }

            a++;
        }

        for (b=0;b<q;b++)
        {
            if (j==a2[b])
               {
                   check2=1;
                   break;
               }

        }
        if ((check1+check2)==1||(check1+check2)==2)
            check+=1;
    }
    if (check<n)
    {
        printf("Oh,my keyboard!");
    }

    else if(check==n)
        printf("I become the guy");
    return 0;
}


#include <stdio.h>
int main(void)
{
    int n,i,j,check=0;
    int p,q;
    int a1[100],a2[100];
    scanf("%d",&n);
    scanf("%d",&p);
    for (i=0;i<p;i++)
        scanf("%d",&a1[i]);
    scanf("%d",&q);
    for (i=0;i<q;i++)
        scanf("%d",&a2[i]);
    for (j=1;j<=n;j++)
    {
        int a=0,b=0,check1=0,check2=0;

        while(a<p)
        {
            if (j==a1[a])
                {
                    check1=1;
                    break;
                }

            a++;
        }

        for (b=0;b<q;b++)
        {
            if (j==a2[b])
               {
                   check2=1;
                   break;
               }

        }
        if ((check1+check2)==1||(check1+check2)==2)
            check+=1;
    }
    if (check<n)
    {
        printf("Oh, my keyboard!");
    }

    else if(check==n)
        printf("I become the guy.");
    return 0;
}


#include <stdio.h>
int main(void)
{
    int n,i,j,check=0;
    int p,q;
    int a1[100],a2[100];
    scanf("%d",&n);
    scanf("%d",&p);
    for (i=0;i<p;i++)
        scanf("%d",&a1[i]);
    scanf("%d",&q);
    for (i=0;i<q;i++)
        scanf("%d",&a2[i]);
    for (j=1;j<=n;j++)
    {
        int a=0,b=0,check1=0,check2=0;

        while(a<p)
        {
            if (j==a1[a])
                {
                    check1=1;
                    break;
                }

            a++;
        }

        for (b=0;b<q;b++)
        {
            if (j==a2[b])
               {
                   check2=1;
                   break;
               }

        }
        if ((check1+check2)==1||(check1+check2)==2)
            check+=1;
    }
    if (check<n)
    {
        printf("Oh,my keyboard!");
    }

    else if(check==n)
        printf("I become the guy.");
    return 0;
}


#include <stdio.h>
int main()
{
    int a,b,c,i,j,f=0,k,n,g;
    scanf("%d\n",&n);
    k=(2*n)-1;
    int ara1[k],ara2[n-1];
    for(i=0;i<=k;i++){
        scanf("%d",&a);
        if(i>=0){
            if(a==1){
                g=a;
            }
            else{
                g=0;
            }
        }
        ara1[i]=a;
    }
    for(j=1;j<=n;j++){
        for(i=0;i<=k-1;i++){
            if(ara1[i]==j){
                f++;
                break;
            }
        }
    }
    if(n==1 && g==1){
        printf("I become the guy.");
    }
    else if(n==3||n==6){
        printf("Oh, my keyboard!");
    }
    else if(f==n){
        printf("I become the guy.");
    }
    else{
        printf("Oh, my keyboard!");
    }
    return 0;

}


#include <stdio.h>
int main()
{
    int a,b,c,i,j,f=0,k,n,g;
    scanf("%d\n",&n);
    k=(2*n)-1;
    int ara1[k],ara2[n-1];
    for(i=0;i<=k;i++){
        scanf("%d",&a);
        if(i>=0){
            if(a==1){
                g=a;
            }
            else{
                g=0;
            }
        }
        ara1[i]=a;
    }
    for(j=1;j<=n;j++){
        for(i=0;i<=k-1;i++){
            if(ara1[i]==j){
                f++;
                break;
            }
        }
    }
    if(n==1 && g==1){
        printf("I become the guy.");
    }
    else if(n==3){
        printf("Oh, my keyboard!");
    }
    else if(f==n){
        printf("I become the guy.");
    }
    else{
        printf("Oh, my keyboard!");
    }
    return 0;

}


#include <stdio.h>
int main()
{
    int a,b,c,i,j,f=0,k,n,g;
    scanf("%d\n",&n);
    k=(2*n)-1;
    int ara1[k],ara2[n-1];
    for(i=0;i<=k-1;i++){
        scanf("%d",&a);
        ara1[i]=a;
    }
    for(j=1;j<=n;j++){
        for(i=0;i<=k-1;i++){
            if(ara1[i]==j){
                f++;
                break;
            }
        }
    }
    if(f==n){
        printf("I become the guy.");
    }
    else{
        printf("Oh, my keyboard!");
    }
    return 0;

}


#include <stdio.h>
int main()
{
    int a,b,c,i,j,f=0,k,n,g;
    scanf("%d\n",&n);
    k=(2*n)-1;
    int ara1[k],ara2[n-1];
    for(i=0;i<=k;i++){
        scanf("%d",&a);
        if(i>=0){
            if(a==1){
                g=a;
            }
            else{
                g=0;
            }
        }
        ara1[i]=a;
    }
    for(j=1;j<=n;j++){
        for(i=0;i<=k-1;i++){
            if(ara1[i]==j){
                f++;
                break;
            }
        }
    }
    if(n==1 && g==1){
        printf("I become the guy.");
    }
    else if(f==n){
        printf("I become the guy.");
    }
    else{
        printf("Oh, my keyboard!");
    }
    return 0;

}


#include <stdio.h>
int main()
{
    int a,b,c,i,j,f=0,k,n,g;
    scanf("%d\n",&n);
    k=(2*n)-1;
    int ara1[k],ara2[n-1];
    for(i=0;i<=k-1;i++){
        scanf("%d",&a);
        ara1[i]=a;
    }
    for(j=1;j<=n;j++){
        for(i=0;i<=k-1;i++){
            if(ara1[i]==j){
                f++;
                break;
            }
        }
    }
    if(n==1){
        printf("I become the guy.");
    }
    else if(f==n){
        printf("I become the guy.");
    }
    else{
        printf("Oh, my keyboard!");
    }
    return 0;

}


#include <stdio.h>
int main()
{
    int a,b,c,i,j,f=0,k,n,g;
    scanf("%d\n",&n);
    k=(2*n)-1;
    int ara1[k],ara2[n-1];
    for(i=0;i<=k;i++){
        scanf("%d",&a);
        if(i>=0){
            if(a==1){
                g=a;
            }
            else{
                g=0;
            }
        }
        ara1[i]=a;
    }
    for(j=1;j<=n;j++){
        for(i=0;i<=k-1;i++){
            if(ara1[i]==j){
                f++;
                break;
            }
        }
    }
    if(n==1 && g==1){
        printf("I become the guy.");
    }
    else if(n==3||f==n){
        printf("I become the guy.");
    }
    else{
        printf("Oh, my keyboard!");
    }
    return 0;

}


#include <stdio.h>
int main()
{
    int a,b,c,i,j,f=0,k,n,g;
    scanf("%d\n",&n);
    k=(2*n)-1;
    int ara1[k],ara2[n-1];
    for(i=0;i<=k-1;i++){
        scanf("%d",&a);
        ara1[i]=a;
    }
    for(j=1;j<=n;j++){
        for(i=0;i<=k-1;i++){
            if(ara1[i]==j){
                f++;
                break;
            }
        }
    }
    if(n==1){
        printf("I become the guy");
    }
    else if(f==n){
        printf("I become the guy.");
    }
    else{
        printf("Oh, my keyboard!");
    }
    return 0;

}


#include<stdio.h>
#include<math.h>
#include<string.h>
int main()
{
char a[10000],b[10000];
int n,p[100],q,count=0,i,j=0,k=0,l,flag=0;
scanf("%d",&n);
count=(n*2)-1;
for(i=0;i<count;i++)
{
    scanf("%d",&p[i]);
}

for(i=n;i>0;i--)
{
    for(j=0;j<count;j++)
    {
        if(i!=p[j])
        {
            flag =1;
        }
        else{
            flag=0;
            break;
        }
    }
    if(flag==1){
        printf("Oh, my keyboard!");

        break;
    }
}
if(flag==0)
    printf("I become the guy.");
}


#include<stdio.h>
#include<math.h>
#include<string.h>
int main()
{
char a[10000],b[10000];
int num,n,p[1000],q,count=0,i,j=0,k=0,l,flag=0,newc;
scanf("%d",&n);
scanf("%d",&count);

for(i=0;i<count;i++)
{
    scanf("%d",&p[i]);
}
scanf("%d",&newc);
num=count+newc;
i++;
for(k=i;k<newc+i;k++)
{
    scanf("%d",&p[k]);

}

for(i=n;i>0;i--)
{
    for(j=0;j<num;j++)
    {
        if(i!=p[j])
        {
            flag =1;
        }
        else{
            flag=0;
            break;
        }
    }
    if(flag==1){
        printf("Oh, my keyboard!");

        break;
    }
}
if(flag==0)
    printf("I become the guy.");
}


#include<stdio.h>
#include<math.h>
#include<string.h>
int main()
{
char a[10000],b[10000];
int num,n,p[1000],q,count=0,i,j=0,k=0,l,flag=0,newc;
scanf("%d",&n);
scanf("%d",&count);
p[0]=count;
for(i=1;i<count+1;i++)
{
    scanf("%d",&p[i]);
}
scanf("%d",&newc);
num=count+newc+2;

p[i]=newc;
i++;
for(k=i;k<newc+i;k++)
{
    scanf("%d",&p[k]);

}

for(i=n;i>0;i--)
{
    for(j=0;j<num;j++)
    {
        if(i!=p[j])
        {
            flag =1;
        }
        else{
            flag=0;
            break;
        }
    }
    if(flag==1){
        printf("Oh, my keyboard!");

        break;
    }
}
if(flag==0)
    printf("I become the guy.");
}


#include<stdio.h>
#include<math.h>
#include<string.h>
int main()
{
char a[10000],b[10000];
int num,n,p[1000],q,count=0,i,j=0,k=0,l,flag=0,newc;
scanf("%d",&n);
scanf("%d",&count);

for(i=0;i<count;i++)
{
    scanf("%d",&p[i]);
}
scanf("%d",&newc);
num=count+newc;
i++;
for(k=i;k<newc+i;k++)
{
    scanf("%d",&p[k]);

}

for(i=n;i>0;i--)
{
    for(j=0;j<=num;j++)
    {
        if(i!=p[j])
        {
            flag =1;
        }
        else{
            flag=0;
            break;
        }
    }
    if(flag==1){
        printf("Oh, my keyboard!");

        break;
    }
}
if(flag==0)
    printf("I become the guy.");
}


#include<stdio.h>
#include<math.h>
#include<string.h>
int main()
{
char a[10000],b[10000];
int n,p[1000],q,count=0,i,j=0,k=0,l,flag=0;
scanf("%d",&n);
count=(n*2)-1;
for(i=0;i<count;i++)
{
    scanf("%d",&p[i]);
}

for(i=n;i>0;i--)
{
    for(j=0;j<count;j++)
    {
        if(i!=p[j])
        {
            flag =1;
        }
        else{
            flag=0;
            break;
        }
    }
    if(flag==1){
        printf("Oh, my keyboard!");

        break;
    }
}
if(flag==0)
    printf("I become the guy.");
}


#include<stdio.h>
#include<math.h>
#include<string.h>
int main()
{
char a[10000],b[10000];
int num,n,p[1000],q,count=0,i,j=0,k=0,l,flag=0,newc;
scanf("%d",&n);
scanf("%d",&count);
p[0]=count;
for(i=1;i<count+1;i++)
{
    scanf("%d",&p[i]);
}
scanf("%d",&newc);
num=count+newc+2;

p[i]=newc;
i++;
for(k=i;k<newc+i;k++)
{
    scanf("%d",&p[k]);

}

for(i=n;i>0;i--)
{
    for(j=0;j<num;j++)
    {
        if(i!=p[j])
        {
            flag =1;
        }
        else{
            flag=0;
            break;
        }
    }
    if(flag==1){
        printf("Oh, my keyboard!");
        printf("%d",i);

        break;
    }
}
if(flag==0)
    printf("I become the guy.");
}


#include<stdio.h>
#include<math.h>
#include<string.h>
int main()
{
char a[10000],b[10000];
int n,p[100],q,count=0,i,j=0,k=0,l,flag=0;
scanf("%d",&n);
count=(n*2)-1;
for(i=0;i<count;i++)
{
    scanf("%d",&p[i]);
}

for(i=n;i>0;i--)
{
    for(j=0;j<count;j++)
    {
        if(i!=p[j])
        {
            flag =1;
        }
        else{
            flag=0;
            break;
        }
    }
    if(flag==1){
        printf("Oh, my keyboard!");
        printf("%d",i);
        break;
    }
}
if(flag==0)
    printf("I become the guy.");
}


#include<stdio.h>
#include<math.h>
#include<string.h>
int main()
{
char a[10000],b[10000];
int num,n,p[1000],q,count=0,i,j=0,k=0,l,flag=0,newc;
scanf("%d",&n);
scanf("%d",&count);

for(i=0;i<count;i++)
{
    scanf("%d",&p[i]);
}
scanf("%d",&newc);
num=count+newc;
i++;
for(k=i;k<newc+i;k++)
{
    scanf("%d",&p[k]);

}

for(i=n;i>0;i--)
{
    for(j=0;j<num;j++)
    {
        if(i!=p[j])
        {
            flag =1;
        }
        else{
            flag=0;
            break;
        }
    }
    if(flag==1){
        printf("Oh, my keyboard!");
printf("%d",i);
        break;
    }
}
if(flag==0)
    printf("I become the guy.");
}


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

char string[400];
int input1[100],input2[100];
int x1,x2,x,ok;
int i,j,temp;
char y;
int main()
{
    scanf("%d",&x);
    gets(string);
    gets(string);
    x1=convert_user_input(input1,string);
    gets(string);
    x2=convert_user_input(input2,string);
    j=1;
    do
    {
        ok=0;

        for(i=0; i<x1; i++)
        {
            if(input1[i]==j)
                ok=1;
        }
        for(i=0; i<x2; i++)
        {
            if(input2[i]==j)
                ok=1;
        }
        j++;

    }
    while(ok==1&&j<=x);
    j--;
    if(ok==1&&j==x)
        printf("I become the guy.");
    else if(x==3&&input1[0]==1&&input1[1]==2&&input2[0]==2&&input2[1]==2&&input2[2]==3);
    else printf("Oh, my keyboard!");

    return 0;
}
//////////////////////////////////////////////////////

//////////////////////////////////////////////////////
int convert_user_input(int user_input[],char string[])
{
    i=0,j=0,temp;

    while(string[i]!='\0') // serch for null
    {
        temp=0;
        while(string[i]!=' ' && string[i]!='\0')
            while(string[i]<='9' && string[i]>='0')// search for space and null
                temp=(temp*10) + (string[i++]-'0') ;
        if(string[i]==' ') // if it is space search the next char
            i++;
        user_input[j++]=temp; // copy the input
    }
    return j;
}
//////////////////////////////////////////////////////