#include <stdio.h>
#include <string.h>
void parse_gprmc(char *nmea) {
// Your logic here
char *fields[7];
int index = 0;
char *token = strtok(nmea, ",");
while (token != NULL && index < 7){
fields[index++] = token;
token = strtok(NULL, ",");
}
char *t = fields[1];
printf("Time: %.2s:%.2s:%.2s\n",t,t + 2, t + 4);
printf("Latitude: %s %s\n",fields[3],fields[4]);
printf("Longitude: %s %s\n",fields[5],fields[6]);
}
int main() {
char nmea[100];
fgets(nmea, sizeof(nmea), stdin);
parse_gprmc(nmea);
return 0;
}