#include <iostream>
#include <string>

struct bigint {
private:
    std::string s;
public:
    bigint(std::string s): s(s) {}
    bigint& operator +(bigint rhs)
    {
        int d = rhs.s.size() < this->s.size() ? this->s.size() - rhs.s.size() : rhs.s.size() - this->s.size();
        if (rhs.s.size() < this->s.size()) for (int i = 0; i < d; ++i) rhs.s = '0' + rhs.s;
        else for (int i = 0; i < d; ++i) this->s = '0' + this->s;

        int c = 0;
        for (int i = this->s.size() - 1; i >= 0; --i) {
            int a = this->s[i] - '0' + rhs.s[i] - '0' + c;
            this->s[i] = a % 10 + '0';
            c = a / 10;
        }
        if (c) this->s = (char)(c + '0') + this->s;
        return *this;
    }
    void print()
    {
        std::cout << s;
    }
};

int main()
{
    int n;
    std::cin >> n;
    std::cin.ignore();

    for (int i = 0; i < n; ++i) {
        std::string s1, s2;
        getline(std::cin, s1);
        getline(std::cin, s2);

        bigint bi1(s1), bi2(s2);
        (bi1 + bi2).print();
        std::cout << std::endl;
    }
}