// Arup Guha
// 3/11/2015
// Solution to UCF HS Problem: Swap Lobster

import java.util.*;

public class lobster {

	public static void main(String[] args) {

		// Get number of cases.
		Scanner stdin = new Scanner(System.in);
		int numCases = stdin.nextInt();

		// Process each case.
		for (int loop=1; loop<=numCases; loop++) {

			// Read in array size and # of buckets for sorting.
			int n = stdin.nextInt();
			int k = stdin.nextInt();

			// Create buckets for sorting.
			ArrayList[] buckets = new ArrayList[k];
			for (int i=0; i<k; i++)
				buckets[i] = new ArrayList<Integer>();

			// Add each item to appropriate bucket.
			for (int i=0; i<n; i++)
				buckets[i%k].add(stdin.nextInt());

			// Sort buckets, which is what the lobster can do...
			for (int i=0; i<k; i++)
				Collections.sort(buckets[i]);

			// Assume that we can do this.
			boolean sortable = true;

			// Check if items are in order.
			for (int i=0; i<n-1; i++) {

				// Get ith and (i+1)st consecutive items, which should be sorted.
				int cur = (Integer)buckets[i%k].get(i/k);
				int next = (Integer)buckets[(i+1)%k].get((i+1)/k);

				// Oops, these are out of order...
				if (next < cur) {
					sortable = false;
					break;
				}
			}

			// Output result.
			if (sortable)
				System.out.println("Lobster #"+loop+": Sortable");
			else
				System.out.println("Lobster #"+loop+": Unsortable");
		}
	}
}