#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-8;
int main() {
  string line;
  getline(cin, line);
  int a = atoi(line.substr(0, line.find(' ') + 1).c_str());
  cout << a << endl;
  int p = atoi(line.substr(line.find(' ') + 1, line.length()).c_str());
  cout << (p + a * 3) / 2 << endl;
  return 0;
}
