import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class A {

	public static void main(String[] args) throws IOException {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int n = Integer.parseInt(br.readLine());

		String s = br.readLine();

		String go = "go";
		String ogo = "ogo";

		int begin = 0;
		int end  = 0;

		boolean flag = false;

		String ss  = "";

		for (int i = 0; i < s.length(); i++) {

			if(!flag){
			if(i <= s.length()-3 && s.substring(i, i+3).equals(ogo)){
				flag = true;
				begin = i;
				end = i+3;
				i = i+2;
				ss += "***";
			}else{

			ss += s.charAt(i);

			}

			}else{
				//System.out.println("3w");

				if(i <= s.length()-2 && s.substring(i,i+2).equals(go)){
					i++;
					end = i+1;

				}else{
					flag = false;
					//ss +=""+ s.charAt(i) +s.charAt(i+1);
					i = end-1;
				//System.out.println(i+1);
					//System.out.println(end);

				}

			}

		}

		//System.out.println(end);

		System.out.println(ss);

	}

}


/**
 * Created on 6/8/14
 *
 * @author: Anirudh Rayabharam <anirudh.rayabharam@gmail.com>
 * @handle: code_overlord
 */
import java.io.*;

public class KitaharaHarukiGift {
    public static void main(String[] args) {
        InputReader in = new InputReader(System.in);
        PrintStream out = System.out;

        int n = in.nextInt();
        int[] w = new int[n];

        int sum = 0;
        int oneH, twoH;
        oneH = twoH = 0;
        for (int i = 0; i < n; i++) {
            w[i] = in.nextInt();
            sum += w[i];
            if (w[i] == 100) oneH++;
            else twoH++;
        }

        int each = sum / 2;
        int x = sum / 100;

        if (x % 2 == 1) out.println("NO");
        else {
            boolean possible = false;
            for (int i = 0; i <= twoH; i++) {
                if (200 * i <= each && each - 200 * i <= oneH * 100) possible = true;
            }

            if (possible) out.println("YES");
            else out.println("NO");
        }
    }

