1393 ill virus Genes

Source: Internet
Author: User
Description

You are lucky to have two things:

1. A virus gene

2. A device that can modify genes;

So you decided to abuse virus genes ......

A virus gene is a string consisting of four characters: A, C, T, and G;

What you can do:

Insert X ST1 indicates inserting a gene segment ST1 after the I-bit of the original gene sequence (the gene segment is also composed of atcg)

Del x y indicates that gene sequences with y length are deleted from position X of the original gene sequence;

Copy indicates that the original gene is copied, And the length is doubled. The copy is followed by the original gene;

Now you have performed N operations and want to know the final genetics ......

Input

The first line contains a string st, the original virus gene;

The second row contains an integer of N, indicating N abuse operations;

The following n lines are in the same format as the topic description to ensure that the data is valid;

Output

Output the appearance of virus genes after N abuse;

Sample Input
aattccg
3
insert 1 aatt
del 2 5
copy
sample output

attccgattccg

subscripts must be considered for this question. It is not difficult, but it is very Bt. The difference between C and C ++ is here.

 # include 
     
       # include 
      
        # include 
       
         int main () {char a [200002]; char B [100002]; char C [10]; int number, T; int I; int local; int begin, end; int length; int length1; scanf ("% s", & A); scanf ("% d", & number); For (t = 0; t 
        
          = Local + length1; I --) {A [I] = [I-length1] ;}for (I = 0; I 
         

         
        
       
      
     

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.