100
-34 81 85 -96 50 20 54 86 22 10 -19 52 65 44 30 53 63 71 17 98 -92 4 5 -99 89 -23 48 9 7 33 75 2 47 -56 42 70 -68 57 51 83 82 94 91 45 46 25 95 11 -12 62 -31 -87 58 38 67 97 -60 66 73 -28 13 93 29 59 -49 77 37 -43 -27 0 -16 72 15 79 61 78 35 21 3 8 84 1 -32 36 74 -88 26 100 6 14 40 76 18 90 24 69 80 64 55 41
 100
-87 -48 -76 -1 -10 -17 -22 -19 -27 -99 -43 49 38 -20 -45 -64 44 -96 -35 -74 -65 -41 -21 -75 37 -12 -67 0 -3 5 -80 -93 -81 -97 -47 -63 53 -100 95 -79 -83 -90 -32 88 -77 -16 -23 -54 -28 -4 -73 -98 -25 -39 60 -56 -34 -2 -11 -55 -52 -69 -68 -29 -82 -62 -36 -13 -6 -89 8 -72 18 -15 -50 -71 -70 -92 -42 -78 -61 -9 -30 -85 -91 -94 84 -86 -7 -57 -14 40 -33 51 -26 46 59 -31 -58 -66
 100
-97 -90 61 78 87 -52 -3 65 83 38 30 -60 35 -50 -73 -77 44 -32 -81 17 -67 58 -6 -34 47 -28 71 -45 69 -80 -4 -7 -57 -79 43 -27 -31 29 16 -89 -21 -93 95 -82 74 -5 -70 -20 -18 36 -64 -66 72 53 62 -68 26 15 76 -40 -99 8 59 88 49 -23 9 10 56 -48 -98 0 100 -54 25 94 13 -63 42 39 -1 55 24 -12 75 51 41 84 -96 -85 -2 -92 14 -46 -91 -19 -11 -86 22 -37
 4
0 -1 -2 -3
 5
-1 -2 -3 -4 0
 100
3 -66 -17 54 24 -29 76 89 32 -37 93 -16 99 -25 51 78 23 68 -95 59 18 34 -45 77 9 39 -10 19 8 73 -5 60 12 31 0 2 26 40 48 30 52 49 27 4 87 57 85 58 -61 50 83 80 69 67 91 97 -96 11 100 56 82 53 13 -92 -72 70 1 -94 -63 47 21 14 74 7 6 33 55 65 64 -41 81 42 36 28 38 20 43 71 90 -88 22 84 -86 15 75 62 44 35 98 46
 100
-95 -28 -43 -72 -11 -24 -37 -35 -44 -66 -45 -62 -96 -51 -55 -23 -31 -26 -59 -17 77 -69 -10 -12 -78 -14 -52 -57 -40 -75 4 -98 -6 7 -53 -3 -90 -63 -8 -20 88 -91 -32 -76 -80 -97 -34 -27 -19 0 70 -38 -9 -49 -67 73 -36 2 81 -39 -65 -83 -64 -18 -94 -79 -58 -16 87 -22 -74 -25 -13 -46 -89 -47 5 -15 -54 -99 56 -30 -60 -21 -86 33 -1 -50 -68 -100 -85 -29 92 -48 -61 42 -84 -93 -41 -82
 100
-75 -60 -18 -92 -71 -9 -37 -34 -82 28 -54 93 -83 -76 -58 -88 -17 -97 64 -39 -96 -81 -10 -98 -47 -100 -22 27 14 -33 -19 -99 87 -66 57 -21 -90 -70 -32 -26 24 -77 -74 13 -44 16 -5 -55 -2 -6 -7 -73 -1 -68 -30 -95 -42 69 0 -20 -79 59 -48 -4 -72 -67 -46 62 51 -52 -86 -40 56 -53 85 -35 -8 49 50 65 29 11 -43 -15 -41 -12 -3 -80 -31 -38 -91 -45 -25 78 94 -23 -63 84 89 -61
 3
-101 101 0
 100
-64 -51 -75 -98 74 -26 -1 -8 -99 -76 -53 -80 -43 -22 -100 -62 -34 -5 -65 -81 -18 -91 -92 -16 -23 -95 -9 -19 -44 -46 -79 52 -35 4 -87 -7 -90 -20 -71 -61 -67 -50 -66 -68 -49 -27 -32 -57 -85 -59 -30 -36 -3 -77 86 -25 -94 -56 60 -24 -37 -72 -41 -31 11 -48 28 -38 -42 -39 -33 -70 -84 0 -93 -73 -14 -69 -40 -97 -6 -55 -45 -54 -10 -29 -96 -12 -83 -15 -21 -47 17 -2 -63 -89 88 13 -58 -82
 21
