Divide the given set of numbers into prime and composite numbers.
[16, 31, 5, 9, 18]
In the given set of numbers [16, 31, 5, 9, 18], the prime numbers are [31, 5] and the composite numbers are [16, 9, 18].
Complete the following task based on the instruction and optional input provided.### Instruction:
Divide the given set of numbers into prime and composite numbers.

### Input:
[16, 31, 5, 9, 18]

### Output:
In the given set of numbers [16, 31, 5, 9, 18], the prime numbers are [31, 5] and the composite numbers are [16, 9, 18].