import re

with open('src/app/page.tsx', 'r') as f:
    lines = f.readlines()

for i, line in enumerate(lines):
    if '<a href="https://instagram.com"' in line:
        if i + 1 < len(lines):
            next_line = lines[i+1]
            if 'M24 12.073' in next_line:
                lines[i] = line.replace('https://instagram.com', 'https://facebook.com')
            elif '>X</span>' in next_line:
                lines[i] = line.replace('https://instagram.com', 'https://x.com')
            elif 'M20.447 20.452h' in next_line:
                lines[i] = line.replace('https://instagram.com', 'https://linkedin.com')
            elif 'M12.017 0C5' in next_line:
                lines[i] = line.replace('https://instagram.com', 'https://pinterest.com')
            elif 'M23.498 6.186a' in next_line:
                lines[i] = line.replace('https://instagram.com', 'https://youtube.com')

with open('src/app/page.tsx', 'w') as f:
    f.writelines(lines)

