Go: package main

import (
	"fmt"
	"math"
	"strings"
	"strconv"
)

func main() {
	var a, b float64
	var x, y float64
	x = 0
	y = 0
	var now float64
	now = 90
	var info string
	for {
		fmt.Scan(&info)
		infos := strings.Split(info, ",")
		a_int, _ := strconv.Atoi(infos[0])
		b_int, _ := strconv.Atoi(infos[1])
		a = float64(a_int)
		b = float64(b_int)
		// println(a, b)
		if a == 0 && b == 0 {
			break
		}
		x += math.Cos(now*math.Pi/180)*a
		y += math.Sin(now*math.Pi/180)*a
		now -= b
	}
	fmt.Printf("%d\n%d\n", int(x), int(y))
}

Python: import math
x=0
y=0
d=90
cos=lambda x:round(math.cos(math.radians(x)),10)
sin=lambda x:round(math.sin(math.radians(x)),10)

while True:
    try:h,r=[int(i) for i in input().split(",")]
    except:break
    if h==0 and r==0:break
    x+=h*cos(d)
    y+=h*sin(d)
    d+=-r
print("{0}\n{1}".format(int(x),int(y)))

Python: import math
x = y = n= 0
while True:
	d,a = map(int,input().split(','))
	if d == a == 0: break
	x += d*math.sin(math.radians(n))
	y += d*math.cos(math.radians(n))
	n+=a
print(*map(int,(x,y)),sep='\n')

Python: from math import radians,sin,cos,pi
def main():
    x = 0
    y = 0
    a = 0
    while True:
        d,_a = map(int,input().split(","))
        if(d == _a == 0):
            break
        x = x + d*cos(radians(a))
        y = y + d*sin(radians(a))
        a = a + _a
    print(int(y))
    print(int(x))

if __name__ == '__main__':
    main()

Python: from math import *

x = 0
y = 0
D = []
A = []
sum_a = -90
while True:
    d, a = map(int, input().split(","))
    if a == 0 and d == 0:
        break
    else:
        D.append(d)
        A.append(a)
for i in range(len(A)):
    x += D[i] * cos(-sum_a * pi / 180)
    y += D[i] * sin(-sum_a * pi / 180)
    sum_a += A[i]
print(floor(x))
print(floor(y))

Python: from math import sin,cos,pi
x = 0
y = 0
ca = pi/2
while True:
    d, a = list(map(int, input().split(",")))
    if d or a:
        x += d*cos(ca)
        y += d*sin(ca)
        ca -= a*pi/180
    else:
        break

print("{0:.0f}".format(x))
print("{0:.0f}".format(y),end="")

Python: import math
a = 0
b = 0
r = 0
while True:
	n,m = map(int,raw_input().split(','))
	if n==0 and m==0:
		break
	a += n * math.sin(math.radians(r))
	b += n * math.cos(math.radians(r))
	r += m
print(int(a))
print(int(b))

Python: import math
x = y = 0
h = math.radians(90)
while True:
    d, t = map(int, input().split(","))
    if d == t == 0:
        break
    x += d * math.cos(h)
    y += d * math.sin(h)
    h -= math.radians(t)
print("{} {}".format(int(x), int(y)))

Python: # coding: utf-8

import math

def RadToDeg(rad):
	return rad*180/math.pi

def DegToRad(deg):
	return deg*math.pi/180

deg = 90
x = 0.
y = 0.

while True:
	d, theta = map(int, raw_input().split(","))
	if d == 0 and theta == 0:
		break
	else:
		x += d * math.cos(DegToRad(deg))
		y += d * math.sin(DegToRad(deg))
		deg -= theta
print(int(x))
print(int(y))

Python: import math


def main():
    p = [0, 0]
    x = math.radians(90)
    while True:
        d, angle = map(int, input().split(","))
        if d == 0 and angle == 0:
            break
        p[0] += math.cos(x) * d
        p[1] += math.sin(x) * d
        x -= math.radians(angle)
    for i in (0,1):
        p[i] = int(p[i])
    print(*p, sep="\n")


if __name__ == "__main__":
    main()

Python: import sys
import math

x,y,t = 0,0,0

for s in sys.stdin:
    a,b = map(int,s.split(','))
    if a==0 and b==0:
        break
    x += a*math.sin(math.radians(t))
    y += a*math.cos(math.radians(t))
    t += b

print(int(x))
print(int(y))

Python: import cmath,math,sys
z=0;p=90
for e in sys.stdin:
 r,d=map(int,e.split(','))
 z+=cmath.rect(r,math.radians(p))
 p-=d
print(int(z.real),int(z.imag))