    private static class InputReader {
        public BufferedReader reader;
        private int tokenCount, nextTokenIndex;
        private String[] tokens;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream));
            tokenCount = nextTokenIndex = 0;
        }

        public String next() {
            String nextLine;
            if (nextTokenIndex == tokenCount) {
                try {
                    nextLine = reader.readLine();
                    nextTokenIndex = 0;
                    tokens = nextLine.split("\\s");
                    tokenCount = tokens.length;
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }

            return tokens[nextTokenIndex++];
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }
    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.Writer;
import java.io.BufferedReader;
import java.util.Comparator;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Arthur Gazizov [2oo7] - Kazan FU
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastScanner in = new FastScanner(inputStream);
        FastPrinter out = new FastPrinter(outputStream);
        TaskD solver = new TaskD();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskD {
        public static int cmpOne(Func a, Func b) {
            if (MathUtils.equals(a.x, 1)) {
                int cmp = Double.compare(a.x, b.x);
                return MathUtils.equals(cmp, 0) ? 0 : cmp;
            }
            if (MathUtils.equals(b.x, 1)) {
                int cmp = Double.compare(a.x, b.x);
                return MathUtils.equals(cmp, 0) ? 0 : cmp;
            }
            return 0;
        }

        public static int cmp(Func a, Func b) {
            int test = cmpOne(a, b);
            if (test != 0) return test;
            if ((a.x - 1) * (b.x - 1) < 0) return Double.compare(a.x, b.x);
            return MathUtils.equals(a.get(), b.get()) ? 0 : (MathUtils.sign(a.x - 1)) * Double.compare(a.get(), b.get());
        }

        public void solve(int testNumber, FastScanner in, FastPrinter out) {
            double x = in.nextDouble();
            double y = in.nextDouble();
            double z = in.nextDouble();
            Func[] funcs = new Func[12];
            funcs[0] = new Func(x, y, z, 0, 0);
            funcs[1] = new Func(x, z, y, 0, 1);
            funcs[2] = new Func(x, y, z, 1, 2);
            funcs[3] = new Func(x, z, y, 1, 3);
            funcs[4] = new Func(y, x, z, 0, 4);
            funcs[5] = new Func(y, z, x, 0, 5);
            funcs[6] = new Func(y, x, z, 1, 6);
            funcs[7] = new Func(y, z, x, 1, 7);
            funcs[8] = new Func(z, x, y, 0, 8);
            funcs[9] = new Func(z, y, x, 0, 9);
            funcs[10] = new Func(z, x, y, 1, 10);
            funcs[11] = new Func(z, y, x, 1, 11);
            int size = 12;
            Comparator<Func> fuck = new Comparator<Func>() {
                public int compare(Func a, Func b) {
                    int c = cmp(a, b);
                    return c == 0 ? -Integer.compare(a.index, b.index) : c;
                }
            };
            Arrays.sort(funcs, fuck);
            String ans = "";
            switch (funcs[11].index) {
                case 0:
                    ans = "x^y^z";
                    break;
                case 1:
                    ans = "x^z^y";
                    break;
                case 2:
                    ans = "(x^y)^z";
                    break;
                case 3:
                    ans = "(x^z)^y";
                    break;
                case 4:
                    ans = "y^x^z";
                    break;
                case 5:
                    ans = "y^z^x";
                    break;
                case 6:
                    ans = "(y^x)^z";
                    break;
                case 7:
                    ans = "(y^z)^x";
                    break;
                case 8:
                    ans = "z^x^y";
                    break;
                case 9:
                    ans = "z^y^x";
                    break;
                case 10:
                    ans = "(z^x)^y";
                    break;
                case 11:
                    ans = "(z^y)^x";
                    break;
            }
            out.print(ans);
        }

    }

    static class Func {
        public double x;
        public double y;
        public double z;
        public int type;
        public int index;

        public Func(double x, double y, double z, int type, int index) {
            this.x = x;
            this.y = y;
            this.z = z;
            this.type = type;
            this.index = index;
        }

        public double get() {
            return type == 0 ? Math.log(Math.abs(Math.log(x))) + z * Math.log(y) : Math.log(Math.abs(Math.log(x))) + Math.log(y * z);
        }

    }

    static class FastScanner extends BufferedReader {
        boolean isEOF;

        public FastScanner(InputStream is) {
            super(new InputStreamReader(is));
        }

        public FastScanner(InputStreamReader inputStreamReader) {
            super(inputStreamReader);
        }

        public int read() {
            try {
                int ret = super.read();
                if (isEOF && ret < 0) {
                    throw new InputMismatchException();
                }
                isEOF = ret == -1;
                return ret;
            } catch (IOException e) {
                throw new InputMismatchException();
            }
        }

        public static boolean isWhiteSpace(int c) {
            return c >= -1 && c <= 32;
        }

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

        public int nextInt() {
            int c = read();
            while (isWhiteSpace(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int ret = 0;
            while (!isWhiteSpace(c)) {
                if (c < '0' || c > '9') {
                    throw new NumberFormatException("digit expected " + (char) c
                            + " found");
                }
                ret = ret * 10 + c - '0';
                c = read();
            }
            return ret * sgn;
        }

        public double nextDouble() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            double res = 0;
            while (!isSpaceChar(c) && c != '.') {
                if (c == 'e' || c == 'E')
                    return res * Math.pow(10, nextInt());
                if (c < '0' || c > '9')
                    throw new NumberFormatException("digit expected " + (char) c
                            + " found");
                res *= 10;
                res += c - '0';
                c = read();
            }
            if (c == '.') {
                c = read();
                double m = 1;
                while (!isSpaceChar(c)) {
                    if (c == 'e' || c == 'E')
                        return res * Math.pow(10, nextInt());
                    if (c < '0' || c > '9')
                        throw new UnknownError();
                    m /= 10;
                    res += (c - '0') * m;
                    c = read();
                }
            }
            return res * sgn;
        }

        public String readLine() {
            try {
                return super.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return null;
        }

    }

    static class FastPrinter extends PrintWriter {
        public FastPrinter(Writer writer) {
            super(writer);
        }

        public FastPrinter(OutputStream out) {
            super(out);
        }

        public void close() {
            super.close();
        }

    }

    static class MathUtils<T> {
        public static final double EPS = 1e-9;

        public static final double abs(double value) {
            return value >= 0 ? value : -value;
        }

        public static final int sign(double value) {
            if (value > EPS) return 1;
            if (value < -EPS) return -1;
            return 0;
        }

        public static final boolean equals(double a, double b) {
            return abs(a - b) < EPS;
        }

    }
}


import java.io.*;
import java.util.*;

public class Main {

	void solve(Scanner in, PrintWriter out) {

		int n = in.nextInt();
		out.println(3L * (1 + n) * n + 1);
	}

	void run() {
		try (Scanner in = new Scanner(System.in); PrintWriter out = new PrintWriter(System.out)) {
			solve(in, out);
		}

	}

	public static void main(String args[]) {
		new Main().run();
	}
}


//package com.company;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        // write your code here
        StringBuilder sb = new StringBuilder();
        Scanner s=new Scanner(System.in);
    char[] a=s.next().toCharArray();StringBuilder power=new StringBuilder();int flag=0;char[] base=new char[a.length];
    for(int i=0;i<a.length;i++){
        if(a[i]=='e'){
            flag=1;continue;
        }
        if(flag==0){
            base[i]=(a[i]);
        }else{
            power.append(a[i]);
        }
    }flag=0;int p=Integer.parseInt(power.toString());int clur=0;
    for(int i=0;i<a.length;i++){
        if(a[i]=='e') break;
        if(flag==0){if(a[i]=='.') {
            flag=1;continue;
        }
            sb.append(a[i]);
        }else{if(a[i]=='0'&&a[i-1]=='.'&&(a[i+1]=='e')) {
            while(p>0){
                sb.append('0');p--;
            }
            break;}
            if(p>0){
                sb.append(a[i]);p--;
            }else{if(clur==0){
                sb.append('.'); clur=1;}sb.append(a[i]);
            }
        }
    }while(p>0){
        sb.append('0');p--;
        }
        System.out.println(sb.toString());
    }static int success=0,endi=0,endj=0;static char[][] a;static int n,m;static int[] [] vis;
static void dfs(int i,int j,char dir,int turns){
   //  vis[i][j]=1;
     if(turns>2) return;

       if(dir=='Z'){
           if(i+1<n&&a[i+1][j]=='T') {
              success=1;return;
           }if(success==1) return;
               if(i+1<n&&a[i+1][j]!='*'&&vis[i+1][j]==0){
               dfs(i+1,j,'D',turns);
           }if(success==1) return;if(i-1>=0&&a[i-1][j]=='T') {
               success=1;return;
           }if(success==1) return;
           if(i-1>=0&&a[i-1][j]!='*'&&vis[i-1][j]==0){
               dfs(i-1,j,'U',turns);
           }if(success==1) return;
           if(j+1<m&&a[i][j+1]=='T') {
               success=1;return;
           }if(success==1) return;
           if(j+1<m&&a[i][j+1]!='*'&&vis[i][j+1]==0){
               dfs(i,j+1,'R',turns);
           }if(success==1) return;
           if(j-1>=0&&a[i][j-1]=='T') {
               success=1;
           }if(success==1) return;
           if(j-1>=0&&a[i][j-1]!='*'){
               dfs(i,j-1,'L',turns);
           }if(success==1) return;
       }else{
           if(i+1<n&&a[i+1][j]=='T') {
               if(turns<2||'D'==dir)
                   success=1;
           }if(success==1) return;
           if(i+1<n&&a[i+1][j]!='*'&&vis[i+1][j]==0){
         if('D'!=dir)       dfs(i+1,j,'D',turns+1);else      dfs(i+1,j,'D',turns);

           }if(success==1) return;
           if(i-1>=0&&a[i-1][j]=='T') {
               if(turns<2||'U'==dir)

                   success=1;;
           }if(success==1) return;
           if(i-1>=0&&a[i-1][j]!='*'&&vis[i-1][j]==0){
             if('U'!=dir)
               dfs(i-1,j,'U',turns+1);else      dfs(i-1,j,'U',turns);

           }if(success==1) return;
           if(j+1<m&&a[i][j+1]=='T') {
               if(turns<2||'R'==dir)

                   success=1;;
           }if(success==1) return;
           if(j+1<m&&a[i][j+1]!='*'&&vis[i][j+1]==0){
              if('R'!=dir)
               dfs(i,j+1,'R',turns+1);
              else
                  dfs(i,j+1,'R',turns);

           }if(success==1) return;
           if(j-1>=0&&a[i][j-1]=='T') {
               if(turns<2||'L'==dir)
               success=1;

           }if(success==1) return;
           if(j-1>=0&&a[i][j-1]!='*'&&vis[i][j-1]==0){
               if('L'!=dir)
               dfs(i,j-1,'L',turns+1);
               else
                   dfs(i,j-1,'L',turns);

           }if(success==1) return;
       }
}

}


//I AM THE CREED
/* //I AM THE CREED
/* package codechef; // don't place package name! */
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
import java.util.*;
public class Main{
    public static void main(String[] args) throws IOException
    {

        Scanner input = new Scanner(System.in);
        while(input.hasNext()){
            int n=input.nextInt();
            String s=input.next();
            int min=s.length();
            for(int i=0;i<s.length();i++){
                if((2)*(i+1)>s.length()){
                    break;
                }
                if(s.substring(0, i+1).equals(s.substring(i+1, (2*i)+2))){
                    min=Math.min(s.length()-(i), min);
                }
            }
            System.out.println(min);
        }

    }

}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        E802 solver = new E802();
        solver.solve(1, in, out);
        out.close();
    }

    static class E802 {
        public void solve(int testNumber, InputReader in, PrintWriter out) {

            int n = in.nextInt();
            int[] a = new int[250];

            for (int v = 1; v <= n; v++) {

                double sum = 0;
                for (int i = 0; i < 250; i++) {
                    a[i] = in.nextInt();
                    sum += a[i];
                }

                double mean = sum / 250;

                double variance = 0;

                for (int i = 0; i < 250; i++) {
                    double deviation = mean - a[i];
                    variance += deviation * deviation;
                }

                variance /= 250;

                int ans = 0;

                if (2 * mean >= variance) { //gaussian
                    ans = ((int) Math.round(mean));
                } else { //uniform
                    ans = arrays.max(a) + arrays.min(a);
                    ans = ((int) Math.round(ans / 2.));
                }

                out.println(ans);

            }
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }

    static class arrays {
        public static int max(int[] a) {
            int ans = a[0];
            for (int i : a) {
                ans = Math.max(ans, i);
            }
            return ans;
        }

        public static int min(int[] a) {
            int ans = a[0];
            for (int i : a) {
                ans = Math.min(ans, i);
            }
            return ans;
        }

    }
}


