import json, html, os

# Load products
with open(r'c:\Users\asenc\Desktop\web eme antigravity\eme-theme\products-data.json', 'r', encoding='utf-8') as f:
    products = json.load(f)

print(f"Loaded {len(products)} products")

# Read theme CSS
with open(r'c:\Users\asenc\Desktop\web eme antigravity\eme-theme\style.css', 'r', encoding='utf-8') as f:
    css = f.read()

# Read theme JS
with open(r'c:\Users\asenc\Desktop\web eme antigravity\eme-theme\assets\js\app.js', 'r', encoding='utf-8') as f:
    js = f.read()

def render_price(price):
    return f"$ {int(price):,}".replace(",", ".")

def render_stars(rating=5):
    return "★" * int(rating)

def render_product_card(p, compact=False):
    price = p['price']
    regular = p['regular_price']
    sale = p['sale_price']
    on_sale = sale > 0 and sale < regular if regular else False
    discount = round(((regular - sale) / regular) * 100) if on_sale and regular else 0
    installment = int(price / 6) if price > 0 else 0
    free_ship = price >= 2000
    title = html.escape(p['title'])
    img = p['image'] if p['image'] else 'data:image/svg+xml,' + html.escape('<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200"><rect fill="#f0f0f0" width="200" height="200"/><text fill="#aaa" x="50%" y="50%" text-anchor="middle" dy=".3em" font-size="14">Imagen</text></svg>')
    
    compact_class = 'compact' if compact else ''
    
    badges = ''
    if not compact:
        if on_sale and discount > 0:
            badges += f'<span class="badge badge-sale">-{discount}%</span>'
        badges_html = f'<div class="product-badges">{badges}</div>' if badges else ''
        quick_actions = '''<div class="product-quick-actions">
            <span class="quick-action" title="Ver producto">
                <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"></path><circle cx="12" cy="12" r="3"></circle></svg>
            </span>
        </div>'''
    else:
        badges_html = ''
        quick_actions = ''

    rating_html = ''
    if not compact:
        rating_html = f'''<div class="product-rating">
            <div class="stars">{render_stars(5)}</div>
            <span class="rating-count">(0)</span>
        </div>'''

    pricing = ''
    if on_sale and regular:
        pricing += f'<span class="price-old">{render_price(regular)}</span>'
    pricing += f'<span class="price-current">{render_price(price)}</span>'

    installment_html = ''
    if not compact and installment > 0:
        installment_html = f'<div class="product-installments">💳 6x ${installment:,} sin interés</div>'.replace(",",".")

    ship_class = 'compact-ship' if compact else ''
    ship_text = '🚚 Envío gratis' if free_ship else '🚚 Envío en 1 día'

    if compact:
        btn = '<button class="compact-btn">Agregar</button>'
    else:
        btn = '''<button class="btn-add-cart">
            <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5"><path d="M6 2 3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4Z"></path><path d="M3 6h18"></path><path d="M16 10a4 4 0 0 1-8 0"></path></svg>
            Agregar al carrito
        </button>'''

    return f'''<article class="product-card {compact_class}">
        <a href="#" class="product-image-link">
            <div class="product-image-wrapper">
                <img src="{img}" alt="{title}" class="product-img" loading="lazy">
                {badges_html}
                {quick_actions}
            </div>
        </a>
        <div class="product-info">
            {rating_html}
            <h3 class="product-title"><a href="#">{title}</a></h3>
            <div class="product-pricing">{pricing}</div>
            {installment_html}
            <div class="product-shipping {ship_class}">{ship_text}</div>
            {btn}
        </div>
    </article>'''

# Generate categories from product titles
categories = {}
for p in products:
    title = p['title'].lower()
    if 'carlinkit' in title or 'carplay' in title or 'android auto' in title:
        cat = 'Carlinkit'
    elif 'funda' in title and 'llave' in title:
        cat = 'Fundas para Llaves'
    elif 'tapones' in title or 'válvula' in title or 'valvula' in title:
        cat = 'Tapones de Válvula'
    elif 'head up' in title or 'hud' in title:
        cat = 'HUD Display'
    elif 'bolsa' in title or 'térmica' in title:
        cat = 'Accesorios'
    elif 'sujetadores' in title or 'sábanas' in title:
        cat = 'Hogar'
    else:
        cat = 'Otros'
    
    if cat not in categories:
        categories[cat] = []
    categories[cat].append(p)

