/** ____ ____ ____ ____ ||ú |||_ |||ò |||a || ||__|||__|||__|||__|| |/__\|/__\|/__\|/__\| **/ #pragma GCC optimize("O3") #pragma target("sse4") #include using namespace std; // Policy Based DataStructure #include #include using namespace __gnu_pbds; template // increasing :) using in_ordered_set = tree, rb_tree_tag, tree_order_statistics_node_update>; template // decreasing :) using de_ordered_set = tree, rb_tree_tag, tree_order_statistics_node_update>; template // smaller than or equal :) using ms_ordered_set = tree, rb_tree_tag, tree_order_statistics_node_update>; // find_by_order() -> returns an iterator to the k-th largest element (counting from zero) // order_of_key() -> the number of items in a set that are strictly smaller than our item //hihi #define ll long long #define ld long double #define db double //haha #define pb push_back #define ppb pop_back #define eb emplace_back #define ins insert #define ff first #define ss second //huhu #define sz(x) (int)(x).size() #define all(x) x.begin(), x.end() #define rall(x) x.rbegin(), x.rend() #define lb lower_bound // first pos >= val #define ub upper_bound // first pos > val //set val #define ms0(a) memset(a, 0, sizeof(a)) #define ms_1(a) memset(a, -1, sizeof(a)) #define msinf(a) memset(a, 0x3f, sizeof(a)) // pair #define pii pair #define pld pair // array #define ar array // vector #define vi vector #define vld vector #define mat vector> #define vpii vector> // FOR #define For(i, a, b) for(int i = a; i < b; i++) #define Ford(i, a, b) for(int i = a; i > b; i--) #define ForE(i, a, b) for(int i = a; i <= b; i++) #define FordE(i, a, b) for(int i = a; i >= b; i--) //hehe template using maxheap = priority_queue; template using minheap = priority_queue, greater>; template ostream& operator << (ostream& out, vector vv) { out << "{"; for(int i = 0; i < sz(vv); i++) { out << vv[i]; if(i != vv.size() - 1) { out << ","; } } out << "}"; return out; } template ostream& operator << (ostream& out, pair prr) { out << "{" << prr.ff << "," << prr.ss << "}"; return out; } template bool setmin(T& a, const T& b) { return b < a ? a = b, 1 : 0; } // a = min(a, b) template bool setmax(T& a, const T& b) { return a < b ? a = b, 1 : 0; } // a = max(a, b) const int MOD = 1e9 + 7; // 998244353 template void add(T& a, const T& b) { a = (a + b); if(a >= MOD) a -= MOD; } template void sub(T& a, const T& b) { a = (a - b); if(a < 0) a += MOD; } // int dX4[] = {0, 0, 1, -1}; int dY4[] = {1, -1, 0, 0}; int dX8[] = {0, -1, -1, -1, 0, 1, 1, 1}; int dY8[] = {1, 1, 0, -1, -1, -1, 0, 1}; int ddX[] = {-1,-2, -2, -1, 1, 2, 2, 1}; int ddY[] = {-2, -1, 1, 2, 2 , 1, -1, -2}; // #define Niconiconiiiiiiii // DEBUG #ifdef Niconiconiiiiiiii #define debug(x) cout << #x << " = " << x << "\n"; #else #define debug(x); #endif // Const const int mxN = 2e5 + 5; const int mxX = 1e6 + 1; const int oooo = 1e18; const int oo = 1e9; const char nl = '\n'; const long double eps = 1e-9; void u_oa() { string a, b; cin >> a >> b; int i = sz(a) - 1, j = sz(b) - 1; deque ans; int rem = 0; while(i >= 0 && j >= 0) { if((a[i] - 48) + (b[j] - 48) >= 10) { if(i == 0 && j == 0) { ans.push_front((((a[i] - 48) + (b[j] - 48))) + rem); } else { ans.push_front((((a[i] - 48) + (b[j] - 48)) % 10) + rem); } rem = 1; i--; j--; } else { ans.push_front((a[i] - 48) + (b[j] - 48) + rem); rem = 0; i--; j--; } } while(i >= 0) { ans.push_front((a[i] - 48) + rem); i--; } while(j >= 0) { ans.push_front((b[j] - 48 + rem)); j--; } for(int x : ans) cout << x; } int main () { ios_base::sync_with_stdio(NULL); cin.tie(nullptr); cout.tie(nullptr); #ifdef Niconiconiiiiiiii freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); auto starttime = chrono::high_resolution_clock::now(); #endif #ifdef LAH freopen(".inp","r",stdin); freopen(".out","w",stdout); #endif int test = 1; // cin >> test; while(test--) u_oa(); #ifdef Niconiconiiiiiiii auto endtime = chrono::high_resolution_clock::now(); auto duration = chrono::duration_cast(endtime - starttime).count(); cout << "\n=====" << "\nUsed: " << duration << " ms\n"; #endif return 0; //hihihaha // AC di ma (^-^) // lam on dung TLE (^-^) // lam on dung RTE (^-^) // lam on dung MLE (^-^) // lam on dung WA (^-^) }