import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;

public class Main
{

    static Scanner p = new Scanner(System.in);
    public static void main(String[] args) {
        String[] nmab = p.nextLine().split(" ");
        int mb = Integer.parseInt(nmab[1]) * Integer.parseInt(nmab[3]);
        int na = Integer.parseInt(nmab[0]) * Integer.parseInt(nmab[2]);
        int n = Integer.parseInt(nmab[0]);
        int m = Integer.parseInt(nmab[1]);
        int a = Integer.parseInt(nmab[2]);
        int b = Integer.parseInt(nmab[3]);
        if(b / m < a){
            if(m == n){
                System.out.println(b);
                System.exit(0);
            }else if(m < n){
                if((n % m) % 2 == 0 && b < a){
                    System.out.println(b*((n + m - 1) / m));
                    System.exit(0);
                }else{
                    if(b < a){
                        System.out.println(b*(n/m)+(b*(n%m)));
                        System.exit(0);
                    }else{
                        System.out.println((b*(n/m))+((n%m)*a));
                        System.exit(0);
                    }
                }

        }else{
                if(b > a && (n*a) < b){
                    System.out.println(n*a);
                    System.exit(0);
                }else{
                    System.out.println(b);
                }
            }
        }else{
            System.out.println(n*a);
            System.exit(0);
        }
    }
}


import java.util.Scanner;

public class PointOnSpiral {

    public static int go(int x , int y){
        int step = 1;
        int flag = 0;
        int sx = 0 , sy = 0;
        int result = 0;
        while(true){
            int nx = sx , ny = sy;
            if(flag == 0){
                if(nx <= 0)
                    nx += step;
                else
                    nx -= step;
            }else{
                if(ny <= 0){
                    ny += step;
                }else
                    ny -= step;
            }

            if(sx == nx && x == sx && (y >= sy && y <= ny || y >= ny && y <= sy))
                return result;

            if(sy == ny && y == sy && (x >= sx && x <= nx || x >= nx && x <= sx))
                return result;

            flag ++;
            if(flag == 2){
                step ++;
                flag = 0;
            }
            result ++;
            sx = nx;
            sy = ny;
        }
    }

    public static void main(String args[]){
        Scanner s = new Scanner(System.in);
        int x = s.nextInt();
        int y = s.nextInt();
        System.out.println(go(x , y));
    }

}


import java.io.*;
import java.util.*;

/**
 * Created by hapsi on 11.10.2016.
 */
public class Main {
    private static class FastScanner {
        private BufferedReader br;
        private StringTokenizer st;
        public FastScanner(InputStream inputStream){
            br = new BufferedReader(new InputStreamReader(inputStream));
        }
        public String next() {
            while (st == null || !st.hasMoreTokens()){
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException ignored){}
            }
            return st.nextToken();
        }
        public int nextInt() {
            return Integer.parseInt(next());
        }
        public long nextLong() {
            return Long.parseLong(next());
        }
        public double nextDouble() {
            return Double.parseDouble(next());
        }
    }

    private static int binarySearch(int []a, int l, int r, int x){
        if (l >= r) return -1;
        int m = (l + r) / 2;
        if (a[m] > x || (a[m] == x && m > 0 && a[m-1] == x))
            return binarySearch(a, l, m, x);
        else if (a[m] < x)
            return binarySearch(a, m + 1, r, x);
        return m;
    }

    private static int nextSearch(int []a, int l, int r, int x){
        if (l >= r) return l;
        int m = (l + r) / 2;
        if (a[m] > x)
            return nextSearch(a, l, m, x);
        else if (a[m] < x || (m < a.length - 1 && a[m+1] == x))
            return nextSearch(a, m + 1, r, x);
        return m + 1;
    }

    private static int nearestSearch(int []a, int l, int r, int x) {
        if (l >= r) {
            if (a.length == 1) {
                return 0;
            }
            else if (l >= a.length) {
                return a.length - 1;
            }
            else if (l-1 >= 0) {
                int d1 = Math.abs(a[l-1] - x);
                int d2 = Math.abs(a[l] - x);
                if (d1 <= d2) {
                    return l-1;
                }
                return l;
            }
            else {
                return l;
            }
        }
        int m = (l + r) / 2;
        if (a[m] > x || (a[m] == x && m > 0 && a[m-1] == x)) {
            return nearestSearch(a, l, m, x);
        }
        else if (a[m] < x) {
            return nearestSearch(a, m + 1, r, x);
        }
        return m;
    }

    private static int compareString(String a, String b){
        if(a.length() > b.length()){
            return 1;
        }
        else if(a.length() < b.length()){
            return -1;
        }
        for(int i=0;i<a.length();i++){
            if(a.charAt(i) > b.charAt(i)){
                return 1;
            }
            else if(a.charAt(i) < b.charAt(i)){
                return -1;
            }
        }
        return 0;
    }

    public static void main(String args[]){
        FastScanner scanner = new FastScanner(System.in);
        PrintWriter printer = new PrintWriter(System.out);
        //printer.println((long)Math.pow(10,9) + " " + (long)Math.pow(10,9) + " " + ((long)((Math.pow(10,9) * Math.pow(10,9))) - 1));
        long n = scanner.nextLong(), m = scanner.nextLong(), k = scanner.nextLong();
        if (k <= n - 1) {
            printer.println((k+1) + " 1");
        }
        else {
            k-=n;
            if(k == 0) {
                printer.println(n + " 2");
            }
            else {
                long d = k / (m - 1);
                long x = n - d;
                k-=d;
                if (m-2 > 0) {
                    k = k - (k / ((m - 2) * 2)) * ((m - 2) * 2);
                }
                long y = 2;
                boolean r = true;
                while(true) {
                    if (k <= m - 2) {
                        if (r) {
                            y += k;
                        } else {
                            y -= k;
                        }
                        break;
                    } else {
                        y = m;
                        k -= m - 2;
                        r = !r;
                    }
                }
                printer.println(x + " " + y);
            }
        }

        printer.close();
    }
}


import java.util.Scanner;

public class CF552_C {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt(),
            b = sc.nextInt(),
            c = sc.nextInt();

        int[] aW = new int[]{1,0,0,1,0,0,1};
        int[] bW = new int[]{0,1,0,0,0,1,0};
        int[] cW = new int[]{0,0,1,0,1,0,0};

        long best = 0;
        for(int day = 0; day < 7; day++){
            long aa = a, bb = b, cc = c;

            long counter = 0;

            for(int i = day; i < 7; i++){
                aa-=aW[i];
                bb-=bW[i];
                cc-=cW[i];
                if(aa < 0 || bb < 0 || cc < 0){
                    if(aa < 0) aa=0;
                    if(bb < 0) bb=0;
                    if(cc < 0) cc=0;
                    break;
                }
                counter++;
            }

            long daysA = aa/3;
            long daysB = bb/2;
            long daysC = cc/2;

            long fullWeeks = Math.min(daysA, Math.min(daysB, daysC));

            counter+= fullWeeks * 7;

            aa-=fullWeeks * 3;
            bb-=fullWeeks * 2;
            cc-=fullWeeks * 2;

            for(int i = 0; i < 7; i++){
                aa-=aW[i];
                bb-=bW[i];
                cc-=cW[i];
                if(aa < 0 || bb < 0 || cc < 0){
                    break;
                }
                counter++;
            }

            best = Math.max(counter, best);
        }

