#include <stdio.h>
#include <limits.h>
struct undefined_int {int undefined, value;};
struct undefined_int f(int *a, int n) {
int i;
struct undefined_int min[2] = {{!0, INT_MIN}, {!0, INT_MIN}};
if (!a && n < 2) return min[1];
for (i = 0; i < n; i++)
if (min[0].undefined || a[i] < min[0].value)
min[1] = min[0], min[0] = (struct undefined_int){0, a[i]};
else if (a[i] != min[0].value && (min[1].undefined || a[i] < min[1].value))
min[1] = (struct undefined_int){0, a[i]};
return min[1];
}
void g(int *a, int n) {
int i;
struct undefined_int x = f(a, n);
for (i = 0; i < n; i++)
printf(i
== 0 ? "%d" : ", %d", a
[i
]); if (x.undefined)
else
}
int main() {
struct {int *a, n;} args[] = {
{(int []){4, 5, 1, 7, 1, 2, 8, 9, 2, 7}, 10}
, {(int []){1, 1, 1}, 3}
, {(int []){1}, 1}
, {(int []){}, 0}
, {(int []){INT_MIN, INT_MIN}, 2}
, {(int []){INT_MIN, INT_MIN + 1}, 2}
, {0, 0}
}, *a;
for (a = args; a->a; a++) g(a->a, a->n);
return 0;
}