public static String[] sort(String[] keys, int R, int W)
	{
		int len = keys.length;
		
		String[] aux = new String[len];
		
		for(int j = W-1; j >=0; j--)
		{
			int[] count = new int[R + 1];
			// counting Frequency
			for(int i = 0; i < len; i++)
			{				
				int index = Character.getNumericValue((keys[i].charAt(j)));
				count[ index + 1]++;
			}
		
			// Counting cumulative frequency
		
			for(int i = 0; i < count.length - 1; i++)
			{
				count[i+1] += count[i];
			}
		
			for(int i = 0; i < len; i++)
			{
				int index = Character.getNumericValue(keys[i].charAt(j));
				aux[count[index]++] = keys[i];
			}	
			
			for(int i = 0; i < len; i++)
				keys[i] = aux[i];
			//System.out.println("------------------");
		}
		return aux;		
	}