import java.io.*;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Arrays;
import java.util.StringTokenizer;

public class A {
    public static class FastIO {

        public static final int DEFAULT_BUFFER_SIZE = 65536;
        public static final int DEFAULT_INTEGER_SIZE = 11;
        public static final int DEFAULT_LONG_SIZE = 20;
        public static final int DEFAULT_WORD_SIZE = 256;
        public static final int DEFAULT_LINE_SIZE = 8192;
        public static final int EOF = -1;

        private final InputStream in;
        private final OutputStream out;

        private byte[] inBuffer;
        private int nextIn, inLength;
        private byte[] outBuffer;
        private int nextOut;

        private char[] charBuffer;
        private byte[] byteBuffer;

        public FastIO(InputStream in, OutputStream out, int inBufferSize, int outBufferSize) {
            this.in = in;
            this.inBuffer = new byte[inBufferSize];
            this.nextIn = 0;
            this.inLength = 0;

            this.out = out;
            this.outBuffer = new byte[outBufferSize];
            this.nextOut = 0;

            this.charBuffer = new char[DEFAULT_LINE_SIZE];
            this.byteBuffer = new byte[DEFAULT_LONG_SIZE];
        }

        public FastIO(InputStream in, OutputStream out) {
            this(in, out, DEFAULT_BUFFER_SIZE, DEFAULT_BUFFER_SIZE);
        }

        public FastIO(InputStream in, OutputStream out, int bufferSize) {
            this(in, out, bufferSize, bufferSize);
        }

        public char nextChar() {
            byte b;
            while (isSpace(b = read()))
                ;

            return (char) b;
        }

        public String next() {
            byte b;
            while (isSpace(b = read()))
                ;

            int pos = 0;
            do {
                charBuffer[pos++] = (char) b;
                ensureCapacity(pos);
            } while (!isSpace(b = read()));

            return new String(charBuffer, 0, pos);
        }

        public String nextLine() {
            byte b;
            int pos = 0;

            while (!isLine(b = read())) {
                charBuffer[pos++] = (char) b;
                ensureCapacity(pos);
            }

            return new String(charBuffer, 0, pos);
        }

        public int nextInt() {
            byte b;
            while (isSpace(b = read()))
                ;

            boolean negative = false;
            int result = b - '0';
            if (b == '-') {
                negative = true;
                result = 0;
            }

            while (isDigit(b = read()))
                result = (result * 10) + (b - '0');

            return negative ? -result : result;
        }

        public long nextLong() {
            byte b;
            while (isSpace(b = read()))
                ;

            boolean negative = false;
            long result = b - '0';
            if (b == '-') {
                negative = true;
                result = 0;
            }

            while (isDigit(b = read()))
                result = (result * 10) + (b - '0');

            return negative ? -result : result;
        }

        public float nextFloat() {
            byte b;
            while (isSpace(b = read()))
                ;

            int pos = 0;
            do {
                charBuffer[pos++] = (char) b;
            } while (!isSpace(b = read()));

            return Float.parseFloat(new String(charBuffer, 0, pos));
        }

        public float nextFloat2() {
            byte b;
            while (isSpace(b = read()))
                ;

            boolean negative = false;
            float result = b - '0';
            if (b == '-') {
                negative = true;
                result = 0;
            }

            while (isDigit(b = read()))
                result = (result * 10) + (b - '0');

            float d = 1;
            if (b == '.') {
                while (isDigit(b = read()))
                    result += (b - '0') / (d *= 10);
            }

            return negative ? -result : result;
        }

        public double nextDouble() {
            byte b;
            while (isSpace(b = read()))
                ;

            int pos = 0;
            do {
                charBuffer[pos++] = (char) b;
            } while (!isSpace(b = read()));

            return Double.parseDouble(new String(charBuffer, 0, pos));
        }

        public double nextDouble2() {
            byte b;
            while (isSpace(b = read()))
                ;

            boolean negative = false;
            double result = b - '0';
            if (b == '-') {
                negative = true;
                result = 0;
            }

            while (isDigit(b = read()))
                result = (result * 10) + (b - '0');

            double d = 1;
            if (b == '.') {
                while (isDigit(b = read()))
                    result += (b - '0') / (d *= 10);
            }

            return negative ? -result : result;
        }

        public BigInteger nextBigInteger() {
            return new BigInteger(next());
        }

        public BigDecimal nextBigDecimal() {
            return new BigDecimal(next());
        }

        public char[] nextToCharArray() {
            byte b;
            while (isSpace(b = read()))
                ;

            int pos = 0;
            do {
                charBuffer[pos++] = (char) b;
                ensureCapacity(pos);
            } while (!isSpace(b = read()));

            char[] array = new char[pos];
            System.arraycopy(charBuffer, 0, array, 0, pos);
            return array;
        }

        public int[] nextIntArray(int size) {
            int[] array = new int[size];
            for (int i = 0; i < size; i++)
                array[i] = nextInt();

            return array;
        }

        public long[] nextLongArray(int size) {
            long[] array = new long[size];
            for (int i = 0; i < size; i++)
                array[i] = nextLong();

            return array;
        }

        public int[][] nextInt2DArray(int Y, int X) {
            int[][] array = new int[Y][X];
            for (int y = 0; y < Y; y++)
                for (int x = 0; x < X; x++)
                    array[y][x] = nextInt();

            return array;
        }

        public void print(char c) {
            write((byte) c);
        }

        public void print(char[] chars) {
            print(chars, 0, chars.length);
        }

        public void print(char[] chars, int start) {
            print(chars, start, chars.length);
        }

        public void print(char[] chars, int start, int end) {
            for (int i = start; i < end; i++)
                write((byte) chars[i]);
        }

        public void print(String s) {
            for (int i = 0; i < s.length(); i++)
                write((byte) s.charAt(i));
        }

        public void print(int i) {
            if (i == 0) {
                write((byte) '0');
                return;
            }
            if (i == Integer.MIN_VALUE) {
                write((byte) '-');
                write((byte) '2');
                write((byte) '1');
                write((byte) '4');
                write((byte) '7');
                write((byte) '4');
                write((byte) '8');
                write((byte) '3');
                write((byte) '6');
                write((byte) '4');
                write((byte) '8');
                return;
            }

            if (i < 0) {
                write((byte) '-');
                i = -i;
            }

            int pos = 0;
            while (i > 0) {
                byteBuffer[pos++] = (byte) ((i % 10) + '0');
                i /= 10;
            }

            while (pos-- > 0)
                write(byteBuffer[pos]);
        }

        public void print(long l) {
            if (l == 0) {
                write((byte) '0');
                return;
            }
            if (l == Long.MIN_VALUE) {
                write((byte) '-');
                write((byte) '9');
                write((byte) '2');
                write((byte) '2');
                write((byte) '3');
                write((byte) '3');
                write((byte) '7');
                write((byte) '2');
                write((byte) '0');
                write((byte) '3');
                write((byte) '6');
                write((byte) '8');
                write((byte) '5');
                write((byte) '4');
                write((byte) '7');
                write((byte) '7');
                write((byte) '5');
                write((byte) '8');
                write((byte) '0');
                write((byte) '8');
                return;
            }

            if (l < 0) {
                write((byte) '-');
                l = -l;
            }

            int pos = 0;
            while (l > 0) {
                byteBuffer[pos++] = (byte) ((l % 10) + '0');
                l /= 10;
            }

            while (pos-- > 0)
                write(byteBuffer[pos]);
        }

        public void print(float f) {
            String sf = Float.toString(f);
            for (int i = 0; i < sf.length(); i++)
                write((byte) sf.charAt(i));
        }

        public void print(double d) {
            String sd = Double.toString(d);
            for (int i = 0; i < sd.length(); i++)
                write((byte) sd.charAt(i));
        }

        public void printls(char c) {
            print(c);
            write((byte) ' ');
        }

        public void printls(String s) {
            print(s);
            write((byte) ' ');
        }

        public void printls(int i) {
            print(i);
            write((byte) ' ');
        }

        public void printls(long l) {
            print(l);
            write((byte) ' ');
        }

        public void printls(float f) {
            print(f);
            write((byte) ' ');
        }

        public void printls(double d) {
            print(d);
            write((byte) ' ');
        }

        public void printls() {
            write((byte) ' ');
        }

        public void println(char c) {
            print(c);
            write((byte) '\n');
        }

        public void println(char[] chars) {
            print(chars, 0, chars.length);
            write((byte) '\n');
        }

        public void println(String s) {
            print(s);
            write((byte) '\n');
        }

        public void println(int i) {
            print(i);
            write((byte) '\n');
        }

        public void println(long l) {
            print(l);
            write((byte) '\n');
        }

        public void println(float f) {
            print(f);
            write((byte) '\n');
        }

        public void println(double d) {
            print(d);
            write((byte) '\n');
        }

        public void println() {
            write((byte) '\n');
        }

        public void printf(String format, Object... args) {
            String s = String.format(format, args);
            for (int i = 0; i < s.length(); i++)
                write((byte) s.charAt(i));
        }

        public void fprint(char c) {
            print(c);
            flushBuffer();
        }

        public void fprint(String s) {
            print(s);
            flushBuffer();
        }

        public void fprint(int i) {
            print(i);
            flushBuffer();
        }

        public void fprint(long l) {
            print(l);
            flushBuffer();
        }

        public void fprint(float f) {
            print(f);
            flushBuffer();
        }

        public void fprint(double d) {
            print(d);
            flushBuffer();
        }

        public void fprintf(String format, Object... args) {
            printf(format, args);
            flushBuffer();
        }

        private byte read() {
            if (nextIn >= inLength) {
                if ((inLength = fill()) == EOF)
                    return EOF;
                nextIn = 0;
            }

            return inBuffer[nextIn++];
        }

        private void write(byte b) {
            if (nextOut >= outBuffer.length)
                flushBuffer();

            outBuffer[nextOut++] = b;
        }

