#include <stdio.h>
#include <stdlib.h>
 
typedef struct MainStruct {
 
    struct SubStruct1 {
        int x;
        int y;
        int Value;
    } s1;
 
    struct SubStruct2 {
        int y;
        int Value;
        int x;
    } s2;
 
    struct SubStruct3 {
        int Value;
        int x;
        int y;
    } s3;
 
} MainStruct_t;
 
typedef union {
    struct SubStruct1 *s1;
    struct SubStruct2 *s2;
    struct SubStruct3 *s3;
    int Value;
} T;
 
void setValue( T **t, int i )
{
  (*t)->Value=i;
}
 
int main()
{
    MainStruct_t x;
    T t;
 
    setValue( (t.s1=&x.s1,&t), 1);
    setValue( (t.s2=&x.s2,&t), 2);
    setValue( (t.s3=&x.s3,&t), 3);
 
    printf( "%d %d %d",x.s1.Value,x.s2.Value,x.s3.Value);
 
    return 0;
}