-100 -200 -300 -400 -500 -600 -700 -800 -900 -1000 0 100 200 300 400 500 600 700 800 900 1000
 100
-1000 -986 -979 -955 -966 -963 -973 -959 -972 -906 -924 -927 -929 -918 -977 -967 -921 -989 -911 -995 -945 -919 -971 -913 -912 -933 -969 -975 -920 -988 -997 -994 -953 -962 -940 -905 -978 -948 -957 -996 0 -976 -949 -931 -903 -985 -923 -993 -944 -909 -938 -946 -934 -992 -904 -980 -954 -943 -917 -968 -991 -956 -902 -942 -999 -998 -908 -928 -930 -914 -922 -936 -960 -937 -939 -926 -965 -925 -951 -910 -907 -970 -990 -984 -964 -987 -916 -947 -982 -950 -974 -915 -932 -958 -981 -941 -961 -983 -952 -935
 64
502 885 -631 -906 735 687 642 -29 -696 -165 -524 15 -129 -663 -846 -501 -651 895 -341 -833 -142 33 -847 688 945 -192 -587 -930 603 849 736 676 788 256 863 -509 319 -49 -807 -158 218 -886 -143 -639 118 -156 -291 325 892 -916 -622 -960 -959 -731 -943 436 -535 861 745 589 -159 376 -182 0
 100
-12 -41 57 13 83 -36 53 69 -6 86 -75 87 11 -5 -4 -14 -37 -84 70 2 -73 16 31 34 -45 94 -9 26 27 52 -42 46 96 21 32 7 -18 61 66 -51 95 -48 -76 90 80 -40 89 77 78 54 -30 8 88 33 -24 82 -15 19 1 59 44 64 -97 -60 43 56 35 47 39 50 29 28 -17 -67 74 23 85 -68 79 0 65 55 -3 92 -99 72 93 -71 38 -10 -100 -98 81 62 91 -63 -58 49 -20 22
 100
-17 16 -70 32 -60 75 -100 -9 -68 -30 -42 86 -88 -98 -47 -5 58 -14 -94 -73 -80 -51 -66 -85 -53 49 -25 -3 -45 -69 -11 -64 83 74 -65 67 13 -91 81 6 -90 -54 -12 -39 0 -24 -71 -41 -44 57 -93 -20 -92 18 -43 -52 -55 -84 -89 -19 40 -4 -99 -26 -87 -36 -56 -61 -62 37 -95 -28 63 23 35 -82 1 -2 -78 -96 -21 -77 -76 -27 -10 -97 -8 46 -15 -48 -34 -59 -7 -29 50 -33 -72 -79 22 38
 5
-1 -2 1 2 0
 99
-1000 -986 -979 -955 -966 -963 -973 -959 -972 -906 -924 -927 -929 -918 -977 -967 -921 -989 -911 -995 -945 -919 -971 -913 -912 -933 -969 -975 -920 -988 -997 -994 -953 -962 -940 -905 -978 -948 -957 -996 0 -976 -949 -931 -903 -985 -923 -993 -944 -909 -938 -946 -934 -992 -904 -980 -954 -943 -917 -968 -991 -956 -902 -942 -999 -998 -908 -928 -930 -914 -922 -936 -960 -937 -939 -926 -965 -925 -951 -910 -907 -970 -990 -984 -964 -987 -916 -947 -982 -950 -974 -915 -932 -958 -981 -941 -961 -983 -952
 59
-990 -876 -641 -726 718 -53 803 -954 894 -265 -587 -665 904 349 754 -978 441 794 -768 -428 -569 -476 188 -620 -290 -333 45 705 -201 109 165 446 13 122 714 -562 -15 -86 -960 43 329 578 287 -776 -14 -71 915 886 -259 337 -495 913 -498 -669 -673 818 225 647 0