        private int fill() {
            try {
                return in.read(inBuffer, 0, inBuffer.length);
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
        }

        public void flush() {
            flushBuffer();
        }

        private void flushBuffer() {
            if (nextOut == 0)
                return;

            try {
                out.write(outBuffer, 0, nextOut);
            } catch (Exception e) {
                throw new RuntimeException(e);
            }

            nextOut = 0;
        }

        public void close() {
            flush();
        }

        public void exit(char c) {
            fprint(c);
            System.exit(0);
        }

        public void exit(String s) {
            fprint(s);
            System.exit(0);
        }

        public void exit(int i) {
            fprint(i);
            System.exit(0);
        }

        public void exit(long l) {
            fprint(l);
            System.exit(0);
        }

        public void exit(float f) {
            fprint(f);
            System.exit(0);
        }

        public void exit(double d) {
            fprint(d);
            System.exit(0);
        }

        public void exit(String format, Object... args) {
            fprintf(format, args);
            System.exit(0);
        }

        public void exit() {
            flushBuffer();
            System.exit(0);
        }

        private void ensureCapacity(int size) {
            if (size < charBuffer.length)
                return;

            char[] array = new char[size * 2];
            System.arraycopy(charBuffer, 0, array, 0, size);
            charBuffer = array;
        }

        private boolean isDigit(byte b) {
            return b >= '0' && b <= '9';
        }

        private boolean isLine(byte b) {
            return b == '\n' || b == '\r' || b == EOF;
        }

        private boolean isSpace(byte b) {
            return b == ' ' || b == '\t' || b == '\n' || b == '\r' || b == '\f' || b == EOF;
        }
    }

    public static void main(String[] args) {
        FastIO ioio = new FastIO(System.in, System.out);
        int tc = ioio.nextInt();
        for (int tt = 0; tt < tc; tt++) {
            int s = ioio.nextInt();
            int a = 0;
            while(s != 0){
                a++;
                s/= 10;
            }
            System.out.println(a);
        }
    }
}


import java.io.*;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Arrays;
import java.util.StringTokenizer;

public class A {
    public static class FastIO {

        public static final int DEFAULT_BUFFER_SIZE = 65536;
        public static final int DEFAULT_INTEGER_SIZE = 11;
        public static final int DEFAULT_LONG_SIZE = 20;
        public static final int DEFAULT_WORD_SIZE = 256;
        public static final int DEFAULT_LINE_SIZE = 8192;
        public static final int EOF = -1;

        private final InputStream in;
        private final OutputStream out;

        private byte[] inBuffer;
        private int nextIn, inLength;
        private byte[] outBuffer;
        private int nextOut;

        private char[] charBuffer;
        private byte[] byteBuffer;

        public FastIO(InputStream in, OutputStream out, int inBufferSize, int outBufferSize) {
            this.in = in;
            this.inBuffer = new byte[inBufferSize];
            this.nextIn = 0;
            this.inLength = 0;

            this.out = out;
            this.outBuffer = new byte[outBufferSize];
            this.nextOut = 0;

            this.charBuffer = new char[DEFAULT_LINE_SIZE];
            this.byteBuffer = new byte[DEFAULT_LONG_SIZE];
        }

        public FastIO(InputStream in, OutputStream out) {
            this(in, out, DEFAULT_BUFFER_SIZE, DEFAULT_BUFFER_SIZE);
        }

        public FastIO(InputStream in, OutputStream out, int bufferSize) {
            this(in, out, bufferSize, bufferSize);
        }

        public char nextChar() {
            byte b;
            while (isSpace(b = read()))
                ;

            return (char) b;
        }

        public String next() {
            byte b;
            while (isSpace(b = read()))
                ;

            int pos = 0;
            do {
                charBuffer[pos++] = (char) b;
                ensureCapacity(pos);
            } while (!isSpace(b = read()));

            return new String(charBuffer, 0, pos);
        }

        public String nextLine() {
            byte b;
            int pos = 0;

            while (!isLine(b = read())) {
                charBuffer[pos++] = (char) b;
                ensureCapacity(pos);
            }

            return new String(charBuffer, 0, pos);
        }

        public int nextInt() {
            byte b;
            while (isSpace(b = read()))
                ;

            boolean negative = false;
            int result = b - '0';
            if (b == '-') {
                negative = true;
                result = 0;
            }

            while (isDigit(b = read()))
                result = (result * 10) + (b - '0');

            return negative ? -result : result;
        }

        public long nextLong() {
            byte b;
            while (isSpace(b = read()))
                ;

            boolean negative = false;
            long result = b - '0';
            if (b == '-') {
                negative = true;
                result = 0;
            }

            while (isDigit(b = read()))
                result = (result * 10) + (b - '0');

            return negative ? -result : result;
        }

        public float nextFloat() {
            byte b;
            while (isSpace(b = read()))
                ;

            int pos = 0;
            do {
                charBuffer[pos++] = (char) b;
            } while (!isSpace(b = read()));

            return Float.parseFloat(new String(charBuffer, 0, pos));
        }

        public float nextFloat2() {
            byte b;
            while (isSpace(b = read()))
                ;

            boolean negative = false;
            float result = b - '0';
            if (b == '-') {
                negative = true;
                result = 0;
            }

            while (isDigit(b = read()))
                result = (result * 10) + (b - '0');

            float d = 1;
            if (b == '.') {
                while (isDigit(b = read()))
                    result += (b - '0') / (d *= 10);
            }

            return negative ? -result : result;
        }

        public double nextDouble() {
            byte b;
            while (isSpace(b = read()))
                ;

            int pos = 0;
            do {
                charBuffer[pos++] = (char) b;
            } while (!isSpace(b = read()));

            return Double.parseDouble(new String(charBuffer, 0, pos));
        }

        public double nextDouble2() {
            byte b;
            while (isSpace(b = read()))
                ;

            boolean negative = false;
            double result = b - '0';
            if (b == '-') {
                negative = true;
                result = 0;
            }

            while (isDigit(b = read()))
                result = (result * 10) + (b - '0');

            double d = 1;
            if (b == '.') {
                while (isDigit(b = read()))
                    result += (b - '0') / (d *= 10);
            }

            return negative ? -result : result;
        }

        public BigInteger nextBigInteger() {
            return new BigInteger(next());
        }

        public BigDecimal nextBigDecimal() {
            return new BigDecimal(next());
        }

        public char[] nextToCharArray() {
            byte b;
            while (isSpace(b = read()))
                ;

            int pos = 0;
            do {
                charBuffer[pos++] = (char) b;
                ensureCapacity(pos);
            } while (!isSpace(b = read()));

            char[] array = new char[pos];
            System.arraycopy(charBuffer, 0, array, 0, pos);
            return array;
        }

        public int[] nextIntArray(int size) {
            int[] array = new int[size];
            for (int i = 0; i < size; i++)
                array[i] = nextInt();

            return array;
        }

        public long[] nextLongArray(int size) {
            long[] array = new long[size];
            for (int i = 0; i < size; i++)
                array[i] = nextLong();

            return array;
        }

        public int[][] nextInt2DArray(int Y, int X) {
            int[][] array = new int[Y][X];
            for (int y = 0; y < Y; y++)
                for (int x = 0; x < X; x++)
                    array[y][x] = nextInt();

            return array;
        }

        public void print(char c) {
            write((byte) c);
        }

        public void print(char[] chars) {
            print(chars, 0, chars.length);
        }

        public void print(char[] chars, int start) {
            print(chars, start, chars.length);
        }

        public void print(char[] chars, int start, int end) {
            for (int i = start; i < end; i++)
                write((byte) chars[i]);
        }

        public void print(String s) {
            for (int i = 0; i < s.length(); i++)
                write((byte) s.charAt(i));
        }

        public void print(int i) {
            if (i == 0) {
                write((byte) '0');
                return;
            }
            if (i == Integer.MIN_VALUE) {
                write((byte) '-');
                write((byte) '2');
                write((byte) '1');
                write((byte) '4');
                write((byte) '7');
                write((byte) '4');
                write((byte) '8');
                write((byte) '3');
                write((byte) '6');
                write((byte) '4');
                write((byte) '8');
                return;
            }

            if (i < 0) {
                write((byte) '-');
                i = -i;
            }

            int pos = 0;
            while (i > 0) {
                byteBuffer[pos++] = (byte) ((i % 10) + '0');
                i /= 10;
            }

            while (pos-- > 0)
                write(byteBuffer[pos]);
        }

        public void print(long l) {
            if (l == 0) {
                write((byte) '0');
                return;
            }
            if (l == Long.MIN_VALUE) {
                write((byte) '-');
                write((byte) '9');
                write((byte) '2');
                write((byte) '2');
                write((byte) '3');
                write((byte) '3');
                write((byte) '7');
                write((byte) '2');
                write((byte) '0');
                write((byte) '3');
                write((byte) '6');
                write((byte) '8');
                write((byte) '5');
                write((byte) '4');
                write((byte) '7');
                write((byte) '7');
                write((byte) '5');
                write((byte) '8');
                write((byte) '0');
                write((byte) '8');
                return;
            }

            if (l < 0) {
                write((byte) '-');
                l = -l;
            }

            int pos = 0;
            while (l > 0) {
                byteBuffer[pos++] = (byte) ((l % 10) + '0');
                l /= 10;
            }

            while (pos-- > 0)
                write(byteBuffer[pos]);
        }

        public void print(float f) {
            String sf = Float.toString(f);
            for (int i = 0; i < sf.length(); i++)
                write((byte) sf.charAt(i));
        }

        public void print(double d) {
            String sd = Double.toString(d);
            for (int i = 0; i < sd.length(); i++)
                write((byte) sd.charAt(i));
        }

        public void printls(char c) {
            print(c);
            write((byte) ' ');
        }

        public void printls(String s) {
            print(s);
            write((byte) ' ');
        }

        public void printls(int i) {
            print(i);
            write((byte) ' ');
        }

        public void printls(long l) {
            print(l);
            write((byte) ' ');
        }

        public void printls(float f) {
            print(f);
            write((byte) ' ');
        }

        public void printls(double d) {
            print(d);
            write((byte) ' ');
        }

        public void printls() {
            write((byte) ' ');
        }

        public void println(char c) {
            print(c);
            write((byte) '\n');
        }

        public void println(char[] chars) {
            print(chars, 0, chars.length);
            write((byte) '\n');
        }

        public void println(String s) {
            print(s);
            write((byte) '\n');
        }

        public void println(int i) {
            print(i);
            write((byte) '\n');
        }

        public void println(long l) {
            print(l);
            write((byte) '\n');
        }

        public void println(float f) {
            print(f);
            write((byte) '\n');
        }

        public void println(double d) {
            print(d);
            write((byte) '\n');
        }

        public void println() {
            write((byte) '\n');
        }

        public void printf(String format, Object... args) {
            String s = String.format(format, args);
            for (int i = 0; i < s.length(); i++)
                write((byte) s.charAt(i));
        }

        public void fprint(char c) {
            print(c);
            flushBuffer();
        }

        public void fprint(String s) {
            print(s);
            flushBuffer();
        }

        public void fprint(int i) {
            print(i);
            flushBuffer();
        }

        public void fprint(long l) {
            print(l);
            flushBuffer();
        }