# Generate category cards
cat_cards = ''
cat_list = list(categories.items())[:6]
for i, (cat_name, cat_products) in enumerate(cat_list):
    img = cat_products[0]['image'] if cat_products[0]['image'] else ''
    min_price = min(p['price'] for p in cat_products if p['price'] > 0) if cat_products else 0
    featured = 'featured-cat' if i == 0 else ''
    trending = '<span class="category-badge">🔥 Trending</span>' if i == 0 else ''
    cat_cards += f'''<a href="#" class="category-card {featured}">
        <div class="category-image"><img src="{img}" alt="{html.escape(cat_name)}" loading="lazy"></div>
        <div class="category-info">
            <h3>{html.escape(cat_name)}</h3>
            <span class="category-price">Desde {render_price(min_price)}</span>
            {trending}
        </div>
    </a>'''

# Generate featured product cards (top 6 by price)
featured = sorted(products, key=lambda x: x['price'], reverse=True)[:6]
featured_cards = ''.join(render_product_card(p) for p in featured)

# Generate new arrivals (compact, first 10)
new_cards = ''.join(render_product_card(p, compact=True) for p in products[:10])

# Hero product
hero = featured[0] if featured else products[0]
hero_price = render_price(hero['price'])
hero_installment = int(hero['price'] / 6) if hero['price'] > 0 else 0

# Second hero - fundas
fundas = [p for p in products if 'funda' in p['title'].lower()]
hero2_product = fundas[0] if fundas else products[1]

# Brands
brands = ['Volkswagen','Chery','BYD','Omoda','Hyundai','Nissan','Ford','BMW','Audi','Suzuki','Geely','Mazda','Tesla','Renault','Fiat','Great Wall','Jetour','MG','Dongfeng']
brand_pills = ''.join(f'<a href="#" class="brand-pill">{b}</a>' for b in brands)

# Reviews
reviews_html = ''
static_reviews = [
    {'text':'Excelente producto y rápida entrega, gracias!','product':'Carlinkit','author':'Darcy','rating':5},
    {'text':'La funda es tal cual la foto, de muy buena calidad. Encaja perfecto.','product':'Funda TPU','author':'Martín','rating':5},
    {'text':'Me llegó en el mismo día que compré. Funciona espectacular.','product':'Carlinkit 4GB','author':'Sebastián','rating':5},
]
for sr in static_reviews:
    reviews_html += f'''<div class="review-card">
        <div class="review-stars">{render_stars(sr["rating"])}</div>
        <p class="review-text">"{html.escape(sr["text"])}"</p>
        <div class="review-product">{html.escape(sr["product"])}</div>
        <div class="review-author">
            <div class="review-avatar">{sr["author"][0].upper()}</div>
            <div><strong>{html.escape(sr["author"])}</strong><span class="verified">✓ Compra verificada</span></div>
        </div>
    </div>'''

# Promo banners
promo_html = ''
if cat_list:
    for pi, (pcat_name, pcat_products) in enumerate(cat_list[:2]):
        pstyle = ['promo-dark', 'promo-gradient'][pi % 2]
        plabel = ['COLECCIÓN', 'ACCESORIOS'][pi % 2]
        pimg = pcat_products[0]['image'] if pcat_products[0]['image'] else ''
        promo_html += f'''<div class="promo-card {pstyle}">
            <div class="promo-card-content">
                <span class="promo-label">{plabel}</span>
                <h3>{html.escape(pcat_name)}</h3>
                <p>Explorá nuestra colección</p>
                <a href="#" class="btn btn-white">Explorar →</a>
            </div>
            {'<div class="promo-card-image"><img src="'+pimg+'" alt="" loading="lazy"></div>' if pimg else ''}
        </div>'''