19 -34 -96 -19 -92 -99 -23 -56 -68 -12 -31 -87 -60 -28 -49 -43 -27 -16 -32 -88
80 81 85 50 20 54 86 22 10 52 65 44 30 53 63 71 17 98 4 5 89 48 9 7 33 75 2 47 42 70 57 51 83 82 94 91 45 46 25 95 11 62 58 38 67 97 66 73 13 93 29 59 77 37 72 15 79 61 78 35 21 3 8 84 1 36 74 26 100 6 14 40 76 18 90 24 69 80 64 55 41
1 0 83 -87 -48 -76 -1 -10 -17 -22 -19 -27 -99 -43 -20 -45 -64 -96 -35 -74 -65 -41 -21 -75 -12 -67 -3 -80 -93 -81 -97 -47 -63 -100 -79 -83 -90 -32 -77 -16 -23 -54 -28 -4 -73 -98 -25 -39 -56 -34 -2 -11 -55 -52 -69 -68 -29 -82 -62 -36 -13 -6 -89 -72 -15 -50 -71 -70 -92 -42 -78 -61 -9 -30 -85 -91 -94 -86 -7 -57 -14 -33 -26 -31 -58 -66
16 49 38 44 37 5 53 95 88 60 8 18 84 40 51 46 59
1 0 51 -97 -90 -52 -3 -60 -50 -73 -77 -32 -81 -67 -6 -34 -28 -45 -80 -4 -7 -57 -79 -27 -31 -89 -21 -93 -82 -5 -70 -20 -18 -64 -66 -68 -40 -99 -23 -48 -98 -54 -63 -1 -12 -96 -85 -2 -92 -46 -91 -19 -11 -86
47 61 78 87 65 83 38 30 35 44 17 58 47 71 69 43 29 16 95 74 36 72 53 62 26 15 76 8 59 88 49 9 10 56 100 25 94 13 42 39 55 24 75 51 41 84 14 22
2 0 -37
 1 -1
2 -3 -2
1 0
 1 -1
2 -4 -3
2 0 -2
 19 -66 -17 -29 -37 -16 -25 -95 -45 -10 -5 -61 -96 -92 -72 -94 -63 -41 -88 -86
80 3 54 24 76 89 32 93 99 51 78 23 68 59 18 34 77 9 39 19 8 73 60 12 31 2 26 40 48 30 52 49 27 4 87 57 85 58 50 83 80 69 67 91 97 11 100 56 82 53 13 70 1 47 21 14 74 7 6 33 55 65 64 81 42 36 28 38 20 43 71 90 22 84 15 75 62 44 35 98 46
1 0 85 -95 -28 -43 -72 -11 -24 -37 -35 -44 -66 -45 -62 -96 -51 -55 -23 -31 -26 -59 -17 -69 -10 -12 -78 -14 -52 -57 -40 -75 -98 -6 -53 -3 -90 -63 -8 -20 -91 -32 -76 -80 -97 -34 -27 -19 -38 -9 -49 -67 -36 -39 -65 -83 -64 -18 -94 -79 -58 -16 -22 -74 -25 -13 -46 -89 -47 -15 -54 -99 -30 -60 -21 -86 -1 -50 -68 -100 -85 -29 -48 -61 -84 -93 -41 -82
14 77 4 7 88 70 73 2 81 87 5 56 33 92 42
1 0 73 -75 -60 -18 -92 -71 -9 -37 -34 -82 -54 -83 -76 -58 -88 -17 -97 -39 -96 -81 -10 -98 -47 -100 -22 -33 -19 -99 -66 -21 -90 -70 -32 -26 -77 -74 -44 -5 -55 -2 -6 -7 -73 -1 -68 -30 -95 -42 -20 -79 -48 -4 -72 -67 -46 -52 -86 -40 -53 -35 -8 -43 -15 -41 -12 -3 -80 -31 -38 -91 -45 -25 -23 -63
25 28 93 64 27 14 87 57 24 13 16 69 59 62 51 56 85 49 50 65 29 11 78 94 84 89
2 0 -61
 1 -101
1 101
1 0
 89 -64 -51 -75 -98 -26 -1 -8 -99 -76 -53 -80 -43 -22 -100 -62 -34 -5 -65 -81 -18 -91 -92 -16 -23 -95 -9 -19 -44 -46 -79 -35 -87 -7 -90 -20 -71 -61 -67 -50 -66 -68 -49 -27 -32 -57 -85 -59 -30 -36 -3 -77 -25 -94 -56 -24 -37 -72 -41 -31 -48 -38 -42 -39 -33 -70 -84 -93 -73 -14 -69 -40 -97 -6 -55 -45 -54 -10 -29 -96 -12 -83 -15 -21 -47 -2 -63 -89 -58 -82