        public void fprint(float f) {
            print(f);
            flushBuffer();
        }

        public void fprint(double d) {
            print(d);
            flushBuffer();
        }

        public void fprintf(String format, Object... args) {
            printf(format, args);
            flushBuffer();
        }

        private byte read() {
            if (nextIn >= inLength) {
                if ((inLength = fill()) == EOF)
                    return EOF;
                nextIn = 0;
            }

            return inBuffer[nextIn++];
        }

        private void write(byte b) {
            if (nextOut >= outBuffer.length)
                flushBuffer();

            outBuffer[nextOut++] = b;
        }

        private int fill() {
            try {
                return in.read(inBuffer, 0, inBuffer.length);
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
        }

        public void flush() {
            flushBuffer();
        }

        private void flushBuffer() {
            if (nextOut == 0)
                return;

            try {
                out.write(outBuffer, 0, nextOut);
            } catch (Exception e) {
                throw new RuntimeException(e);
            }

            nextOut = 0;
        }

        public void close() {
            flush();
        }

        public void exit(char c) {
            fprint(c);
            System.exit(0);
        }

        public void exit(String s) {
            fprint(s);
            System.exit(0);
        }

        public void exit(int i) {
            fprint(i);
            System.exit(0);
        }

        public void exit(long l) {
            fprint(l);
            System.exit(0);
        }

        public void exit(float f) {
            fprint(f);
            System.exit(0);
        }

        public void exit(double d) {
            fprint(d);
            System.exit(0);
        }

        public void exit(String format, Object... args) {
            fprintf(format, args);
            System.exit(0);
        }

        public void exit() {
            flushBuffer();
            System.exit(0);
        }

        private void ensureCapacity(int size) {
            if (size < charBuffer.length)
                return;

            char[] array = new char[size * 2];
            System.arraycopy(charBuffer, 0, array, 0, size);
            charBuffer = array;
        }

        private boolean isDigit(byte b) {
            return b >= '0' && b <= '9';
        }

        private boolean isLine(byte b) {
            return b == '\n' || b == '\r' || b == EOF;
        }

        private boolean isSpace(byte b) {
            return b == ' ' || b == '\t' || b == '\n' || b == '\r' || b == '\f' || b == EOF;
        }
    }

    public static void main(String[] args) {
        FastIO ioio = new FastIO(System.in, System.out);
        int tc = ioio.nextInt();
        for (int tt = 0; tt < tc; tt++) {
            String s = ioio.next();
            int a = s.length();
            System.out.println(a);
        }
    }
}


import java.io.*;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Arrays;
import java.util.StringTokenizer;

public class A {
    public static class FastIO {

        public static final int DEFAULT_BUFFER_SIZE = 65536;
        public static final int DEFAULT_INTEGER_SIZE = 11;
        public static final int DEFAULT_LONG_SIZE = 20;
        public static final int DEFAULT_WORD_SIZE = 256;
        public static final int DEFAULT_LINE_SIZE = 8192;
        public static final int EOF = -1;

        private final InputStream in;
        private final OutputStream out;

        private byte[] inBuffer;
        private int nextIn, inLength;
        private byte[] outBuffer;
        private int nextOut;

        private char[] charBuffer;
        private byte[] byteBuffer;

        public FastIO(InputStream in, OutputStream out, int inBufferSize, int outBufferSize) {
            this.in = in;
            this.inBuffer = new byte[inBufferSize];
            this.nextIn = 0;
            this.inLength = 0;

            this.out = out;
            this.outBuffer = new byte[outBufferSize];
            this.nextOut = 0;

            this.charBuffer = new char[DEFAULT_LINE_SIZE];
            this.byteBuffer = new byte[DEFAULT_LONG_SIZE];
        }

        public FastIO(InputStream in, OutputStream out) {
            this(in, out, DEFAULT_BUFFER_SIZE, DEFAULT_BUFFER_SIZE);
        }

        public FastIO(InputStream in, OutputStream out, int bufferSize) {
            this(in, out, bufferSize, bufferSize);
        }

        public char nextChar() {
            byte b;
            while (isSpace(b = read()))
                ;

            return (char) b;
        }

        public String next() {
            byte b;
            while (isSpace(b = read()))
                ;

            int pos = 0;
            do {
                charBuffer[pos++] = (char) b;
                ensureCapacity(pos);
            } while (!isSpace(b = read()));

            return new String(charBuffer, 0, pos);
        }

        public String nextLine() {
            byte b;
            int pos = 0;

            while (!isLine(b = read())) {
                charBuffer[pos++] = (char) b;
                ensureCapacity(pos);
            }

            return new String(charBuffer, 0, pos);
        }

        public int nextInt() {
            byte b;
            while (isSpace(b = read()))
                ;

            boolean negative = false;
            int result = b - '0';
            if (b == '-') {
                negative = true;
                result = 0;
            }

            while (isDigit(b = read()))
                result = (result * 10) + (b - '0');

            return negative ? -result : result;
        }

        public long nextLong() {
            byte b;
            while (isSpace(b = read()))
                ;

            boolean negative = false;
            long result = b - '0';
            if (b == '-') {
                negative = true;
                result = 0;
            }

            while (isDigit(b = read()))
                result = (result * 10) + (b - '0');

            return negative ? -result : result;
        }

        public float nextFloat() {
            byte b;
            while (isSpace(b = read()))
                ;

            int pos = 0;
            do {
                charBuffer[pos++] = (char) b;
            } while (!isSpace(b = read()));

            return Float.parseFloat(new String(charBuffer, 0, pos));
        }

        public float nextFloat2() {
            byte b;
            while (isSpace(b = read()))
                ;

            boolean negative = false;
            float result = b - '0';
            if (b == '-') {
                negative = true;
                result = 0;
            }

            while (isDigit(b = read()))
                result = (result * 10) + (b - '0');

            float d = 1;
            if (b == '.') {
                while (isDigit(b = read()))
                    result += (b - '0') / (d *= 10);
            }

            return negative ? -result : result;
        }

        public double nextDouble() {
            byte b;
            while (isSpace(b = read()))
                ;

            int pos = 0;
            do {
                charBuffer[pos++] = (char) b;
            } while (!isSpace(b = read()));

            return Double.parseDouble(new String(charBuffer, 0, pos));
        }

        public double nextDouble2() {
            byte b;
            while (isSpace(b = read()))
                ;

            boolean negative = false;
            double result = b - '0';
            if (b == '-') {
                negative = true;
                result = 0;
            }

            while (isDigit(b = read()))
                result = (result * 10) + (b - '0');

            double d = 1;
            if (b == '.') {
                while (isDigit(b = read()))
                    result += (b - '0') / (d *= 10);
            }

            return negative ? -result : result;
        }

        public BigInteger nextBigInteger() {
            return new BigInteger(next());
        }

        public BigDecimal nextBigDecimal() {
            return new BigDecimal(next());
        }

        public char[] nextToCharArray() {
            byte b;
            while (isSpace(b = read()))
                ;

            int pos = 0;
            do {
                charBuffer[pos++] = (char) b;
                ensureCapacity(pos);
            } while (!isSpace(b = read()));

            char[] array = new char[pos];
            System.arraycopy(charBuffer, 0, array, 0, pos);
            return array;
        }

        public int[] nextIntArray(int size) {
            int[] array = new int[size];
            for (int i = 0; i < size; i++)
                array[i] = nextInt();

            return array;
        }

        public long[] nextLongArray(int size) {
            long[] array = new long[size];
            for (int i = 0; i < size; i++)
                array[i] = nextLong();

            return array;
        }

        public int[][] nextInt2DArray(int Y, int X) {
            int[][] array = new int[Y][X];
            for (int y = 0; y < Y; y++)
                for (int x = 0; x < X; x++)
                    array[y][x] = nextInt();

            return array;
        }

        public void print(char c) {
            write((byte) c);
        }

        public void print(char[] chars) {
            print(chars, 0, chars.length);
        }

        public void print(char[] chars, int start) {
            print(chars, start, chars.length);
        }

        public void print(char[] chars, int start, int end) {
            for (int i = start; i < end; i++)
                write((byte) chars[i]);
        }

        public void print(String s) {
            for (int i = 0; i < s.length(); i++)
                write((byte) s.charAt(i));
        }

        public void print(int i) {
            if (i == 0) {
                write((byte) '0');
                return;
            }
            if (i == Integer.MIN_VALUE) {
                write((byte) '-');
                write((byte) '2');
                write((byte) '1');
                write((byte) '4');
                write((byte) '7');
                write((byte) '4');
                write((byte) '8');
                write((byte) '3');
                write((byte) '6');
                write((byte) '4');
                write((byte) '8');
                return;
            }

            if (i < 0) {
                write((byte) '-');
                i = -i;
            }

            int pos = 0;
            while (i > 0) {
                byteBuffer[pos++] = (byte) ((i % 10) + '0');
                i /= 10;
            }

            while (pos-- > 0)
                write(byteBuffer[pos]);
        }

        public void print(long l) {
            if (l == 0) {
                write((byte) '0');
                return;
            }
            if (l == Long.MIN_VALUE) {
                write((byte) '-');
                write((byte) '9');
                write((byte) '2');
                write((byte) '2');
                write((byte) '3');
                write((byte) '3');
                write((byte) '7');
                write((byte) '2');
                write((byte) '0');
                write((byte) '3');
                write((byte) '6');
                write((byte) '8');
                write((byte) '5');
                write((byte) '4');
                write((byte) '7');
                write((byte) '7');
                write((byte) '5');
                write((byte) '8');
                write((byte) '0');
                write((byte) '8');
                return;
            }

            if (l < 0) {
                write((byte) '-');
                l = -l;
            }

            int pos = 0;
            while (l > 0) {
                byteBuffer[pos++] = (byte) ((l % 10) + '0');
                l /= 10;
            }

            while (pos-- > 0)
                write(byteBuffer[pos]);
        }

        public void print(float f) {
            String sf = Float.toString(f);
            for (int i = 0; i < sf.length(); i++)
                write((byte) sf.charAt(i));
        }

        public void print(double d) {
            String sd = Double.toString(d);
            for (int i = 0; i < sd.length(); i++)
                write((byte) sd.charAt(i));
        }

        public void printls(char c) {
            print(c);
            write((byte) ' ');
        }

        public void printls(String s) {
            print(s);
            write((byte) ' ');
        }

        public void printls(int i) {
            print(i);
            write((byte) ' ');
        }

        public void printls(long l) {
            print(l);
            write((byte) ' ');
        }

