// Arup Guha
// 7/13/2026
// Solution to 1994 UCF HSPT Problem: Visual Acuity

import java.util.*;

public class acuity {
	
	// List of what each character flipped maps to.
	final public static char[] MAP = {'0','1','5','3','x','2','x','x','8','x'};
	
	public static void main(String[] args) {
	
		Scanner stdin = new Scanner(System.in);
		
		// Process cases.
		while (stdin.hasNext()) {
		
			// Get the input.
			char[] inp = stdin.next().toCharArray();
			String sInp = new String(inp);
			
			// Flip it.
			char[] flip = tryFlip(inp);
			String sFlip = null;
			if (flip != null) sFlip = new String(flip);
			
			// Doesn't work.
			if (flip == null)
				System.out.println("Fred does not see a valid number.");
				
			// It's bigger.
			else if (bigger(flip, inp))
				System.out.println("Fred sees "+sFlip+", which is bigger than "+sInp+".");
				
			// It's not bigger.
			else
				System.out.println("Fred sees "+sFlip+", which is not bigger than "+sInp+".");
		}
	}
	
	// Returns the result of flipping inp.
	public static char[] tryFlip(char[] inp) {
	
		// Store result here.
		int n = inp.length;
		char[] res = new char[n];
		
		// Do each character.
		for (int i=0; i<n; i++) {
		
			// Special case.
			if (inp[i] == '-') {
				res[i] = inp[i];
				continue;
			}
			
			// This digit isn't flippable.
			if (MAP[inp[i]-'0'] == 'x') return null;
			
			// Store the mapped character after the flip.
			res[i] = MAP[inp[i]-'0'];
		}
		
		// Ta da!
		return res;
	}
	
	// Returns true iff num1 is bigger than num2.
	public static boolean bigger(char[] num1, char[] num2) {
	
		// We need to remember this.
		boolean neg = (num1[0] == '-');
		
		// Go most significant to least.
		for (int i=0; i<num1.length; i++) {
		
			// No difference.
			if (num1[i] == num2[i]) continue;
			
			// Weird but this is one way to decide.
			boolean regBig = (num1[i] > num2[i]); 
			return neg ? !regBig : regBig;
		}
		
		// Equal if we get here, which isn't bigger.
		return false;
	}
}