Algorithms and Data Structures

  • Profound Academy

    • Status
      • 1
        Implementation
      • 2
        Bitwise operations
      • 3
        Prefix Sums
      • 4
        Sliding window / Two pointers
      • 5
        Modular Arithmetic
      • 6
        Number Theory
      • 7
        Binary Search
      • 8
        Basic Sorting
      • 9
        Greedy Algorithms
      • 10
        Basic Dynamic Programming
      • 11
        Recursion
      • 12
        Linked LIst
      • 13
        Queue & Stack
      • 14
        Binary tree + BST
      • 15
        Divide & Conquer + Advanced Sorting
      • 16
        Heap
      • 17
        Hashing
      • 18
        Graph Representation

  • Encoding a sentence

    When talking to a friend of yours, you’d like to encode your messages so that other people don’t understand them. You get together with your friend Alice and decide to send messages to each other after following a secret algorithm that you came up with. Given an English sentence, you’ve decided to shift all the consonant letters (B, C, D, F, G, H, J, K, L, M, N, P, Q, R, S, T, V, W, X, Z) cyclically, while leaving all the vowels untouched. You hope that this will prevent other people from reading your conversations. Yet, encoding and decoding the messages every time yourself is tedious. So, you decide to implement the algorithm to make sure the messages get encoded instantly.

    Input

    The input contains the text of English letters, whitespaces, and punctuation marks. The length of the text does not exceed 100,000.

    Output

    The program should print the encoded text.

    Examples

    Input
    Output
    Hello, how are you doing?
    lelho, wor ade you noigH?
     

    Constraints

    Time limit: 1 seconds

    Memory limit: 512 MB

    Output limit: 1 MB

    To check your solution you need to sign in
    Sign in to continue