// converts from a string to type T template T fromStr(string s) { stringstream ss(s); T ret; ss >> ret; return ret; }