        public void printls(float f) {
            print(f);
            write((byte) ' ');
        }

        public void printls(double d) {
            print(d);
            write((byte) ' ');
        }

        public void printls() {
            write((byte) ' ');
        }

        public void println(char c) {
            print(c);
            write((byte) '\n');
        }

        public void println(char[] chars) {
            print(chars, 0, chars.length);
            write((byte) '\n');
        }

        public void println(String s) {
            print(s);
            write((byte) '\n');
        }

        public void println(int i) {
            print(i);
            write((byte) '\n');
        }

        public void println(long l) {
            print(l);
            write((byte) '\n');
        }

        public void println(float f) {
            print(f);
            write((byte) '\n');
        }

        public void println(double d) {
            print(d);
            write((byte) '\n');
        }

        public void println() {
            write((byte) '\n');
        }

        public void printf(String format, Object... args) {
            String s = String.format(format, args);
            for (int i = 0; i < s.length(); i++)
                write((byte) s.charAt(i));
        }

        public void fprint(char c) {
            print(c);
            flushBuffer();
        }

        public void fprint(String s) {
            print(s);
            flushBuffer();
        }

        public void fprint(int i) {
            print(i);
            flushBuffer();
        }

        public void fprint(long l) {
            print(l);
            flushBuffer();
        }

        public void fprint(float f) {
            print(f);
            flushBuffer();
        }

        public void fprint(double d) {
            print(d);
            flushBuffer();
        }

        public void fprintf(String format, Object... args) {
            printf(format, args);
            flushBuffer();
        }

        private byte read() {
            if (nextIn >= inLength) {
                if ((inLength = fill()) == EOF)
                    return EOF;
                nextIn = 0;
            }

            return inBuffer[nextIn++];
        }

        private void write(byte b) {
            if (nextOut >= outBuffer.length)
                flushBuffer();

            outBuffer[nextOut++] = b;
        }

        private int fill() {
            try {
                return in.read(inBuffer, 0, inBuffer.length);
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
        }

        public void flush() {
            flushBuffer();
        }

        private void flushBuffer() {
            if (nextOut == 0)
                return;

            try {
                out.write(outBuffer, 0, nextOut);
            } catch (Exception e) {
                throw new RuntimeException(e);
            }

            nextOut = 0;
        }

        public void close() {
            flush();
        }

        public void exit(char c) {
            fprint(c);
            System.exit(0);
        }

        public void exit(String s) {
            fprint(s);
            System.exit(0);
        }

        public void exit(int i) {
            fprint(i);
            System.exit(0);
        }

        public void exit(long l) {
            fprint(l);
            System.exit(0);
        }

        public void exit(float f) {
            fprint(f);
            System.exit(0);
        }

        public void exit(double d) {
            fprint(d);
            System.exit(0);
        }

        public void exit(String format, Object... args) {
            fprintf(format, args);
            System.exit(0);
        }

        public void exit() {
            flushBuffer();
            System.exit(0);
        }

        private void ensureCapacity(int size) {
            if (size < charBuffer.length)
                return;

            char[] array = new char[size * 2];
            System.arraycopy(charBuffer, 0, array, 0, size);
            charBuffer = array;
        }

        private boolean isDigit(byte b) {
            return b >= '0' && b <= '9';
        }

        private boolean isLine(byte b) {
            return b == '\n' || b == '\r' || b == EOF;
        }

        private boolean isSpace(byte b) {
            return b == ' ' || b == '\t' || b == '\n' || b == '\r' || b == '\f' || b == EOF;
        }
    }

    public static void main(String[] args) {
        FastIO ioio = new FastIO(System.in, System.out);
        int tc = ioio.nextInt();
        for (int tt = 0; tt < tc; tt++) {
            long s = ioio.nextLong();
            int a = 0;
            while(s != 0){
                a++;
                s/= 10;
            }
            System.out.println(a);
        }
    }
}


import java.io.*;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Arrays;
import java.util.StringTokenizer;

public class A {
    public static class FastIO {

        public static final int DEFAULT_BUFFER_SIZE = 65536;
        public static final int DEFAULT_INTEGER_SIZE = 11;
        public static final int DEFAULT_LONG_SIZE = 20;
        public static final int DEFAULT_WORD_SIZE = 256;
        public static final int DEFAULT_LINE_SIZE = 8192;
        public static final int EOF = -1;

        private final InputStream in;
        private final OutputStream out;

        private byte[] inBuffer;
        private int nextIn, inLength;
        private byte[] outBuffer;
        private int nextOut;

        private char[] charBuffer;
        private byte[] byteBuffer;

        public FastIO(InputStream in, OutputStream out, int inBufferSize, int outBufferSize) {
            this.in = in;
            this.inBuffer = new byte[inBufferSize];
            this.nextIn = 0;
            this.inLength = 0;

            this.out = out;
            this.outBuffer = new byte[outBufferSize];
            this.nextOut = 0;

            this.charBuffer = new char[DEFAULT_LINE_SIZE];
            this.byteBuffer = new byte[DEFAULT_LONG_SIZE];
        }

        public FastIO(InputStream in, OutputStream out) {
            this(in, out, DEFAULT_BUFFER_SIZE, DEFAULT_BUFFER_SIZE);
        }

        public FastIO(InputStream in, OutputStream out, int bufferSize) {
            this(in, out, bufferSize, bufferSize);
        }

        public char nextChar() {
            byte b;
            while (isSpace(b = read()))
                ;

            return (char) b;
        }

        public String next() {
            byte b;
            while (isSpace(b = read()))
                ;

            int pos = 0;
            do {
                charBuffer[pos++] = (char) b;
                ensureCapacity(pos);
            } while (!isSpace(b = read()));

            return new String(charBuffer, 0, pos);
        }

        public String nextLine() {
            byte b;
            int pos = 0;

            while (!isLine(b = read())) {
                charBuffer[pos++] = (char) b;
                ensureCapacity(pos);
            }

            return new String(charBuffer, 0, pos);
        }

        public int nextInt() {
            byte b;
            while (isSpace(b = read()))
                ;

            boolean negative = false;
            int result = b - '0';
            if (b == '-') {
                negative = true;
                result = 0;
            }

            while (isDigit(b = read()))
                result = (result * 10) + (b - '0');

            return negative ? -result : result;
        }

        public long nextLong() {
            byte b;
            while (isSpace(b = read()))
                ;

            boolean negative = false;
            long result = b - '0';
            if (b == '-') {
                negative = true;
                result = 0;
            }

            while (isDigit(b = read()))
                result = (result * 10) + (b - '0');

            return negative ? -result : result;
        }

        public float nextFloat() {
            byte b;
            while (isSpace(b = read()))
                ;

            int pos = 0;
            do {
                charBuffer[pos++] = (char) b;
            } while (!isSpace(b = read()));

            return Float.parseFloat(new String(charBuffer, 0, pos));
        }

        public float nextFloat2() {
            byte b;
            while (isSpace(b = read()))
                ;

            boolean negative = false;
            float result = b - '0';
            if (b == '-') {
                negative = true;
                result = 0;
            }

            while (isDigit(b = read()))
                result = (result * 10) + (b - '0');

            float d = 1;
            if (b == '.') {
                while (isDigit(b = read()))
                    result += (b - '0') / (d *= 10);
            }

            return negative ? -result : result;
        }

        public double nextDouble() {
            byte b;
            while (isSpace(b = read()))
                ;

            int pos = 0;
            do {
                charBuffer[pos++] = (char) b;
            } while (!isSpace(b = read()));

            return Double.parseDouble(new String(charBuffer, 0, pos));
        }

        public double nextDouble2() {
            byte b;
            while (isSpace(b = read()))
                ;

            boolean negative = false;
            double result = b - '0';
            if (b == '-') {
                negative = true;
                result = 0;
            }

            while (isDigit(b = read()))
                result = (result * 10) + (b - '0');

            double d = 1;
            if (b == '.') {
                while (isDigit(b = read()))
                    result += (b - '0') / (d *= 10);
            }

            return negative ? -result : result;
        }

        public BigInteger nextBigInteger() {
            return new BigInteger(next());
        }

        public BigDecimal nextBigDecimal() {
            return new BigDecimal(next());
        }

        public char[] nextToCharArray() {
            byte b;
            while (isSpace(b = read()))
                ;

            int pos = 0;
            do {
                charBuffer[pos++] = (char) b;
                ensureCapacity(pos);
            } while (!isSpace(b = read()));

            char[] array = new char[pos];
            System.arraycopy(charBuffer, 0, array, 0, pos);
            return array;
        }

        public int[] nextIntArray(int size) {
            int[] array = new int[size];
            for (int i = 0; i < size; i++)
                array[i] = nextInt();

            return array;
        }

        public long[] nextLongArray(int size) {
            long[] array = new long[size];
            for (int i = 0; i < size; i++)
                array[i] = nextLong();

            return array;
        }

        public int[][] nextInt2DArray(int Y, int X) {
            int[][] array = new int[Y][X];
            for (int y = 0; y < Y; y++)
                for (int x = 0; x < X; x++)
                    array[y][x] = nextInt();

            return array;
        }

        public void print(char c) {
            write((byte) c);
        }

        public void print(char[] chars) {
            print(chars, 0, chars.length);
        }

        public void print(char[] chars, int start) {
            print(chars, start, chars.length);
        }

        public void print(char[] chars, int start, int end) {
            for (int i = start; i < end; i++)
                write((byte) chars[i]);
        }

        public void print(String s) {
            for (int i = 0; i < s.length(); i++)
                write((byte) s.charAt(i));
        }

        public void print(int i) {
            if (i == 0) {
                write((byte) '0');
                return;
            }
            if (i == Integer.MIN_VALUE) {
                write((byte) '-');
                write((byte) '2');
                write((byte) '1');
                write((byte) '4');
                write((byte) '7');
                write((byte) '4');
                write((byte) '8');
                write((byte) '3');
                write((byte) '6');
                write((byte) '4');
                write((byte) '8');
                return;
            }

            if (i < 0) {
                write((byte) '-');
                i = -i;
            }

            int pos = 0;
            while (i > 0) {
                byteBuffer[pos++] = (byte) ((i % 10) + '0');
                i /= 10;
            }

            while (pos-- > 0)
                write(byteBuffer[pos]);
        }

