#!/usr/bin/env python import sys print('0 1 ') print('1 1 ') print('2 2 ') print('2 0 ') with open(sys.argv[1], 'r') as fin: node = 3 for entry in fin: fields = entry.strip().split(' ') phone = fields[0] if phone == '' or phone == '': continue elif '#' in phone: # disambiguous phone print('{} {} {} {}'.format(0, 0, '', phone)) else: print('{} {} {} {}'.format(1, node, phone, phone)) print('{} {} {} {}'.format(node, node, phone, '')) print('{} {} {} {}'.format(node, 2, '', '')) node += 1 print('0')