#!/usr/bin/env python
import json
import sys
file_name = sys.argv[1]
f = open(file_name)
json =json.loads(f.read()[1:-1])
for i,window in enumerate(json['windows']):
    print 'Window %s'% (i+1) 
    for tabs in window['tabs']:
        entry = tabs['entries']
        if entry[len(entry)-1].has_key('title') and entry[len(entry)-1].has_key('url'):	
            print '\tTitle: %s Url %s'% (entry[len(entry)-1]['title'], entry[len(entry)-1]['url'])