Python: from math import radians
from cmath import rect

z = 0
deg = 90
while True:
    r, d = map(int, input().split(','))
    if r == d == 0: break
    z += rect(r, radians(deg))
    deg -= d
print(int(z.real), int(z.imag))

Python: 56,65
97,54
64,-4
55,76
42,-27
43,80
87,-86
55,-6
89,34
95,5
0,0

Python: # 0016
import math as m
x,y,d=0,0,90
while True:
    r,t=map(int,input().split(","))
    if (r,t)==(0,0):
        break
    x+=r*m.cos(m.radians(d))
    y+=r*m.sin(m.radians(d))
    d-=t
print(int(x))
print(int(y))

Python: import math
 
x, y ,angle = 0, 0, 90
while True:
  line = map(int, raw_input().split(','))
  if line[0] == 0 and line[1] == 0: break
  radian = math.radians(angle)
  x += math.cos(radian) * line[0]
  y += math.sin(radian) * line[0]
  angle -= line[1]
 
print(int(x))
print(int(y))

Python: import math
x = y = n= 0
while True:
	d,a = map(int,input().split(','))
	if d == a == 0: break
	x += d*math.sin(math.radians(n))
	y += d*math.cos(math.radians(n))
	n+=a
print(*map(int,(x,y)),sep=',')

Python: import math

x, y, r = 0, 0, 90
while True:
    d, t = map(int, input().split(","))
    if d == t == 0:
        break
    x += r * math.cos(math.radians(r))
    y += r * math.sin(math.radians(r))
    r -= t
print(int(x))
print(int(y))

Python: import math
A = math.radians(90)
aD = 90
x = y = 0
while 1:
    user = input().split(",")
    r = int(user[0])
    if r == 0 and int(user[1]) == 0:
        break
    x += r * math.cos(A)
    y += r * math.sin(A)
    aD -= int(user[1])
    A = math.radians(aD)
print(int(x))
print(int(y))

Python: import math

def calc(x, y, r, d, nd):
	x = x + r * math.cos(math.radians(d))
	y = y + r * math.sin(math.radians(d))
	d -= nd
	return x, y, d

x = y = 0
d = 90

while True:
	r, nd = map(int, input().split(","))
	if r == nd == 0: break
	x, y, d = calc(x, y, r, d, nd)

print(int(x))
print(int(y))

Python: import cmath,math,sys
z=0;p=90
for e in sys.stdin:
 r,d=map(int,e.split(','))
 z+=cmath.rect(r,math.radians(p))
 p-=d
print(int(z.real),'\n',int(z.imag))

C++: #include <iostream>
#include <sstream>
#include <cmath>
#include <fstream>

using namespace std;

int length, angle, currentAngle;
double px, py;

void walk(void)
{
	px += length * cos (currentAngle * M_PI/180. );
	py += length * sin (currentAngle * M_PI/180. );
	currentAngle -= angle;
}

int main()
{
//	cut here before submit 
//	freopen("testcase.th", "r", stdin);
	string str = "";
	px = py = 0.;
	currentAngle = 90;

	while (getline (cin, str ) ){
		str = str.replace (str.find (','), 1, " " );
		stringstream ss(str);
		ss >> length >> angle;		
		if (length == 0 && angle == 0 ){
			break;
		} // end if
		walk();
	} // end while

	cout << (int)px << endl;
	cout << (int)py << endl;	
	
	return 0;
}

C++: #include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
using namespace std;

typedef long long ll;
typedef pair<int, int> P;

#define all(c) (c).begin(), (c).end()
#define pb push_back
#define mp make_pair
#define EXIST(v,i) (find(all(v), i) != (v).end())
#define ERASE(v,i) (v).erase(remove(all(v), i), (v).end())
#define INDEX(v,i) (find(all(v), i) - (v).begin())
#define rep(i,n) for(int i = 0; i < (int)n; ++i)
#define debug(x) cerr << #x << " = " << (x) << endl;

inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

const int INF = 100000000;
const double PI = 3.14159265358979323846;
const double EPS = 1e-10;

int main() {
	double cx = 0, cy = 0;
	int angle = 90;
	for(int l, r; scanf("%d,%d", &l, &r) && l && r;) {
		double rad = angle * PI / 180.0;
		cx += l * cos(rad);
		cy += l * sin(rad);
		angle += r;
#if 0
		cout << "before" << endl;
		cout << rad << endl;
		cout << cx << endl;
		cout << cy << endl;
		cout << "after" << endl;
#endif
	}
	printf("%d\n%d\n", (int)cx, (int)cy);
	return 0;
}