diff --git a/bin/start.dart b/bin/start.dart new file mode 100644 index 0000000..3bf7647 --- /dev/null +++ b/bin/start.dart @@ -0,0 +1,38 @@ +library start; + +import 'dart:io'; +import 'package:args/args.dart'; + +import 'startc/startc.dart'; +import 'starti/starti.dart'; + +ArgResults options() { + final options = new Options(); + final argv = options.arguments; + + final parser = new ArgParser(); + parser.addFlag('debug', help: 'Print debugging info', defaultsTo: false); + parser.addFlag('show', help: 'Print IR', defaultsTo: false); + parser.addFlag('run', help: 'Execute code', defaultsTo: true); + parser.addFlag('stats', help: 'Show stats', defaultsTo: false); + return parser.parse(argv); +} + +void main() +{ + final args = options(); + if (args.rest.length != 1) + throw 'Filename expected'; + final filename = args.rest[0]; + + final file = new File(filename); + final input = file.readAsStringSync(); + final output = compile(input); + if (args['show']) + print(output); + if (args['run']) { + final stats = execute(output, debug: args['debug']); + if (args['stats']) + print('\n$stats'); + } +} \ No newline at end of file diff --git a/bin/startc/startc.dart b/bin/startc/startc.dart new file mode 100644 index 0000000..0e21909 --- /dev/null +++ b/bin/startc/startc.dart @@ -0,0 +1,815 @@ +library startc; + +part 'startg.dart'; +part 'starts.dart'; + +final _buffer = new StringBuffer(); + +void printf(message) { + _buffer.write(message.toString()); +} + +Token token; +int instruction; +int topOfStack; +Node globalScope = new Node(); +Node nullObject; + + +// This function searches for an object named id in the root scope. If +// found, a pointer to the object is returned. Otherwise, null is returned. +Node findObj(Node root, String id) { + int maxlev; + Node curr; + Node obj; + + maxlev = -1; + curr = root; + obj = null; + while (curr != null) { + while ((curr != null) && ((strcmp(curr.name, id) != 0) + || (curr.lev <= maxlev))) { + curr = curr.next; + } + if (curr != null) { + obj = curr; + maxlev = curr.lev; + curr = curr.next; + } + } + if (obj != null) { + if (((obj.kind == KIND_VAR) || (obj.kind == KIND_FLD)) && ((obj.lev != 0) + && (obj.lev != currentLevel))) { + error("object cannot be accessed"); + } + } + return obj; +} + + +// This function adds a new object at the end of the object list pointed to +// by root and returns a pointer to the new node. +Node addToList(Node root, String id) { + Node curr; + + curr = null; + if (root == null) { // first object + curr = new Node(); + root = curr; + curr.kind = null; + curr.lev = currentLevel; + curr.next = null; + curr.dsc = null; + curr.type = null; + curr.name = id; + curr.val = 0; + } else { // linked list is not empty, add to the end of the list + curr = root; + while (((curr.lev != currentLevel) || (strcmp(curr.name, id) != 0)) + && (curr.next != null)) { + curr = curr.next; + } + if ((strcmp(curr.name, id) == 0) && (curr.lev == currentLevel)) { + error("duplicate identifier"); + } else { + curr.next = new Node(); + curr = curr.next; + curr.kind = null; + curr.lev = currentLevel; + curr.next = null; + curr.dsc = null; + curr.type = null; + curr.name = id; + curr.val = 0; + } + } + return curr; +} + + +// This function initializes the fields of an object. +void initObject(Node obj, Kind clss, Node dsc, TypeDesc type, int val) { + obj.kind = clss; + obj.next = null; + obj.dsc = dsc; + obj.type = type; + obj.val = val; +} + + +// Similar to InitObj(), but also initalizes the ENTRY POINT of a procedure. +void initProcObj(Node obj, Kind clss, Node dsc, TypeDesc type, Node entrypt) { + obj.kind = clss; + obj.next = null; + obj.dsc = dsc; + obj.type = type; + obj.jmpTrue = entrypt; +} + + +/*************************************************************************/ + +Node factor(Node x) +{ + Node obj; + + switch (token) { + case TOKEN_NEW: + token = nextToken(); + var ctr = findObj(globalScope, currentAsString); + if (ctr == null || ctr.kind != KIND_TYPE) + error("Badly formed constructor $currentAsString"); + var size = new Node(); + token = nextToken(); + // TODO(vsm): Cleanup. + if (ctr.type == listType && token == TOKEN_LSS) { + token = nextToken(); + assert(token == TOKEN_IDENT && currentAsString == "int"); + token = nextToken(); + assert(token == TOKEN_GTR); + token = nextToken(); + } + if (token != TOKEN_LPAREN) error("'(' expected"); + token = nextToken(); + if (ctr.type == listType) { + // Argument expected. + size = expression(size); + size = unbox(size); + } else { + makeConstNodeDesc(size, intType, ctr.type.size); + } + if (token != TOKEN_RPAREN) error("')' expected"); + token = nextToken(); + size = load(size); + x = putOpNodeNode(inew, ctr, size, ctr.type); + break; + case TOKEN_IDENT: + obj = findObj(globalScope, currentAsString); + if (obj == null) error("unknown identifier"); + makeNodeDesc(x, obj); + token = nextToken(); // consume ident before calling Designator + x = designatorM(x); + x = load(x); + break; + case TOKEN_NUMBER: + makeConstNodeDesc(x, intType, currentAsInt); + token = nextToken(); + break; + case TOKEN_LPAREN: + token = nextToken(); + x = expression(x); + if (token != TOKEN_RPAREN) error("')' expected"); + token = nextToken(); + break; + default: error("factor expected"); break; + } + return x; +} + + +Node term(Node x) +{ + Token op; + Node y; + + x = factor(x); + while ((token == TOKEN_TIMES) || (token == TOKEN_DIV) || (token == TOKEN_MOD)) { + op = token; + token = nextToken(); + y = new Node(); + y = factor(y); + x = op2(op, x, y); + } + return x; +} + + +Node simpleExpression(Node x) +{ + Token op; + Node y; + + if ((token == TOKEN_PLUS) || (token == TOKEN_MINUS)) { + op = token; + token = nextToken(); + x = term(x); + x = op1(op, x); + } else { + x = term(x); + } + while ((token == TOKEN_PLUS) || (token == TOKEN_MINUS)) { + op = token; + token = nextToken(); + y = new Node(); + y = term(y); + x = op2(op, x, y); + } + return x; +} + + +Node equalityExpr(Node x) +{ + Token op; + Node y; + + x = simpleExpression(x); + if ((token == TOKEN_LSS) || (token == TOKEN_LEQ) || (token == TOKEN_GTR) + || (token == TOKEN_GEQ)) { + y = new Node(); + op = token; + token = nextToken(); + y = simpleExpression(y); + x = relation(op, x, y); + } + return x; +} + + +Node expression(Node x) +{ + Token op; + Node y; + + x = equalityExpr(x); + if ((token == TOKEN_EQL) || (token == TOKEN_NEQ)) { + op = token; + token = nextToken(); + y = new Node(); + y = equalityExpr(y); + x = relation(op, x, y); + } + return x; +} + +/*************************************************************************/ + + +void fieldList(TypeDesc type) +{ + Node curr; + + type.fields = variableDeclaration(type.fields); + while (token != TOKEN_RBRACE) { + type.fields = variableDeclaration(type.fields); + } + curr = type.fields; + if (curr == null) error("empty structs are not allowed"); + // vtable + type.size += intType.size; + while (curr != null) { + curr.kind = KIND_FLD; + curr.val = type.size; + type.size += intType.size; + if (type.size > 0x7fffffff) error("struct too large"); + curr = curr.next; + } +} + + +TypeDesc classType(TypeDesc type) +{ + Node obj; + int oldinstruct; + String id; + + assert(token == TOKEN_CLASS); + token = nextToken(); + if (token != TOKEN_IDENT) error("identifier expected"); + id = currentAsString; + token = nextToken(); + if (token != TOKEN_LBRACE) { + obj = findObj(globalScope, id); + if (obj == null) error("unknown struct type"); + if ((obj.kind != KIND_TYPE) || (obj.type.form != FORM_CLASS)) + error("struct type expected"); + type = obj.type; + } else { + token = nextToken(); + type = new TypeDesc(id); + type.form = FORM_CLASS; + type.fields = null; + type.size = 0; + oldinstruct = instruction; + instruction = 1; + obj = addToList(globalScope, id); + // TODO(vsm): Abstract 8 to addr size. + initObject(obj, KIND_TYPE, null, type, 8); + + fieldList(type); + instruction = oldinstruct; + if (token != TOKEN_RBRACE) error("'}' expected"); + token = nextToken(); + } + return type; +} + + +TypeDesc typeDesc(TypeDesc t) +{ + Node obj; + + if (token != TOKEN_IDENT) error("identifier expected"); + obj = findObj(globalScope, currentAsString); + if (obj == null) error("unknown type $currentAsString"); + if (obj.kind != KIND_TYPE) error("type expected"); + t = obj.type; + token = nextToken(); + return t; +} + + +Node ident(Node root, TypeDesc type) +{ + Node obj; + + if (type == listType) { + // List + type.base = dynamicType; + } + + if (token != TOKEN_IDENT) error("identifier expected"); + obj = addToList(root, currentAsString); + if (root == null) root = obj; + token = nextToken(); + + if (instruction == 0) topOfStack -= intType.size; //type.size; + initObject(obj, KIND_VAR, null, type, topOfStack); + return root; +} + + +Node identList(Node root, TypeDesc type) +{ + root = ident(root, type); + while (token == TOKEN_COMMA) { + token = nextToken(); + root = ident(root, type); + } + return root; +} + + +Node variableDeclaration(Node root) +{ + TypeDesc type; + + type = typeDesc(type); + root = identList(root, type); + if (token != TOKEN_SEMICOLON) error("';' expected"); + token = nextToken(); + return root; +} + + +/*************************************************************************/ + + +Node designatorM(Node x) +{ + Node obj; + Node y; + + // CSSident already consumed + bool first = true; + while ((token == TOKEN_PERIOD) || (token == TOKEN_LBRAK)) { + if (!first) { + x = load(x); + } else { + first = false; + } + if (token == TOKEN_PERIOD) { + token = nextToken(); + //if (x.type.form != CSGStruct) CSSError("struct type expected"); + if (token != TOKEN_IDENT) error("field identifier expected"); + if (x.type != dynamicType) { + obj = findObj(x.type.fields, currentAsString); + token = nextToken(); + if (obj == null) error("unknown identifier"); + x = fieldAddress(x, obj); + } else { + Node dyn = new Node(); + makeDynamicNodeDesc(dyn, currentAsString); + token = nextToken(); + x = fieldAddress(x, dyn); + } + } else { + token = nextToken(); + if (x.type != dynamicType && x.type.form != FORM_LIST) { + error("array type expected"); + } + y = new Node(); + y = expression(y); + x = indexAddress(x, y); + if (token != TOKEN_RBRAK) error("']' expected"); + token = nextToken(); + } + } + return x; +} + + +void assignmentM(Node x) +{ + Node y; + + assert(x != null); + // CSSident already consumed + y = new Node(); + x = designatorM(x); + if (token != TOKEN_BECOMES) error("'=' expected"); + token = nextToken(); + y = expression(y); + store(x, y); + if (token != TOKEN_SEMICOLON) error("';' expected"); + token = nextToken(); +} + + +void expList(Node proc) +{ + Node curr; + Node x; + + x = new Node(); + curr = proc.dsc; + x = expression(x); + if ((curr == null) || (curr.dsc != proc)) error("too many parameters"); + if (x.type != curr.type && x.type != dynamicType + && curr.type != dynamicType) error("incorrect type"); + x = parameter(x, curr.type, curr.kind); + curr = curr.next; + while (token == TOKEN_COMMA) { + x = new Node(); + token = nextToken(); + x = expression(x); + if ((curr == null) || (curr.dsc != proc)) error("too many parameters"); + // if (x.type != curr.type) CSSError("incorrect type"); + x = parameter(x, curr.type, curr.kind); + curr = curr.next; + } + if ((curr != null) && (curr.dsc == proc)) error("too few parameters"); +} + + +void procedureCallM(Node obj, Node x) +{ + Node y; + + // CSSident already consumed + makeNodeDesc(x, obj); + if (token != TOKEN_LPAREN) error("'(' expected"); + token = nextToken(); + if (x.kind == KIND_SPROC) { + y = new Node(); + if (x.val == 1) { + if (token != TOKEN_IDENT) error("identifier expected"); + obj = findObj(globalScope, currentAsString); + if (obj == null) error("unknown identifier"); + makeNodeDesc(y, obj); + token = nextToken(); // consume ident before calling Designator + y = designatorM(y); + } else if (x.val == 2) { + y = expression(y); + } + ioCall(x, y); + } else { + assert(x.type == null); + if (token != TOKEN_RPAREN) { + expList(obj); + } else { + if ((obj.dsc != null) && (obj.dsc.dsc == obj)) { + error("too few parameters"); + } + } + call(x); + } + if (token != TOKEN_RPAREN) error("')' expected"); + token = nextToken(); + if (token != TOKEN_SEMICOLON) error("';' expected"); + token = nextToken(); +} + + +// This function parses if statements - helpful for CFG creation. +void ifStatement() +{ + Node label; + Node x; + + x = new Node(); + assert(token == TOKEN_IF); + token = nextToken(); + label = initLabel(label); + if (token != TOKEN_LPAREN) error("'(' expected"); + token = nextToken(); + x = expression(x); + // TODO(vsm): Restore. + // CSGTestBool(x); + fixLink(x.jmpFalse); + if (token != TOKEN_RPAREN) error("')' expected"); + token = nextToken(); + if (token != TOKEN_LBRACE) error("'{' expected"); + token = nextToken(); + statementSequence(); + if (token != TOKEN_RBRACE) error("'}' expected"); + token = nextToken(); + if (token == TOKEN_ELSE) { + token = nextToken(); + label = forwardJump(label); + fixLink(x.jmpTrue); + if (token != TOKEN_LBRACE) error("'{' expected"); + token = nextToken(); + statementSequence(); + if (token != TOKEN_RBRACE) error("'}' expected"); + token = nextToken(); + } else { + fixLink(x.jmpTrue); + } + fixLink(label); +} + + +// This function parses while statements - helpful for CFG creation. +void whileStatement() +{ + Node label; + Node x; + + x = new Node(); + assert(token == TOKEN_WHILE); + token = nextToken(); + if (token != TOKEN_LPAREN) error("'(' expected"); + token = nextToken(); + label = setLabel(label); + x = expression(x); + // CSGTestBool(x); + fixLink(x.jmpFalse); + if (token != TOKEN_RPAREN) error("')' expected"); + token = nextToken(); + if (token != TOKEN_LBRACE) error("'{' expected"); + token = nextToken(); + statementSequence(); + if (token != TOKEN_RBRACE) error("'}' expected"); + token = nextToken(); + backJump(label); + fixLink(x.jmpTrue); +} + + +void statement() +{ + Node obj; + Node x; + + switch (token) { + case TOKEN_IF: ifStatement(); break; + case TOKEN_WHILE: whileStatement(); break; + case TOKEN_IDENT: + obj = findObj(globalScope, currentAsString); + if (obj == null) error("unknown identifier $currentAsString"); + token = nextToken(); + x = new Node(); + if (token == TOKEN_LPAREN) { + procedureCallM(obj, x); + } else { + makeNodeDesc(x, obj); + assignmentM(x); + } + break; + case TOKEN_SEMICOLON: break; /* empty statement */ + default: error("unknown statement"); + } +} + + +void statementSequence() +{ + while (token != TOKEN_RBRACE) { + statement(); + } +} + + +/*************************************************************************/ + + +int formalParameter(Node root, int paddr) +{ + Node obj; + TypeDesc type; + + type = typeDesc(type); + + if (token != TOKEN_IDENT) error("identifier expected"); + assert(root != null); + obj = addToList(root, currentAsString); + token = nextToken(); + if (token == TOKEN_LBRAK) error("no array parameters allowed"); + initObject(obj, KIND_VAR, root, type, 0); + paddr += intType.size; + return paddr; +} + + +void formalParameters(Node root) +{ + Node curr; + int paddr; + + paddr = 16; + paddr = formalParameter(root, paddr); + while (token == TOKEN_COMMA) { + token = nextToken(); + paddr = formalParameter(root, paddr); + } + curr = root.next; + while (curr != null) { + paddr -= intType.size; //curr.type.size; + curr.val = paddr; + curr = curr.next; + } +} + + +Node procedureHeading(Node proc) +{ + String name; + + if (token != TOKEN_IDENT) error("function name expected"); + name = currentAsString; + proc = addToList(globalScope, name); + initProcObj(proc, KIND_PROC, null, null, pc); + adjustLevel(1); + token = nextToken(); + if (token != TOKEN_LPAREN) error("'(' expected"); + token = nextToken(); + if (token != TOKEN_RPAREN) { + formalParameters(proc); + } + if (token != TOKEN_RPAREN) error("')' expected"); + token = nextToken(); + if (strcmp(name, "main") == 0) entryPoint(); + return proc; +} + + +Node procedureBody(Node proc) +{ + int returnsize; + Node curr; + + topOfStack = 0; + while ((token == TOKEN_IDENT) && + (findObj(globalScope, currentAsString).kind == KIND_TYPE)) { + proc = variableDeclaration(proc); + } + assert(proc.dsc == null); + proc.dsc = proc.next; + if (-topOfStack > 32768) error("maximum stack frame size of 32kB exceeded"); + enter(-topOfStack); + returnsize = 0; + curr = proc.dsc; + while ((curr != null) && (curr.dsc == proc)) { + returnsize += 8; + curr = curr.next; + } + statementSequence(); + ret(returnsize); + adjustLevel(-1); + return proc; +} + + +void procedureDeclaration() +{ + Node proc; + + assert(token == TOKEN_VOID); + token = nextToken(); + proc = procedureHeading(proc); + if (token != TOKEN_LBRACE) error("'{' expected"); + token = nextToken(); + proc = procedureBody(proc); + if (token != TOKEN_RBRACE) error("'}' expected"); + token = nextToken(); + proc.next = null; // cut off rest of list +} + + +void program() +{ + open(); + topOfStack = 32768; + instruction = 0; + while ((token != TOKEN_VOID) && (token != TOKEN_EOF)) { + if (token == TOKEN_CLASS) { + classType(null); + } else { + globalScope = variableDeclaration(globalScope); + } + } + if (token != TOKEN_VOID) error("procedure expected"); + while (token == TOKEN_VOID) { + procedureDeclaration(); + } + if (token != TOKEN_EOF) error("unrecognized characters at end of file"); +} + + +/*************************************************************************/ + + +Node insertObj(Node root, Kind clss, TypeDesc type, String name, int val) +{ + Node curr; + + if (root == null) { + root = new Node(); + curr = root; + } else { + curr = root; + if (strcmp(curr.name, name) == 0) error("duplicate symbol"); + while (curr.next != null) { + curr = curr.next; + if (strcmp(curr.name, name) == 0) error("duplicate symbol"); + } + curr.next = new Node(); + curr = curr.next; + } + curr.next = null; + curr.kind = clss; + curr.type = type; + curr.name = name; + curr.val = val; + curr.dsc = null; + curr.lev = 0; + return root; +} + +void printTypes() { + for(var sym = globalScope; sym != null; sym = sym.next) { + if (sym.kind == KIND_TYPE) { + if (sym.type.form == FORM_CLASS) { + printf(" type ${sym.name}:"); + for (var field = sym.type.fields; field != null; + field = field.next) { + final typeName = field.type.name; + printf(" ${field.name}#${field.val}:$typeName"); + } + printf("\n"); + } + } + } +} + +void printGlobals() { + for(var sym = globalScope; sym != null; sym = sym.next) { + if (sym.kind == KIND_VAR) { + final typeName = sym.type.name; + printf(" global ${sym.name}#${sym.val}:$typeName"); + + printf("\n"); + } + } +} + +void printMethods() { + for(var sym = globalScope; sym != null; sym = sym.next) { + if (sym.kind == KIND_PROC) { + printf(" method ${sym.name}@${sym.jmpTrue.line}:"); + for (var param = sym.dsc; param != null; param = param.next) { + final typeName = param.type.name; + printf(" ${param.name}#${param.val}:$typeName"); + } + + printf("\n"); + } + } +} + +String compile(String input) +{ + initialParser(); + globalScope = null; + globalScope = insertObj(globalScope, KIND_TYPE, intType, "int", 8); + globalScope = insertObj(globalScope, KIND_TYPE, listType, "List", 8); + globalScope = insertObj(globalScope, KIND_TYPE, dynamicType, "dynamic", 8); + globalScope = insertObj(globalScope, KIND_SPROC, null, "WriteLong", 2); + globalScope = insertObj(globalScope, KIND_SPROC, null, "WriteLine", 3); + + // TODO(vsm): Make this a built-in token. + globalScope = insertObj(globalScope, KIND_CONST, intType, "null", 0); + nullObject = findObj(globalScope, "null"); + + initializeTokenizer(input); + token = nextToken(); + program(); + assignLineNumbers(); + printTypes(); + printMethods(); + printGlobals(); + decode(); + return _buffer.toString(); +} + diff --git a/bin/startc/startg.dart b/bin/startc/startg.dart new file mode 100644 index 0000000..27172e9 --- /dev/null +++ b/bin/startc/startg.dart @@ -0,0 +1,778 @@ +part of startc; + +/* kind */ +class Kind { + const Kind._(this._value); + final _value; + toString() => 'KIND_${_value.toUpperCase()}'; +} + +const KIND_VAR = const Kind._('Var'); +const KIND_CONST = const Kind._('Const'); +const KIND_FLD = const Kind._('Fld'); +const KIND_TYPE = const Kind._('Type'); +const KIND_PROC = const Kind._('Proc'); +const KIND_SPROC = const Kind._('SProc'); +const KIND_ADDR = const Kind._('Addr'); +const KIND_DYN_ADDR = const Kind._('DynAddr'); +const KIND_INST = const Kind._('Inst'); + + +/* form */ +class Form { + const Form._(this._value); + final _value; + toString() => 'FORM_${_value.toUpperCase()}'; +} + +const FORM_INTEGER = const Form._('Integer'); +const FORM_BOOLEAN = const Form._('Boolean'); +const FORM_LIST = const Form._('List'); +const FORM_CLASS = const Form._('Class'); +const FORM_POINTER = const Form._('Pointer'); + +class TypeDesc { + TypeDesc(this.name); + + final String name; + Form form; + + Node fields; // linked list of the fields in a struct + int size = 0; // total size of the type + TypeDesc base; // base type (for list or pointer) + TypeDesc _pointer; // cached pointer type. Use the ref function. +} + +class Node { + Kind kind; // Var, Const, Field, Type, Proc, SProc, Addr, Inst + int lev = 0; // 0 = global, 1 = local + Node next; // linked list of all objects in same scope + Node dsc; // Proc: link to procedure scope (head) + TypeDesc type; // type + String name; // name + int val = 0; // Const: value; Var: addr; Fld: offset; SProc: num; Type: size + Opcode op; // operation of instruction + Node x, y, z; // the operands + Node prv, nxt; // previous and next instruction + int line = 0; // line number for printing purposes + Node jmpTrue, jmpFalse; // Jmp: true and false chains; Proc: true = entry + Node original; // Pointer to original node object if a copy was made +} + +TypeDesc intType, boolType, dynamicType, listType; +int currentLevel = 0; +Node pc; + +class Opcode { + const Opcode._(this._value); + final _value; + toString() => '$_value'; +} + +// Math opcodes. +const ineg = const Opcode._('neg'); +const iadd = const Opcode._('add'); +const isub = const Opcode._('sub'); +const imul = const Opcode._('mul'); +const idiv = const Opcode._('div'); +const imod = const Opcode._('mod'); + +// Comparison opcodes. +const icmpeq = const Opcode._('cmpeq'); +const icmplt = const Opcode._('cmplt'); +const icmple = const Opcode._('cmple'); + +// Function call opcodes. +const inop = const Opcode._('nop'); +const ientrypc = const Opcode._('entrypc'); +const iparam = const Opcode._('param'); +const icall = const Opcode._('call'); +const ienter = const Opcode._('enter'); +const iret = const Opcode._('ret'); + +// Other control flow opcodes. +const iblbs = const Opcode._('blbs'); +const iblbc = const Opcode._('blbc'); +const ibr = const Opcode._('br'); + +// Memory / variable access opcodes. +const iload = const Opcode._('load'); +const istore = const Opcode._('store'); +const imove = const Opcode._('move'); + +// Output opcodes. +const iwrite = const Opcode._('write'); +const iwrl = const Opcode._('wrl'); + +// Memory allocation. +const inew = const Opcode._('new'); +const ibox = const Opcode._('box'); +const iunbox = const Opcode._('unbox'); + +// Safety check opcodes. +const ichecknull = const Opcode._('checknull'); +const icheckbounds = const Opcode._('checkbounds'); +const ichecktype = const Opcode._('checktype'); + +// Dynamic access opcodes. +const ilddynamic = const Opcode._('lddynamic'); +const istdynamic = const Opcode._('stdynamic'); + +Node code, entrypc, fp, gp; + +/*****************************************************************************/ + +// A pointer to the underlying type. +TypeDesc ref(TypeDesc t) { + assert(t.form != FORM_POINTER); + if (t._pointer != null) return t._pointer; + TypeDesc reftype = new TypeDesc('${t.name}*'); + reftype.form = FORM_POINTER; + reftype.size = intType.size; + reftype.base = t; + t._pointer = reftype; + return reftype; +} + +TypeDesc deref(TypeDesc t) { + assert(t.form == FORM_POINTER); + return t.base; +} + +// This function adds a new instruction at the end of the instruction list +// and sets the operation to op and the operands to x and y. +Node putOpNodeNodeNode(Opcode op, Node x, Node y, Node z, TypeDesc type) +{ + Node i; + + pc.nxt = new Node(); + i = pc; + pc = pc.nxt; + pc.kind = KIND_INST; + pc.op = inop; + pc.prv = i; + pc.nxt = null; + + assert(i != null); + i.kind = KIND_INST; + i.op = op; + i.x = x; + i.y = y; + i.z = z; + i.type = type; + i.lev = 0; + + return i; +} + +Node putOpNodeNode(Opcode op, Node x, Node y, TypeDesc type) +{ + return putOpNodeNodeNode(op, x, y, null, type); +} + +Node putOpNode(Opcode op, Node x, TypeDesc type) +{ + return putOpNodeNode(op, x, null, type); +} + + +Node putOp(Opcode op, TypeDesc type) +{ + return putOpNodeNode(op, null, null, type); +} + + +void makeDynamicNodeDesc(Node x, String fieldName) { + x.kind = KIND_FLD; + x.type = dynamicType; + x.lev = currentLevel; + x.name = fieldName; +} + + +// This function SETS the member fields of a CSGNode object. +void makeConstNodeDesc(Node x, TypeDesc typ, int val) +{ + x.kind = KIND_CONST; + x.type = typ; + x.val = val; + x.lev = currentLevel; +} + + +// This function make a COPY of a CSGNode object +void makeNodeDesc(Node x, Node y) { + int i; + + x.kind = y.kind; + x.type = y.type; + x.val = y.val; + x.lev = y.lev; + x.jmpTrue = y.jmpTrue; + x.name = y.name; + + // Make the 'original' field of the copy to point back to original Node object + if (y.original == null) { + x.original = y; + } else { + x.original = y.original; + } +} + + +Node dynamicAddr(Node ref, Node field) { + Node addr = new Node(); + addr.kind = KIND_DYN_ADDR; + addr.x = ref; + addr.y = field; + return addr; +} + +/*****************************************************************************/ + +Node unbox(Node x) { + if (x.type == intType) return x; // Already unboxed; + if (x.type == dynamicType) { + return putOpNode(iunbox, x, intType); + } + error("Cannot unbox non-int type"); +} + +Node box(Node x) { + if (isNull(x)) return x; + + if (x.type == boolType) { + // TODO(vsm): Support this. + error("Cannot box bool type"); + } + if (x.type == intType) { + return putOpNode(ibox, x, dynamicType); + } + return x; +} + +Node checkType(Node x, TypeDesc t) { + if(x.type == t) + return x; + Node type = new Node(); + initObject(type, KIND_TYPE, null, t, 8); + x = putOpNodeNode(ichecktype, x, type, t); + return x; +} + +void checkBounds(Node list, Node index) { + putOpNodeNode(icheckbounds, list, index, null); +} + +Node checkNull(Node x) { + x = putOpNode(ichecknull, x, x.type); + return x; +} + +Node load(Node x) { + if (x.kind == KIND_DYN_ADDR) { + x = putOpNodeNode(ilddynamic, x.x, x.y, dynamicType); + } else if (x.kind == KIND_ADDR) { + x = putOpNode(iload, x, deref(x.type)); + } else if ((x.kind == KIND_VAR) && (x.lev == 0)) { + final type = x.type; + x = putOpNodeNode(iadd, x, gp, ref(type)); + x = putOpNode(iload, x, type); + } else if (x.kind == KIND_VAR) { + assert(x.lev != 0); + } + return x; +} + +Node fieldAddress(Node x, Node y) { /* x = x.y */ + if (x.kind == KIND_VAR) { + if (x.lev == 0) { + final type = x.type; + x = putOpNodeNode(iadd, x, gp, ref(type)); + x = putOpNode(iload, x, type); + } + } + x = checkNull(x); + if (y.type == dynamicType) { + x = dynamicAddr(x, y); + } else { + x = putOpNodeNode(iadd, x, y, ref(y.type)); + x.kind = KIND_ADDR; + } + return x; +} + + +Node indexAddress(Node x, Node y) { /* x = x[y] */ + Node baseoffset = new Node(); + makeConstNodeDesc(baseoffset, intType, intType.size*2); + + final basetype = (x.type == dynamicType) ? dynamicType : x.type.base; + Node indexoffset = new Node(); + makeConstNodeDesc(indexoffset, intType, intType.size); + + if (x.kind != KIND_ADDR) { + if (x.kind != KIND_INST) { + if (x.lev == 0) { + final type = x.type; + x = putOpNodeNode(iadd, x, gp, ref(type)); + x = putOpNode(iload, x, type); + } + } + } + x = checkNull(x); + x = checkType(x, listType); + y = unbox(y); + checkBounds(x, y); + x = putOpNodeNode(iadd, x, baseoffset, ref(basetype)); + y = op2(TOKEN_TIMES, y, indexoffset); + + x = putOpNodeNode(iadd, x, y, ref(basetype)); + x.kind = KIND_ADDR; + return x; +} + + +/*****************************************************************************/ + + +// The following five functions deal with control transfer. Mostly, they +// remember where the control transferring instructions are so that their +// targets can be set later if the targets have not yet been compiled. + + +Node initLabel(Node lbl) { + return null; +} + +Node setLabel(Node lbl) { + return pc; +} + + +// This function sets the target of a forward jump, call, or branch once +// the target is being compiled. +void fixLink(Node lbl) { + if (lbl != null) { + if ((lbl.op == icall) || (lbl.op == ibr)) { + lbl.x = pc; + } else { + lbl.y = pc; + } + } +} + + +void backJump(Node lbl) { + putOpNode(ibr, lbl, null); +} + + +Node forwardJump(Node lbl) { + lbl = putOpNode(ibr, lbl, null); + lbl = pc.prv; + return lbl; +} + + +/*****************************************************************************/ + + +void testInt(Node x) { + if (x.type.form != FORM_INTEGER) error("type integer expected"); +} + + +void testBool(Node x) { + if (x.type.form != FORM_BOOLEAN) error("type boolean expected"); +} + + +/*****************************************************************************/ + + +Node op1(Token op, Node x) { /* x = op x */ + x = unbox(x); + if (op == TOKEN_PLUS) { + testInt(x); + } else if (op == TOKEN_MINUS) { + testInt(x); + x = putOpNode(ineg, x, x.type); + } + return x; +} + + +Node op2(Token op, Node x, Node y) /* x = x op y */ +{ + assert(x != null); + assert(y != null); + x = unbox(x); + y = unbox(y); + + switch (op) { + case TOKEN_PLUS: x = putOpNodeNode(iadd, x, y, intType); break; + case TOKEN_MINUS: x = putOpNodeNode(isub, x, y, intType); break; + case TOKEN_TIMES: x = putOpNodeNode(imul, x, y, intType); break; + case TOKEN_DIV: x = putOpNodeNode(idiv, x, y, intType); break; + case TOKEN_MOD: x = putOpNodeNode(imod, x, y, intType); break; + } + return x; +} + + +Node relation(Token op, Node x, Node y) +{ + Node t; + + if (op != TOKEN_EQL) { + x = unbox(x); + y = unbox(y); + } else { + // TODO(vsm): Implement iisnull. + if (!isNull(x) && !isNull(y)) { + x = unbox(x); + y = unbox(y); + } + } + + switch (op) { + case TOKEN_EQL: + t = putOpNodeNode(icmpeq, x, y, boolType); + x = putOpNode(iblbc, t, null); + break; + case TOKEN_NEQ: + t = putOpNodeNode(icmpeq, x, y, boolType); + x = putOpNode(iblbs, t, null); + break; + case TOKEN_LSS: + t = putOpNodeNode(icmplt, x, y, boolType); + x = putOpNode(iblbc, t, null); + break; + case TOKEN_GTR: + t = putOpNodeNode(icmple, x, y, boolType); + x = putOpNode(iblbs, t, null); + break; + case TOKEN_LEQ: + t = putOpNodeNode(icmple, x, y, boolType); + x = putOpNode(iblbc, t, null); + break; + case TOKEN_GEQ: + t = putOpNodeNode(icmplt, x, y, boolType); + x = putOpNode(iblbs, t, null); + break; + } + x.jmpFalse = null; + x.jmpTrue = pc.prv; + return x; +} + + +/*****************************************************************************/ + +bool isNull(Node x) { + // TODO(vsm): Make this more robust. + return x.name == "null"; +} + + +void store(Node x, Node y) { /* x = y */ + assert(x != null); + assert(y != null); + + var storedType = x.type; + if (x.kind == KIND_INST || x.kind == KIND_ADDR) { + if (storedType.form != FORM_POINTER) error("expected pointer type"); + storedType = storedType.base; + } else if (x.kind == KIND_DYN_ADDR) { + storedType = dynamicType; + } + + if (y.type == null) return; + if (storedType == intType) { + y = unbox(y); + } else if (storedType == dynamicType) { + y = box(y); + } else if (y.type == dynamicType) { + y = checkType(y, storedType); + } else { + if (!isNull(y) && + storedType.form != y.type.form) error("incompatible assignment"); + } + + if (x.kind == KIND_DYN_ADDR) { + x = putOpNodeNodeNode(istdynamic, y, x.x, x.y, null); + } else if ((x.kind == KIND_INST) || (x.kind == KIND_ADDR)) { + // TODO(vsm): Restore? + // assert(x.type.form == FORM_POINTER && x.type.base == y.type); + putOpNodeNode(istore, y, x, null); + } else if ((x.kind == KIND_VAR) && (x.lev == 0)) { + x = putOpNodeNode(iadd, x, gp, ref(x.type)); + putOpNodeNode(istore, y, x, null); + } else { + assert(x.kind == KIND_VAR); + putOpNodeNode(imove, y, x, null); + } +} + + +void adjustLevel(int n) +{ + currentLevel += n; + assert(0 <= currentLevel && currentLevel <= 1); +} + + +Node parameter(Node x, TypeDesc ftyp, Kind clss) +{ + if (ftyp == dynamicType) { + x = box(x); + } else if (ftyp == intType) { + x = unbox(x); + } else if (x.type == dynamicType) { + x = checkType(x, ftyp); + } else { + if (x.type != ftyp) error("Incorrect parameter type"); + } + x = putOpNode(iparam, x, null); + return x; +} + + +/*****************************************************************************/ + + +void call(Node x) +{ + putOpNode(icall, x, null); +} + + +void ioCall(Node x, Node y) +{ + Node z; + + if (x.val < 3) testInt(y); + if (x.val == 2) { + y = unbox(y); + putOpNode(iwrite, y, null); + } else { + putOp(iwrl, null); + } +} + + +void entryPoint() +{ + if (entrypc != null) error("multiple program entry points"); + entrypc = pc; + putOp(ientrypc, null); +} + + +void enter(int size) +{ + /* size: The size of local variables */ + Node x = new Node(); + makeConstNodeDesc(x, intType, size); + putOpNode(ienter, x, null); +} + + +void ret(int size) +{ + /* The size of formal parameters, shows how much to unwind the stack */ + Node x = new Node(); + makeConstNodeDesc(x, intType, size); + putOpNode(iret, x, null); +} + + +void open() +{ + currentLevel = 0; + pc = new Node(); + pc.kind = KIND_INST; + pc.op = inop; + pc.prv = code; + pc.nxt = null; + code.nxt = pc; +} + + +void printBrakNode(Node x) +{ + assert(x != null); + if (x.kind != KIND_INST) { + error("unknown brak kind"); + } else { + printf(" [${x.line}]"); + } +} + + +// This function Prints the Node information based on the Node type +void printNode(Node x) +{ + assert(x != null); + if (x == gp) { + printf(" GP"); + } else if (x == fp) { + printf(" FP"); + } else { + switch (x.kind) { + case KIND_VAR: + if (x.lev > 0) + printf(" ${x.name}#${x.val}"); + else + printf(" ${x.name}_base#${x.val}"); + break; + case KIND_CONST: printf(" ${x.val}"); break; + case KIND_FLD: + final offset = x.type != dynamicType ? x.val : '?'; + printf(" ${x.name}_offset#$offset"); + break; + case KIND_INST: case KIND_ADDR: printf(" (${x.line})"); break; + case KIND_PROC: printf(" [${x.jmpTrue.line}]"); break; + case KIND_TYPE: printf(" ${x.type.name}_type#${x.type.size}"); break; + default: error("unknown class ${x.kind}"); + } + } +} + +void assignLineNumbers() +{ + Node i; + int cnt; + + // assign line numbers + cnt = 1; + i = code; + while (i != null) { + i.line = cnt; + cnt++; + i = i.nxt; + } +} + +void decode() +{ + Node i; + + i = code; + while (i != null) { + printf(" instr ${i.line}: ${i.op}"); + switch (i.op) { + // Binary operations + case iadd: + case isub: + case imul: + case idiv: + case imod: + case icmpeq: + case icmple: + case icmplt: + case istore: + case imove: + case inew: + case icheckbounds: + case ichecktype: + case ilddynamic: + printNode(i.x); + printNode(i.y); + assert(i.z == null); + break; + + // Unary operations + case ineg: + case iload: + case iparam: + case ienter: + case iret: + case icall: + case iwrite: + case ichecknull: + case ibox: + case iunbox: + printNode(i.x); + assert(i.y == null); + assert(i.z == null); + break; + + // Zero-arg operations + case ientrypc: + case iwrl: + case inop: + assert(i.x == null); + assert(i.y == null); + assert(i.z == null); + break; + + // Ternary operations: + case istdynamic: + printNode(i.x); + printNode(i.y); + printNode(i.z); + break; + + // Branch + case ibr: + printBrakNode(i.x); + assert(i.y == null); + assert(i.z == null); + break; + + // Conditional branch + case iblbc: + case iblbs: + printNode(i.x); + printBrakNode(i.y); + assert(i.z == null); + break; + + default: error("unknown instruction"); + } + if (i.type != null) { + final type = i.type; + printf(" :${type.name}"); + } + printf("\n"); + i = i.nxt; + } +} + + +void initialParser() +{ + entrypc = null; + + code = new Node(); + code.kind = KIND_INST; + code.op = inop; + code.prv = null; + code.nxt = null; + + intType = new TypeDesc('int'); + intType.form = FORM_INTEGER; + intType.size = 8; + + boolType = new TypeDesc('bool'); + boolType.form = FORM_BOOLEAN; + boolType.size = 8; + + dynamicType = new TypeDesc('dynamic'); + dynamicType.form = FORM_INTEGER; + dynamicType.size = 8; + + listType = new TypeDesc('List'); + listType.form = FORM_LIST; + listType.size = 8; + + gp = new Node(); + intType.form = FORM_INTEGER; + intType.size = 8; + + fp = new Node(); + intType.form = FORM_INTEGER; + intType.size = 8; +} diff --git a/bin/startc/starts.dart b/bin/startc/starts.dart new file mode 100644 index 0000000..e281f52 --- /dev/null +++ b/bin/startc/starts.dart @@ -0,0 +1,323 @@ +part of startc; + +// Tokenizer + +class Token { + const Token._(this._value); + final _value; + toString() => 'TOKEN_${_value.toUpperCase()}'; +} + +const TOKEN_TIMES = const Token._('times'); +const TOKEN_DIV = const Token._('div'); +const TOKEN_MOD = const Token._('mod'); +const TOKEN_PLUS = const Token._('plus'); +const TOKEN_MINUS = const Token._('minus'); +const TOKEN_EQL = const Token._('eql'); +const TOKEN_NEQ = const Token._('neq'); +const TOKEN_LSS = const Token._('lss'); +const TOKEN_LEQ = const Token._('leq'); +const TOKEN_GTR = const Token._('gtr'); +const TOKEN_GEQ = const Token._('geq'); +const TOKEN_PERIOD = const Token._('period'); +const TOKEN_COMMA = const Token._('comma'); +const TOKEN_RPAREN = const Token._('rparen'); +const TOKEN_RBRAK = const Token._('rbrak'); +const TOKEN_RBRACE = const Token._('rbrace'); +const TOKEN_LPAREN = const Token._('lparen'); +const TOKEN_LBRAK = const Token._('lbrak'); +const TOKEN_LBRACE = const Token._('lbrace'); +const TOKEN_BECOMES = const Token._('becomes'); +const TOKEN_NUMBER = const Token._('number'); +const TOKEN_IDENT = const Token._('ident'); +const TOKEN_SEMICOLON = const Token._('semicolon'); +const TOKEN_ELSE = const Token._('else'); +const TOKEN_IF = const Token._('if'); +const TOKEN_WHILE = const Token._('while'); +const TOKEN_CLASS = const Token._('class'); +const TOKEN_VOID = const Token._('void'); +const TOKEN_EOF = const Token._('eof'); +const TOKEN_NEW = const Token._('new'); + +const MAX_ID_LENGTH = 16; + +int _currentAsInt = null; +int get currentAsInt { + assert(_currentAsInt != null); + final current = _currentAsInt; + _currentAsInt = null; + return current; +} + +StringBuffer _currentBuffer = null; +String get currentAsString { + assert(_currentBuffer != null); + String current = _currentBuffer.toString(); + return current; +} + +// Current line / position / character in the script. +String _script; +int _ch; +int _line; +int _position = 0; + +// Support for C-style processing. +final int EOF = null; + +int getc(String file) { + if (_position >= file.length) return EOF; + int result = file.codeUnitAt(_position); + _position++; + return result; +} + +int strcmp(String str1, String str2) { + return str1.compareTo(str2); +} + +void error(String msg) { + var message = " line $_line error $msg\n"; + print(message); + throw new Exception(message); +} + +int _int(String char) { + assert(char.length == 1); + return char.codeUnitAt(0); +} + +void identifier() { + int i; + + i = 0; + _currentBuffer = new StringBuffer(); + while (((_int('a') <= _ch) && (_ch <= _int('z'))) || + ((_int('A') <= _ch) && (_ch <= _int('Z'))) || + ((_int('0') <= _ch) && (_ch <= _int('9'))) || + (_ch == _int('_'))) { + if (i < MAX_ID_LENGTH) _currentBuffer.writeCharCode(_ch); + i++; + _ch = getc(_script); + } + if (i >= MAX_ID_LENGTH) error("identifier too long"); +} + + +void number() +{ + _currentAsInt = 0; + while ((_int('0') <= _ch) && (_ch <= _int('9')) && + ((0x8000000000000000 + _int('0') - _ch) ~/ 10 >= _currentAsInt)) { + _currentAsInt = _currentAsInt * 10 + _ch - _int('0'); + _ch = getc(_script); + } + if ((_int('0') <= _ch) && (_ch <= _int('9'))) { + error("number too large"); + } +} + + +void comment() +{ + _ch = getc(_script); + do { + while ((_ch != EOF) && (_ch != _int('*'))) { + if (_ch == _int('\n')) _line++; + _ch = getc(_script); + } + _ch = getc(_script); + } while ((_ch != EOF) && (_ch != _int('/'))); + _ch = getc(_script); +} + + +void commentLine() +{ + do { + _ch = getc(_script); + } while ((_ch != EOF) && (_ch != _int('\n'))); +} + + +Token nextToken() +{ + Token sym; + + while ((_ch != EOF) && (_ch <= _int(' '))) { + if (_ch == _int('\n')) _line++; + _ch = getc(_script); + } + if (_ch == null) { + sym = TOKEN_EOF; + } else { + switch (new String.fromCharCode(_ch)) { + case '+': + sym = TOKEN_PLUS; + _ch = getc(_script); + break; + case '-': + sym = TOKEN_MINUS; + _ch = getc(_script); + break; + case '*': + sym = TOKEN_TIMES; + _ch = getc(_script); + break; + case '%': + sym = TOKEN_MOD; + _ch = getc(_script); + break; + case '/': + sym = TOKEN_DIV; + _ch = getc(_script); + if (_ch == _int('/')) { + commentLine(); + sym = nextToken(); + } else if (_ch == _int('*')) { + comment(); + sym = nextToken(); + } + break; + case '=': + sym = TOKEN_BECOMES; + _ch = getc(_script); + if (_ch == _int('=')) { + sym = TOKEN_EQL; + _ch = getc(_script); + } + break; + case '#': + commentLine(); + sym = nextToken(); + break; + case '.': + sym = TOKEN_PERIOD; + _ch = getc(_script); + break; + case ',': + sym = TOKEN_COMMA; + _ch = getc(_script); + break; + case ';': + sym = TOKEN_SEMICOLON; + _ch = getc(_script); + break; + case '!': + _ch = getc(_script); + if (_ch != _int('=')) error("illegal symbol encountered"); + sym = TOKEN_NEQ; + _ch = getc(_script); + break; + case '(': + sym = TOKEN_LPAREN; + _ch = getc(_script); + break; + case '[': + sym = TOKEN_LBRAK; + _ch = getc(_script); + break; + case '{': + sym = TOKEN_LBRACE; + _ch = getc(_script); + break; + case ')': + sym = TOKEN_RPAREN; + _ch = getc(_script); + break; + case ']': + sym = TOKEN_RBRAK; + _ch = getc(_script); + break; + case '}': + sym = TOKEN_RBRACE; + _ch = getc(_script); + break; + case '<': + sym = TOKEN_LSS; + _ch = getc(_script); + if (_ch == _int('=')) { + sym = TOKEN_LEQ; + _ch = getc(_script); + } + break; + case '>': + sym = TOKEN_GTR; + _ch = getc(_script); + if (_ch == _int('=')) { + sym = TOKEN_GEQ; + _ch = getc(_script); + } + break; + + case '0': case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + sym = TOKEN_NUMBER; + number(); + break; + + case 'c': + sym = TOKEN_IDENT; identifier(); + if (strcmp(currentAsString, "class") == 0) sym = TOKEN_CLASS; + break; + case 'e': + sym = TOKEN_IDENT; + identifier(); + if (strcmp(currentAsString, "else") == 0) sym = TOKEN_ELSE; + break; + case 'i': + sym = TOKEN_IDENT; + identifier(); + if (strcmp(currentAsString, "if") == 0) { + sym = TOKEN_IF; + } else if (strcmp(currentAsString, "import") == 0) { + commentLine(); + sym = nextToken(); + } + break; + case 's': + sym = TOKEN_IDENT; + identifier(); + if (strcmp(currentAsString, "struct") == 0) sym = TOKEN_CLASS; + break; + case 'v': + sym = TOKEN_IDENT; + identifier(); + if (strcmp(currentAsString, "void") == 0) sym = TOKEN_VOID; + break; + case 'w': + sym = TOKEN_IDENT; + identifier(); + if (strcmp(currentAsString, "while") == 0) sym = TOKEN_WHILE; + break; + case 'n': + sym = TOKEN_IDENT; + identifier(); + if (strcmp(currentAsString, "new") == 0) sym = TOKEN_NEW; + break; + + case 'a': case 'b': case 'd': case 'f': case 'g': case 'h': case 'j': + case 'k': case 'l': case 'm': case 'o': case 'p': case 'q': + case 'r': case 't': case 'u': case 'x': case 'y': case 'z': case '_': + case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'G': + case 'H': case 'I': case 'J': case 'K': case 'L': case 'M': case 'N': + case 'O': case 'P': case 'Q': case 'R': case 'S': case 'T': case 'U': + case 'V': case 'W': case 'X': case 'Y': case 'Z': + sym = TOKEN_IDENT; + identifier(); + break; + default: error("illegal symbol encountered"); + } + } + return sym; +} + + +void initializeTokenizer(String script) +{ + _line = 0; + _script = script; + if (_script == null) error("could not open file"); + _line = 1; + _ch = getc(_script); +} diff --git a/bin/starti/starti.dart b/bin/starti/starti.dart new file mode 100644 index 0000000..4cf1699 --- /dev/null +++ b/bin/starti/starti.dart @@ -0,0 +1,589 @@ +library starti; + +final _bufferedPrint = () { + var _buffer = new StringBuffer(); + return (message) { + final str = message.toString(); + final list = str.split('\n'); + assert(list.length > 0); + _buffer.write(list[0]); + if (list.length > 1) { + print(_buffer.toString()); + _buffer = new StringBuffer(); + for (int i = 1; i < list.length - 1; ++i) { + print(list[i]); + } + _buffer.write(list.last); + } + }; +}(); + +void _check(bool flag, String message) { + if (!flag) { + print(message); + throw new Exception(message); + } +} + +int cost(String opc) { + final costMap = { + "new": 10, + "lddynamic": 100, + "stdynamic": 100, + "box": 12, + "unbox": 3, + }; + if (costMap.containsKey(opc)) { + return costMap[opc]; + } else { + return 1; + } +} + +class Instruction { + final opcode; + final args; + + Instruction(this.opcode, this.args); +} + +class Type { + static int _idgen = 0; + + final String name; + final int id; + + final Map fieldMap = new Map(); + final Map fieldTypes = new Map(); + + static Map idMap = new Map(); + static Map typeMap = new Map(); + + Type(this.name, List fields) : + id = _idgen++ { + idMap[id] = this; + typeMap[name] = this; + + for (final field in fields) { + final parts = field.split(new RegExp(r'#|:')); + final fieldName = parts[0]; + final offset = int.parse(parts[1]); + final typeName = parts[2]; + fieldMap[fieldName] = offset; + fieldTypes[fieldName] = typeName; + } + } + + int get size => fieldMap.length * 8 + 8; +} + +int _parse(String bytecode, List instructions) { + int entrypc; + // Read in the program from stdin + for (final line in bytecode.split('\n')) { + var words = line.trim().split(" "); + if (line.trim() == "") continue; + if (words[0] == "type") { + final typename = words[1].substring(0, words[1].length-1); + final type = new Type(typename, words.sublist(2)); + continue; + } + if (words[0] == "method") continue; + if (words[0] == "global") continue; + _check(words[0] == "instr", "Invalid instruction $line"); + final index = int.parse(words[1].replaceFirst(':', '')); + _check(index == (instructions.length + 1), "Invalid index $index"); + final opcode = words[2]; + final args = words.sublist(3, words.length); + instructions.add(new Instruction(opcode, args)); + if (opcode == "entrypc") + entrypc = instructions.length; + } + _check(entrypc != null, "Invalid bytecode: no entry"); + return entrypc; +} + +class Memory { + // The "machine" word size. + static const slotsize = 8; + + // Amount of global space in bytes and longs. + static const gsize = 32768; + static const glongsize = gsize ~/ slotsize; + + // Amount of stack space in bytes and longs. + static const ssize = 65536; + static const slongsize = ssize ~/ slotsize; + + // Amount of heap space in bytes and longs. + static const hsize = 1048576; + static const hlongsize = hsize ~/ slotsize; + + static const longsize = glongsize + slongsize + hlongsize; + static const bytesize = longsize * slotsize; + + // Flat memory of long values with globals followed by stack + final memory = new List.filled(longsize, 0); + + Memory() { + _check(gsize % slotsize == 0, + "Global memory must evenly divide into slots"); + _check(ssize % slotsize == 0, + "Stack must evenly divide into slots"); + _check(hsize % slotsize == 0, + "Heap must evenly divide into slots"); + fp = gp; + sp = fp; + hp = ssize + gsize; + allocated = 0; + } + + int _address2slot(addr) => (addr~/slotsize); + int _slot2address(slot) => (slot*slotsize); + + int load(int addr) => memory[_address2slot(addr)]; + void store(int addr, int value) { + memory[_address2slot(addr)] = value; + } + + const gp = ssize; + int fp; + int sp; + int hp; + int allocated; + + int malloc(int bytes) { + _check(bytes > 0 && bytes % slotsize == 0, "Malloc request must divide into slots"); + int chunk = hp; + hp = hp + bytes; + // Check if we're out of memory. + if (hp >= bytesize) return 0; + allocated += bytes; + return chunk; + } + + void push(int value) { + sp -= slotsize; + memory[_address2slot(sp)] = value; + } + + int pop() { + final result = memory[_address2slot(sp)]; + memory[_address2slot(sp)] = 0; + sp += slotsize; + return result; + } + + void pushN(int newSlots) { + sp -= newSlots * slotsize; + } + + void popN(int oldSlots) { + for (int i = 0; i < oldSlots; ++i) + pop(); + } + + void printGlobals() { + final map = new Map(); + final first = _address2slot(gp); + for (int i = first; i < first + glongsize; ++i) { + if (memory[i] != 0) { + map[_slot2address(i)] = memory[i]; + } + } + print("Globals: $map"); + } + + void printHeap() { + final map = new Map(); + final first = _address2slot(gp) + glongsize; + for (int i = first; i < _address2slot(hp); ++i) { + if (memory[i] != 0) { + map[_slot2address(i)] = memory[i]; + } + } + print("Heap: $map"); + } + + bool validate() { + if (sp <= 0) { + print("StackOverflowError"); + return false; + } + _check(sp > 0, + "Stack overflow: sp == $sp <= 0}"); + _check(fp <= gp, + "Stack underflow: fp == $fp > gp == $gp"); + _check(sp <= fp, + "Frame is corrupt: fp == $fp > sp == $sp"); + return true; + } + + void dump() { + printGlobals(); + printHeap(); + print("Stack: ${memory.sublist(_address2slot(sp), + _address2slot(gp))}"); + } +} + +// TODO(vsm): Should we make these caller-save? +// Register set : assume each method has its own private set of registers +class RegisterStack { + final _stack = []; + Map _current = null; + + void push() { + if (_current != null) _stack.add(_current); + _current = new Map(); + } + + void pop() { + assert(!_stack.isEmpty); + _current = _stack.removeLast(); + } + + int operator[](int i) => _current[i]; + void operator[]=(int i, int val) { + _current[i] = val; + } +} + +String execute(String bytecode, { bool debug: false }) { + // Instructions indexed by pc-1 + final instructions = []; + final entrypc = _parse(bytecode, instructions); + + final inttype = new Type("int", []); + final booltype = new Type("bool", []); + final listtype = new Type("List", []); + + final memory = new Memory(); + final reg = new RegisterStack(); + + // Initial pc + var pc = entrypc; + + // Resolve operand + int op(String arg) { + if (arg == "GP") + return memory.gp; + else if (arg == "FP") + return memory.fp; + else if ((arg.indexOf("_base#") > 0) + || (arg.indexOf("_offset#") > 0) + || (arg.indexOf("_type#") > 0)) + return int.parse(arg.split("#")[1]); + else if (arg.indexOf("#") > 0) { + final offset = int.parse(arg.split("#")[1]); + //return offset; + // TODO(vsm): Delete this and clean up base above. + return memory.load(memory.fp+offset); + } else if (arg[0] == "(") + return reg[int.parse(arg.slice(1,-1))]; + else if (arg[0] == "[") + return int.parse(arg.slice(1,-1)); + else + return int.parse(arg); + }; + + // Set operand to val + void set(String lvalue, int val) { + final offset = int.parse(lvalue.split("#")[1]); + memory.store(memory.fp+offset, val); + }; + + // Instrumentation + var cycles = 0; + var instructionCount = 0; + var icacheMisses = 0; + var branchMispredicts = 0; + + // Instruction cache simulator + final icachesize = 256; + final icachelinebits = 2; + final icachelinesize = 1 << icachelinebits; + final icachelines = icachesize >> icachelinebits; + final icache = new List.filled(icachelines, 0); + final icacheMissCost = 10; + + void icacheFetch(int pc) { + // Get directly mapped icache slot for this pc + final line = pc >> icachelinebits; + final slot = line % icachelines; + if (icache[slot] != line) { + icache[slot] = line; + icacheMisses = icacheMisses + 1; + cycles = cycles + icacheMissCost; + } + }; + + Instruction instructionFetch(int pc) { + icacheFetch(pc); + return instructions[pc-1]; + }; + + // Branch prediction simulator + final mispredictCost = 1; + + void conditionalBranch(bool condition, int newpc) { + // Test for branch misprediction + final predict = (newpc < pc); + if (predict != condition) { + branchMispredicts = branchMispredicts + 1; + cycles = cycles + mispredictCost; + } + if (condition) { + pc = newpc - 1; + } + }; + + // Execute until top function returns + while (true) { + final inst = instructionFetch(pc); + final opc = inst.opcode; + final args = inst.args; + + if (!memory.validate()) break; + + if (debug) { + memory.dump(); + print("\nExecuting ($pc, ${memory.fp}, ${memory.sp}): $opc $args"); + } + + cycles = cycles + cost(opc); + instructionCount = instructionCount + 1; + if (opc == "add") + reg[pc] = op(args[0]) + op(args[1]); + else if (opc == "sub") + reg[pc] = op(args[0]) - op(args[1]); + else if (opc == "mul") + reg[pc] = op(args[0]) * op(args[1]); + else if (opc == "div") + reg[pc] = op(args[0]) ~/ op(args[1]); + else if (opc == "mod") + reg[pc] = op(args[0]) % op(args[1]); + else if (opc == "neg") + reg[pc] = -op(args[0]); + else if (opc == "cmpeq") + reg[pc] = (op(args[0]) == op(args[1])) ? 1 : 0; + else if (opc == "cmple") + reg[pc] = (op(args[0]) <= op(args[1])) ? 1 : 0; + else if (opc == "cmplt") + reg[pc] = (op(args[0]) < op(args[1])) ? 1 : 0; + else if (opc == "br") + pc = op(args[0]) - 1; + else if (opc == "blbc") + conditionalBranch(op(args[0]) == 0, op(args[1])); + else if (opc == "blbs") + conditionalBranch(op(args[0]) != 0, op(args[1])); + else if (opc == "call") { + // Push old pc and set new one + memory.push(pc); + pc = op(args[0]) - 1; + // Push old fp and set new one + memory.push(memory.fp); + memory.fp = memory.sp; + } + else if (opc == "load") { + reg[pc] = memory.load(op(args[0])); + if (debug) + print("Loading ${reg[pc]} at ${op(args[0])}"); + } + else if (opc == "store") { + if (debug) + print("Storing ${op(args[0])} at ${op(args[1])}"); + memory.store(op(args[1]), op(args[0])); + } + else if (opc == "lddynamic") { + final ref = op(args[0]); + final fieldname = args[1].split("_offset")[0]; + final reftypeid = memory.load(ref); + final dynamicType = Type.idMap[reftypeid]; + final offset = dynamicType.fieldMap[fieldname]; + if (offset == null) { + print("DynamicError"); + break; + } + final value = memory.load(ref+offset); + // Auto-box int values. + final fieldTypeName = dynamicType.fieldTypes[fieldname]; + if (fieldTypeName == inttype.name) { + // Auto-box. + // TODO(vsm): Factor out. + final boxed = memory.malloc(16); + if (boxed == 0) { + print("OutOfMemoryError"); + break; + } + memory.store(boxed, inttype.id); + memory.store(boxed+8, value); + reg[pc] = boxed; + } else { + // Already a boxed type. + reg[pc] = value; + } + } + else if (opc == "stdynamic") { + var value = op(args[0]); + final ref = op(args[1]); + final fieldname = args[2].split("_offset")[0]; + final reftypeid = memory.load(ref); + final dynamicType = Type.idMap[reftypeid]; + final offset = dynamicType.fieldMap[fieldname]; + if (offset == null) { + print("DynamicError"); + break; + } + // Auto-unbox int values based on static type. + final fieldTypeName = dynamicType.fieldTypes[fieldname]; + if (fieldTypeName == inttype.name) { + _check(memory.load(value) == inttype.id, "Invalid boxed int"); + value = memory.load(value+8); + } + memory.store(ref+offset, value); + } + else if (opc == "box") { + final value = op(args[0]); + final boxed = memory.malloc(16); + if (boxed == 0) { + print("OutOfMemoryError"); + break; + } + memory.store(boxed, inttype.id); + memory.store(boxed+8, value); + reg[pc] = boxed; + } + else if (opc == "unbox") { + final ref = op(args[0]); + final reftypeid = memory.load(ref); + if (reftypeid != inttype.id) { + print("UnboxError"); + break; + } + reg[pc] = memory.load(ref+8); + } + else if (opc == "move") { + if (debug) + print("Moving ${op(args[0])} to ${args[1]}"); + set(args[1], op(args[0])); + } + else if (opc == "write") { + _bufferedPrint(" ${op(args[0])}"); + if (debug) + _bufferedPrint("\n"); + } + else if (opc == "wrl") + _bufferedPrint("\n"); + else if (opc == "param") { + if (debug) + print("Pushing ${op(args[0])} at ${memory.sp}"); + // Push arg + memory.push(op(args[0])); + } + else if (opc == "new") { + final typename = args[0].split("_type")[0]; + // TODO(vsm): Install vtable. + // TODO(vsm): Replace with newlist. + if (typename.startsWith('List')) { + final length = op(args[1]); + final list = memory.malloc(16+8*length); + if (list == 0) { + print("OutOfMemoryError"); + break; + } + reg[pc] = list; + memory.store(list, listtype.id); + memory.store(list+8, length); + } else { + final type = Type.typeMap[typename]; + _check(type.size == op(args[0]), + "Incorrect size ${op(args[0])} for ${type.name} (expected ${type.size})"); + final obj = memory.malloc(type.size); + if (obj == 0) { + print("OutOfMemoryError"); + break; + } + + memory.store(obj, type.id); + reg[pc] = obj; + } + } + else if (opc == "newlist") { + final length = op(args[0]); + final list = memory.malloc(16+8*length); + if (list == 0) { + print("OutOfMemoryError"); + break; + } + reg[pc] = list; + memory.store(list, listtype.id); + memory.store(list+8, length); + } + else if (opc == "checknull") { + final ref = op(args[0]); + if (ref == 0) { + print('NullPointerError'); + break; + } + reg[pc] = ref; + } + else if (opc == "checkbounds") { + final list = op(args[0]); + final index = op(args[1]); + final length = memory.load(list+8); + if (index < 0 || length <= index) { + print('RangeError'); + break; + } + } + else if (opc == "checktype") { + final ref = op(args[0]); + final reftypeid = memory.load(ref); + final typename = args[1].split("_type")[0]; + final type = Type.typeMap[typename]; + if (type.id != reftypeid) { + print('TypeError'); + break; + } + reg[pc] = ref; + } + else if (opc == "enter") { + // New register window + reg.push(); + // Allocate locals + memory.pushN(op(args[0]) ~/ Memory.slotsize); + } + else if (opc == "ret") { + // Pop locals + memory.sp = memory.fp; + if (memory.fp == memory.gp) + // Top-level method is returning. + break; + // Restore fp and pc + memory.fp = memory.pop(); + pc = memory.pop(); + // Pop arguments + final args2pop = op(args[0]); + memory.sp = memory.sp + args2pop; + // Restore registers + reg.pop(); + } + else if ((opc == "entrypc") || (opc == "nop")) + pc = pc; + else + _check(false, "Unknown opcode $opc"); + if (debug) + print("reg[$pc] == ${reg[pc]}"); + pc = pc + 1; + } + final stats = """ +------------------------- +- Dynamic cycles : $cycles +- Instruction count : $instructionCount +- Instruction cache misses : $icacheMisses +- Branch mispredicts : $branchMispredicts +- Allocated bytes: ${memory.allocated} +"""; + return stats; +} diff --git a/bin/test.dart b/bin/test.dart new file mode 100644 index 0000000..3167139 --- /dev/null +++ b/bin/test.dart @@ -0,0 +1,65 @@ +library start_test; + +import 'dart:async'; +import 'dart:io'; + +import 'package:unittest/unittest.dart'; + +final TESTS = [ + 'class.dart', + 'gcd.dart', + 'hanoifibfac.dart', + 'link.dart', + 'mmm.dart', + 'prime.dart', + 'regslarge.dart', + 'sieve.dart', + 'sort.dart', + 'struct.dart', + ]; + +Future> run(String vm, String interp, String dir, String test) { + final dart = Process.run(vm, ['$dir/$test']) + .then((r) => r.stdout); + final start = Process.run(vm, [interp, '$dir/$test']) + .then((r) => r.exitCode != 0 + ? fail('$test failed on:\n${r.stderr}') + : r.stdout); + + return Future.wait([dart, start]); +} + +void main() { + final options = new Options(); + final vm = options.executable; + final script = options.script; + Future dir = new File(script).directory().then((d) => d.path); + dir.then((path) => runTests(vm, '$path/..')); +} + +void runTests(String vm, String path) { + final interp = '$path/bin/start.dart'; + for (final name in TESTS) { + test('typed $name', () { + final check = expectAsync1((results) { + final dart = results[0]; + final start = results[1]; + expect(start, equals(dart)); + }); + run(vm, interp, '$path/examples', name) + .then(check); + }); + } + + for (final name in TESTS) { + test('untyped $name', () { + final check = expectAsync1((results) { + final dart = results[0]; + final start = results[1]; + expect(start, equals(dart)); + }); + run(vm, interp, '$path/untyped', name) + .then(check); + }); + } +} diff --git a/bin/time.dart b/bin/time.dart new file mode 100644 index 0000000..5845f99 --- /dev/null +++ b/bin/time.dart @@ -0,0 +1,60 @@ +library start_test; + +import 'dart:async'; +import 'dart:io'; + +import 'package:unittest/unittest.dart'; + +final TESTS = [ + 'class.dart', + 'gcd.dart', + 'hanoifibfac.dart', + 'link.dart', + 'mmm.dart', + 'prime.dart', + 'regslarge.dart', + 'sieve.dart', + 'sort.dart', + 'struct.dart', + ]; + +int findTime(String output) { + final lines = output.split('\n'); + for (String line in lines) { + if (line.contains("Dynamic cycles")) { + final words = line.split(' '); + return int.parse(words.last); + } + } +} + +Future> time(String vm, String interp, String dir, + String test) { + final out = Process.run(vm, [interp, '--stats', + '$dir/$test']) + .then((r) => r.exitCode != 0 + ? fail('$test failed on:\n${r.stderr}') + : r.stdout); + + return out.then(findTime); +} + +void runTests(String vm, String path) { + final interp = '$path/bin/start.dart'; + for (final name in TESTS) { + time(vm, interp, '$path/examples', name).then((typed) { + time(vm, interp, '$path/untyped', name).then((untyped) { + print('$name: typed:$typed untyped:$untyped (${untyped/typed})'); + }); + }); + + } +} + +void main() { + final options = new Options(); + final vm = options.executable; + final script = options.script; + Future dir = new File(script).directory().then((d) => d.path); + dir.then((path) => runTests(vm, '$path/..')); +} \ No newline at end of file diff --git a/examples/class.dart b/examples/class.dart new file mode 100644 index 0000000..b900f08 --- /dev/null +++ b/examples/class.dart @@ -0,0 +1,49 @@ +//test array and struct +import 'stdio.dart'; + +class A { + int x; + int y; +} + +class B { + int y; + A a; +} + +class C { + A y; +} + +dynamic b; + +void init1(A a, B b) { + b.a = a; + a.x = 19; +} + +void init2(dynamic c) { + c.y = 23; + b = c; +} + +void main() +{ + A a; + B b2; + C c; + + a = new A(); + b = null; + b2 = new B(); + init1(a, b2); + init2(a); + init2(b2); + + WriteLong(b2.a.y + b.y + b2.a.x - 23); + WriteLine(); +} + +/* +42 +*/ diff --git a/examples/gcd.dart b/examples/gcd.dart new file mode 100644 index 0000000..918b11c --- /dev/null +++ b/examples/gcd.dart @@ -0,0 +1,59 @@ +//test multiple function calls +import 'stdio.dart'; + +int a, b; +int res; + + +void GCD(int a, int b) +{ + int c; + + while (b != 0) { + c = a; + a = b; + b = c % b; + WriteLong(c); + WriteLong(a); + WriteLong(b); + WriteLine(); + } + res = a; +} + + +void main() +{ + a = 25733; + b = 48611; + GCD(a, b); + WriteLong(res); + WriteLine(); + WriteLine(); + + a = 7485671; + b = 7480189; + GCD(a, b); + WriteLong(res); + WriteLine(); +} + + +/* + expected output: + 25733 48611 25733 + 48611 25733 22878 + 25733 22878 2855 + 22878 2855 38 + 2855 38 5 + 38 5 3 + 5 3 2 + 3 2 1 + 2 1 0 + 1 + + 7485671 7480189 5482 + 7480189 5482 2741 + 5482 2741 0 + 2741 +*/ diff --git a/examples/hanoifibfac.dart b/examples/hanoifibfac.dart new file mode 100644 index 0000000..1d30091 --- /dev/null +++ b/examples/hanoifibfac.dart @@ -0,0 +1,104 @@ +//test recursive function calls +import 'stdio.dart'; + +int a, m, q, r; +int count; +int res; + + +void Factorial(int n) +{ + if (n == 0) { + res = 1; + } else { + Factorial(n-1); + res = n * res; + } +} + + +void FibRec(int n) +{ + int x, y; + + if (n <= 1) { + res = 1; + } else { + FibRec(n-1); + x = res; + FibRec(n-2); + y = res; + res = x + y; + } +} + + +void MoveDisc(int from, int to) +{ + WriteLong(from); + WriteLong(to); + WriteLine(); + count = count + 1; +} + + +void MoveTower(int from, int by, int to, int height) +{ + if (height == 1) { + MoveDisc(from, to); + } else { + MoveTower(from, to, by, height-1); + MoveDisc(from, to); + MoveTower(by, from, to, height-1); + } +} + + +void Hanoi(int height) +{ + count = 0; + MoveTower(1, 2, 3, height); + WriteLine(); + WriteLong(count); + WriteLine(); +} + + +void main() +{ + a = 16807; + m = 127; + m = m * 256 + 255; + m = m * 256 + 255; + m = m * 256 + 255; + q = m / a; + r = m % a; + Factorial(7); + WriteLong(res); + WriteLine(); + WriteLine(); + FibRec(11); + WriteLong(res); + WriteLine(); + WriteLine(); + Hanoi(3); + WriteLine(); +} + + +/* + expected output: + 5040 + + 144 + + 1 3 + 1 2 + 3 2 + 1 3 + 2 1 + 2 3 + 1 3 + + 7 +*/ diff --git a/examples/link.dart b/examples/link.dart new file mode 100644 index 0000000..fe5c243 --- /dev/null +++ b/examples/link.dart @@ -0,0 +1,48 @@ +//test array and struct +import 'stdio.dart'; + +class A { + int value; + A next; +} + +A tmp; +int total; + +void init(int count) { + A a; + if (count <= 0) { + tmp = null; + } else { + init(count - 1); + a = new A(); + a.value = count; + a.next = tmp; + tmp = a; + } +} + +void sum(A a) { + if (a == null) { + total = 0; + } else { + sum(a.next); + total = total + a.value; + } +} + +void main() +{ + A a; + + init(10); + a = tmp; + sum(a); + WriteLong(total); + WriteLine(); +} + + +/* +55 +*/ diff --git a/examples/loop.dart b/examples/loop.dart new file mode 100644 index 0000000..2921a67 --- /dev/null +++ b/examples/loop.dart @@ -0,0 +1,49 @@ +//test control flow hierarchy +import 'stdio.dart'; + +void main() +{ + int a, b, c, d, e, f; + int n, x; + + n = 13; + x = 0; + + + a = 0; + while(a < n){ + b = 0; + x = 0; + while(b < n){ + c = 0; + while(c v) { + j = i - 1; + } else { + if ((v % prime[j]) == 0) { + j = i; + } + } + j = j + 1; + } + if (j == i) { + prime[i] = v; + WriteLong(v); + i = i + 1; + } + v = v + 2; + } + WriteLine(); +} + + +/* + expected output: + 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107 109 113 127 131 137 139 149 151 157 163 167 173 179 181 191 193 197 199 211 223 227 229 233 239 241 251 257 263 269 271 277 281 283 293 307 311 313 317 331 337 347 349 353 359 367 373 379 383 389 397 401 409 419 421 431 433 439 443 449 457 461 463 467 479 487 491 499 503 509 521 523 541 547 557 563 569 571 577 587 593 599 601 607 613 617 619 631 641 643 647 653 659 661 673 677 683 691 701 709 719 727 733 739 743 751 757 761 769 773 787 797 809 811 821 823 827 829 839 853 857 859 863 877 881 883 887 907 911 919 929 937 941 947 953 967 971 977 983 991 997 1009 1013 1019 1021 1031 1033 1039 1049 1051 1061 1063 1069 1087 1091 1093 1097 1103 1109 1117 1123 1129 1151 1153 1163 1171 1181 1187 1193 1201 1213 1217 1223 1229 1231 1237 1249 1259 1277 1279 1283 1289 1291 1297 1301 1303 1307 1319 1321 1327 1361 1367 1373 1381 1399 1409 1423 1427 1429 1433 1439 1447 1451 1453 1459 1471 1481 1483 1487 1489 1493 1499 1511 1523 1531 1543 1549 1553 1559 1567 1571 1579 1583 1597 1601 1607 1609 1613 1619 1621 1627 1637 1657 1663 1667 1669 1693 1697 1699 1709 1721 1723 1733 1741 1747 1753 1759 1777 1783 1787 1789 1801 1811 1823 1831 1847 1861 1867 1871 1873 1877 1879 1889 1901 1907 1913 1931 1933 1949 1951 1973 1979 1987 1993 1997 1999 2003 2011 2017 2027 2029 2039 2053 2063 2069 2081 2083 2087 2089 2099 2111 2113 2129 2131 2137 2141 2143 2153 2161 2179 2203 2207 2213 2221 2237 2239 2243 2251 2267 2269 2273 2281 2287 2293 2297 2309 2311 2333 2339 2341 2347 2351 2357 2371 2377 2381 2383 2389 2393 2399 2411 2417 2423 2437 2441 2447 2459 2467 2473 2477 2503 2521 2531 2539 2543 2549 2551 2557 2579 2591 2593 2609 2617 2621 2633 2647 2657 2659 2663 2671 2677 2683 2687 2689 2693 2699 2707 2711 2713 2719 2729 2731 2741 +*/ diff --git a/examples/regslarge.dart b/examples/regslarge.dart new file mode 100644 index 0000000..2437a2c --- /dev/null +++ b/examples/regslarge.dart @@ -0,0 +1,636 @@ +//test computation structure +import 'stdio.dart'; + +void main() +{ + int a, b, c; + + a = 1; + b = 2; + c = 3; + + while (a < 4) { + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + + WriteLine(); + } +} + + +/* + expected output: + 131 261 391 521 651 781 911 1041 1171 1301 1431 1561 1691 1821 1951 2081 2211 2341 2471 2601 2731 2861 2991 3121 3251 3381 3511 3641 3771 3901 4031 4161 4291 4421 4551 4681 4811 4941 5071 5201 5331 5461 5591 5721 5851 5981 6111 6241 6371 6501 6631 6761 6891 7021 7151 7281 7411 7541 7671 7801 7931 8061 8191 8321 8451 8581 8711 8841 8971 9101 9231 9361 9491 9621 9751 9881 10011 10141 10271 10401 10531 10661 10791 10921 11051 11181 11311 11441 11571 11701 11831 11961 12091 12221 12351 12481 12611 12741 12871 13001 13131 13261 13391 13521 13651 13781 13911 14041 14171 14301 14431 14561 14691 14821 14951 15081 15211 15341 15471 15601 15731 15861 15991 16121 16251 16381 16511 16641 16771 16901 17031 17161 17291 17421 17551 17681 17811 17941 18071 18201 18331 18461 18591 18721 18851 18981 19111 19241 19371 19501 19631 19761 19891 20021 20151 20281 20411 20541 20671 20801 20931 21061 21191 21321 21451 21581 21711 21841 21971 22101 22231 22361 22491 22621 22751 22881 23011 23141 23271 23401 23531 23661 23791 23921 24051 24181 24311 24441 24571 24701 24831 24961 25091 25221 25351 25481 25611 25741 25871 26001 26131 26261 26391 26521 26651 26781 26911 27041 27171 27301 27431 27561 27691 27821 27951 28081 28211 28341 28471 28601 28731 28861 28991 29121 29251 29381 29511 29641 29771 29901 30031 30161 30291 30421 30551 30681 30811 30941 31071 31201 31331 31461 31591 31721 31851 31981 32111 32241 32371 32501 32631 32761 32891 33021 33151 33281 33411 33541 33671 33801 33931 34061 34191 34321 34451 34581 34711 34841 34971 35101 35231 35361 35491 35621 35751 35881 36011 36141 36271 36401 36531 36661 36791 36921 37051 37181 37311 37441 37571 37701 37831 37961 38091 38221 38351 38481 38611 38741 38871 39001 39131 39261 39391 +*/ diff --git a/examples/sieve.dart b/examples/sieve.dart new file mode 100644 index 0000000..79d35b4 --- /dev/null +++ b/examples/sieve.dart @@ -0,0 +1,49 @@ +//test the array +import 'stdio.dart'; + +/* + * Sieve of Eratosthenes + * Method for finding out prime numbers. + */ + +int n; + +void main() { + int i; + int j; + List is_prime; + n = 1000; + is_prime = new List(n); + // int is_prime[1000]; + + /* Mark all numbers as prime, initially */ + is_prime[0] = 0; + is_prime[1] = 0; + i = 2; + while (i < n) { + is_prime[i] = 1; + i = i + 1; + } + + i = 2; + while (i < n) { + if (is_prime[i] != 0) { + j = 2; + while ((i * j) < n) { + is_prime[i * j] = 0; + j = j + 1; + } + } + i = i + 1; + } + + /* Write out all the prime numbers */ + i = 2; + while (i < n) { + if (is_prime[i] != 0) { + WriteLong(i); + } + i = i + 1; + } + WriteLine(); +} diff --git a/examples/sort.dart b/examples/sort.dart new file mode 100644 index 0000000..599334c --- /dev/null +++ b/examples/sort.dart @@ -0,0 +1,53 @@ +//test array and while sentence +import 'stdio.dart'; + +int n; + +void main() { + + int i; + int j; + int temp; + List array; + + n = 10; + array = new List(n); + + i = 0; + while (i < n) { + array[i] = (n - i - 1); + i = i + 1; + } + + i = 0; + while (i < n) { + WriteLong(array[i]); + i = i + 1; + } + WriteLine(); + + i = 0; + while (i < n) { + j = 0; + while (j < i) { + if (array[j] > array[i]) { + temp = array[i]; + array[i] = array[j]; + array[j] = temp; + } + j = j + 1; + } + i = i + 1; + } + + i = 0; + while (i < n) { + WriteLong(array[i]); + i = i + 1; + } + WriteLine(); +} + +/* + expected output: +*/ diff --git a/examples/stdio.dart b/examples/stdio.dart new file mode 100644 index 0000000..18c41f5 --- /dev/null +++ b/examples/stdio.dart @@ -0,0 +1,21 @@ +library stdio; + +var _buffer = new StringBuffer(); + +void _printf(String str) { + final list = str.split('\n'); + assert(list.length > 0); + _buffer.write(list[0]); + if (list.length > 1) { + print(_buffer.toString()); + _buffer = new StringBuffer(); + for (int i = 1; i < list.length - 1; ++i) { + print(list[i]); + } + _buffer.write(list.last); + } +} + +void WriteLong(int n) => _printf(' $n'); + +void WriteLine() => _printf('\n'); diff --git a/examples/struct.dart b/examples/struct.dart new file mode 100644 index 0000000..39281ae --- /dev/null +++ b/examples/struct.dart @@ -0,0 +1,86 @@ +//test array and struct +import 'stdio.dart'; + +class B { + int q; + int r; + int s; +} + +class A { + int x; + int y; + B z; +} + +A a; + +List b; + +void main() +{ + int i; + A c; + B qq; + + a = new A(); + a.z = new B(); + c = new A(); + c.z = new B(); + qq = new B(); + b = new List(3); + i = 0; + while (i < 3) { + b[i] = new A(); + b[i].z = new B(); + i = i + 1; + } + + + c.z.r = 987654321; + + a.x = 1; + a.y = 2; + + c.x = 9; + c.y = 0; + + b[0].x = 3; + b[0].y = 4; + + b[a.x].x = 5; + b[a.x].y = 6; + + b[b[a.x-1].x-1].x = 7; + b[b[a.y-2].x-1].y = 8; + + WriteLong(a.x); + WriteLong(a.y); + WriteLine(); + + i = 0; + while (i < 3) { + WriteLong(b[i].x); + WriteLong(b[i].y); + WriteLine(); + i = i + 1; + } + + WriteLong(c.x); + WriteLong(c.y); + WriteLine(); + + WriteLong(c.z.r); + WriteLine(); +} + + +/* + expected output: + 1 2 + 3 4 + 5 6 + 7 8 + 9 0 + 987654321 +*/ diff --git a/pubspec.yaml b/pubspec.yaml new file mode 100644 index 0000000..3371704 --- /dev/null +++ b/pubspec.yaml @@ -0,0 +1,8 @@ +name: start +description: A sample command-line application +dependencies: + unittest: any + args: any + +#dependencies: +# unittest: any \ No newline at end of file diff --git a/untyped/class.dart b/untyped/class.dart new file mode 100644 index 0000000..d7ba0af --- /dev/null +++ b/untyped/class.dart @@ -0,0 +1,49 @@ +//test array and struct +import 'stdio.dart'; + +class A { + dynamic x; + dynamic y; +} + +class B { + dynamic y; + dynamic a; +} + +class C { + dynamic y; +} + +dynamic b; + +void init1(dynamic a, dynamic b) { + b.a = a; + a.x = 19; +} + +void init2(dynamic c) { + c.y = 23; + b = c; +} + +void main() +{ + dynamic a; + dynamic b2; + dynamic c; + + a = new A(); + b = null; + b2 = new B(); + init1(a, b2); + init2(a); + init2(b2); + + WriteLong(b2.a.y + b.y + b2.a.x - 23); + WriteLine(); +} + +/* +42 +*/ diff --git a/untyped/gcd.dart b/untyped/gcd.dart new file mode 100644 index 0000000..3347cf7 --- /dev/null +++ b/untyped/gcd.dart @@ -0,0 +1,59 @@ +//test multiple function calls +import 'stdio.dart'; + +dynamic a, b; +dynamic res; + + +void GCD(dynamic a, dynamic b) +{ + dynamic c; + + while (b != 0) { + c = a; + a = b; + b = c % b; + WriteLong(c); + WriteLong(a); + WriteLong(b); + WriteLine(); + } + res = a; +} + + +void main() +{ + a = 25733; + b = 48611; + GCD(a, b); + WriteLong(res); + WriteLine(); + WriteLine(); + + a = 7485671; + b = 7480189; + GCD(a, b); + WriteLong(res); + WriteLine(); +} + + +/* + expected output: + 25733 48611 25733 + 48611 25733 22878 + 25733 22878 2855 + 22878 2855 38 + 2855 38 5 + 38 5 3 + 5 3 2 + 3 2 1 + 2 1 0 + 1 + + 7485671 7480189 5482 + 7480189 5482 2741 + 5482 2741 0 + 2741 +*/ diff --git a/untyped/hanoifibfac.dart b/untyped/hanoifibfac.dart new file mode 100644 index 0000000..9e03cda --- /dev/null +++ b/untyped/hanoifibfac.dart @@ -0,0 +1,104 @@ +//test recursive function calls +import 'stdio.dart'; + +dynamic a, m, q, r; +dynamic count; +dynamic res; + + +void Factorial(dynamic n) +{ + if (n == 0) { + res = 1; + } else { + Factorial(n-1); + res = n * res; + } +} + + +void FibRec(dynamic n) +{ + dynamic x, y; + + if (n <= 1) { + res = 1; + } else { + FibRec(n-1); + x = res; + FibRec(n-2); + y = res; + res = x + y; + } +} + + +void MoveDisc(dynamic from, dynamic to) +{ + WriteLong(from); + WriteLong(to); + WriteLine(); + count = count + 1; +} + + +void MoveTower(dynamic from, dynamic by, dynamic to, dynamic height) +{ + if (height == 1) { + MoveDisc(from, to); + } else { + MoveTower(from, to, by, height-1); + MoveDisc(from, to); + MoveTower(by, from, to, height-1); + } +} + + +void Hanoi(dynamic height) +{ + count = 0; + MoveTower(1, 2, 3, height); + WriteLine(); + WriteLong(count); + WriteLine(); +} + + +void main() +{ + a = 16807; + m = 127; + m = m * 256 + 255; + m = m * 256 + 255; + m = m * 256 + 255; + q = m / a; + r = m % a; + Factorial(7); + WriteLong(res); + WriteLine(); + WriteLine(); + FibRec(11); + WriteLong(res); + WriteLine(); + WriteLine(); + Hanoi(3); + WriteLine(); +} + + +/* + expected output: + 5040 + + 144 + + 1 3 + 1 2 + 3 2 + 1 3 + 2 1 + 2 3 + 1 3 + + 7 +*/ diff --git a/untyped/link.dart b/untyped/link.dart new file mode 100644 index 0000000..e12903a --- /dev/null +++ b/untyped/link.dart @@ -0,0 +1,48 @@ +//test array and struct +import 'stdio.dart'; + +class A { + dynamic value; + dynamic next; +} + +dynamic tmp; +dynamic total; + +void init(dynamic count) { + dynamic a; + if (count <= 0) { + tmp = null; + } else { + init(count - 1); + a = new A(); + a.value = count; + a.next = tmp; + tmp = a; + } +} + +void sum(dynamic a) { + if (a == null) { + total = 0; + } else { + sum(a.next); + total = total + a.value; + } +} + +void main() +{ + dynamic a; + + init(10); + a = tmp; + sum(a); + WriteLong(total); + WriteLine(); +} + + +/* +55 +*/ diff --git a/untyped/loop.dart b/untyped/loop.dart new file mode 100644 index 0000000..f2447ac --- /dev/null +++ b/untyped/loop.dart @@ -0,0 +1,49 @@ +//test control flow hierarchy +import 'stdio.dart'; + +void main() +{ + dynamic a, b, c, d, e, f; + dynamic n, x; + + n = 13; + x = 0; + + + a = 0; + while(a < n){ + b = 0; + x = 0; + while(b < n){ + c = 0; + while(c v) { + j = i - 1; + } else { + if ((v % prime[j]) == 0) { + j = i; + } + } + j = j + 1; + } + if (j == i) { + prime[i] = v; + WriteLong(v); + i = i + 1; + } + v = v + 2; + } + WriteLine(); +} + + +/* + expected output: + 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107 109 113 127 131 137 139 149 151 157 163 167 173 179 181 191 193 197 199 211 223 227 229 233 239 241 251 257 263 269 271 277 281 283 293 307 311 313 317 331 337 347 349 353 359 367 373 379 383 389 397 401 409 419 421 431 433 439 443 449 457 461 463 467 479 487 491 499 503 509 521 523 541 547 557 563 569 571 577 587 593 599 601 607 613 617 619 631 641 643 647 653 659 661 673 677 683 691 701 709 719 727 733 739 743 751 757 761 769 773 787 797 809 811 821 823 827 829 839 853 857 859 863 877 881 883 887 907 911 919 929 937 941 947 953 967 971 977 983 991 997 1009 1013 1019 1021 1031 1033 1039 1049 1051 1061 1063 1069 1087 1091 1093 1097 1103 1109 1117 1123 1129 1151 1153 1163 1171 1181 1187 1193 1201 1213 1217 1223 1229 1231 1237 1249 1259 1277 1279 1283 1289 1291 1297 1301 1303 1307 1319 1321 1327 1361 1367 1373 1381 1399 1409 1423 1427 1429 1433 1439 1447 1451 1453 1459 1471 1481 1483 1487 1489 1493 1499 1511 1523 1531 1543 1549 1553 1559 1567 1571 1579 1583 1597 1601 1607 1609 1613 1619 1621 1627 1637 1657 1663 1667 1669 1693 1697 1699 1709 1721 1723 1733 1741 1747 1753 1759 1777 1783 1787 1789 1801 1811 1823 1831 1847 1861 1867 1871 1873 1877 1879 1889 1901 1907 1913 1931 1933 1949 1951 1973 1979 1987 1993 1997 1999 2003 2011 2017 2027 2029 2039 2053 2063 2069 2081 2083 2087 2089 2099 2111 2113 2129 2131 2137 2141 2143 2153 2161 2179 2203 2207 2213 2221 2237 2239 2243 2251 2267 2269 2273 2281 2287 2293 2297 2309 2311 2333 2339 2341 2347 2351 2357 2371 2377 2381 2383 2389 2393 2399 2411 2417 2423 2437 2441 2447 2459 2467 2473 2477 2503 2521 2531 2539 2543 2549 2551 2557 2579 2591 2593 2609 2617 2621 2633 2647 2657 2659 2663 2671 2677 2683 2687 2689 2693 2699 2707 2711 2713 2719 2729 2731 2741 +*/ diff --git a/untyped/regslarge.dart b/untyped/regslarge.dart new file mode 100644 index 0000000..da22a2f --- /dev/null +++ b/untyped/regslarge.dart @@ -0,0 +1,636 @@ +//test computation structure +import 'stdio.dart'; + +void main() +{ + dynamic a, b, c; + + a = 1; + b = 2; + c = 3; + + while (a < 4) { + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + a = a + ((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+((b+c)+(b+c)))))))))))))))))))))))))); + WriteLong(a); + + WriteLine(); + } +} + + +/* + expected output: + 131 261 391 521 651 781 911 1041 1171 1301 1431 1561 1691 1821 1951 2081 2211 2341 2471 2601 2731 2861 2991 3121 3251 3381 3511 3641 3771 3901 4031 4161 4291 4421 4551 4681 4811 4941 5071 5201 5331 5461 5591 5721 5851 5981 6111 6241 6371 6501 6631 6761 6891 7021 7151 7281 7411 7541 7671 7801 7931 8061 8191 8321 8451 8581 8711 8841 8971 9101 9231 9361 9491 9621 9751 9881 10011 10141 10271 10401 10531 10661 10791 10921 11051 11181 11311 11441 11571 11701 11831 11961 12091 12221 12351 12481 12611 12741 12871 13001 13131 13261 13391 13521 13651 13781 13911 14041 14171 14301 14431 14561 14691 14821 14951 15081 15211 15341 15471 15601 15731 15861 15991 16121 16251 16381 16511 16641 16771 16901 17031 17161 17291 17421 17551 17681 17811 17941 18071 18201 18331 18461 18591 18721 18851 18981 19111 19241 19371 19501 19631 19761 19891 20021 20151 20281 20411 20541 20671 20801 20931 21061 21191 21321 21451 21581 21711 21841 21971 22101 22231 22361 22491 22621 22751 22881 23011 23141 23271 23401 23531 23661 23791 23921 24051 24181 24311 24441 24571 24701 24831 24961 25091 25221 25351 25481 25611 25741 25871 26001 26131 26261 26391 26521 26651 26781 26911 27041 27171 27301 27431 27561 27691 27821 27951 28081 28211 28341 28471 28601 28731 28861 28991 29121 29251 29381 29511 29641 29771 29901 30031 30161 30291 30421 30551 30681 30811 30941 31071 31201 31331 31461 31591 31721 31851 31981 32111 32241 32371 32501 32631 32761 32891 33021 33151 33281 33411 33541 33671 33801 33931 34061 34191 34321 34451 34581 34711 34841 34971 35101 35231 35361 35491 35621 35751 35881 36011 36141 36271 36401 36531 36661 36791 36921 37051 37181 37311 37441 37571 37701 37831 37961 38091 38221 38351 38481 38611 38741 38871 39001 39131 39261 39391 +*/ diff --git a/untyped/sieve.dart b/untyped/sieve.dart new file mode 100644 index 0000000..bf7c2e4 --- /dev/null +++ b/untyped/sieve.dart @@ -0,0 +1,48 @@ +//test the array +import 'stdio.dart'; + +/* + * Sieve of Eratosthenes + * Method for finding out prime numbers. + */ + +dynamic n; + +void main() { + dynamic i; + dynamic j; + List is_prime; + n = 1000; + is_prime = new List(n); + + /* Mark all numbers as prime, initially */ + is_prime[0] = 0; + is_prime[1] = 0; + i = 2; + while (i < n) { + is_prime[i] = 1; + i = i + 1; + } + + i = 2; + while (i < n) { + if (is_prime[i] != 0) { + j = 2; + while ((i * j) < n) { + is_prime[i * j] = 0; + j = j + 1; + } + } + i = i + 1; + } + + /* Write out all the prime numbers */ + i = 2; + while (i < n) { + if (is_prime[i] != 0) { + WriteLong(i); + } + i = i + 1; + } + WriteLine(); +} diff --git a/untyped/sort.dart b/untyped/sort.dart new file mode 100644 index 0000000..3f53500 --- /dev/null +++ b/untyped/sort.dart @@ -0,0 +1,53 @@ +//test array and while sentence +import 'stdio.dart'; + +dynamic n; + +void main() { + + dynamic i; + dynamic j; + dynamic temp; + List array; + + n = 10; + array = new List(n); + + i = 0; + while (i < n) { + array[i] = (n - i - 1); + i = i + 1; + } + + i = 0; + while (i < n) { + WriteLong(array[i]); + i = i + 1; + } + WriteLine(); + + i = 0; + while (i < n) { + j = 0; + while (j < i) { + if (array[j] > array[i]) { + temp = array[i]; + array[i] = array[j]; + array[j] = temp; + } + j = j + 1; + } + i = i + 1; + } + + i = 0; + while (i < n) { + WriteLong(array[i]); + i = i + 1; + } + WriteLine(); +} + +/* + expected output: +*/ diff --git a/untyped/stdio.dart b/untyped/stdio.dart new file mode 100644 index 0000000..18c41f5 --- /dev/null +++ b/untyped/stdio.dart @@ -0,0 +1,21 @@ +library stdio; + +var _buffer = new StringBuffer(); + +void _printf(String str) { + final list = str.split('\n'); + assert(list.length > 0); + _buffer.write(list[0]); + if (list.length > 1) { + print(_buffer.toString()); + _buffer = new StringBuffer(); + for (int i = 1; i < list.length - 1; ++i) { + print(list[i]); + } + _buffer.write(list.last); + } +} + +void WriteLong(int n) => _printf(' $n'); + +void WriteLine() => _printf('\n'); diff --git a/untyped/struct.dart b/untyped/struct.dart new file mode 100644 index 0000000..d2baf69 --- /dev/null +++ b/untyped/struct.dart @@ -0,0 +1,85 @@ +//test array and struct +import 'stdio.dart'; + +class B { + dynamic q; + dynamic r; + dynamic s; +} + +class A { + dynamic x; + dynamic y; + dynamic z; +} + +dynamic a; + +dynamic b; + +void main() +{ + dynamic i; + dynamic c; + dynamic qq; + + a = new A(); + a.z = new B(); + c = new A(); + c.z = new B(); + qq = new B(); + b = new List(3); + i = 0; + while (i < 3) { + b[i] = new A(); + b[i].z = new B(); + i = i + 1; + } + + c.z.r = 987654321; + + a.x = 1; + a.y = 2; + + c.x = 9; + c.y = 0; + + b[0].x = 3; + b[0].y = 4; + + b[a.x].x = 5; + b[a.x].y = 6; + + b[b[a.x-1].x-1].x = 7; + b[b[a.y-2].x-1].y = 8; + + WriteLong(a.x); + WriteLong(a.y); + WriteLine(); + + i = 0; + while (i < 3) { + WriteLong(b[i].x); + WriteLong(b[i].y); + WriteLine(); + i = i + 1; + } + + WriteLong(c.x); + WriteLong(c.y); + WriteLine(); + + WriteLong(c.z.r); + WriteLine(); +} + + +/* + expected output: + 1 2 + 3 4 + 5 6 + 7 8 + 9 0 + 987654321 +*/