10 74 52 4 86 60 11 28 17 88 13
1 0 9 -100 -200 -300 -400 -500 -600 -700 -800 -900
10 100 200 300 400 500 600 700 800 900 1000
2 0 -1000
 97 -1000 -986 -979 -955 -966 -963 -973 -959 -972 -906 -924 -927 -929 -918 -977 -967 -921 -989 -911 -995 -945 -919 -971 -913 -912 -933 -969 -975 -920 -988 -997 -994 -953 -962 -940 -905 -978 -948 -957 -996 -976 -949 -931 -903 -985 -923 -993 -944 -909 -938 -946 -934 -992 -904 -980 -954 -943 -917 -968 -991 -956 -902 -942 -999 -998 -908 -928 -930 -914 -922 -936 -960 -937 -939 -926 -965 -925 -951 -910 -907 -970 -990 -984 -964 -987 -916 -947 -982 -950 -974 -915 -932 -958 -981 -941 -961 -983
2 -935 -952
1 0
 35 -631 -906 -29 -696 -165 -524 -129 -663 -846 -501 -651 -341 -833 -142 -847 -192 -587 -930 -509 -49 -807 -158 -886 -143 -639 -156 -291 -916 -622 -960 -959 -731 -943 -535 -159
27 502 885 735 687 642 15 895 33 688 945 603 849 736 676 788 256 863 319 218 118 325 892 436 861 745 589 376
2 0 -182
 35 -12 -41 -36 -6 -75 -5 -4 -14 -37 -84 -73 -45 -9 -42 -18 -51 -48 -76 -40 -30 -24 -15 -97 -60 -17 -67 -68 -3 -99 -71 -10 -100 -98 -63 -58
63 57 13 83 53 69 86 87 11 70 2 16 31 34 94 26 27 52 46 96 21 32 7 61 66 95 90 80 89 77 78 54 8 88 33 82 19 1 59 44 64 43 56 35 47 39 50 29 28 74 23 85 79 65 55 92 72 93 38 81 62 91 49 22
2 0 -20
 75 -17 -70 -60 -100 -9 -68 -30 -42 -88 -98 -47 -5 -14 -94 -73 -80 -51 -66 -85 -53 -25 -3 -45 -69 -11 -64 -65 -91 -90 -54 -12 -39 -24 -71 -41 -44 -93 -20 -92 -43 -52 -55 -84 -89 -19 -4 -99 -26 -87 -36 -56 -61 -62 -95 -28 -82 -2 -78 -96 -21 -77 -76 -27 -10 -97 -8 -15 -48 -34 -59 -7 -29 -33 -72 -79
24 16 32 75 86 58 49 83 74 67 13 81 6 57 18 40 37 63 23 35 1 46 50 22 38
1 0 1 -1
2 1 2
2 0 -2
 1 -1000
2 -999 -998
96 -997 -996 -995 -994 -993 -992 -991 -990 -989 -988 -987 -986 -985 -984 -983 -982 -981 -980 -979 -978 -977 -976 -975 -974 -973 -972 -971 -970 -969 -968 -967 -966 -965 -964 -963 -962 -961 -960 -959 -958 -957 -956 -955 -954 -953 -952 -951 -950 -949 -948 -947 -946 -945 -944 -943 -942 -941 -940 -939 -938 -937 -936 -934 -933 -932 -931 -930 -929 -928 -927 -926 -925 -924 -923 -922 -921 -920 -919 -918 -917 -916 -915 -914 -913 -912 -911 -910 -909 -908 -907 -906 -905 -904 -903 -902 0
 29 -990 -876 -641 -726 -53 -954 -265 -587 -665 -978 -768 -428 -569 -476 -620 -290 -333 -201 -562 -15 -86 -960 -776 -14 -71 -259 -495 -498 -669
28 718 803 894 904 349 754 441 794 188 45 705 109 165 446 13 122 714 43 329 578 287 915 886 337 913 818 225 647
2 0 -673

import sys
below0= []
equal0= []
lager0= []

n = input()
num = map( int, raw_input().split() )

ans0 = []
ans1 = []
ans2 = []

for i in num:
    if i < 0:
        below0.append(i)
    elif i == 0:
        ans2.append( i )
    else:
        lager0.append(i)

ans0.append( below0.pop() )
if len(lager0) > 0:
    ans1.append( lager0.pop() )
else :
    ans1.append( below0.pop() )
    ans1.append( below0.pop() )
'''    
print below0
print lager0
'''
ans2.extend(below0)
ans2.extend(lager0)

print len(ans0),
for i in ans0:
    sys.stdout.write(' %d'%i)
print

print len(ans1),
for i in ans1:
    sys.stdout.write(' %d'%i)
print

print len(ans2),
for i in ans2:
    sys.stdout.write(' %d'%i)