        public void print(long l) {
            if (l == 0) {
                write((byte) '0');
                return;
            }
            if (l == Long.MIN_VALUE) {
                write((byte) '-');
                write((byte) '9');
                write((byte) '2');
                write((byte) '2');
                write((byte) '3');
                write((byte) '3');
                write((byte) '7');
                write((byte) '2');
                write((byte) '0');
                write((byte) '3');
                write((byte) '6');
                write((byte) '8');
                write((byte) '5');
                write((byte) '4');
                write((byte) '7');
                write((byte) '7');
                write((byte) '5');
                write((byte) '8');
                write((byte) '0');
                write((byte) '8');
                return;
            }

            if (l < 0) {
                write((byte) '-');
                l = -l;
            }

            int pos = 0;
            while (l > 0) {
                byteBuffer[pos++] = (byte) ((l % 10) + '0');
                l /= 10;
            }

            while (pos-- > 0)
                write(byteBuffer[pos]);
        }

        public void print(float f) {
            String sf = Float.toString(f);
            for (int i = 0; i < sf.length(); i++)
                write((byte) sf.charAt(i));
        }

        public void print(double d) {
            String sd = Double.toString(d);
            for (int i = 0; i < sd.length(); i++)
                write((byte) sd.charAt(i));
        }

        public void printls(char c) {
            print(c);
            write((byte) ' ');
        }

        public void printls(String s) {
            print(s);
            write((byte) ' ');
        }

        public void printls(int i) {
            print(i);
            write((byte) ' ');
        }

        public void printls(long l) {
            print(l);
            write((byte) ' ');
        }

        public void printls(float f) {
            print(f);
            write((byte) ' ');
        }

        public void printls(double d) {
            print(d);
            write((byte) ' ');
        }

        public void printls() {
            write((byte) ' ');
        }

        public void println(char c) {
            print(c);
            write((byte) '\n');
        }

        public void println(char[] chars) {
            print(chars, 0, chars.length);
            write((byte) '\n');
        }

        public void println(String s) {
            print(s);
            write((byte) '\n');
        }

        public void println(int i) {
            print(i);
            write((byte) '\n');
        }

        public void println(long l) {
            print(l);
            write((byte) '\n');
        }

        public void println(float f) {
            print(f);
            write((byte) '\n');
        }

        public void println(double d) {
            print(d);
            write((byte) '\n');
        }

        public void println() {
            write((byte) '\n');
        }

        public void printf(String format, Object... args) {
            String s = String.format(format, args);
            for (int i = 0; i < s.length(); i++)
                write((byte) s.charAt(i));
        }

        public void fprint(char c) {
            print(c);
            flushBuffer();
        }

        public void fprint(String s) {
            print(s);
            flushBuffer();
        }

        public void fprint(int i) {
            print(i);
            flushBuffer();
        }

        public void fprint(long l) {
            print(l);
            flushBuffer();
        }

        public void fprint(float f) {
            print(f);
            flushBuffer();
        }

        public void fprint(double d) {
            print(d);
            flushBuffer();
        }

        public void fprintf(String format, Object... args) {
            printf(format, args);
            flushBuffer();
        }

        private byte read() {
            if (nextIn >= inLength) {
                if ((inLength = fill()) == EOF)
                    return EOF;
                nextIn = 0;
            }

            return inBuffer[nextIn++];
        }

        private void write(byte b) {
            if (nextOut >= outBuffer.length)
                flushBuffer();

            outBuffer[nextOut++] = b;
        }

        private int fill() {
            try {
                return in.read(inBuffer, 0, inBuffer.length);
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
        }

        public void flush() {
            flushBuffer();
        }

        private void flushBuffer() {
            if (nextOut == 0)
                return;

            try {
                out.write(outBuffer, 0, nextOut);
            } catch (Exception e) {
                throw new RuntimeException(e);
            }

            nextOut = 0;
        }

        public void close() {
            flush();
        }

        public void exit(char c) {
            fprint(c);
            System.exit(0);
        }

        public void exit(String s) {
            fprint(s);
            System.exit(0);
        }

        public void exit(int i) {
            fprint(i);
            System.exit(0);
        }

        public void exit(long l) {
            fprint(l);
            System.exit(0);
        }

        public void exit(float f) {
            fprint(f);
            System.exit(0);
        }

        public void exit(double d) {
            fprint(d);
            System.exit(0);
        }

        public void exit(String format, Object... args) {
            fprintf(format, args);
            System.exit(0);
        }

        public void exit() {
            flushBuffer();
            System.exit(0);
        }

        private void ensureCapacity(int size) {
            if (size < charBuffer.length)
                return;

            char[] array = new char[size * 2];
            System.arraycopy(charBuffer, 0, array, 0, size);
            charBuffer = array;
        }

        private boolean isDigit(byte b) {
            return b >= '0' && b <= '9';
        }

        private boolean isLine(byte b) {
            return b == '\n' || b == '\r' || b == EOF;
        }

        private boolean isSpace(byte b) {
            return b == ' ' || b == '\t' || b == '\n' || b == '\r' || b == '\f' || b == EOF;
        }
    }

    public static void main(String[] args) {
        FastIO ioio = new FastIO(System.in, System.out);
        int tc = ioio.nextInt();
        for (int tt = 0; tt < tc; tt++) {
            String s = ioio.nextLine();
            int a = s.length();
            System.out.println(a);
        }
    }
}


import java.io.*;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Arrays;
import java.util.StringTokenizer;

public class A {
    public static class FastIO {

        public static final int DEFAULT_BUFFER_SIZE = 65536;
        public static final int DEFAULT_INTEGER_SIZE = 11;
        public static final int DEFAULT_LONG_SIZE = 20;
        public static final int DEFAULT_WORD_SIZE = 256;
        public static final int DEFAULT_LINE_SIZE = 8192;
        public static final int EOF = -1;

        private final InputStream in;
        private final OutputStream out;

        private byte[] inBuffer;
        private int nextIn, inLength;
        private byte[] outBuffer;
        private int nextOut;

        private char[] charBuffer;
        private byte[] byteBuffer;

        public FastIO(InputStream in, OutputStream out, int inBufferSize, int outBufferSize) {
            this.in = in;
            this.inBuffer = new byte[inBufferSize];
            this.nextIn = 0;
            this.inLength = 0;

            this.out = out;
            this.outBuffer = new byte[outBufferSize];
            this.nextOut = 0;

            this.charBuffer = new char[DEFAULT_LINE_SIZE];
            this.byteBuffer = new byte[DEFAULT_LONG_SIZE];
        }

        public FastIO(InputStream in, OutputStream out) {
            this(in, out, DEFAULT_BUFFER_SIZE, DEFAULT_BUFFER_SIZE);
        }

        public FastIO(InputStream in, OutputStream out, int bufferSize) {
            this(in, out, bufferSize, bufferSize);
        }

        public char nextChar() {
            byte b;
            while (isSpace(b = read()))
                ;

            return (char) b;
        }

        public String next() {
            byte b;
            while (isSpace(b = read()))
                ;

            int pos = 0;
            do {
                charBuffer[pos++] = (char) b;
                ensureCapacity(pos);
            } while (!isSpace(b = read()));

            return new String(charBuffer, 0, pos);
        }

        public String nextLine() {
            byte b;
            int pos = 0;

            while (!isLine(b = read())) {
                charBuffer[pos++] = (char) b;
                ensureCapacity(pos);
            }

            return new String(charBuffer, 0, pos);
        }

        public int nextInt() {
            byte b;
            while (isSpace(b = read()))
                ;

            boolean negative = false;
            int result = b - '0';
            if (b == '-') {
                negative = true;
                result = 0;
            }

            while (isDigit(b = read()))
                result = (result * 10) + (b - '0');

            return negative ? -result : result;
        }

        public long nextLong() {
            byte b;
            while (isSpace(b = read()))
                ;

            boolean negative = false;
            long result = b - '0';
            if (b == '-') {
                negative = true;
                result = 0;
            }

            while (isDigit(b = read()))
                result = (result * 10) + (b - '0');

            return negative ? -result : result;
        }

        public float nextFloat() {
            byte b;
            while (isSpace(b = read()))
                ;

            int pos = 0;
            do {
                charBuffer[pos++] = (char) b;
            } while (!isSpace(b = read()));

            return Float.parseFloat(new String(charBuffer, 0, pos));
        }

        public float nextFloat2() {
            byte b;
            while (isSpace(b = read()))
                ;

            boolean negative = false;
            float result = b - '0';
            if (b == '-') {
                negative = true;
                result = 0;
            }

            while (isDigit(b = read()))
                result = (result * 10) + (b - '0');

            float d = 1;
            if (b == '.') {
                while (isDigit(b = read()))
                    result += (b - '0') / (d *= 10);
            }

            return negative ? -result : result;
        }

        public double nextDouble() {
            byte b;
            while (isSpace(b = read()))
                ;

            int pos = 0;
            do {
                charBuffer[pos++] = (char) b;
            } while (!isSpace(b = read()));

            return Double.parseDouble(new String(charBuffer, 0, pos));
        }

        public double nextDouble2() {
            byte b;
            while (isSpace(b = read()))
                ;

            boolean negative = false;
            double result = b - '0';
            if (b == '-') {
                negative = true;
                result = 0;
            }

            while (isDigit(b = read()))
                result = (result * 10) + (b - '0');

            double d = 1;
            if (b == '.') {
                while (isDigit(b = read()))
                    result += (b - '0') / (d *= 10);
            }

            return negative ? -result : result;
        }

        public BigInteger nextBigInteger() {
            return new BigInteger(next());
        }

        public BigDecimal nextBigDecimal() {
            return new BigDecimal(next());
        }

        public char[] nextToCharArray() {
            byte b;
            while (isSpace(b = read()))
                ;

            int pos = 0;
            do {
                charBuffer[pos++] = (char) b;
                ensureCapacity(pos);
            } while (!isSpace(b = read()));

            char[] array = new char[pos];
            System.arraycopy(charBuffer, 0, array, 0, pos);
            return array;
        }

        public int[] nextIntArray(int size) {
            int[] array = new int[size];
            for (int i = 0; i < size; i++)
                array[i] = nextInt();

            return array;
        }

        public long[] nextLongArray(int size) {
            long[] array = new long[size];
            for (int i = 0; i < size; i++)
                array[i] = nextLong();

            return array;
        }

        public int[][] nextInt2DArray(int Y, int X) {
            int[][] array = new int[Y][X];
            for (int y = 0; y < Y; y++)
                for (int x = 0; x < X; x++)
                    array[y][x] = nextInt();

            return array;
        }

        public void print(char c) {
            write((byte) c);
        }

        public void print(char[] chars) {
            print(chars, 0, chars.length);
        }

        public void print(char[] chars, int start) {
            print(chars, start, chars.length);
        }

