/*
 * gSchem symbol generation program
 * Copyright (C) 2005 Darrell Harmon
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */


#include<stdio.h>

int getstrings(char *pinname, char *pinlabel){
  if(feof(stdin))
    return 0;
  char temp[200];
  scanf("%s\n", temp);
  int i = 0;
  while((temp[i]!=',')&&(temp[i]!='\0')){
    pinname[i]=temp[i];
    i++;
  }
  pinname[i]='\0';
  if(temp[i]=',')
    i++;
  else
    return 0;
  int j = 0;
  while(temp[i]!='\0'){
    pinlabel[j]=temp[i];
    i++;
    j++;
  }
  pinlabel[j]='\0';
  return 1;
}


main(){
  char pinname[100], pinlabel[200];
  int ypos = 10000;
  int xpos = 0;
  printf("v 20040111 1\n");
  while(getstrings(pinname, pinlabel)){
    /* x1 y1 x2 y2 color pintype whichend*/
    printf("P %d %d %d %d 1 0 1 \n{\n", xpos+300, ypos, xpos, ypos);
    printf("T %d %d 5 8 1 1 0 6 1\n", xpos+250, ypos+50);
    printf("pinnumber=%s\n", pinname);
    printf("T %d %d 9 8 1 1 0 0 1\n", xpos+400, ypos);
    printf("pinlabel=%s\n", pinlabel);
    printf("}\n");
    ypos-=200;
    if(ypos<0){
      ypos=10000;
      xpos+=4000;
    }
  }
}

