using
System;
using
System.Collections.Generic;
class
GFG
{
static
void
makeSets(
int
[]arr,
int
n)
{
List<
int
> first =
new
List<
int
>();
List<
int
> second =
new
List<
int
>();
List<
int
> third =
new
List<
int
>();
for
(
int
i = 0; i < n; i++)
{
if
(arr[i] == 0)
{
third.Add(arr[i]);
}
if
(arr[i] > 0)
{
second.Add(arr[i]);
}
if
(arr[i] < 0)
{
first.Add(arr[i]);
}
}
if
(first.Count == 0 || third.Count == 0)
{
Console.Write(
"Not Possible"
);
return
;
}
if
(second.Count == 0)
{
for
(
int
i = 0; i < 2; i++)
{
second.Add(first[first.Count-1]);
first.Remove(first.Count - 1);
}
}
if
(first.Count % 2 == 0)
{
third.Add(first[first.Count-1]);
first.Remove(first.Count - 1);
}
for
(
int
i = 0; i < first.Count; i++)
{
Console.Write(first[i] +
" "
);
}
Console.WriteLine();
for
(
int
i = 0; i < second.Count; i++)
{
Console.Write(second[i] +
" "
);
}
Console.WriteLine();
for
(
int
i = 0; i < third.Count; i++)
{
Console.Write(third[i] +
" "
);
}
}
public
static
void
Main(String[] args)
{
int
[]arr = {-1, 2, 0};
int
n = arr.Length;
makeSets(arr, n);
}
}