        System.out.println(best);

    }

}


import java.util.*;

public class Test {

    public static void main(String args[]) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int a = in.nextInt();
        int b = in.nextInt();
        int c = in.nextInt();

        int count = 0;
        for(int i=0;i<=a;i+=2){
            int rem = n;
            rem = rem - i/2;
            for(int j=0;j<=b&&j<=rem;j++){
                int rem1 = rem - j;
                if(rem1%2==0&&rem1/2<=c)
                    count++;
            }
        }
        System.out.println(count);
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.StringTokenizer;

public class CF336A {
    public static void main(String[] args) {
        FastReader input = new FastReader();
        PrintWriter pw = new PrintWriter(System.out);

        int x = input.nextInt();
        int y = input.nextInt();

        if(x > 0 && y > 0)
            pw.println(0 + " " + (x+y) + " " + (x+y) + " " + 0);

        else if(x > 0 && y < 0){
            x = Math.abs(x);
            y = Math.abs(y);

            pw.println(0 + " " + ((-1) * (x+y)) + " " + (x+y) + " " + 0);
        }

        else if(x < 0 && y > 0){
            x = Math.abs(x);
            y = Math.abs(y);

            pw.println(((-1) * (x+y)) + " " + 0 + " " + 0 + " " + (x+y));
        }

        else if(x < 0 && y < 0){
            x = Math.abs(x);
            y = Math.abs(y);

            pw.println(((-1) * (x+y)) + " " + 0 + " " + 0 + " " + ((-1) * (x+y)));
        }

        // ****If sorting is required, use ArrayList
        pw.flush();
        pw.close();
    }
    static class FastReader
    {
        BufferedReader br;
        StringTokenizer st;

        public FastReader()
        {
            br = new BufferedReader(new
                    InputStreamReader(System.in));
        }

        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt()
        {
            return Integer.parseInt(next());
        }

        long nextLong()
        {
            return Long.parseLong(next());
        }

        double nextDouble()
        {
            return Double.parseDouble(next());
        }

        String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }
}


    import java.io.IOException;

     import java.util.*;

        public class Training {

                public static void main(String[] args) throws IOException {
     		Scanner input = new Scanner(System.in);
                     int [][]a= new int[8][8];
                     String answer = "NO";
                   for(int i =2;i<6;i++){
                      String s= input.next();
                      for(int j=2;j<6;j++){
                          if(s.charAt(j-2)=='x'){
                              a[i][j]= 1;

                          }else if(s.charAt(j-2)=='o'){
                              a[i][j]= -1;
                          }else if(s.charAt(j-2)=='.'){
                              a[i][j]=10;
                          }
                      }
                   }

          for(int i =2;i<6;i++){
         for(int j =2;j<6;j++){

            if ( a[i][j] + a[i][j+1] + a[i][j+2] == 12 )
            {
              answer = "YES";
            }
            if ( a[i][j] + a[i+1][j+1] + a[i+2][j+2] == 12 )
            {
              answer = "YES";
            }
            if ( a[i][j] + a[i+1][j] + a[i+2][j] == 12)
            {
              answer = "YES";
            }
            if ( a[i][j] + a[i-1][j+1] + a[i-2][j+2] == 12 )
            {
              answer = "YES";
            }

             }
                    } // end for

          System.out.println(answer);

                 } // end main

        } // end Class


/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class C {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        //BufferedReader r = new BufferedReader(new InputStreamReader(System.in));
        Scanner in = new Scanner(System.in);
        int n  ,i,j,k,a,a0=0,a1=0;
        String s;
        int[][] f = new int[10][10];
        for (i=0;i<10;i++) for(j=0;j<10;j++) f[i][j] = 1;
        for (i = 0; i < 8; i++) {
            s = in.nextLine();
            for(j=0;j<s.length();j++) {
                switch (s.charAt(j)) {
                    case '.' : f[i+1][j+1] = 0; break;
                    case 'A' : f[i+1][j+1] = 0; break;
                    case 'M' : f[i+1][j+1] = 5; break;
                    case 'S' : f[i+1][j+1] = 13; break;
                }
            }
        }
        List<Integer> mm;
        int[] di = new int[]{0,0,1,-1,1,1,-1,-1};
        int[] dj = new int[]{1,-1,0,0,1,-1,1,-1};
        mm = new ArrayList<Integer>(64);
        for (a=0; a<8; a++) {
            mm.clear();
            for (i=0;i<10;i++) for(j=0;j<10;j++)
                if (f[i][j] == 5) mm.add(i*10+j);
            for (Integer m : mm) {
                i = m/10; j = m%10;
                for (k=0;k<8;k++)
                    if (f[i+di[k]][j+dj[k]]==0) f[i+di[k]][j+dj[k]]=5;
            }

            for (i=0;i<10;i++) for(j=8;j>0;j--)
                if (f[j-1][i]==13) {
                    f[j][i] = 13;
                    f[j-1][i] = 0;
                }
        }
        if (mm.size()==0) System.out.print("LOSE");
        else System.out.print("WIN");

    }
}
/*
.......A
........
........
........
........
.S......
S.......
M.......
 *
 *
 */


import java.util.*;
public class Vasya {

	public static void main(String[] args) {

Scanner sc = new Scanner(System.in);
int n,m;

n=sc.nextInt();
m=sc.nextInt();
int days=0;
while(n!=0) {
	n--;
	days++;
	if(days%m==0 && days!=0) {

		n++;
	}

}
System.out.println(days);

	}

}


