import java.io.*; import java.util.*; import java.util.function.*; final class Solver { void solve(Supplier sc) { int N = Integer.parseInt(sc.get()); var grid = new BitSet(N + 1); { var start = -Math.floorDiv(-N, 2); grid.set(start); if (N % 2 == 0) grid.set(start + 1); System.out.printf("%d %d%n", grid.cardinality(), grid.nextSetBit(0)); } while (true) { int t = Integer.parseInt(sc.get()); if (t != 3) { return; } int k = Integer.parseInt(sc.get()); int x = Integer.parseInt(sc.get()); grid.set(x, x + k - 1); var start = N - x + 1 - (k - 1); grid.set(start); if (k == 2) grid.set(start + 1); System.out.printf("%d %d%n", k, start); } } } class Main { public static void main(String... args) { // System.setOut(new PrintStream(new BufferedOutputStream(System.out))); var reader = new BufferedReader(new InputStreamReader(System.in)); new Solver().solve(new Supplier<>() { StringTokenizer line; public String get() { while (line == null || !line.hasMoreTokens()) try { line = new StringTokenizer(reader.readLine()); } catch (IOException e) { throw new UncheckedIOException(e); } return line.nextToken(); } }); // System.out.flush(); } }