#include <stdio.h>
#include <math.h>
#include <string.h>
#include <limits.h>
#include <stdlib.h>

// apparently, this isn't in limits.h in ideone's implementation
#define LINE_MAX 1024

int main()
{
    char buf[LINE_MAX];
    fgets(buf, sizeof(buf), stdin);
    const char *lparen = strchr(buf, '(');
    const char *comma = strchr(lparen + 1, ',');
    // const char *rparen = strchr(comma + 1, ')'); // is this even needed?

    char str[lparen - buf + 1];
    memcpy(str, buf, lparen - buf);
    str[lparen - buf] = 0;
    int n1 = strtol(lparen + 1, NULL, 10);
    int n2 = strtol(comma + 1, NULL, 10);

    printf("string: %s\nNumbers: %d and %d\n", str, n1, n2);

    return 0;
}