import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.math.BigInteger;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.IOException;
import java.util.StringTokenizer;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author shu_mj @ http://shu-mj.com
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		Scanner in = new Scanner(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskC solver = new TaskC();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskC {
    Scanner in;
    PrintWriter out;

    public void solve(int testNumber, Scanner in, PrintWriter out) {
        this.in = in;
        this.out = out;
        run();
    }

    void run() {
        long c = in.nextInt();
        long hr = in.nextInt();
        long hb = in.nextInt();
        long wr = in.nextInt();
        long wb = in.nextInt();
        out.println(Math.max(go(c, hr, hb, wr, wb), go(c, hb, hr, wb, wr)));
    }

    private long go(long c, long hr, long hb, long wr, long wb) {
        long top = c / wr;
        long res = 0;
        for (int i = 0; i < 1000000; i++) {
            long y = top - i;
            long x = (c - y * wr) / wb;
            if (x >= 0 && y >= 0) res = Math.max(res, x * hb + y * hr);
        }
        return res;
    }
}

class Scanner {
    BufferedReader br;
    StringTokenizer st;

    public Scanner(InputStream in) {
        br = new BufferedReader(new InputStreamReader(in));
        eat("");
    }

    private void eat(String s) {
        st = new StringTokenizer(s);
    }

    public String nextLine() {
        try {
            return br.readLine();
        } catch (IOException e) {
            return null;
        }
    }

    public boolean hasNext() {
        while (!st.hasMoreTokens()) {
            String s = nextLine();
            if (s == null)
                return false;
            eat(s);
        }
        return true;
    }

    public String next() {
        hasNext();
        return st.nextToken();
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }

}


import java.io.*;
import java.util.*;

public class Main{

	    static String s1, s2, virus;
	    static int[][][] dp = new int[200][200][200];
	    static int[][] ch = new int[200][30];
	    static int[] fail = new int[200];
	    static int n, x, y;
	    static boolean[][][] vis = new boolean[200][200][200];

	    static void init() {
	        fail[0] = fail[1] = 0;
	        for (int i = 1; i < n; i++) {
	            int j = fail[i];
	            while (j != 0 && virus.charAt(i) != virus.charAt(j)) j = fail[j];
	            fail[i + 1] = (virus.charAt(i) == virus.charAt(j)) ? j + 1 : 0;
	        }

	        for (int i = 0; i < n; i++) ch[i][virus.charAt(i) - 'A'] = i + 1;
	        for (int i = 0; i < n; i++) {
	            for (int c = 0; c < 26; c++) {
	                if (ch[i][c] == 0)
	                    ch[i][c] = ch[fail[i]][c];
	            }
	        }
	    }

	    static int dfs(int i, int j, int k) {
	        if (vis[i][j][k] == true)
	            return dp[i][j][k];
	        vis[i][j][k] = true;
	        if (k >= n)
	            return dp[i][j][k] = -999999999;
	        if (i >= x || j >= y)
	            return dp[i][j][k] = 0;

	        dp[i][j][k] = Math.max(dfs(i + 1, j, k), dfs(i, j + 1, k));

	        if (s1.charAt(i) == s2.charAt(j)) {
	            dp[i][j][k] = Math.max(dp[i][j][k], dfs(i + 1, j + 1, ch[k][s1.charAt(i) - 'A']) + 1);
	        }

	        return dp[i][j][k];
	    }

	    public static void main(String[] args) {
	        Scanner in = new Scanner(System.in);

	        s1 = in.next().trim();
	        s2 = in.next().trim();
	        virus = in.next().trim();

	        x = s1.length();
	        y = s2.length();
	        n = virus.length();
	        init();

	        if (dfs(0, 0, 0) != 0) {
	            int i = 0, j = 0, k = 0;
	            String ans = "";
	            while (i < x && j < y) {
	                if (dfs(i, j, k) == dfs(i + 1, j, k))
	                    i++;
	                else if (dfs(i, j, k) == dfs(i, j + 1, k))
	                    j++;
	                else {

	                    ans += s1.charAt(i);
	                    k = ch[k][s1.charAt(i) - 'A'];
	                    i++;
	                    j++;
	                }
	            }
	            System.out.println(ans);
	        } else {
	            System.out.println("0");
	        }
	    }
	}


import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.Set;
import java.util.StringTokenizer;

public class BB {

    static StringTokenizer st;
    static BufferedReader in;
    public static void main(String[] args) throws IOException {
        in = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
        int n = nextInt();
        int inc = 0;
        if (n==1e9)
            inc = 1;
        Set<Integer> set = new HashSet<Integer>();
        for (int leng = 1; leng <= 9; leng++) {
            for (int i = 0; i <= 9; i++) {
                for (int j = i+1; j <= 9; j++) {
                    for (int j2 = 0; j2 < (1 << leng); j2++) {
                        int t = 0;
                        for (int k = leng-1; k >= 0; k--) {
                            t = t*10;
                            if ((j2 & (1 << k)) != 0)
                                t += i;
                            else
                                t += j;
                        }
                        if (t <= n && t != 0)
                            set.add(t);
                    }
                }
            }
        }
        System.out.println(set.size()+inc);
        pw.close();
    }
    private static int nextInt() throws IOException{
        return Integer.parseInt(next());
    }

    private static long nextLong() throws IOException{
        return Long.parseLong(next());
    }

    private static double nextDouble() throws IOException{
        return Double.parseDouble(next());
    }

    private static String next() throws IOException {
        while (st == null || !st.hasMoreTokens()) {
            st = new StringTokenizer(in.readLine());
        }
        return st.nextToken();
    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.StringTokenizer;
import java.io.BufferedReader;
import java.util.Comparator;
import java.util.Collections;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Graph solver = new Graph();
        solver.solve(1, in, out);
        out.close();
    }

    static class Graph {
        ArrayList<Edge>[] edges;
        ArrayList<Integer> component = new ArrayList<>();
        int need;
        Function[] functions;

        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int N = in.nextInt();
            int M = in.nextInt();
            functions = new Function[N];
            edges = new ArrayList[N];
            for (int i = 0; i < N; i++) {
                edges[i] = new ArrayList<>();
            }
            for (int i = 0; i < M; i++) {
                int a = in.nextInt() - 1;
                int b = in.nextInt() - 1;
                int c = in.nextInt() * 2;
                edges[a].add(new Edge(b, c));
                edges[b].add(new Edge(a, c));
            }
            ArrayList<Integer> necessary = new ArrayList<>();
            int[] ans = new int[N];
            for (int i = 0; i < N; i++) {
                if (functions[i] == null) {
                    component.clear();
                    need = Integer.MAX_VALUE;
                    functions[i] = new Function(1, 0);
                    dfs(i);
                    int x;
                    if (need == Integer.MIN_VALUE) {
                        out.println("NO");
                        return;
                    } else if (need == Integer.MAX_VALUE) {
                        Collections.sort(component, new Comparator<Integer>() {

                            public int compare(Integer integer, Integer t1) {
                                return Integer.compare(functions[integer].x * functions[integer].c, functions[t1].x * functions[t1].c);
                            }
                        });
                        x = -functions[component.get(component.size() / 2)].x * functions[component.get(component.size() / 2)].c;
                    } else {
                        x = need;
                    }
                    for (int j : component) {
                        ans[j] = functions[j].x * x + functions[j].c;
                    }
                }
            }
            out.println("YES");
            for (int i : ans) {
                out.println((double) (i) / 2);
            }
        }

        void dfs(int n) {
            component.add(n);
            for (Edge e : edges[n]) {
                if (functions[e.to] == null) {
                    functions[e.to] = functions[n].subtract(e.c);
                    dfs(e.to);
                } else {
                    int res = functions[n].is(functions[e.to], e.c);
                    if (res == Integer.MIN_VALUE) {
                        need = Integer.MIN_VALUE;
                    } else if (res != Integer.MAX_VALUE) {
                        if (need != Integer.MAX_VALUE && need != res) {
                            need = Integer.MIN_VALUE;
                        } else {
                            need = res;
                        }
                    }
                }
            }
        }

        class Function {
            int x;
            int c;

            Function(int x, int c) {
                this.x = x;
                this.c = c;
            }

            Function subtract(int c) {
                return new Function(-x, c - this.c);
            }

            int is(Function f, int c) {
                if (f.x == this.x) {
                    return (c - f.c - this.c) / (2 * f.x);
                }
                if (f.x != this.x && (this.c + f.c) != c) {
                    return Integer.MIN_VALUE;
                }
                return Integer.MAX_VALUE;
            }

        }

        class Edge {
            int to;
            int c;

            Edge(int to, int c) {
                this.to = to;
                this.c = c;
            }

        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}


import java.io.*;
import java.util.*;
import java.math.*;

public class Main {

    /**
     * @param args
     */
    public static BigInteger W,K,M;
    public static BigInteger calc(BigInteger x){
        BigInteger tmp = BigInteger.valueOf(0);
        BigInteger ans = BigInteger.valueOf(0);
        BigInteger tmq = BigInteger.valueOf(1);
        BigInteger t;
        while (tmp.compareTo(x) < 0){
            t = tmp.multiply(BigInteger.valueOf(10));
            t = t.add(BigInteger.valueOf(9));
            if (t.compareTo(x) <= 0){
                ans = ans.add(t.subtract(tmp).multiply(K).multiply(tmq));
            }
            else{
                ans = ans.add(x.subtract(tmp).multiply(K).multiply(tmq));
            }
            tmq = tmq.add(BigInteger.valueOf(1));
            tmp = t;
            //System.out.print(tmq+" "+ans+"\n");
        }
        return ans;
    }
    public static void main(String[] args) {
        // TODO Auto-generated method stub
        Scanner cin = new Scanner(new BufferedInputStream(System.in));
        W = cin.nextBigInteger();
        M = cin.nextBigInteger();
        K = cin.nextBigInteger();
        BigInteger x = BigInteger.valueOf(10);
        //System.out.print(calc(x)+"\n");
         W = W.add(calc(M.subtract(BigInteger.valueOf(1))));
        BigInteger l = BigInteger.valueOf(0);
        BigInteger r = BigInteger.valueOf(1);
        while (W.compareTo(calc(r)) > 0)
                r = r.multiply(BigInteger.valueOf(10));
        while (l.compareTo(r) != 0){
            BigInteger mid = l.add(r);
            mid = mid.divide(BigInteger.valueOf(2));
            mid = mid.add(BigInteger.valueOf(1));
            if (W.compareTo(calc(mid)) >= 0)
                l = mid;
            else
                r = mid.subtract(BigInteger.valueOf(1));
        }
        System.out.print(l.subtract(M).add(BigInteger.valueOf(1)));
    }

}


//package goodbye2015;

import java.io.BufferedOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.*;

public class B {

    public static void main(String[] args) {
        IO io = new IO();
        try {
            io.println(codeForce(io));
        } finally {
            //System.out.println("CLOSING FINALLY");
            io.close();
        }
    }

    public static long codeForce(IO io) {
        long a = io.nextLong();
        long b = io.nextLong();
        String bin = Long.toBinaryString(a);
        String goal = Long.toBinaryString(b);
        int indexForInitialZero = 0; // placeholder value

        //System.out.println("BIN: " + bin);
        //System.out.println("GOAL: " + goal);

        // We want to start with a binary string that has a single 0
        // If we have too much, fill out extra 0's with 1's
        // Going right->left to increase value as little as possible
        int zerosInBin = countZeros(bin);
        for (int i=bin.length()-1; zerosInBin>1; i--) {
            if (bin.charAt(i) == '0') {
                zerosInBin--;
                StringBuilder newBin = new StringBuilder();
                if (i>0) newBin.append(bin.substring(0,i));
                newBin.append('1');
                if (i<bin.length()-1) newBin.append(bin.substring(i+1, bin.length()));
                bin = newBin.toString();
            }
        }

        // If we have no zeros in starting binary string, turn 111 -> 1011
        if (zerosInBin == 0) {
            String possibleAddition = "";
            if (bin.length() > 1) possibleAddition = bin.substring(1,bin.length());
            if (goal.length() < bin.length()+1) return 0;
            if (goal.length() == bin.length()+1 && !stringIsBelowOrAtGoal(1, goal)) {
                Long parsed = Long.parseLong("10" + possibleAddition, 2);
                if (parsed > b) {
                    //System.out.println("parsed: " + parsed);
                    return 0;
                }
                else {
                    long count = 0;
                    if (goal.contains("0")) count++;
                    if (b != parsed) count++;
                    return count;
                }
            }
            bin = "10" + possibleAddition;
        }
        // Find initial zero
        int i=0;
        for ( ;i<bin.length(); i++) {
            if (bin.charAt(i) == '0') break;
        }
        indexForInitialZero = i;

        // First round may start from middle so do it separately
        long count = 0;
        for (i=indexForInitialZero; i<bin.length(); i++) {
            Long parsed = Long.parseLong(bin, 2);
            if (parsed <= b) count++;
            if (parsed >= b) return count;

            int len = bin.length();
            bin = "";

            for (int j=0; j<=i; j++) {
                bin += '1';
            }
            if (bin.length() < len) {
                bin += '0';
            }
            for (int j=i+2; j<len; j++) {
                bin += '1';
            }
        }

        // All other rounds. specRep represents binary strings
        // from 11110 -> 10111
        int specRep = bin.length()+1;
        boolean doneSomethingHere = false;
        while (specRep <= goal.length() + 1) {
            if (specRep == goal.length()+1) {
                // We possibly counted too many
                // Subtract the ones that went over
                if (!doneSomethingHere) return count;
                while (specRep > goal.length()) specRep--;
                for (i=specRep-1; i>=1; i--) {
                    if (stringIsBelowOrAtGoal(i, goal)) break;
                    count--;
                }
                return count;
            }
            doneSomethingHere = true;
            count += (specRep-1); // bc cant replace first '1' with '0'
            specRep++;
        }

        return count;
    }

    public static boolean stringIsBelowOrAtGoal(int a, String b) {
        // a represents a string that has same length as b
        // with all characters '1' except for a single '0' in index a
        for (int i=1; i<a; i++) {
            if (b.charAt(i) == '0') return false;
        }
        if (b.charAt(a) == '1') return true;
        for (int i=a+1; i<b.length(); i++) {
            if (b.charAt(i) == '0') return false;
        }
        return true;
    }

    public static int countZeros(String a) {
        int count = 0;
        for (int i=0; i<a.length(); i++) {
            if (a.charAt(i) == '0') count++;
        }
        return count;
    }

    static class IO extends PrintWriter {
	private InputStreamReader r;
	private static final int BUFSIZE = 1 << 15;
	private char[] buf;
	private int bufc;
	private int bufi;
	private StringBuilder sb;

	public IO() {
		super(new BufferedOutputStream(System.out));
		r = new InputStreamReader(System.in);

		buf = new char[BUFSIZE];
		bufc = 0;
		bufi = 0;
		sb = new StringBuilder();
	}

	private void fillBuf() throws IOException {
		bufi = 0;
		bufc = 0;
		while(bufc == 0) {
			bufc = r.read(buf, 0, BUFSIZE);
			if(bufc == -1) {
				bufc = 0;
				return;
			}
		}
	}

	private boolean pumpBuf() throws IOException {
		if(bufi == bufc) {
			fillBuf();
		}
		return bufc != 0;
	}

	private boolean isDelimiter(char c) {
		return c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == '\f';
	}

	private void eatDelimiters() throws IOException {
		while(true) {
			if(bufi == bufc) {
				fillBuf();
				if(bufc == 0) throw new RuntimeException("IO: Out of input.");
			}

			if(!isDelimiter(buf[bufi])) break;
			++bufi;
		}
	}

	public String next() {
		try {
			sb.setLength(0);

			eatDelimiters();
			int start = bufi;

			while(true) {
				if(bufi == bufc) {
					sb.append(buf, start, bufi - start);
					fillBuf();
					start = 0;
					if(bufc == 0) break;
				}

				if(isDelimiter(buf[bufi])) break;
				++bufi;
			}

			sb.append(buf, start, bufi - start);

			return sb.toString();
		} catch(IOException e) {
			throw new RuntimeException("IO.next: Caught IOException.");
		}
	}

	public int nextInt() {
		try {
			int ret = 0;

			eatDelimiters();

			boolean positive = true;
			if(buf[bufi] == '-') {
				++bufi;
				if(!pumpBuf()) throw new RuntimeException("IO.nextInt: Invalid int.");
				positive = false;
			}

			boolean first = true;
			while(true) {
				if(!pumpBuf()) break;
				if(isDelimiter(buf[bufi])) {
					if(first) throw new RuntimeException("IO.nextInt: Invalid int.");
					break;
				}
				first = false;

				if(buf[bufi] >= '0' && buf[bufi] <= '9') {
					if(ret < -214748364) throw new RuntimeException("IO.nextInt: Invalid int.");
					ret *= 10;
					ret -= (int)(buf[bufi] - '0');
					if(ret > 0) throw new RuntimeException("IO.nextInt: Invalid int.");
				} else {
					throw new RuntimeException("IO.nextInt: Invalid int.");
				}

				++bufi;
			}

			if(positive) {
				if(ret == -2147483648) throw new RuntimeException("IO.nextInt: Invalid int.");
				ret = -ret;
			}

			return ret;
		} catch(IOException e) {
			throw new RuntimeException("IO.nextInt: Caught IOException.");
		}
	}

	public long nextLong() {
		try {
			long ret = 0;

			eatDelimiters();

			boolean positive = true;
			if(buf[bufi] == '-') {
				++bufi;
				if(!pumpBuf()) throw new RuntimeException("IO.nextLong: Invalid long.");
				positive = false;
			}

			boolean first = true;
			while(true) {
				if(!pumpBuf()) break;
				if(isDelimiter(buf[bufi])) {
					if(first) throw new RuntimeException("IO.nextLong: Invalid long.");
					break;
				}
				first = false;

				if(buf[bufi] >= '0' && buf[bufi] <= '9') {
					if(ret < -922337203685477580L) throw new RuntimeException("IO.nextLong: Invalid long.");
					ret *= 10;
					ret -= (long)(buf[bufi] - '0');
					if(ret > 0) throw new RuntimeException("IO.nextLong: Invalid long.");
				} else {
					throw new RuntimeException("IO.nextLong: Invalid long.");
				}

				++bufi;
			}

			if(positive) {
				if(ret == -9223372036854775808L) throw new RuntimeException("IO.nextLong: Invalid long.");
				ret = -ret;
			}

			return ret;
		} catch(IOException e) {
			throw new RuntimeException("IO.nextLong: Caught IOException.");
		}
	}

	public double nextDouble() {
		return Double.parseDouble(next());
	}

    }
}


import java.util.Scanner;

public class Triangle {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int d = sc.nextInt();

		if (a + b > c && a + c > b && b + c > a || a + b > d && a + d > b
				&& b + d > a || b + c > d && b + d > c && c + d > b
				|| a + c > d && a + d > c && c + d > a)
			System.out.println("TRIANGLE");
		else if (a + b == c || a + b == d || a + c == b || a + c == d
				|| a + d == b || a + d == c || c + b == a || c + b == d
				|| d + b == a || d + b == c || c + d == a || c + d == b)
			System.out.println("SEGMENT");
		else
			System.out.println("IMPOSSIBLE");
	}
}


import java.util.*;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.*;
import java.util.*;

public class Main {
	//////
	static class FastReader {
		BufferedReader br;
		StringTokenizer st;

		public FastReader() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String next() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}
	}

	//////

	public static void main(String[] args) throws IOException {

		FastReader scan = new FastReader();

		int A=scan.nextInt();

		if(A==1){
			System.out.println("1 1");
			System.out.println("1");
			return;
		}

		System.out.println(2*(A-1)+" 2");
		System.out.println("1 2");

	}

}