# BUILD THE HTML
page_html = f'''<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>EME – Accesorios Para Autos | Preview WordPress Theme</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap" rel="stylesheet">
<style>{css}</style>
</head>
<body class="eme-premium eme-home">

<!-- ANNOUNCEMENT BAR -->
<div class="announcement-bar">
  <div class="announcement-track">
    <div class="announcement-slide active">🚚 <strong>Envío GRATIS</strong> en compras +$2.000 · Montevideo en el día</div>
    <div class="announcement-slide">💳 Hasta <strong>6 cuotas sin interés</strong> con todas las tarjetas</div>
    <div class="announcement-slide">⭐ <strong>+500 clientes</strong> nos recomiendan · Calificación 4.8/5</div>
  </div>
</div>

<!-- HEADER -->
<header class="site-header" id="siteHeader">
  <div class="header-inner">
    <button class="mobile-menu-toggle" id="menuToggle" aria-label="Menu">
      <span></span><span></span><span></span>
    </button>
    <a href="#" class="logo"><span class="logo-text">EME</span><span class="logo-sub">ACCESORIOS</span></a>
    <nav class="main-nav">
      <ul class="nav-list">
        <li class="nav-item"><a href="#">Inicio</a></li>
        <li class="nav-item"><a href="#">Tienda</a></li>
        <li class="nav-item"><a href="#">Carlinkit</a></li>
        <li class="nav-item"><a href="#">Fundas</a></li>
        <li class="nav-item"><a href="#">Contacto</a></li>
      </ul>
    </nav>
    <div class="header-actions">
      <button class="header-action" id="searchToggle" aria-label="Buscar">
        <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/></svg>
      </button>
      <a href="#" class="header-action" aria-label="Cuenta">
        <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"/><circle cx="12" cy="7" r="4"/></svg>
      </a>
      <button class="header-action cart-toggle" id="cartToggle" aria-label="Carrito">
        <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M6 2 3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4Z"/><path d="M3 6h18"/><path d="M16 10a4 4 0 0 1-8 0"/></svg>
        <span class="cart-count">0</span>
      </button>
    </div>
  </div>

  <!-- Search Overlay -->
  <div class="search-overlay" id="searchOverlay">
    <div class="search-inner">
      <input type="text" placeholder="¿Qué estás buscando?" id="searchInput">
      <button class="search-close" id="searchClose">✕</button>
    </div>
    <div class="search-suggestions">
      <span class="search-tag">Carlinkit</span>
      <span class="search-tag">Fundas</span>
      <span class="search-tag">Tapones</span>
      <span class="search-tag">HUD</span>
    </div>
  </div>
</header>

<!-- MOBILE NAV -->
<div class="mobile-nav-overlay" id="mobileOverlay"></div>
<nav class="mobile-nav" id="mobileNav">
  <div class="mobile-nav-header">
    <span class="logo-text">EME</span>
    <button class="mobile-nav-close" id="mobileNavClose">✕</button>
  </div>
  <ul class="mobile-nav-list">
    <li><a href="#">Inicio</a></li>
    <li><a href="#">Toda la Tienda</a></li>
    <li><a href="#">Carlinkit</a></li>
    <li><a href="#">Fundas para Llaves</a></li>
    <li><a href="#">Tapones de Válvula</a></li>
    <li><a href="#">HUD Display</a></li>
    <li><a href="#">Contacto</a></li>
  </ul>
  <div class="mobile-nav-footer">
    <a href="#" class="mobile-nav-btn">Mi Cuenta</a>
    <a href="https://api.whatsapp.com/send?phone=59895542866" class="mobile-nav-btn whatsapp">💬 WhatsApp</a>
  </div>
</nav>

<!-- HERO -->
<section class="hero" id="heroSection">
  <div class="hero-slider">
    <div class="hero-slide active" data-slide="0">
      <div class="hero-bg" style="background:linear-gradient(135deg,#0a0a0a 0%,#1a1a2e 50%,#16213e 100%);"></div>
      <div class="hero-content">
        <div class="hero-text">
          <span class="hero-badge">🔥 MÁS VENDIDO</span>
          <h1>{html.escape(hero['title'])}</h1>
          <div class="hero-price">
            <span class="hero-price-current">{hero_price}</span>
          </div>
          <div class="hero-installments">💳 6 cuotas de ${hero_installment:,} sin interés</div>
          <div class="hero-ctas">
            <a href="#" class="btn btn-primary btn-glow">Comprar ahora</a>
            <a href="#" class="btn btn-outline">Ver detalles</a>
          </div>
        </div>
        <div class="hero-image">
          <img src="{hero['image']}" alt="{html.escape(hero['title'])}" loading="eager">
          <div class="hero-image-glow"></div>
        </div>
      </div>
    </div>
    <div class="hero-slide" data-slide="1">
      <div class="hero-bg" style="background:linear-gradient(135deg,#1a0a2e 0%,#2d1b69 50%,#11998e 100%);"></div>
      <div class="hero-content">
        <div class="hero-text">
          <span class="hero-badge">⭐ NUEVO</span>
          <h1>Fundas para Llaves</h1>
          <p class="hero-desc">Protegé y personalizá la llave de tu vehículo. Disponibles para todas las marcas.</p>
          <div class="hero-price"><span class="hero-price-current">Desde $ 290</span></div>
          <div class="hero-installments">🚚 Envío gratis en compras +$2.000</div>
          <div class="hero-ctas">
            <a href="#" class="btn btn-primary btn-glow">Ver fundas</a>
            <a href="#" class="btn btn-outline">Encontrar la mía</a>
          </div>
        </div>
        <div class="hero-image">
          <img src="{hero2_product['image']}" alt="Fundas" loading="lazy">
          <div class="hero-image-glow"></div>
        </div>
      </div>
    </div>
  </div>
  <div class="hero-dots">
    <button class="hero-dot active" data-slide="0"></button>
    <button class="hero-dot" data-slide="1"></button>
  </div>
</section>

<!-- TRUST BAR -->
<section class="trust-bar">
  <div class="trust-bar-inner">
    <div class="trust-item"><div class="trust-icon">🚚</div><div class="trust-text"><strong>Envío en el día</strong><span>Montevideo y alrededores</span></div></div>
    <div class="trust-item"><div class="trust-icon">💳</div><div class="trust-text"><strong>6 cuotas sin interés</strong><span>Todas las tarjetas</span></div></div>
    <div class="trust-item"><div class="trust-icon">🛡️</div><div class="trust-text"><strong>Compra protegida</strong><span>30 días de devolución</span></div></div>
    <div class="trust-item"><div class="trust-icon">⭐</div><div class="trust-text"><strong>+500 clientes felices</strong><span>Calificación 4.8/5</span></div></div>
  </div>
</section>

<!-- CATEGORIES -->
<section class="categories-section" id="categoriesSection">
  <div class="container">
    <div class="section-header">
      <h2>Explorá por categoría</h2>
      <a href="#" class="section-link">Ver todo →</a>
    </div>
    <div class="categories-grid">{cat_cards}</div>
  </div>
</section>

<!-- FEATURED PRODUCTS -->
<section class="products-section" id="featuredProducts">
  <div class="container">
    <div class="section-header">
      <div><span class="section-label">🔥 TRENDING NOW</span><h2>Productos Destacados</h2></div>
      <a href="#" class="section-link">Ver colección →</a>
    </div>
    <div class="products-grid">{featured_cards}</div>
  </div>
</section>

<!-- PROMO BANNERS -->
<section class="promo-banner">
  <div class="container">
    <div class="promo-grid">{promo_html}</div>
  </div>
</section>

<!-- NEW ARRIVALS SCROLL -->
<section class="products-section">
  <div class="container">
    <div class="section-header">
      <div><span class="section-label">🔑 LO NUEVO</span><h2>Últimos Ingresos</h2></div>
      <a href="#" class="section-link">Ver todas →</a>
    </div>
    <div class="products-scroll" id="newArrivals">
      <div class="products-track">{new_cards}</div>
      <button class="scroll-btn scroll-left" data-target="newArrivals">❮</button>
      <button class="scroll-btn scroll-right" data-target="newArrivals">❯</button>
    </div>
  </div>
</section>

<!-- SOCIAL PROOF -->
<section class="social-proof" id="socialProof">
  <div class="container">
    <div class="section-header center"><span class="section-label">💬 LO QUE DICEN NUESTROS CLIENTES</span><h2>Reseñas verificadas</h2></div>
    <div class="reviews-grid">{reviews_html}</div>
  </div>
</section>

<!-- BRANDS -->
<section class="brands-section">
  <div class="container">
    <div class="section-header center"><h2>Compatibles con tu marca</h2><p class="section-subtitle">Encontrá accesorios específicos para tu vehículo</p></div>
    <div class="brands-grid">{brand_pills}</div>
  </div>
</section>

<!-- NEWSLETTER -->
<section class="newsletter-section">
  <div class="container">
    <div class="newsletter-card">
      <h2>¡No te pierdas nuestras ofertas!</h2>
      <p>Suscribite y recibí un <strong>10% de descuento</strong> en tu primera compra</p>
      <form class="newsletter-form" id="newsletterForm">
        <input type="email" placeholder="Tu email" required>
        <button type="submit" class="btn btn-primary">Suscribirme</button>
      </form>
      <span class="newsletter-note">🔒 No spam. Podés desuscribirte cuando quieras.</span>
    </div>
  </div>
</section>

<!-- FOOTER -->
<footer class="site-footer">
  <div class="container">
    <div class="footer-grid">
      <div class="footer-col">
        <span class="footer-logo">EME</span>
        <p class="footer-desc">Accesorios para autos con envío en el día a todo Uruguay. La mejor calidad al mejor precio.</p>
        <div class="footer-social">
          <a href="https://www.instagram.com/tiendaeme.com.uy/" target="_blank">📷</a>
          <a href="https://www.tiktok.com/@tiendaeme.com.uy" target="_blank">🎵</a>
          <a href="https://api.whatsapp.com/send?phone=59895542866" target="_blank">💬</a>
        </div>
      </div>
      <div class="footer-col"><h4>Tienda</h4><a href="#">Toda la Tienda</a><a href="#">Carlinkit</a><a href="#">Fundas</a><a href="#">Tapones</a></div>
      <div class="footer-col"><h4>Información</h4><a href="#">Políticas de Privacidad</a><a href="#">Contacto</a></div>
      <div class="footer-col"><h4>Mi Cuenta</h4><a href="#">Iniciar Sesión</a><a href="#">Mis Pedidos</a><a href="#">Carrito</a></div>
    </div>
    <div class="footer-bottom">
      <p>&copy; 2026 EME – Accesorios Para Autos. Todos los derechos reservados.</p>
      <div class="payment-methods">
        <span class="payment-badge">💳 Visa</span>
        <span class="payment-badge">💳 Mastercard</span>
        <span class="payment-badge">💳 OCA</span>
        <span class="payment-badge">💚 MercadoPago</span>
      </div>
    </div>
  </div>
</footer>

<!-- MOBILE BOTTOM NAV -->
<nav class="mobile-bottom-nav" id="mobileBottomNav">
  <a href="#" class="bottom-nav-item active">
    <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"></path><polyline points="9 22 9 12 15 12 15 22"></polyline></svg>
    <span>Inicio</span>
  </a>
  <a href="#" class="bottom-nav-item">
    <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="9" cy="21" r="1"></circle><circle cx="20" cy="21" r="1"></circle><path d="M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"></path></svg>
    <span>Tienda</span>
  </a>
  <a href="#" class="bottom-nav-item" id="mobileSearchTrigger">
    <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="11" cy="11" r="8"></circle><path d="m21 21-4.3-4.3"></path></svg>
    <span>Buscar</span>
  </a>
  <a href="#" class="bottom-nav-item">
    <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path><circle cx="12" cy="7" r="4"></circle></svg>
    <span>Cuenta</span>
  </a>
  <a href="#" class="bottom-nav-item cart-mobile">
    <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M6 2 3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4Z"></path><path d="M3 6h18"></path><path d="M16 10a4 4 0 0 1-8 0"></path></svg>
    <span>Carrito</span>
    <span class="bottom-cart-count">0</span>
  </a>
</nav>

<!-- WhatsApp -->
<a href="https://api.whatsapp.com/send?phone=59895542866" class="whatsapp-float" id="whatsappFloat" target="_blank">
  <svg width="28" height="28" viewBox="0 0 24 24" fill="#fff"><path d="M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413z"/></svg>
  <span class="whatsapp-tooltip">¿Necesitás ayuda?</span>
</a>

<script>{js}</script>
</body>
</html>'''

# Write preview
output = r'c:\Users\asenc\Desktop\web eme antigravity\eme-theme\preview-wordpress.html'
with open(output, 'w', encoding='utf-8') as f:
    f.write(page_html)

print(f"Preview generated: {len(page_html)} bytes")
print(f"Products shown: {len(featured)} featured, {min(10,len(products))} new arrivals")
print(f"Categories: {len(cat_list)}")
print(f"Output: {output}")