        public void print(char[] chars, int start, int end) {
            for (int i = start; i < end; i++)
                write((byte) chars[i]);
        }

        public void print(String s) {
            for (int i = 0; i < s.length(); i++)
                write((byte) s.charAt(i));
        }

        public void print(int i) {
            if (i == 0) {
                write((byte) '0');
                return;
            }
            if (i == Integer.MIN_VALUE) {
                write((byte) '-');
                write((byte) '2');
                write((byte) '1');
                write((byte) '4');
                write((byte) '7');
                write((byte) '4');
                write((byte) '8');
                write((byte) '3');
                write((byte) '6');
                write((byte) '4');
                write((byte) '8');
                return;
            }

            if (i < 0) {
                write((byte) '-');
                i = -i;
            }

            int pos = 0;
            while (i > 0) {
                byteBuffer[pos++] = (byte) ((i % 10) + '0');
                i /= 10;
            }

            while (pos-- > 0)
                write(byteBuffer[pos]);
        }

        public void print(long l) {
            if (l == 0) {
                write((byte) '0');
                return;
            }
            if (l == Long.MIN_VALUE) {
                write((byte) '-');
                write((byte) '9');
                write((byte) '2');
                write((byte) '2');
                write((byte) '3');
                write((byte) '3');
                write((byte) '7');
                write((byte) '2');
                write((byte) '0');
                write((byte) '3');
                write((byte) '6');
                write((byte) '8');
                write((byte) '5');
                write((byte) '4');
                write((byte) '7');
                write((byte) '7');
                write((byte) '5');
                write((byte) '8');
                write((byte) '0');
                write((byte) '8');
                return;
            }

            if (l < 0) {
                write((byte) '-');
                l = -l;
            }

            int pos = 0;
            while (l > 0) {
                byteBuffer[pos++] = (byte) ((l % 10) + '0');
                l /= 10;
            }

            while (pos-- > 0)
                write(byteBuffer[pos]);
        }

        public void print(float f) {
            String sf = Float.toString(f);
            for (int i = 0; i < sf.length(); i++)
                write((byte) sf.charAt(i));
        }

        public void print(double d) {
            String sd = Double.toString(d);
            for (int i = 0; i < sd.length(); i++)
                write((byte) sd.charAt(i));
        }

        public void printls(char c) {
            print(c);
            write((byte) ' ');
        }

        public void printls(String s) {
            print(s);
            write((byte) ' ');
        }

        public void printls(int i) {
            print(i);
            write((byte) ' ');
        }

        public void printls(long l) {
            print(l);
            write((byte) ' ');
        }

        public void printls(float f) {
            print(f);
            write((byte) ' ');
        }

        public void printls(double d) {
            print(d);
            write((byte) ' ');
        }

        public void printls() {
            write((byte) ' ');
        }

        public void println(char c) {
            print(c);
            write((byte) '\n');
        }

        public void println(char[] chars) {
            print(chars, 0, chars.length);
            write((byte) '\n');
        }

        public void println(String s) {
            print(s);
            write((byte) '\n');
        }

        public void println(int i) {
            print(i);
            write((byte) '\n');
        }

        public void println(long l) {
            print(l);
            write((byte) '\n');
        }

        public void println(float f) {
            print(f);
            write((byte) '\n');
        }

        public void println(double d) {
            print(d);
            write((byte) '\n');
        }

        public void println() {
            write((byte) '\n');
        }

        public void printf(String format, Object... args) {
            String s = String.format(format, args);
            for (int i = 0; i < s.length(); i++)
                write((byte) s.charAt(i));
        }

        public void fprint(char c) {
            print(c);
            flushBuffer();
        }

        public void fprint(String s) {
            print(s);
            flushBuffer();
        }

        public void fprint(int i) {
            print(i);
            flushBuffer();
        }

        public void fprint(long l) {
            print(l);
            flushBuffer();
        }

        public void fprint(float f) {
            print(f);
            flushBuffer();
        }

        public void fprint(double d) {
            print(d);
            flushBuffer();
        }

        public void fprintf(String format, Object... args) {
            printf(format, args);
            flushBuffer();
        }

        private byte read() {
            if (nextIn >= inLength) {
                if ((inLength = fill()) == EOF)
                    return EOF;
                nextIn = 0;
            }

            return inBuffer[nextIn++];
        }

        private void write(byte b) {
            if (nextOut >= outBuffer.length)
                flushBuffer();

            outBuffer[nextOut++] = b;
        }

        private int fill() {
            try {
                return in.read(inBuffer, 0, inBuffer.length);
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
        }

        public void flush() {
            flushBuffer();
        }

        private void flushBuffer() {
            if (nextOut == 0)
                return;

            try {
                out.write(outBuffer, 0, nextOut);
            } catch (Exception e) {
                throw new RuntimeException(e);
            }

            nextOut = 0;
        }

        public void close() {
            flush();
        }

        public void exit(char c) {
            fprint(c);
            System.exit(0);
        }

        public void exit(String s) {
            fprint(s);
            System.exit(0);
        }

        public void exit(int i) {
            fprint(i);
            System.exit(0);
        }

        public void exit(long l) {
            fprint(l);
            System.exit(0);
        }

        public void exit(float f) {
            fprint(f);
            System.exit(0);
        }

        public void exit(double d) {
            fprint(d);
            System.exit(0);
        }

        public void exit(String format, Object... args) {
            fprintf(format, args);
            System.exit(0);
        }

        public void exit() {
            flushBuffer();
            System.exit(0);
        }

        private void ensureCapacity(int size) {
            if (size < charBuffer.length)
                return;

            char[] array = new char[size * 2];
            System.arraycopy(charBuffer, 0, array, 0, size);
            charBuffer = array;
        }

        private boolean isDigit(byte b) {
            return b >= '0' && b <= '9';
        }

        private boolean isLine(byte b) {
            return b == '\n' || b == '\r' || b == EOF;
        }

        private boolean isSpace(byte b) {
            return b == ' ' || b == '\t' || b == '\n' || b == '\r' || b == '\f' || b == EOF;
        }
    }

    public static void main(String[] args) {
        FastIO ioio = new FastIO(System.in, System.out);
        int tc = ioio.nextInt();
        for (int tt = 0; tt < tc; tt++) {
            String s = ioio.nextLine();
            ioio.println(s.length());
        }
    }
}


import java.util.*;
import java.io.*;
public class A{
    static class InputReader {

        private final InputStream stream;
        private final byte[] buf = new byte[8192];
        private int curChar, snumChars;
        private SpaceCharFilter filter;

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

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

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

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

        public int[] nextIntArray(int n) {
            int a[] = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = nextInt();
            }
            return a;
        }

        public String readString() {
            int c = snext();
            while (isSpaceChar(c)) {
                c = snext();
            }
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = snext();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public String nextLine() {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = snext();
            } while (!isEndOfLine(c));
            return res.toString();
        }

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

        private boolean isEndOfLine(int c) {
            return c == '\n' || c == '\r' || c == -1;
        }

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

    }
    static class OutputWriter {
		private final PrintWriter writer;

		public OutputWriter(OutputStream outputStream) {
			writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
		}

		public OutputWriter(Writer writer) {
			this.writer = new PrintWriter(writer);
		}

		public void print(Object...objects) {
			for (int i = 0; i < objects.length; i++) {
				if (i != 0)
					writer.print(' ');
				writer.print(objects[i]);
			}
		}

		public void printLine(Object...objects) {
			print(objects);
			writer.println();
		}

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

		public void flush() {
			writer.flush();
		}

		}
    static int gcd(int a, int b)
    {
        if (a == 0)
            return b;
        return gcd(b % a, a);
    }
    static int mod = (int)(1e9+7);
    public static long pow(long a,long b)
    {
        long ans = 1;
        while(b> 0)
        {
            if((b & 1)==1){
                ans = (ans*a) % mod;
            }
            a = (a*a) % mod;
            b = b>>1;
        }
        return ans;
    }
    static void sort(int[] a) {
		ArrayList<Integer> l=new ArrayList<>();
		for (int i:a) l.add(i);
		Collections.sort(l);
		for (int i=0; i<a.length; i++) a[i]=l.get(i);
	}
    public static void main(String[] args) {
        InputReader in = new InputReader(System.in);
        OutputWriter out = new OutputWriter(System.out);
        int t = in.nextInt();
        while(t-- >0)
        {
            String s = in.nextLine();
            out.printLine(s.length());
        }
        out.flush();
        out.close();
    }
}


    import java.util.*;
    import java.math.BigInteger;

    public class Main {
        public static void main(String[] args) {
            Scanner input = new Scanner(System.in);
            int t = input.nextInt();
            int count = 0;
            while(t > 0) {
                BigInteger n = input.nextBigInteger();
                BigInteger division = new BigInteger("10");
                BigInteger zero = new BigInteger("0");
                do {
                    n = n.divide(division);
                    count++;
                } while(n.compareTo(zero) != 0);

                System.out.println(count);
                count = 0;
                t--;
            }
        }
    }


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

public class StrangeFunctions {
    static class Reader {
        final private int BUFFER_SIZE = 1 << 16;
        private DataInputStream din;
        private byte[] buffer;
        private int bufferPointer, bytesRead;

        public Reader() {
            din = new DataInputStream(System.in);
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public Reader(String file_name) throws IOException {
            din = new DataInputStream(new FileInputStream(file_name));
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public String readLine() throws IOException {
            byte[] buf = new byte[64]; // line length
            int cnt = 0, c;
            while ((c = read()) != -1) {
                if (c == '\n')
                    break;
                buf[cnt++] = (byte) c;
            }
            return new String(buf, 0, cnt);
        }

        public int nextInt() throws IOException {
            int ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do {
                ret = ret * 10 + c - '0';
            } while ((c = read()) >= '0' && c <= '9');
            if (neg)
                return -ret;
            return ret;
        }

        public long nextLong() throws IOException {
            long ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9');
            if (neg)
                return -ret;
            return ret;
        }

        public double nextDouble() throws IOException {
            double ret = 0, div = 1;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9');
            if (c == '.') {
                while ((c = read()) >= '0' && c <= '9') {
                    ret += (c - '0') / (div *= 10);
                }
            }
            if (neg)
                return -ret;
            return ret;
        }

        private void fillBuffer() throws IOException {
            bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
            if (bytesRead == -1)
                buffer[0] = -1;
        }

        private byte read() throws IOException {
            if (bufferPointer == bytesRead)
                fillBuffer();
            return buffer[bufferPointer++];
        }

        public void close() throws IOException {
            if (din == null)
                return;
            din.close();
        }
    }

    static Reader sc = new Reader();
    static BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));

