# store = {'север': 0, 'юг': 0, 'запад': 0, 'восток': 0}
#
# for _ in range(int(input())):
#     a = input().split(' ')
#     if a[0] in store:
#         store[a[0]] += int(a[1])
#
#
# print('{} {}'.format(-store['запад'] + store['восток'], -store['юг'] + store['север'])) 

# if __name__ == '__main__':
#     main()
