#include <iostream>
#include <string>
#include <iomanip>
using namespace std;

int main()
{
	ifstream cin("stuff.in");
	ofstream cout("stuff.out");
	int t=5,hor,ver;
	while (t--)
	{
		cin>>hor;
		cin>>ver;
		int x=50,y=25;

		do
		{
			x=x+hor;
			y=y+ver;

			if (x>=100)
			{
				cout<<"100,"<<y<<endl;
				break;
			}
			else
				if (x<=0)
				{
					cout<<"0,"<<y<<endl;
					break;
				}
				else
					if (y>=50)
					{
						
						cout<<x<<",50"<<endl;
						break;
					}
					else
						if (y<=0)
						{
							cout<<x<<",0"<<endl;
							break;
						}

		}
		while (1!=0);
	}

	return 0;

}