    public static void main(String args[]) throws IOException {
        /*
         * For integer input: int n=inputInt();
         * For long input: long n=inputLong();
         * For double input: double n=inputDouble();
         * For String input: String s=inputString();
         * Logic goes here
         * For printing without space: print(a+""); where a is a variable of any datatype
         * For printing with space: printSp(a+""); where a is a variable of any datatype
         * For printing with new line: println(a+""); where a is a variable of any datatype
         */
        Scanner s = new Scanner(System.in);
        int t = s.nextInt();
        s.nextLine();
        while(t-->0){
            String str = s.nextLine();
            System.out.println(str.length());
        }
        bw.flush();
        bw.close();
    }

    public static int inputInt() throws IOException {
        return sc.nextInt();
    }

    public static long inputLong() throws IOException {
        return sc.nextLong();
    }

    public static double inputDouble() throws IOException {
        return sc.nextDouble();
    }

    public static String inputString() throws IOException {
        return sc.readLine();
    }

    public static void print(String a) throws IOException {
        bw.write(a);
    }

    public static void printSp(String a) throws IOException {
        bw.write(a + " ");
    }

    public static void println(String a) throws IOException {
        bw.write(a + "\n");
    }
}


import java.math.BigInteger;
import java.util.*;

public class Main {

    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);
        int test = scanner.nextInt();
        for (int i = 0; i < test; i++) {

            BigInteger n = scanner.nextBigInteger();
            System.out.println(countDigit(n));

        }

    }
    static long countDigit(BigInteger n)
    {
        if (n.equals(BigInteger.ZERO))
            return 0;
        return countDigit(n.divide(BigInteger.TEN))+1 ;
    }

}


import java.math.BigInteger;
import java.util.Scanner;

public class Test1 {

	public static void main (String[] args) throws java.lang.Exception
	{
		// your code goes here
		Scanner sc = new Scanner(System.in);
		int t = sc.nextInt();
		for(int i=0;i<t;i++) {
			BigInteger a = sc.nextBigInteger();
			BigInteger c = BigInteger.valueOf(1);
			int count = 0;
			while(c.compareTo(a)!=1) {
				count++;
				c = c.multiply(BigInteger.valueOf(10));
			}
			System.out.println(count);
		}
	}
}


import java.util.*;
 import java.math.*;
public class Main{
     public static void main(String args[])
     {
          Scanner sc= new Scanner(System.in);
          int t= sc.nextInt();
          sc.nextLine();
          while(t-- !=0)
          {

               BigInteger n = new BigInteger(sc.nextLine());

               long c=0;

                    long i=0;

                    while(BigDecimal.valueOf(Math.pow(10,i)).toBigInteger().compareTo(n)<=0)
                    {
                         i++;
                         c++;
                    }

               System.out.println(c);
               }

          }
     }


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

public class Main
{
    public static int total(BigInteger a){
        BigInteger temp = a;
        int b = 0;
        int r = 10;
        do{
        temp = temp.divide(BigInteger.valueOf(r));
        b ++;
        }while (temp != BigInteger.ZERO);

        return b;
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int t = sc.nextInt();
        BigInteger in [] = new BigInteger [t];

        for (int i = 0; i < t; i ++){
            in[i] = sc.nextBigInteger();
        }

        for(int i = 0; i < t; i ++){
            int s = total(in[i]);

            System.out.println(s);
        }

    }

}


import java.math.BigInteger;
import java.util.*;

import java.util.Scanner;

public class StrangeFunctions {

	public static int getCount(BigInteger number) {
		  double factor = Math.log(2) / Math.log(10);
		  int Count = (int) (factor * number.bitLength() + 1);
		  if (BigInteger.TEN.pow(Count - 1).compareTo(number) > 0) {
		    return Count - 1;
		  }
		  return Count;
		}
	public static void main(String[] args) {
		// TODO Auto-generated method stub

		Scanner sc = new Scanner(System.in);
		int t = sc.nextInt();
		while(t-->0) {
			BigInteger n = sc.nextBigInteger();
			System.out.println(getCount(n));
		}
	}

}


import java.math.BigInteger;
import java.util.Scanner;
public class Edu9982 {

	public static int getDigitCount(BigInteger number) {
		  double factor = Math.log(2) / Math.log(10);
		  int digitCount = (int) (factor * number.bitLength() + 1);
		  if (BigInteger.TEN.pow(digitCount - 1).compareTo(number) > 0) {
		    return digitCount - 1;
		  }
		  return digitCount;
		}
	public static void main(String[] args) {
		// TODO Auto-generated method stub

		Scanner sc = new Scanner(System.in);
		int t = sc.nextInt();
		while(t-->0) {
			BigInteger n = sc.nextBigInteger();
			System.out.println(getDigitCount(n));
		}
	}

}


import java.math.BigInteger;
import java.util.Scanner;
public class EduCodef998 {

