import java.io.InputStream;
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.BufferedWriter;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.HashMap;
import java.io.IOException;
import java.util.InputMismatchException;
import java.io.PrintWriter;
import java.io.OutputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Alex
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }
    static class TaskC {
        int BAD = 11111;
        int rows;
        int cols;
        HashMap<IntIntPair, Integer>[] mem;

        boolean contains(int mem, int index) {
            if(index < 0) return false;
            return ((mem >> index) & 1) == 1;
        }

        int add(int mem, int index) {
            if(((mem >> index) & 1) == 0) {
                mem += (1 << index);
            }
            return mem;
        }

        int size(int mem) {
            int res = 0;
            while(mem > 0) {
                if(mem % 2 == 1) res++;
                mem /= 2;
            }
            return res;
        }

        void test() {
            if(contains(5, 0) == false) throw new RuntimeException();
            if(contains(5, 1) == true) throw new RuntimeException();
            if(contains(5, -1) == true) throw new RuntimeException();
            if(contains(5, 2) == false) throw new RuntimeException();
            if(contains(5, 3) == true) throw new RuntimeException();
            if(add(0, 2) != 4) throw new RuntimeException();
            if(add(4, 0) != 5) throw new RuntimeException();
            if(add(5, 0) != 5) throw new RuntimeException();
            if(size(5) != 2) throw... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?