import java.io.*;
import java.util.*;

public class Solution {
	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		PrintWriter pr = new PrintWriter(System.out);
		long n = sc.nextLong();
		long max = Long.MIN_VALUE;
		long min = Long.MAX_VALUE;
		for (int i = 1; i <= Math.sqrt(n); i++) {
			long k = n;
			if (k % i == 0) {
				k /= i;
				for (int j = 1; j <= Math.sqrt(n); j++) {
					long m = k;
						if (m % j == 0) {
							m /= j;
							min = Math.min((i + 1) * (j + 2) * (m + 2) - n, min);
							min = Math.min((i + 2) * (j + 1) * (m + 2) - n, min);
							min = Math.min((i + 2) * (j + 2) * (m + 1) - n, min);
							max = Math.max((i + 1) * (j + 2) * (m + 2) - n, max);
							max = Math.max((i + 2) * (j + 1) * (m + 2) - n, max);
							max = Math.max((i + 2) * (j + 2) * (m + 1) - n, max);
						}
					}
			}
		}
		pr.print(min + " " + max);
		pr.close();
	}
}


//package sol2;
import java.io.*;
import java.lang.reflect.Array;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.math.RoundingMode;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*;

public class Solution1 {

  static long MOD = (long)1e9 + 7;
  static long T, x;