	public static void main(String[] args) {
		// TODO Auto-generated method stub

		Scanner sc = new Scanner(System.in);
		int t = sc.nextInt();
		while(t-->0) {
			long n = sc.nextInt();

			int count = 0;

		    while (n != 0) {

		      n /= 10;
		      ++count;
		    }

		    System.out.println(count);
		}

	}

}


import java.util.Scanner;

public class StrangeFunc {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int t = Integer.parseInt(sc.nextLine());
        String n;
        for(int i=t;i>0;i--) {
            n=sc.nextLine();
            int ans=n.length();
            System.out.println(ans);
        }

    }
}


#include <bits/stdc++.h>

#define mp make_pair
#define ll long long
#define fi first
#define se second
#define fr front()
#define pb push_back
#define len length()
#define pll pair<ll,ll>
#define sqr(a) ((a)*(a))
#define pu push
#define ld long double
#define pld pair<ld,ld>
#define y1 Enkognit
//#define {cout.flush()} {fflush(stdout)}

using namespace std;

const ll MOD=1e9;

ll n, m, sum, ans, k, l, ls, r, i, j, dp[300005];
string s, d[1001];
bool t1, t2;

ll ask(ll x,ll y,ll l,ll r)
{
    ll z;
    cout << "? " << x << " " << y << " " << l << " " << r << "\n";
    cin >> z;
    return z%2;
}

int main()
{
    //freopen("cipher.in","r",stdin);
    //freopen("cipher.out","w",stdout);
    //ios_base::sync_with_stdio(0);cin.tie(0);
    //freopen("lexicon.in","r",stdin);
    //freopen("lexicon.out","w",stdout);
    cin >> n;
    ll x1=-1e18, y1=-1e18, x2=1e18, y2=1e18;
    for (ll i = 1; i <= n; i++)
    {
        if (ask(i, 1, i, n)) x1=max(x1,i), x2=min(x2,i), t1=1;
    }

    for (ll i = 1; i <= n; i++)
    {
        if (ask(1, i, n, i)) y1=max(y1,i), y2=min(y2,i), t2=1;
    }
    //cout << "-----\n";
    if (!t1)
    {
        ll l = 1, r = n, k = 0;
        while (l<r)
        {
            ll w = (l + r) / 2 + (l + r)%2;
            if (ask(w,y1,n,y1)) l=w+1, ans=max(ans,w); else r=w;
        }
        x1=ans, x2=x1;
    }

    if (!t2)
    {
        ll l = 1, r = n, k = 0;
        while (l<r)
        {
            ll w = (l + r) / 2 + (l + r)%2;
            if (ask(x1, w, x1, n)) l=w+1, ans=max(ans,w); else r=w;
        }
        y1=ans, y2=y1;
    }
    cout << "! " << x1 << " " << y1 << " " << x2 << " " << y2 << "\n";
    return 0;
}


#include <bits/stdc++.h>

#define mp make_pair
#define ll long long
#define fi first
#define se second
#define fr front()
#define pb push_back
#define len length()
#define pll pair<ll,ll>
#define sqr(a) ((a)*(a))
#define pu push
#define ld long double
#define pld pair<ld,ld>
#define y1 Enkognit
//#define {cout.flush()} {fflush(stdout)}

using namespace std;

const ll MOD=1e9;

ll n, m, sum, ans, k, l, ls, r, i, j, dp[300005];
string s, d[1001];
bool t1, t2;

ll ask(ll x,ll y,ll l,ll r)
{
    ll z;
    cout << "? " << x << " " << y << " " << l << " " << r << "\n";
    cin >> z;
    return (z%2);
}

int main()
{
    //freopen("cipher.in","r",stdin);
    //freopen("cipher.out","w",stdout);
    //ios_base::sync_with_stdio(0);cin.tie(0);
    //freopen("lexicon.in","r",stdin);
    //freopen("lexicon.out","w",stdout);
    cin >> n;
    ll x1=-1e18, y1=-1e18, x2=1e18, y2=1e18;
    t1=0, t2=0;
    for (ll i = 1; i <= n; i++)
    {
        if (ask(i, 1, i, n)) x1=max(x1,i), x2=min(x2,i), t1=1;
    }

    for (ll i = 1; i <= n; i++)
    {
        if (ask(1, i, n, i)) y1=max(y1,i), y2=min(y2,i), t2=1;
    }
    //cout << "-----\n";
    if (!t1)
    {
        ll l = 1, r = n, ans = -1;
        while (l<r)
        {
            ll w = (l + r) / 2;
            if (ask(w, y1, n, y1)) l=w+1, ans=max(ans,w); else r=w;
        }
        x1=ans, x2=x1;
    }

    if (!t2)
    {
        ll l = 1, r = n, ans = -1;
        while (l<r)
        {
            ll w = (l + r) / 2;
            if (ask(x1, w, x1, n)) l=w+1, ans=max(ans,w); else r=w;
        }
        y1=ans, y2=y1;
    }
    if (!ask(x1,y1,x2,y2)) swap(y1,y2);
    cout << "! " << x1 << " " << y1 << " " << x2 << " " << y2 << "\n";
    return 0;
}


#include <bits/stdc++.h>
#define ll long long
#define w cout
#define e endl
using namespace std;

const int N = 1e6 + 7;

void ask(int x1 , int y1 , int x2 , int y2) {
	w << "? " << x1 << " " << y1 << " " << x2 << " " << y2 << e;
}

int main() {
	int n;
	cin >> n;
	int x1 = 1 , y1 = 1 , x2 = n , y2 = 1;
	int xx1  = -1, yy1  = -1, xx2 = -1 , yy2 = -1;
	int res;
	while(y1 <= n) {
		ask(x1 , y1 , x2 , y1);
		cin >> res;
		if(res % 2) {
			if(yy1 == -1) {
				yy1 = y1;
			} else {
				yy2 = y1;
			}
		}
		y1++;
	}

	x1 = 1 , y1 = 1, x2 = 1 , y2 = n;
	while(x1 <= n) {
		ask(x1 , y1 , x1 , y2);
		cin >> res;
		if(res % 2) {
			if(xx1 == -1) {
				xx1 = x1;
			} else {
				xx2 = y2;
				break;
			}
		}
		x1++;
	}
	if(xx1 == -1) {
		int l = 1 , h = n;
		int ans;
		while(l <= h) {
			int mid = (l + h) / 2;
			ask(1 , yy1 , mid , yy1);
			cin >> res;
			if(res == 1) {
				ans = mid;
				h = mid - 1;
			} else {
				l = mid + 1;
			}
		}
		cout << "! " << ans << " " << yy1 << " " << ans << " " << yy2 << endl;
	} else if(yy1 == -1) {
		int l = 1 , h =  n;
		int ans ;
		while(l <= h) {
			int mid = (l + h) / 2;
			ask(xx1 , 1 , xx1 , mid);
			cin >> res;
			if(res == 1) {
				ans = mid;
				h = mid - 1;
			} else{
				l = mid + 1;
			}
		}
		cout << "! " << xx1 << " " << ans << " " << xx2 << " " << ans << endl;
	} else {
		cout << "! " <<  xx1 << " " << yy1 << " " << xx2 << " " << yy2 << endl;
	}
}


#include <bits/stdc++.h>
#define ll long long
#define w cout
#define e endl
using namespace std;

const int N = 1e6 + 7;

void ask(int x1 , int y1 , int x2 , int y2) {
	w << "? " << x1 << " " << y1 << " " << x2 << " " << y2 << e;
}

int main() {
	int n;
	cin >> n;
	int x1 = 1 , y1 = 1 , x2 = n , y2 = 1;
	int xx1  = -1, yy1  = -1, xx2 = -1 , yy2 = -1;
	int res;
	while(y1 <= n) {
		ask(x1 , y1 , x2 , y1);
		cin >> res;
		if(res % 2) {
			if(yy1 == -1) {
				yy1 = y1;
			} else {
				yy2 = y1;
			}
		}
		y1++;
	}

	x1 = 1 , y1 = 1, x2 = 1 , y2 = n;
	while(x1 <= n) {
		ask(x1 , y1 , x1 , y2);
		cin >> res;
		if(res % 2) {
			if(xx1 == -1) {
				xx1 = x1;
			} else {
				xx2 = y2;
			}
		}
		x1++;
	}
	if(xx1 == -1) {
		int l = 1 , h = n;
		int ans;
		while(l <= h) {
			int mid = (l + h) / 2;
			ask(1 , yy1 , mid , yy1);
			cin >> res;
			if(res == 1) {
				ans = mid;
				h = mid - 1;
			} else {
				l = mid + 1;
			}
		}
		cout << "! " << ans << " " << yy1 << " " << ans << " " << yy2 << endl;
	} else if(yy1 == -1) {
		int l = 1 , h =  n;
		int ans ;
		while(l <= h) {
			int mid = (l + h) / 2;
			ask(xx1 , 1 , xx1 , mid);
			cin >> res;
			if(res == 1) {
				ans = mid;
				h = mid - 1;
			} else{
				l = mid + 1;
			}
		}
		cout << "! " << xx1 << " " << ans << " " << xx2 << " " << ans << endl;
	} else {
			int ax1,ay1,ax2,ay2;
			ask(xx1 , yy1 , xx1 , yy1);
			cin >> res;
			if(res%2==1)
			{
				ax1=xx1,ay1=yy1;
				ax2=xx2,ay2=yy2;
			}
			else
			{
				ax1=xx1,ay1=yy2;
				ax2=xx2,ay2=yy1;
			}
			cout<<"! "<<ax1<<" "<<ay1<<" "<<ax2<<" "<<ay2<<endl;
	}
}


#include <bits/stdc++.h>
#define ll long long
#define w cout
#define e endl
using namespace std;

const int N = 1e6 + 7;

void ask(int x1 , int y1 , int x2 , int y2) {
	w << "? " << x1 << " " << y1 << " " << x2 << " " << y2 << e;
}

int main() {
	int n;
	cin >> n;
	int x1 = 1 , y1 = 1 , x2 = n , y2 = 1;
	int xx1  = -1, yy1  = -1, xx2 = -1 , yy2 = -1;
	int res;
	for(int i = 1 ; i <= n ; i ++ ) {
		ask(1 , i , n , i);
		cin >> res;
		if(res % 2) {
			if(yy1 == -1) {
				yy1 = i;
			} else {
				yy2 = i;
			}
		}
	}

	x1 = 1 , y1 = 1, x2 = 1 , y2 = n;
	for(int i = 1 ; i <= n ;i ++ ) {
		ask(i , 1 , i , n);
		cin >> res;
		if(res % 2) {
			if(xx1 == -1) {
				xx1 = i;
			} else {
				xx2 = i;
			}
		}
	}
	if(xx1 == -1) {
		int l = 1 , h = n;
		int ans;
		while(l <= h) {
			int mid = (l + h) / 2;
			ask(1 , yy1 , mid , yy1);
			cin >> res;
			if(res == 1) {
				ans = mid;
				h = mid - 1;
			} else {
				l = mid + 1;
			}
		}
		cout << "! " << ans << " " << yy1 << " " << ans << " " << yy2 << endl;
	} else if(yy1 == -1) {
		int l = 1 , h =  n;
		int ans ;
		while(l <= h) {
			int mid = (l + h) / 2;
			ask(xx1 , 1 , xx1 , mid);
			cin >> res;
			if(res == 1) {
				ans = mid;
				h = mid - 1;
			} else{
				l = mid + 1;
			}
		}
		cout << "! " << xx1 << " " << ans << " " << xx2 << " " << ans << endl;
	} else {
			cout<<"! "<<xx1<<" "<<yy1<<" "<<xx2<<" "<<yy2<<endl;
	}
}


#include <bits/stdc++.h>
#define ll long long
#define w cout
#define e endl
using namespace std;

const int N = 1e6 + 7;

void ask(int x1 , int y1 , int x2 , int y2) {
	w << "? " << x1 << " " << y1 << " " << x2 << " " << y2 << e;
}

int main() {
	int n;
	cin >> n;
	int x1 = 1 , y1 = 1 , x2 = n , y2 = 1;
	int xx1  = -1, yy1  = -1, xx2 = -1 , yy2 = -1;
	int res;
	while(y1 <= n) {
		ask(x1 , y1 , x2 , y1);
		cin >> res;
		if(res % 2) {
			if(yy1 == -1) {
				yy1 = y1;
			} else {
				yy2 = y1;
			}
		}
		y1++;
	}

	x1 = 1 , y1 = 1, x2 = 1 , y2 = n;
	while(x1 <= n) {
		ask(x1 , y1 , x1 , y2);
		cin >> res;
		if(res % 2) {
			if(xx1 == -1) {
				xx1 = x1;
			} else {
				xx2 = y2;
				break;
			}
		}
		x1++;
	}
	if(xx1 == -1) {
		int l = 1 , h = n;
		int ans;
		while(l <= h) {
			int mid = (l + h) / 2;
			ask(1 , yy1 , mid , yy1);
			cin >> res;
			if(res == 1) {
				ans = mid;
				h = mid - 1;
			} else {
				l = mid + 1;
			}
		}
		cout << "! " << ans << " " << yy1 << " " << ans << " " << yy2 << endl;
	} else if(yy1 == -1) {
		int l = 1 , h =  n;
		int ans ;
		while(l <= h) {
			int mid = (l + h) / 2;
			ask(xx1 , 1 , xx1 , mid);
			cin >> res;
			if(res == 1) {
				ans = mid;
				h = mid - 1;
			} else{
				l = mid + 1;
			}
		}
		cout << "! " << xx1 << " " << ans << " " << xx2 << " " << ans << endl;
	} else {
			int ax1,ay1,ax2,ay2;
			ask(xx1 , yy1 , xx1 , yy1);
			cin >> res;
			if(res%2==1)
			{
				ax1=xx1,ay1=yy1;
				ax2=xx2,ay2=yy2;
			}
			else
			{
				ax1=xx1,ay1=yy2;
				ax2=xx2,ay2=yy1;
			}
			cout<<"! "<<ax1<<" "<<ay1<<" "<<ax2<<" "<<ay2<<endl;
	}
}


#include <bits/stdc++.h>
#define ll long long
#define w cout
#define e endl
using namespace std;

const int N = 1e6 + 7;

void ask(int x1 , int y1 , int x2 , int y2) {
	w << "? " << x1 << " " << y1 << " " << x2 << " " << y2 << e;
}

int main() {
	int n;
	cin >> n;
	int x1 = 1 , y1 = 1 , x2 = n , y2 = 1;
	int xx1  = -1, yy1  = -1, xx2 = -1 , yy2 = -1;
	int res;
	for(int i = 1 ; i <= n ; i ++ ) {
		ask(1 , i , n , i);
		cin >> res;
		if(res % 2) {
			if(yy1 == -1) {
				yy1 = i;
			} else {
				yy2 = i;
			}
		}
	}

	x1 = 1 , y1 = 1, x2 = 1 , y2 = n;
	for(int i = 1 ; i <= n ;i ++ ) {
		ask(i , 1 , i , n);
		cin >> res;
		if(res % 2) {
			if(xx1 == -1) {
				xx1 = i;
			} else {
				xx2 = i;
			}
		}
	}
	if(xx1 == -1) {
		int l = 1 , h = n;
		int ans;
		while(l <= h) {
			int mid = (l + h) / 2;
			ask(1 , yy1 , mid , yy1);
			cin >> res;
			if(res %2 == 1) {
				ans = mid;
				h = mid - 1;
			} else {
				l = mid + 1;
			}
		}
		cout << "! " << ans << " " << yy1 << " " << ans << " " << yy2 << endl;
	} else if(yy1 == -1) {
		int l = 1 , h =  n;
		int ans ;
		while(l <= h) {
			int mid = (l + h) / 2;
			ask(xx1 , 1 , xx1 , mid);
			cin >> res;
			if(res % 2 == 1) {
				ans = mid;
				h = mid - 1;
			} else{
				l = mid + 1;
			}
		}
		cout << "! " << xx1 << " " << ans << " " << xx2 << " " << ans << endl;
	} else {
			cout<<"! "<<xx1<<" "<<yy1<<" "<<xx2<<" "<<yy2<<endl;
	}
}