<s> """<STR_LIT>""" <EOL> __author__ = '<STR_LIT>' <EOL> class Solution ( object ) : <EOL> def solve ( self , cipher ) : <EOL> """<STR_LIT>""" <EOL> N , K , Q , A , q = cipher <EOL> result = [ ] <EOL> for i in q : <EOL> result . append ( A [ ( i - K ) % N ] ) <EOL> return "<STR_LIT:\n>" . join ( map ( str , result ) ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> import sys <EOL> f = open ( "<STR_LIT>" , "<STR_LIT:r>" ) <EOL> N , K , Q = map ( int , f . readline ( ) . strip ( ) . split ( '<STR_LIT:U+0020>' ) ) <EOL> A = map ( int , f . readline ( ) . strip ( ) . split ( '<STR_LIT:U+0020>' ) ) <EOL> q = [ ] <EOL> for i in xrange ( Q ) : <EOL> q . append ( int ( f . readline ( ) . strip ( ) ) ) <EOL> cipher = N , K , Q , A , q <EOL> s = "<STR_LIT>" % ( Solution ( ) . solve ( cipher ) ) <EOL> print s , </s>