  static int ret=0;
  static int a, b;
  public static void main(String[] args) throws IOException {
    FastInput fi = new FastInput(System.in);
    PrintWriter pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));

    int x=fi.nextInt(), y = fi.nextInt(), z = fi.nextInt(), a = fi.nextInt(), b = fi.nextInt(), c = fi.nextInt();
    if(x>a) {
      System.out.println("NO");
      return;
    }
    a-=x;
    if(y>a+b) {
      System.out.println("NO");
      return;
    }
    if(a>=y) {
      a-=y;
      y=0;
    } else {
      y-=a;
      a=0;
      b-=y;
    }

    if(z>a+b+c) {
      System.out.println("NO");
      return;
    } else {
      System.out.println("YES");
    }
  }

  static long calc(long[] arr, long from, long to, int st, int fin) {
    if(st == fin || from==to) {
      return (fin-st+1)*b*(to-from+1);
    }
    int piv = -1;
    long toNext = (from + to)/2 + 1;
    for(int i=st; i<=fin; i++) {
      if(arr[i]>=toNext) {
        piv=i;
        break;
      }
    }
    long ret = (fin-st+1)*b*(to-from+1);
    if(piv == -1) {
      ret = Math.min(ret, a + calc(arr, from, toNext-1, st, fin));
    } else if(piv == st) {
      ret = Math.min(ret, a + calc(arr, toNext, fin, st, fin));
    } else {
      ret = Math.min(ret, calc(arr, from, toNext-1, st, piv-1) + calc(arr, toNext, to, piv, fin));
    }
    return ret;
  }

  static class Pair<K extends Comparable, V extends Comparable> implements Comparable {
    K key;
    V value;

    @Override
    public boolean equals(Object o) {
      if (this == o) {
        return true;
      }
      if (!(o instanceof Pair)) {
        return false;
      }
      Pair<?, ?> pair = (Pair<?, ?>) o;
      return Objects.equals(key, pair.key) &&
          Objects.equals(value, pair.value);
    }

    @Override
    public int hashCode() {
      return Objects.hash(key, value);
    }

    public Pair(K key, V value) {
      this.key = key;
      this.value = value;
    }

    @Override
    public int compareTo(Object o) {
      Pair<K, V> p = (Pair)o;
      if(p.key.compareTo(this.key) > 0)
        return 1;
      else if(p.key.compareTo(this.key) < 0)
        return -1;
      else {
        if(p.value.compareTo(this.value) > 0)
          return 1;
        else if(p.value.compareTo(this.value) < 0)
          return -1;
        else return 0;
      }
    }
  }

  private static class FastInput {

    BufferedReader  reader;
    StringTokenizer st;

    public FastInput(InputStream inputStream) {
      reader = new BufferedReader(new InputStreamReader(inputStream), 32768);
    }

    String nextString() {
      while(st == null || !st.hasMoreTokens()) {
        try {
          st = new StringTokenizer(reader.readLine());
        } catch (IOException e) {
          throw new RuntimeException(e);
        }
      }
      return st.nextToken();
    }

    int nextInt() {
      return Integer.parseInt(nextString());
    }

    long nextLong() {
      return Long.parseLong(nextString());
    }
  }
}


