// Arup Guha
// 4/29/2025
// Solution to 2025 COP 4516 Team Final Contest Problem: Fizz or Buzz, Cuzz

import java.util.*;

public class fizzbuzz {

	public static void main(String[] args) {
	
		// Process cases.
		Scanner stdin = new Scanner(System.in);
		int nC = stdin.nextInt();
		for (int loop=0; loop<nC; loop++) {
		
			// Get divisibility numbers.
			int fizz = stdin.nextInt();
			int buzz = stdin.nextInt();
			int cuzz = stdin.nextInt();
			
			// Get bounds.
			int s = stdin.nextInt();
			int e = stdin.nextInt();
			
			// Go through the range.
			for (int i=s; i<=e; i++) {
			
				// Follow the rules.
				if (i%fizz == 0) System.out.println("FIZZ");
				else if (i%buzz == 0) System.out.println("BUZZ");
				else if (i%cuzz == 0) System.out.println("CUZZ");
				else System.out.println(i);
			}
		}
	}
}