Little Artem is fond of dancing. Most of all dances Artem likes rueda — Cuban dance that is danced by pairs of boys and girls forming a circle and dancing together.

More detailed, there are n pairs of boys and girls standing in a circle. Initially, boy number 1 dances with a girl number 1, boy number 2 dances with a girl number 2 and so on. Girls are numbered in the clockwise order. During the dance different moves are announced and all pairs perform this moves. While performing moves boys move along the circle, while girls always stay at their initial position. For the purpose of this problem we consider two different types of moves:

  1. Value x and some direction are announced, and all boys move x positions in the corresponding direction. 
  2. Boys dancing with even-indexed girls swap positions with boys who are dancing with odd-indexed girls. That is the one who was dancing with the girl 1 swaps with the one who was dancing with the girl number 2, while the one who was dancing with girl number 3 swaps with the one who was dancing with the girl number 4 and so one. It's guaranteed that n is even. 



Your task is to determine the final position of each boy.

Input

The first line of the input contains two integers n and q (2 ≤ n ≤ 1 000 000, 1 ≤ q ≤ 2 000 000) — the number of couples in the rueda and the number of commands to perform, respectively. It's guaranteed that n is even.

Next q lines contain the descriptions of the commands. Each command has type as the integer 1 or 2 first. Command of the first type is given as x ( - n ≤ x ≤ n), where 0 ≤ x ≤ n means all boys moves x girls in clockwise direction, while  - x means all boys move x positions in counter-clockwise direction. There is no other input for commands of the second type.

Output

Output n integers, the i-th of them should be equal to the index of boy the i-th girl is dancing with after performing all q moves.

Examples

Input

6 3
1 2
2
1 2


Output

4 3 6 5 2 1


Input

2 3
1 1
2
1 -2


Output

1 2


Input

4 2
2
1 3


Output

1 4 3 2
import java.io.*;
import java.util.*;
import java.math.*;


public class main
{
    public static void main(String args[])
    {
        InputStream inputStream = System.in;
        InputReader in = new InputReader(inputStream);
        OutputStream outputStream = System.out;
        PrintWriter out = new PrintWriter(outputStream);
        int n = in.nextInt(),q=in.nextInt();
            int a1=0,a2=1;
            while(q-->0)
            {
			    int type = in.nextInt();
                if(type==1)
                {
                    int x=in.nextInt();
                    a1+=x;
                    a2+=x;
                    a1=a1%n;
                    a2=a2%n;
                    if(a1<0)
                    {
                        a1+=n;
                    }
                    if(a2<0)
                    {
                        a2+=n;
                    }
                }
                else
                {
                    if(a1%2==1)
                    {
                        a1--;
                    }
                    else
                    {
                        a1++;
                    }
                    if(a2%2==1)
                    {
                        a2--;
                    }
                    else
                    {
                        a2++;
                    }
                }
            }
            int ans[]=new int[n];
            Arrays.fill(ans,-1);
            int count=1;
            while(count<n)
            {
                ans[a1]=count;
                count+=2;
                a1+=2;
                a1=a1%n;
            }
            count=2;
            while(count<=n)
            {
                ans[a2]=count;
                count+=2;
                a2+=2;
                a2=a2%n;
            }
            StringBuilder line = new StringBuilder();
        for (int i = 0; i < n ; i++)
        {
            line.append(ans[i]).append(' ');
        }
        out.println(line);
        out.flush();
    }
    static class InputReader
    {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;

        public InputReader(InputStream stream)
        {
            this.stream = stream;
        }

        private int[] nextInts(int n)
        {
            int[] ret = new int[n];
            for (int i = 0; i < n; i++)
            {
                ret[i] = nextInt();
            }
            return ret;
        }

        private int[][] nextIntTable(int n, int m)
        {
            int[][] ret = new int[n][m];
            for (int i = 0; i < n; i++)
            {
                for (int j = 0; j < m; j++)
                {
                    ret[i][j] = nextInt();
                }
            }
            return ret;
        }

        private long[] nextLongs(int n)
        {
            long[] ret = new long[n];
            for (int i = 0; i < n; i++)
            {
                ret[i] = nextLong();
            }
            return ret;
        }

        private long[][] nextLongTable(int n, int m)
        {
            long[][] ret = new long[n][m];
            for (int i = 0; i < n; i++)
            {
                for (int j = 0; j < m; j++)
                {
                    ret[i][j] = nextLong();
                }
            }
            return ret;
        }

        private double[] nextDoubles(int n)
        {
            double[] ret = new double[n];
            for (int i = 0; i < n; i++)
            {
                ret[i] = nextDouble();
            }
            return ret;
        }

        private int next()
        {
            if (numChars == -1)
                throw new InputMismatchException();
            if (curChar >= numChars)
            {
                curChar = 0;
                try
                {
                    numChars = stream.read(buf);
                }
                catch (IOException e)
                {
                    throw new InputMismatchException();
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public char nextChar()
        {
            int c = next();
            while (isSpaceChar(c))
                c = next();
            if ('a' <= c && c <= 'z')
            {
                return (char) c;
            }
            if ('A' <= c && c <= 'Z')
            {
                return (char) c;
            }
            throw new InputMismatchException();
        }

        public String nextToken()
        {
            int c = next();
            while (isSpaceChar(c))
                c = next();
            StringBuilder res = new StringBuilder();
            do
            {
                res.append((char) c);
                c = next();
            }
            while (!isSpaceChar(c));
            return res.toString();
        }

        public int nextInt()
        {
            int c = next();
            while (isSpaceChar(c))
                c = next();
            int sgn = 1;
            if (c == '-')
            {
                sgn = -1;
                c = next();
            }
            int res = 0;
            do
            {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c-'0';
                c = next();
            }
            while (!isSpaceChar(c));
            return res*sgn;
        }

        public long nextLong()
        {
            int c = next();
            while (isSpaceChar(c))
                c = next();
            long sgn = 1;
            if (c == '-')
            {
                sgn = -1;
                c = next();
            }
            long res = 0;
            do
            {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c-'0';
                c = next();
            }
            while (!isSpaceChar(c));
            return res*sgn;
        }

        public double nextDouble()
        {
            return Double.valueOf(nextToken());
        }

        public boolean isSpaceChar(int c)
        {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter
        {
            public boolean isSpaceChar(int ch);
        }
    }

    static void debug(Object... o)
    {
        System.err.println(Arrays.deepToString(o));
    }
}