#!/usr/bin/env python
# 
# Copyright 2009 Mark Fiers, Plant & Food Research
# 
# This file is part of Moa - http://github.com/mfiers/Moa
# 
# Moa is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
# Software Foundation, either version 3 of the License, or (at your
# option) any later version.
# 
# Moa is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
# License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with Moa.  If not, see <http://www.gnu.org/licenses/>.
# 
"""
Takes a 'r2' sequence file and cuts segment from the sequence

Example:

  return the first 5 nt
  r2cut :5  < input > out

  return the last 5 nt
  r2cut -5:

"""
import os
import sys

ce = sys.argv[1]
cf = eval('lambda x: x[%s]' % ce)
print cf

while True:
    line = sys.stdin.readline()
    if not line: break
    id,seq = line.split()
    print id, cf(seq)


    


