#include <stdio.h> #include <string.h> #include<stdlib.h> #define MAX_SIZE 1000000 typedef struct { int data[MAX_SIZE]; int top; } stack; int main() { int cnt, i, j, k = 0, temp, flag = 0, q; int minn = 1000001; char buf[50] = {'\0'}; char str[50] = {'\0'...