#include <stdio.h>

int main() {
    int n;
    scanf("%d", &n);

    if (n < 1 || n > 10) {
        printf("Invalid Input");
        return 0;
    }

    // Upper half (including middle line)
    for (int i = 1; i <= n; i++) {
        for (int j = 1; j <= n - i; j++) {
            printf(" ");
        }
        for (int j = 1; j <= i; j++) {
            printf("*");
        }
        printf("\n");
    }

    // Lower half
    for (int i = n - 1; i >= 1; i--) {
        for (int j = 1; j <= n - i; j++) {
            printf(" ");
        }
        for (int j = 1; j <= i; j++) {
            printf("*");
        }
        printf("\n");
    }

    return 0;
}





#include <stdio.h>
#include <stdlib.h>

struct Node {
    int data;
    struct Node* prev;
    struct Node* next;
};

// Function to create a new node
struct Node* createNode(int value) {
    struct Node* newNode = (struct Node*)malloc(sizeof(struct Node));
    newNode->data = value;
    newNode->prev = NULL;
    newNode->next = NULL;
    return newNode;
}

int main() {
    int n, value;
    scanf("%d", &n);

    // Check for invalid number of participants
    if (n <= 0 || n > 10) {
        printf("Invalid Input");
        return 0;
    }

    struct Node* head = NULL;
    struct Node* tail = NULL;

    for (int i = 0; i < n; i++) {
        if (scanf("%d", &value) != 1  value < -10000  value > 10000) {
            printf("Invalid Input");
            return 0;
        }

        struct Node* newNode = createNode(value);
        if (head == NULL) {
            head = newNode;
            tail = newNode;
        } else {
            tail->next = newNode;
            newNode->prev = tail;
            tail = newNode;
        }
    }

    // Print list in order
    struct Node* temp = head;
    while (temp != NULL) {
        printf("%d", temp->data);
        if (temp->next != NULL) printf(" ");
        temp = temp->next;
    }

    return 0;
}




#include <stdio.h>
#include <string.h>
#include <ctype.h>

int main() {
    char str[101], result[101];
    int seen[256] = {0}; // Track visited characters
    int k = 0;

    // Read whole line including spaces
    if (!fgets(str, sizeof(str), stdin)) {
        printf("Invalid Input");
        return 0;
    }

    // Remove newline if present
    str[strcspn(str, "\n")] = '\0';

    int n = strlen(str);

    // Constraint check
    if (n < 1 || n > 100) {
        printf("Invalid Input");
        return 0;
    }

    // Process string
    for (int i = 0; i < n; i++) {
        char c = str[i];

        // Allow only letters, digits, and spaces
        if (!(isalpha(c)  isdigit(c)  c == ' ')) {
            printf("Invalid Input");
            return 0;
        }

        // If character not seen yet, add to result
        if (!seen[(unsigned char)c]) {
            result[k++] = c;
            seen[(unsigned char)c] = 1;
        }
    }

    result[k] = '\0';
    printf("%s", result);

    return 0;
}