import Control.Monad import Data.List import Data.Function import Data.Maybe main = do [t, a, b] <- liftM (map read . words) getLine let f p = let xs = mapMaybe (g p) [0..t] in guard (not (null xs)) >> return (maximumBy (compare `on` uncurry (+)) xs) g p x = let y = x - p in if x < p || x + y > t then Nothing else Just (x, y) i = f a j = f b case liftM2 ((+) `on` (uncurry (+))) i j of Nothing -> putStrLn "NO" Just k | k < t -> putStrLn "NO" | otherwise -> do putStrLn "YES" let Just (u, d) = i Just (r, l) = j xs = replicate u "^" ++ replicate d "v" ++ replicate (t-u-d) "" ys = replicate (t-l-r) "" ++ replicate l "<" ++ replicate r ">" mapM_ putStrLn $ zipWith (++) xs ys