import java.util.*;
import java.io.*;
import java.math.*;
public class Main {
	public static long mod= (long) (1e9 +7);
	public static void main(String args[])
	{
		InputReader s= new InputReader(System.in);
		OutputStream outputStream= System.out;
		PrintWriter out= new PrintWriter(outputStream);
		int n= s.nextInt();
		String str= s.next();
		HashMap<Character,Integer> hmap= new HashMap<>();
		hmap.put('B', 0);
		hmap.put('G', 0);
		hmap.put('R', 0);
		for(int i=0;i<n;i++){
			hmap.put(str.charAt(i), hmap.get(str.charAt(i))+1);
		}
		int cnt=0;
		for(Character k : hmap.keySet()){
			if(hmap.get(k)>=2)
				cnt++;
		}
		if(cnt>=2){
			out.println("BGR");
		}
		else if(cnt>=1){
			int sum=0;
			for(Character k : hmap.keySet()){
				if(hmap.get(k)==0){
					sum++;
				}
			}
			if(sum==2){
				for(Character k : hmap.keySet()){
					if(hmap.get(k)>=2){
						System.out.println(k);
						return;
					}
				}
			}
			ArrayList<Character> arr= new ArrayList<>();
			if(sum==1){
				for(Character k : hmap.keySet()){
					if(hmap.get(k)<2){
						arr.add(k);
						//System.out.print(k);
						//out.println("fsdfs");
					}
				}
				Collections.sort(arr);
				for(int i=0;i<arr.size();i++)
					out.print(arr.get(i));
			}
			if(sum==0)
				out.println("BGR");
		}
		else{
		//s	out.println("fewfs");
			int count=0;
			for(Character k : hmap.keySet()){
				if(hmap.get(k)==1){
					count++;
				}
			}

			ArrayList<Character> arr= new ArrayList<>();
			if(count==3)
				out.print("BGR");
			else if(count==2){
				for(Character k : hmap.keySet()){
					if(hmap.get(k)==0){
						arr.add(k);
						//out.print(k);
					}
				}
				Collections.sort(arr);
				for(int i=0;i<arr.size();i++)
					out.print(arr.get(i));
			}
			else{
				for(Character k : hmap.keySet()){
					if(hmap.get(k)==1){
						arr.add(k);
					}
				}
				Collections.sort(arr);
				for(int i=0;i<arr.size();i++)
					out.print(arr.get(i));
			}
		}
		out.close();
	}

	static long combinations(long n,long r){   // O(r)
		if(r==0 || r==n) return 1;
		r= Math.min(r, n-r);
		long ans=n;  // nC1=n;
		for(int i=1;i<r;i++){
			ans= ans*(n-i);
			ans= ans/(i+1);
		}
		return ans;

	}
	public static void debug(Object... o) {
		System.out.println(Arrays.deepToString(o));
	}
	static long modulo(long a,long b,long c) {
		long x=1;
		long y=a;
		while(b > 0){
			if(b%2 == 1){
				x=(x*y)%c;
			}
			y = (y*y)%c; // squaring the base
			b /= 2;
		}
		return  x%c;
	}
	static void catalan_numbers(int n) {
		long catalan[]= new long[n+1];
	    catalan[1] = 1;
	    for (int i = 2; i <= n; i++) {
	        for (int j = 1; j <= i - 1; j++) {
	            catalan[i] = catalan[i] + ((catalan[j]) * catalan[i - j]);
	        }
	    }
	}

	static ArrayList<Integer> primeFactors(int n)   // O(sqrt(n))
	{
	    // Print the number of 2s that divide n
		ArrayList<Integer> arr= new ArrayList<>();
	    while (n%2 == 0)
	    {
	        arr.add(2);
	        n = n/2;
	    }

	    // n must be odd at this point.  So we can skip one element (Note i = i +2)
	    for (int i = 3; i <= Math.sqrt(n); i = i+2)
	    {
	        // While i divides n, print i and divide n
	        while (n%i == 0)
	        {
	            arr.add(i);
	            n = n/i;
	        }
	    }
	    // This condition is to handle the case when n is a prime number
	    // greater than 2
	    if (n > 2)
	        arr.add(n);

	    return arr;
	}

	public static int expo(int a, int b){
		if (b==0)
	        return 1;
	    if (b==1)
	        return a;
	    if (b==2)
	        return a*a;

	    if (b%2==0){
	            return expo(expo(a,b/2),2);
	    }
	    else{
	        return a*expo(expo(a,(b-1)/2),2);
	    }
	}
	static class Pair implements Comparable<Pair>
	{
		long f;
		String s;
		Pair(long ii, String cc)
		{
			f=ii;
			s=cc;
		}

		public int compareTo(Pair o)
		{
			return Long.compare(this.f, o.f);
		}

	}

	public static int[] sieve(int N){    // O(n*log(logn))
		int arr[]= new int[N+1];
		for(int i=2;i<=Math.sqrt(N);i++){
			if(arr[i]==0){
				for(int j= i*i;j<= N;j= j+i){
					arr[j]=1;
				}
			}
		}
		return arr;
		// All the i for which arr[i]==0 are prime numbers.
	}
	static long gcd(long a,long b){       // O(logn)
		if(b==0) return a;
		return gcd(b,a%b);
	}
	static class InputReader {

	    public BufferedReader reader;
	    public StringTokenizer tokenizer;

	    public InputReader(InputStream inputstream) {
	      reader = new BufferedReader(new InputStreamReader(inputstream));
	      tokenizer = null;
	    }

	    public String nextLine(){
	    	String fullLine=null;
	    	while (tokenizer == null || !tokenizer.hasMoreTokens()) {
	            try {
	              fullLine=reader.readLine();
	            } catch (IOException e) {
	              throw new RuntimeException(e);
	            }
	            return fullLine;
	          }
	          return fullLine;
	    }
		public String next() {
	      while (tokenizer == null || !tokenizer.hasMoreTokens()) {
	        try {
	          tokenizer = new StringTokenizer(reader.readLine());
	        } catch (IOException e) {
	          throw new RuntimeException(e);
	        }
	      }
	      return tokenizer.nextToken();
	    }
		public long nextLong() {
		      return Long.parseLong(next());
		    }
	    public int nextInt() {
	      return Integer.parseInt(next());
	    }
	  }
}