#include<iostream> #include<cstdio> #include<string> using namespace std; int main() { string str1, str2, sum1, sum2; int int_len1, int_len2, dec_len1, dec_len2, i; while (cin >> str1 >> str2) { int_len1 = int_len2 = 0; for (int i = 0; str1[i] != '.'; ++i) { ++int_len1; } for (int i = 0; str2[i] != '.'; ++i) { ++int_len2; } dec_len1 = str1.size() - int_len1 - 1; dec_len2 = str2.size() - int_len2 - 1; str1.erase(int_len1, 1); str2.erase(int_len2, 1); if (dec_len1 < dec_len2) { for (int i = int_len2 + dec_len1 - 1; i >= int_len2; --i) { str2[i] += str1[i + int_len1 - int_len2] - '0'; if (str2[i] > '9') { str2[i - 1] += 1; str2[i] -= 10; } } sum1 = str2.substr(int_len2, dec_len2); } else { for (int i = int_len1 + dec_len2 - 1; i >= int_len1; --i) { str1[i] += str2[i + int_len2 - int_len1] - '0'; if (str1[i] > '9') { str1[i - 1] += 1; str1[i] -= 10; } } sum1 = str1.substr(int_len1, dec_len1); } if (int_len1 < int_len2) { for (int i = int_len2 - 1; i >= int_len2 - int_len1; --i) { str2[i] += str1[i - int_len2 + int_len1] - '0'; if (str2[i] > '9') { str2[i - 1] += 1; str2[i] -= 10; } } sum2 = str2.substr(0, int_len2); i = int_len2 - int_len1 - 1; } else { for (int i = int_len1 - 1; i >= int_len1 - int_len2; --i) { str1[i] += str2[i - int_len1 + int_len2] - '0'; if (str1[i] > '9') { str1[i - 1] += 1; str1[i] -= 10; } } sum2 = str1.substr(0, int_len1); i = int_len1 - int_len2 - 1; } while (sum2[i] > '9' && i > 0) { sum2[i - 1] += 1; sum2[i--] -= 10; } if (sum2[0] > '9') { sum2[0] -= 10; sum2.insert(0, "1"); } sum1.insert(0, "."); cout << sum2 << sum1 << endl; } return 0; }