Skip to content

Instantly share code, notes, and snippets.

@itsrifat
Last active August 29, 2015 14:11
Show Gist options
  • Save itsrifat/0025a4d9e29abb3fd75a to your computer and use it in GitHub Desktop.
Save itsrifat/0025a4d9e29abb3fd75a to your computer and use it in GitHub Desktop.
Solution to the captcha cracker challenge in hackerrank
import numpy as np
from sklearn.linear_model import LogisticRegression
train_x = [
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,18,0,3,18,0,255,255,0,255,255,255,255,255,255,255,15,255,255,255,255,255,255,255,0,255,255,255,255,255,255,255,0,2,0,10,0,255,255,255,2,255,255,255,255,255,255,255,1,255,255,255,255,255,255,255,0,255,255,255,255,255,255,255,31,255,255,255,255,255,255,255,0,8,0,0,0,8,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,18,6,0,255,255,10,0,255,255,255,13,13,255,0,255,255,255,255,255,255,255,0,255,255,255,255,255,255,255,6,255,255,255,255,255,255,255,0,255,255,255,0,5,0,255,0,255,255,255,255,3,11,255,0,255,255,255,255,0,0,255,0,6,255,255,255,13,0,255,255,0,0,0,8,0,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,12,255,255,255,255,18,0,255,0,255,255,255,255,0,0,255,0,19,255,255,1,13,255,255,255,0,19,0,2,255,255,255,255,255,0,8,255,255,255,255,255,255,0,0,255,255,255,255,255,255,0,4,255,255,255,255,255,255,1,0,255,255,255,255,255,255,0,8,255,255,255,255,255,255,6,0,255,255,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,3,255,255,255,255,0,0,255,0,255,255,255,0,36,255,255,0,255,255,0,7,255,255,255,8,255,11,0,255,255,255,255,0,10,0,255,255,255,255,255,3,0,0,255,255,255,255,255,0,255,12,0,255,255,255,255,0,255,255,2,21,255,255,255,0,255,255,255,0,0,255,255,0,255,255,255,255,0,5,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,255,255,255,255,255,12,2,13,255,255,255,255,0,0,0,0,255,255,255,10,10,255,0,10,255,255,6,0,255,255,0,0,255,255,0,255,255,255,18,0,255,255,18,0,13,0,0,21,2,255,255,255,255,255,8,0,255,255,255,255,255,255,1,0,255,255,255,255,255,255,9,5,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,8,16,8,255,255,0,0,255,255,255,0,0,255,10,255,255,255,255,255,255,255,0,255,255,255,255,255,255,255,0,255,255,255,255,255,255,255,7,255,255,255,11,0,4,255,0,255,255,255,255,18,0,255,0,255,255,255,255,0,12,255,0,8,255,255,255,1,0,255,255,0,0,0,0,0,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,4,5,0,1,255,255,5,255,255,255,255,4,12,255,0,255,255,255,255,7,0,255,0,255,255,255,255,21,0,255,0,3,7,0,6,0,255,255,7,0,0,0,255,255,255,255,0,255,255,7,2,255,255,255,0,255,255,255,0,0,255,255,3,255,255,255,255,10,0,255,10,255,255,255,255,0,6,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,2,0,7,0,2,255,255,4,1,255,255,255,0,0,255,0,255,255,255,255,255,0,255,0,255,255,255,255,255,255,255,2,255,255,255,255,255,255,255,10,255,255,255,255,255,255,255,0,255,255,255,255,255,255,255,7,255,255,255,255,255,0,255,0,3,255,255,255,6,11,255,255,4,0,5,6,1,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,12,0,0,10,255,255,255,0,255,255,255,0,5,255,255,255,255,255,255,255,0,0,255,255,255,255,255,5,15,255,255,255,255,0,2,7,255,255,255,255,255,255,255,0,0,255,255,255,255,255,255,255,0,0,255,255,255,255,255,255,3,12,255,10,255,255,255,6,0,255,255,11,0,7,6,0,255,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,10,0,0,0,0,0,255,255,0,255,255,255,255,255,255,255,0,255,255,255,255,255,255,255,10,255,0,0,9,255,255,255,3,0,255,255,0,8,255,255,255,255,255,255,255,4,0,255,255,255,255,255,255,0,13,255,6,255,255,255,255,8,0,255,0,0,255,255,13,0,255,255,255,14,0,0,0,255,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,6,0,17,255,255,255,0,0,255,255,0,0,255,255,10,255,255,255,255,13,255,255,0,255,255,255,255,255,255,255,0,255,0,8,5,255,255,255,1,2,255,255,0,0,255,255,0,255,255,255,255,22,0,255,2,255,255,255,255,0,3,255,8,0,255,255,0,0,255,255,255,0,0,4,7,255,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,4,0,255,255,255,0,0,255,255,8,0,255,255,0,255,255,255,255,0,14,255,15,255,255,255,255,12,0,255,0,255,255,255,255,4,0,255,1,255,255,255,255,0,0,255,0,255,255,255,255,0,4,255,2,255,255,255,255,3,3,255,13,0,255,255,19,0,255,255,255,5,3,0,0,255,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,0,0,7,11,255,255,7,255,255,255,255,255,255,255,3,255,255,255,255,255,255,255,0,255,6,0,0,255,255,255,1,6,255,255,1,0,255,255,255,255,255,255,255,2,12,255,255,255,255,255,255,0,0,255,0,255,255,255,255,22,0,255,1,9,255,255,0,0,255,255,255,0,14,0,3,255,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,255,255,255,255,9,3,255,11,255,255,255,255,9,0,255,1,255,255,255,255,0,0,255,0,255,255,255,255,3,2,255,0,255,0,8,255,0,1,255,0,255,0,0,255,0,1,255,1,255,8,2,255,8,0,255,4,1,1,0,2,15,0,255,0,0,255,255,0,0,5,255,7,255,255,255,255,11,0,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,13,0,255,255,255,255,255,14,0,0,255,255,255,255,0,0,2,4,255,255,255,255,255,255,0,17,255,255,255,255,255,255,4,0,255,255,255,255,255,255,0,0,255,255,255,255,255,255,0,10,255,255,255,255,255,255,11,0,255,255,255,255,255,255,0,3,255,255,255,255,5,0,5,0,2,0,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,0,8,255,255,255,255,255,255,0,1,255,255,255,255,255,255,0,11,255,255,255,255,255,255,0,0,255,255,255,255,255,255,5,0,255,255,255,255,255,255,0,6,255,255,255,255,255,255,0,0,255,255,0,255,255,255,3,8,255,255,10,13,255,13,0,255,255,255,255,0,0,1,255,255,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,3,0,7,0,255,255,255,7,1,255,255,0,0,255,255,2,255,255,255,255,0,255,255,0,255,255,255,255,255,255,255,0,255,0,11,3,255,255,255,0,0,255,255,1,0,255,255,5,255,255,255,255,6,14,255,3,255,255,255,255,8,0,255,0,3,255,255,11,0,255,255,255,0,0,4,0,255,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,23,0,5,0,255,255,255,13,0,255,255,0,5,255,255,0,255,255,255,255,0,0,255,255,255,255,255,255,14,8,255,255,255,255,255,0,0,255,255,255,255,255,22,1,255,255,255,255,255,11,0,255,255,255,255,255,2,0,255,255,255,255,255,0,0,255,255,255,255,255,255,0,4,6,0,20,1,0,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,6,21,0,0,3,10,2,255,255,255,255,255,255,0,1,255,255,255,255,255,255,5,0,255,255,255,255,255,13,0,255,255,255,255,255,1,0,255,255,255,255,255,2,0,255,255,255,255,255,0,6,255,255,255,255,255,29,0,255,255,255,255,255,255,0,255,255,255,255,255,255,255,0,255,255,255,255,255,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,1,0,0,255,255,0,14,255,255,255,17,7,255,8,255,255,255,255,255,0,255,0,255,255,255,255,255,255,255,0,255,255,255,255,255,255,255,3,255,255,255,255,255,255,255,4,255,255,255,255,255,255,255,0,255,255,255,255,255,0,255,10,0,255,255,255,0,2,255,255,1,3,0,0,0,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,12,255,255,255,255,0,0,255,0,255,255,255,255,3,0,255,0,255,255,255,255,11,20,255,13,1,255,255,15,0,255,255,0,1,255,255,0,4,255,255,3,3,255,255,4,0,255,255,255,1,4,14,1,255,255,255,255,0,0,1,0,255,255,255,255,255,4,11,255,255,255,255,255,255,0,0,255,255,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,255,255,255,255,255,255,255,0,255,255,255,255,255,255,255,5,255,255,255,255,255,255,255,13,255,255,255,255,255,255,255,0,255,255,255,255,255,255,255,0,255,255,255,255,255,255,255,0,255,255,255,255,255,255,255,5,255,255,255,255,255,255,255,8,255,255,255,255,255,255,255,0,0,15,4,0,9,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,9,0,0,0,11,0,255,255,255,255,18,3,255,255,255,255,255,255,7,4,255,255,255,255,255,255,0,0,255,255,255,255,255,255,0,0,255,255,255,255,255,255,0,9,255,255,255,255,255,255,0,0,255,255,255,255,255,255,3,1,255,255,255,255,255,255,0,0,255,255,255,255,2,2,0,5,0,18,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,5,0,14,255,255,255,0,0,255,255,0,6,255,255,5,255,255,255,255,0,5,255,255,255,255,255,255,1,4,255,255,255,255,255,0,0,255,255,255,255,255,0,2,255,255,255,255,255,21,0,255,255,255,255,255,0,1,255,255,255,255,255,0,10,255,255,255,255,255,255,4,0,4,0,11,0,0,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,1,0,0,255,255,0,14,255,255,255,17,7,255,8,255,255,255,255,255,0,255,0,255,255,255,255,255,255,255,0,255,255,255,255,255,255,255,3,255,255,255,255,255,255,255,4,255,255,255,255,255,255,255,0,255,255,255,255,255,0,255,10,0,255,255,255,0,2,255,255,1,3,0,0,0,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,20,2,255,255,255,0,0,255,255,0,0,255,255,10,255,255,255,255,7,0,255,0,255,255,255,255,0,10,255,0,255,255,255,255,0,5,255,7,255,255,255,255,0,0,255,0,255,255,255,255,7,21,255,0,255,255,255,255,0,2,255,0,8,255,255,0,10,255,255,255,0,15,0,0,255,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,6,16,255,255,255,255,255,1,0,0,255,255,255,255,0,0,20,15,255,255,255,255,255,255,0,0,255,255,255,255,255,255,0,13,255,255,255,255,255,255,0,0,255,255,255,255,255,255,12,5,255,255,255,255,255,255,0,0,255,255,255,255,255,255,2,3,255,255,255,255,0,0,0,4,6,9,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,19,0,12,0,0,23,255,255,0,255,255,255,255,0,0,255,0,255,255,255,255,1,2,255,0,255,255,255,255,0,14,255,0,15,6,0,7,8,255,255,8,0,0,4,255,255,255,255,0,255,255,5,0,255,255,255,7,255,255,255,0,5,255,255,0,255,255,255,255,14,0,255,16,255,255,255,255,0,0,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,6,21,0,0,3,10,2,255,255,255,255,255,255,0,1,255,255,255,255,255,255,5,0,255,255,255,255,255,13,0,255,255,255,255,255,1,0,255,255,255,255,255,2,0,255,255,255,255,255,0,6,255,255,255,255,255,29,0,255,255,255,255,255,255,0,255,255,255,255,255,255,255,0,255,255,255,255,255,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,11,0,0,0,255,255,255,5,0,255,255,12,10,255,255,10,255,255,255,255,6,19,255,0,255,255,255,255,0,0,255,8,255,255,255,255,7,0,255,0,255,255,255,255,0,0,255,0,255,10,0,255,0,2,255,6,255,255,10,6,0,0,255,5,0,255,255,3,12,255,255,255,0,5,15,0,255,0,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,14,4,255,255,255,0,0,255,255,0,4,255,255,10,255,255,255,255,0,0,255,0,255,255,255,255,13,0,255,0,255,255,255,255,0,9,255,7,255,255,255,255,0,0,255,0,255,255,255,255,1,12,255,0,255,255,255,255,1,0,255,0,8,255,255,7,12,255,255,255,0,2,5,0,255,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,2,255,255,255,255,0,0,255,14,255,255,255,255,0,0,255,0,19,255,255,0,0,255,255,255,0,0,10,3,255,255,255,255,255,6,0,255,255,255,255,255,255,9,0,255,255,255,255,255,255,0,0,255,255,255,255,255,255,0,9,255,255,255,255,255,255,0,0,255,255,255,255,255,255,11,11,255,255,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,1,0,0,15,12,0,0,255,255,255,15,0,255,255,255,255,255,255,1,14,255,255,255,255,255,255,3,0,255,255,255,255,255,255,0,5,255,255,255,255,255,255,0,0,255,255,255,255,255,255,0,4,255,255,255,255,255,255,1,0,255,255,255,255,255,255,0,8,255,255,255,255,255,255,6,0,255,255,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,255,255,255,255,255,0,0,5,0,255,255,255,0,5,255,255,6,0,255,255,0,255,255,255,255,5,0,255,0,255,255,255,255,1,0,255,0,255,255,255,255,0,0,255,1,0,5,0,0,8,0,255,0,255,255,255,255,8,0,255,2,255,255,255,255,5,4,255,0,255,255,255,255,1,0,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,15,1,2,16,1,255,255,255,8,255,255,255,0,4,255,255,0,255,255,255,255,14,19,255,21,255,255,255,255,0,0,255,0,255,255,255,255,8,0,255,7,255,255,255,255,0,0,255,0,255,255,255,255,0,13,255,9,255,255,255,255,7,0,255,1,255,255,255,0,7,255,255,5,0,13,0,3,255,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,9,3,0,0,15,0,255,255,255,255,255,255,0,21,255,255,255,255,255,255,9,0,255,255,255,255,255,13,0,255,255,255,255,255,0,4,255,255,255,255,255,0,0,255,255,255,255,255,0,10,255,255,255,255,255,255,12,255,255,255,255,255,255,255,0,255,255,255,255,255,255,255,4,4,0,0,0,1,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,6,6,0,2,0,14,255,255,1,255,255,255,255,5,18,255,0,255,255,255,255,0,0,255,0,255,255,255,255,21,0,255,2,0,8,0,5,0,255,255,8,5,0,0,255,255,255,255,0,255,255,0,21,255,255,255,9,255,255,255,0,0,255,255,0,255,255,255,255,0,8,255,0,255,255,255,255,0,1,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,8,255,255,255,255,13,3,255,1,2,255,255,5,3,0,255,0,0,7,8,0,0,12,255,6,255,11,0,255,11,0,255,0,255,0,6,255,0,0,255,0,255,0,2,255,0,0,255,0,255,255,255,255,0,0,255,9,255,255,255,255,13,0,255,2,255,255,255,255,0,0,255,0,255,255,255,255,0,7,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,8,0,0,2,255,255,255,0,19,255,255,7,7,255,255,0,255,255,255,255,0,9,255,8,255,255,255,255,4,6,255,0,255,255,255,255,1,0,255,0,255,255,255,255,4,0,255,23,255,0,5,255,0,7,255,0,255,255,4,0,10,0,255,0,3,255,255,0,25,255,255,255,1,12,0,0,255,1,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,1,255,255,255,255,0,9,255,4,255,255,255,255,4,8,255,0,255,255,255,255,0,0,255,0,255,255,255,255,7,14,255,3,255,255,255,255,0,0,255,4,255,255,255,255,0,0,255,5,255,255,255,255,3,13,255,3,255,255,255,255,11,0,255,0,8,255,255,14,0,255,255,255,0,0,15,0,255,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,255,255,255,255,0,0,255,0,13,255,255,255,4,0,255,6,0,10,255,255,0,19,255,0,0,0,255,255,0,0,255,1,255,7,0,255,5,0,255,7,255,7,0,255,13,0,255,0,255,255,6,1,0,0,255,0,255,255,255,0,6,10,255,0,255,255,255,13,0,0,255,7,255,255,255,255,24,7,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,20,0,0,13,255,255,255,8,0,255,255,0,0,255,255,5,255,255,255,255,7,0,255,2,255,255,255,255,4,10,255,0,3,255,255,4,0,0,255,255,0,0,0,255,0,1,255,255,255,255,255,255,12,0,255,0,255,255,255,255,0,16,255,6,0,255,255,0,0,255,255,255,10,17,0,1,255,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,7,0,0,0,0,255,255,255,0,255,255,255,0,12,255,255,6,255,255,255,255,0,0,255,0,255,255,255,255,0,5,255,0,255,255,255,255,6,0,255,0,255,255,255,255,0,1,255,7,255,255,255,255,0,0,255,0,255,255,255,255,6,3,255,11,255,255,255,0,3,255,255,0,8,9,0,2,255,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,8,0,0,2,255,255,255,0,19,255,255,7,7,255,255,0,255,255,255,255,0,9,255,8,255,255,255,255,4,6,255,0,255,255,255,255,1,0,255,0,255,255,255,255,4,0,255,23,255,0,5,255,0,7,255,0,255,255,4,0,10,0,255,0,3,255,255,0,25,255,255,255,1,12,0,0,255,1,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,19,3,9,0,0,255,255,16,255,255,255,255,0,0,255,0,255,255,255,255,255,255,255,0,255,255,255,255,255,255,255,5,0,0,0,0,0,255,255,255,255,255,255,255,0,8,255,255,255,255,255,255,15,0,255,255,255,255,255,255,0,2,255,0,255,255,255,255,0,0,255,0,2,0,4,2,10,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,9,3,0,1,0,0,255,255,255,255,255,255,4,0,255,255,255,255,255,255,0,19,255,255,255,255,255,0,8,255,255,255,255,255,3,0,255,255,255,255,255,0,0,255,255,255,255,255,0,10,255,255,255,255,255,255,12,255,255,255,255,255,255,255,0,255,255,255,255,255,255,255,4,4,15,0,0,6,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,9,0,8,0,0,255,255,0,0,255,255,255,3,6,255,1,255,255,255,255,255,255,255,11,255,255,255,255,255,255,255,0,255,255,255,255,255,255,255,2,255,255,255,0,5,0,255,0,255,255,255,255,3,11,255,0,255,255,255,255,0,0,255,0,6,255,255,255,13,0,255,255,0,0,0,8,0,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,1,0,0,8,255,255,255,255,255,255,6,0,255,255,255,255,255,255,6,0,255,255,255,255,255,255,0,22,255,255,255,255,255,255,0,3,255,255,255,255,255,255,6,0,255,255,255,255,255,255,13,4,255,255,0,255,255,255,0,4,255,255,0,0,255,0,2,255,255,255,255,15,0,7,255,255,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,16,0,3,11,0,0,255,255,1,255,255,255,255,7,0,255,0,255,255,255,255,255,255,255,8,255,255,255,255,255,255,255,0,3,0,13,4,0,255,255,255,255,255,255,255,0,3,255,255,255,255,255,255,0,0,255,255,255,255,255,255,1,2,255,7,255,255,255,255,6,0,255,0,2,7,0,0,0,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,7,4,0,18,2,255,255,255,7,255,255,255,0,0,255,255,255,255,255,255,255,13,7,255,255,255,255,255,0,0,255,255,255,255,0,3,0,255,255,255,255,255,255,255,0,0,255,255,255,255,255,255,255,1,0,255,255,255,255,255,255,0,14,255,4,255,255,255,0,0,255,255,0,10,0,0,11,255,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,2,9,0,255,255,0,0,255,255,255,6,0,255,10,255,255,255,255,255,255,255,0,255,255,255,255,255,255,255,0,255,255,255,255,255,255,255,7,255,255,255,0,0,1,255,0,255,255,255,255,0,9,255,0,255,255,255,255,14,0,255,0,8,255,255,255,6,0,255,255,0,0,15,0,0,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,19,0,15,0,255,255,255,255,255,255,0,9,255,255,255,255,255,255,8,0,255,255,255,255,255,8,0,255,255,255,255,255,7,2,255,255,255,255,255,5,0,255,255,255,255,255,3,12,255,255,255,255,255,255,0,255,255,255,255,255,255,255,20,255,255,255,255,255,255,255,0,0,21,0,5,2,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,8,255,255,255,255,13,3,255,1,2,255,255,5,3,0,255,0,0,7,8,0,0,12,255,6,255,11,0,255,11,0,255,0,255,0,6,255,0,0,255,0,255,0,2,255,0,0,255,0,255,255,255,255,0,0,255,9,255,255,255,255,13,0,255,2,255,255,255,255,0,0,255,0,255,255,255,255,0,7,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,3,9,19,5,0,255,255,255,0,255,255,255,0,13,255,255,22,255,255,255,255,0,0,255,0,255,255,255,0,0,255,255,16,0,0,9,1,255,255,255,4,255,255,255,0,11,255,255,0,255,255,255,255,0,11,255,0,255,255,255,255,8,0,255,1,255,255,255,0,15,255,255,0,1,0,4,0,255,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,8,255,255,255,255,255,0,8,0,24,255,255,255,0,17,255,255,1,0,255,255,0,255,255,255,255,5,17,255,0,255,255,255,255,6,0,255,7,255,255,255,255,8,0,255,0,23,0,4,11,0,11,255,22,255,255,255,255,1,0,255,0,255,255,255,255,19,11,255,0,255,255,255,255,0,6,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,14,0,5,255,255,255,255,255,255,0,2,255,255,255,255,255,255,14,0,255,255,255,255,255,255,0,6,255,255,255,255,255,255,0,0,255,255,255,255,255,255,3,3,255,255,255,255,255,255,0,9,255,255,0,255,255,255,0,3,255,255,10,13,255,14,0,255,255,255,255,0,12,0,255,255,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,255,255,255,255,255,8,11,5,255,255,255,255,0,0,0,0,255,255,255,255,255,255,11,2,255,255,255,255,255,255,0,13,255,255,255,255,255,255,0,0,255,255,255,255,255,255,0,19,255,255,255,255,255,255,6,2,255,255,255,255,255,255,4,0,255,255,255,255,0,0,15,0,0,0,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,255,255,255,255,255,2,6,0,255,255,255,255,8,5,0,6,255,255,255,0,0,255,0,0,255,255,0,6,255,255,2,0,255,255,0,255,255,255,2,0,255,255,5,0,0,0,11,12,0,255,255,255,255,255,0,0,255,255,255,255,255,255,7,0,255,255,255,255,255,255,0,0,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,6,6,1,3,0,255,255,255,0,255,255,255,4,0,255,255,0,255,255,255,255,6,0,255,0,255,255,255,255,1,0,255,4,255,255,255,255,8,0,255,0,255,255,255,255,0,2,255,3,255,255,255,255,10,0,255,6,255,255,255,255,8,1,255,3,255,255,255,5,0,255,255,0,6,0,0,0,255,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,255,255,255,255,0,9,255,14,0,255,255,7,15,8,255,11,1,0,17,1,0,0,255,4,255,0,0,255,2,14,255,0,255,13,0,255,0,0,255,11,255,2,0,255,0,0,255,0,255,255,255,255,0,11,255,7,255,255,255,255,2,0,255,0,255,255,255,255,6,11,255,12,255,255,255,255,0,6,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,18,0,2,0,0,255,255,0,255,255,255,255,20,0,255,15,255,255,255,255,1,5,255,0,255,255,255,255,0,0,255,0,2,8,0,0,0,255,255,7,255,255,255,255,255,255,255,0,255,255,255,255,255,255,255,0,255,255,255,255,255,255,255,0,255,255,255,255,255,255,255,7,255,255,255,255,255,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,2,0,1,255,255,255,0,0,255,255,0,0,255,255,4,255,255,255,255,13,0,255,10,255,255,255,255,0,6,255,0,255,255,255,255,0,10,255,0,255,255,255,255,0,0,255,12,255,0,6,255,0,20,255,0,255,255,0,0,6,0,255,0,0,255,255,22,0,255,255,255,10,0,4,0,255,0,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,4,3,0,255,255,255,0,6,255,255,7,0,255,255,5,255,255,255,255,2,2,255,2,255,255,255,255,0,1,255,0,11,255,255,0,0,0,255,255,0,0,12,255,0,12,255,255,255,255,255,255,4,0,255,0,255,255,255,255,13,0,255,0,2,255,255,26,0,255,255,255,6,15,0,0,255,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,255,255,255,255,255,0,0,5,0,255,255,255,0,5,255,255,6,0,255,255,0,255,255,255,255,5,0,255,0,255,255,255,255,1,0,255,0,255,255,255,255,0,0,255,1,0,5,0,0,8,0,255,0,255,255,255,255,8,0,255,2,255,255,255,255,5,4,255,0,255,255,255,255,1,0,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,15,5,0,3,0,0,255,255,5,255,255,255,255,255,255,255,0,255,255,255,255,255,255,255,4,255,255,255,255,255,255,255,7,1,0,0,8,255,255,255,0,255,255,255,255,255,255,255,21,255,255,255,255,255,255,255,0,255,255,255,255,255,255,255,7,255,255,255,255,255,255,255,0,0,0,0,0,18,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,12,255,255,255,255,0,0,255,0,255,255,255,255,3,0,255,0,255,255,255,255,11,20,255,13,1,255,255,15,0,255,255,0,1,255,255,0,4,255,255,3,3,255,255,4,0,255,255,255,1,4,14,1,255,255,255,255,0,0,1,0,255,255,255,255,255,4,11,255,255,255,255,255,255,0,0,255,255,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,255,255,255,255,0,0,255,0,255,255,255,255,6,7,255,5,255,255,255,255,0,0,255,13,255,255,255,255,0,27,255,0,255,6,0,255,0,0,255,0,255,12,0,255,11,0,255,0,255,0,0,255,0,14,255,5,5,3,14,8,0,0,255,8,0,255,255,10,3,4,255,0,255,255,255,255,2,0,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,0,9,0,10,255,255,255,255,255,255,11,6,255,255,255,255,255,255,4,0,255,255,255,255,255,12,0,255,255,255,255,255,0,0,255,255,255,255,255,8,0,255,255,255,255,255,16,0,255,255,255,255,255,255,0,255,255,255,255,255,255,255,9,255,255,255,255,255,255,255,7,13,10,0,0,17,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,6,6,1,3,0,255,255,255,0,255,255,255,4,0,255,255,0,255,255,255,255,6,0,255,0,255,255,255,255,1,0,255,4,255,255,255,255,8,0,255,0,255,255,255,255,0,2,255,3,255,255,255,255,10,0,255,6,255,255,255,255,8,1,255,3,255,255,255,5,0,255,255,0,6,0,0,0,255,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,11,0,0,0,255,255,255,5,0,255,255,12,10,255,255,10,255,255,255,255,6,19,255,0,255,255,255,255,0,0,255,8,255,255,255,255,7,0,255,4,255,255,255,255,0,0,255,5,255,255,255,255,3,13,255,3,255,255,255,255,11,0,255,0,8,255,255,14,0,255,255,255,0,0,15,0,255,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,255,255,255,255,13,10,255,0,255,255,255,255,0,0,255,0,255,255,255,255,0,5,255,5,255,255,255,255,6,0,255,0,255,0,7,255,0,3,255,10,255,0,10,255,0,0,255,0,255,24,0,255,12,3,255,0,0,0,0,10,5,0,255,0,8,255,255,0,0,9,255,9,255,255,255,255,8,6,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,1,9,6,0,0,255,255,8,0,255,255,255,5,0,255,0,255,255,255,255,255,255,255,0,255,255,255,255,255,255,255,6,255,255,255,255,255,255,255,6,255,255,255,0,3,3,255,0,255,255,255,255,0,12,255,0,255,255,255,255,4,0,255,0,0,255,255,255,0,13,255,255,6,1,20,0,1,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,6,5,0,0,3,255,255,6,255,255,255,255,3,0,255,3,255,255,255,255,255,255,255,0,255,255,255,255,255,255,255,4,0,0,9,0,4,255,255,255,255,255,255,255,0,8,255,255,255,255,255,255,11,0,255,255,255,255,255,255,0,20,255,0,255,255,255,255,0,15,255,5,0,0,2,0,1,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,12,0,3,8,10,0,255,255,255,4,0,255,255,255,255,255,255,1,0,255,255,255,255,255,255,0,8,255,255,255,255,255,255,0,0,255,255,255,255,255,255,0,0,255,255,255,255,255,255,0,0,255,255,255,255,255,255,12,3,255,255,255,255,255,255,0,0,255,255,255,255,255,255,4,0,255,255,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,0,0,0,0,0,255,255,255,255,255,255,8,5,255,255,255,255,255,255,1,5,255,255,255,255,255,0,4,255,255,255,255,255,9,4,255,255,255,255,255,0,12,255,255,255,255,255,15,0,255,255,255,255,255,12,0,255,255,255,255,255,255,2,255,255,255,255,255,255,255,0,255,255,255,255,255,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,255,255,255,255,3,1,255,0,255,255,255,255,0,0,255,2,0,255,255,0,12,255,255,255,10,5,0,17,255,255,255,255,255,0,9,255,255,255,255,255,255,0,7,255,255,255,255,255,1,0,0,0,255,255,255,0,1,255,255,3,0,255,255,16,255,255,255,255,9,1,255,0,255,255,255,255,0,0,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,9,255,255,255,255,0,16,255,8,255,255,255,0,7,255,255,0,255,255,5,0,255,255,255,0,255,3,0,255,255,255,255,0,0,10,255,255,255,255,255,0,4,0,255,255,255,255,255,3,255,0,0,255,255,255,255,0,255,255,18,0,255,255,255,7,255,255,255,8,16,255,255,11,255,255,255,255,0,20,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,8,255,255,255,255,13,3,255,1,2,255,255,5,3,0,255,0,0,7,8,0,0,12,255,6,255,11,0,255,11,0,255,0,255,0,6,255,0,0,255,0,255,0,2,255,0,0,255,0,255,255,255,255,0,0,255,9,255,255,255,255,13,0,255,2,255,255,255,255,0,0,255,0,255,255,255,255,0,7,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,16,0,3,11,0,0,255,255,1,255,255,255,255,7,0,255,0,255,255,255,255,255,255,255,8,255,255,255,255,255,255,255,0,3,0,13,4,0,255,255,255,255,255,255,255,0,3,255,255,255,255,255,255,0,0,255,255,255,255,255,255,1,2,255,7,255,255,255,255,6,0,255,0,2,7,0,0,0,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,10,0,9,5,255,255,255,0,2,255,255,0,8,255,255,3,255,255,255,255,1,0,255,255,255,255,255,255,0,0,255,255,255,255,255,0,4,255,255,255,255,255,0,3,255,255,255,255,255,9,0,255,255,255,255,255,13,0,255,255,255,255,255,0,10,255,255,255,255,255,255,5,0,1,2,0,5,13,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,3,13,255,255,255,255,255,0,0,0,255,255,255,255,6,13,8,0,255,255,255,255,255,255,0,10,255,255,255,255,255,255,3,0,255,255,255,255,255,255,3,0,255,255,255,255,255,255,4,0,255,255,255,255,255,255,0,0,255,255,255,255,255,255,7,5,255,255,255,255,10,0,0,0,11,0,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,5,0,6,255,255,255,11,255,255,255,0,17,255,255,6,255,255,255,255,0,0,255,0,255,255,255,255,0,16,255,0,255,255,255,255,10,0,255,2,255,255,255,255,0,2,255,0,255,255,255,255,0,8,255,25,255,255,255,255,30,0,255,0,255,255,255,0,0,255,255,0,2,0,0,23,255,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,23,0,5,0,255,255,255,13,0,255,255,0,5,255,255,0,255,255,255,255,0,0,255,255,255,255,255,255,14,8,255,255,255,255,255,0,0,255,255,255,255,255,22,1,255,255,255,255,255,11,0,255,255,255,255,255,2,0,255,255,255,255,255,0,0,255,255,255,255,255,255,0,4,6,0,20,1,0,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,3,255,255,255,255,0,0,255,0,255,255,255,0,36,255,255,0,255,255,0,7,255,255,255,8,255,11,0,255,255,255,255,0,10,0,255,255,255,255,255,3,0,0,255,255,255,255,255,0,255,12,0,255,255,255,255,0,255,255,2,21,255,255,255,0,255,255,255,0,0,255,255,0,255,255,255,255,0,5,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,22,0,7,0,0,255,255,255,8,255,255,255,9,1,255,255,13,255,255,255,255,0,7,255,0,255,255,255,5,0,255,255,0,8,0,1,4,255,255,255,0,255,255,255,13,0,255,255,0,255,255,255,255,5,0,255,15,255,255,255,255,0,14,255,5,255,255,255,0,0,255,255,8,0,8,9,0,255,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,11,0,9,8,255,255,255,0,0,255,255,16,0,255,255,0,255,255,255,255,0,1,255,255,255,255,255,255,3,2,255,255,255,255,255,6,3,255,255,255,255,255,0,7,255,255,255,255,255,0,0,255,255,255,255,255,7,6,255,255,255,255,255,0,0,255,255,255,255,255,255,0,4,0,5,0,0,3,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,14,0,255,255,255,255,255,0,0,0,0,255,255,255,0,3,255,255,0,0,255,255,11,255,255,255,255,0,9,255,0,255,255,255,255,0,0,255,0,255,255,255,255,8,0,255,21,255,255,255,255,0,10,255,0,9,255,255,15,0,255,255,255,3,2,0,0,255,255,255,255,255,0,0,255,255,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,5,4,0,255,255,255,3,255,255,255,0,0,255,255,0,255,255,255,255,2,0,255,0,255,255,255,5,0,255,255,5,0,10,8,0,255,255,255,0,255,255,255,0,0,255,255,4,255,255,255,255,0,11,255,0,255,255,255,255,6,0,255,5,255,255,255,0,0,255,255,0,17,4,0,8,255,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,255,255,255,255,4,0,255,0,255,255,255,255,0,9,255,3,255,255,255,255,2,0,255,2,255,255,255,255,8,6,255,1,0,0,11,0,8,0,255,0,255,255,255,255,0,2,255,9,255,255,255,255,17,0,255,0,255,255,255,255,2,2,255,2,255,255,255,255,5,0,255,0,255,255,255,255,0,0,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,11,0,0,0,255,255,255,5,0,255,255,12,10,255,255,10,255,255,255,255,6,19,255,0,255,255,255,255,0,0,255,8,255,255,255,255,7,0,255,0,255,255,255,255,0,0,255,0,255,10,0,255,0,2,255,6,255,255,10,6,0,0,255,5,0,255,255,3,12,255,255,255,0,5,15,0,255,0,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,15,0,5,255,255,255,0,0,255,255,0,6,255,255,10,255,255,255,255,0,3,255,0,255,255,255,255,5,0,255,0,255,255,255,255,0,10,255,7,255,255,255,255,0,1,255,0,255,255,255,255,0,12,255,0,255,255,255,255,0,0,255,0,8,255,255,8,10,255,255,255,0,11,1,10,255,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,14,0,255,255,255,255,255,0,0,0,0,255,255,255,8,3,255,255,0,0,255,255,4,255,255,255,255,0,9,255,4,255,255,255,255,0,0,255,0,255,255,255,255,0,6,255,0,16,0,0,0,5,0,255,6,255,255,255,255,4,1,255,1,255,255,255,255,0,7,255,0,255,255,255,255,7,0,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,5,255,255,255,255,12,0,255,0,255,255,255,255,1,0,255,5,255,255,255,255,0,14,255,0,255,255,255,255,9,0,255,0,1,4,4,4,0,6,255,2,255,255,255,255,5,0,255,3,255,255,255,255,1,14,255,0,255,255,255,255,3,0,255,4,255,255,255,255,0,0,255,0,255,255,255,255,17,18,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,255,255,255,255,255,0,0,5,0,255,255,255,0,5,255,255,6,0,255,255,0,255,255,255,255,5,0,255,0,255,255,255,255,1,0,255,0,255,255,255,255,0,2,255,0,255,255,255,255,14,0,255,0,8,255,255,0,9,255,255,255,4,0,10,2,255,255,255,255,255,0,4,255,255,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,8,255,255,255,255,0,0,255,0,255,255,255,255,9,5,255,3,255,255,255,255,0,5,255,0,6,255,255,1,0,255,255,0,9,255,255,0,7,255,255,0,2,255,255,11,0,255,255,255,0,2,17,0,255,255,255,255,19,0,0,14,255,255,255,255,255,6,0,255,255,255,255,255,255,0,5,255,255,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,18,5,0,12,0,255,255,0,255,255,255,255,255,255,255,15,255,255,255,255,255,255,255,0,255,0,4,17,255,255,255,0,2,255,255,0,0,255,255,255,255,255,255,255,0,0,255,255,255,255,255,255,7,21,255,0,255,255,255,255,0,2,255,8,0,255,255,0,10,255,255,255,0,15,0,0,255,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,0,2,0,18,255,255,255,255,0,15,255,255,255,255,255,255,19,0,255,255,255,255,255,255,0,0,255,255,255,255,255,255,2,0,255,255,255,255,255,255,9,0,255,255,255,255,255,255,1,0,255,255,255,255,255,255,3,0,255,255,255,255,255,255,0,0,255,255,255,255,0,0,5,5,0,0,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,3,22,0,255,255,255,2,7,255,255,0,5,255,255,1,255,255,255,255,2,0,255,0,12,255,255,4,0,255,255,255,0,0,0,1,255,255,255,0,0,255,255,11,0,255,255,8,255,255,255,255,0,7,255,5,255,255,255,255,21,6,255,2,5,255,255,6,0,255,255,255,21,0,0,4,255,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,255,255,255,255,0,0,255,5,255,255,255,255,0,2,255,13,255,255,255,255,6,0,255,0,5,255,255,0,0,255,255,0,13,255,255,0,0,255,255,1,10,255,255,10,5,255,255,255,0,3,5,0,255,255,255,255,0,4,7,2,255,255,255,255,255,0,1,255,255,255,255,255,255,3,6,255,255,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,15,5,0,3,0,0,255,255,5,255,255,255,255,255,255,255,0,255,255,255,255,255,255,255,4,255,255,255,255,255,255,255,7,1,0,0,8,255,255,255,0,255,255,255,255,255,255,255,21,255,255,255,255,255,255,255,0,255,255,255,255,255,255,255,7,255,255,255,255,255,255,255,0,0,0,0,0,18,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,9,3,10,0,11,0,255,255,255,255,255,255,0,0,255,255,255,255,255,255,7,3,255,255,255,255,255,0,0,255,255,255,255,255,3,2,255,255,255,255,255,0,1,255,255,255,255,255,0,10,255,255,255,255,255,255,12,255,255,255,255,255,255,255,0,255,255,255,255,255,255,255,4,4,0,0,19,4,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,4,0,0,10,255,255,255,0,10,255,255,0,18,255,255,5,255,255,255,255,0,5,255,0,255,255,255,255,5,7,255,1,0,255,255,0,0,3,255,255,0,10,0,255,0,0,255,255,255,255,255,255,33,0,255,0,255,255,255,255,0,2,255,11,0,255,255,0,12,255,255,255,0,0,0,0,255,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,6,0,2,0,2,0,10,255,255,255,255,255,255,7,0,255,255,255,255,255,255,3,12,255,255,255,255,255,0,1,255,255,255,255,255,4,0,255,255,255,255,255,6,1,255,255,255,255,255,15,0,255,255,255,255,255,12,0,255,255,255,255,255,255,0,255,255,255,255,255,255,255,0,255,255,255,255,255,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,255,255,255,255,0,0,255,0,16,255,255,10,1,0,255,0,0,1,3,0,1,3,255,0,255,0,0,255,0,0,255,11,255,15,0,255,20,0,255,0,255,1,0,255,0,0,255,0,255,255,255,255,0,0,255,0,255,255,255,255,3,6,255,15,255,255,255,255,18,0,255,0,255,255,255,255,1,1,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,15,5,0,3,0,0,255,255,5,255,255,255,255,255,255,255,0,255,255,255,255,255,255,255,4,255,255,255,255,255,255,255,7,1,0,0,8,255,255,255,0,255,255,255,255,255,255,255,21,255,255,255,255,255,255,255,0,255,255,255,255,255,255,255,7,255,255,255,255,255,255,255,0,0,0,0,0,18,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,4,10,0,3,255,255,0,0,255,255,255,1,0,255,10,255,255,255,255,255,6,255,0,255,255,255,255,255,255,255,0,255,255,255,255,255,255,255,7,255,255,255,255,255,255,255,0,255,255,255,255,255,255,255,0,255,255,255,255,255,1,255,0,8,255,255,255,4,0,255,255,0,0,3,16,4,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,255,255,255,255,255,255,255,1,255,255,255,255,255,255,255,0,255,255,255,255,255,255,255,3,255,255,255,255,255,255,255,0,255,255,255,255,255,255,255,0,255,255,255,255,255,255,255,0,255,255,255,255,255,255,255,0,255,255,255,255,255,255,255,0,255,255,255,255,255,255,255,2,1,0,0,2,11,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,3,0,0,255,255,255,0,18,255,255,13,3,255,255,0,255,255,255,255,12,255,255,0,255,255,255,255,255,255,255,2,255,0,0,0,255,255,255,0,0,255,255,11,0,255,255,8,255,255,255,255,0,7,255,5,255,255,255,255,21,6,255,2,5,255,255,6,0,255,255,255,21,0,0,4,255,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,1,10,0,0,255,255,255,0,0,255,255,3,0,255,255,15,255,255,255,255,0,1,255,0,255,255,255,255,5,11,255,16,0,255,255,0,0,0,255,255,0,0,0,255,0,8,255,255,255,255,255,255,13,0,255,16,255,255,255,255,17,0,255,0,10,255,255,2,0,255,255,255,13,0,0,2,255,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,8,255,255,255,255,0,0,255,0,255,255,255,255,9,5,255,3,255,255,255,255,0,5,255,0,6,255,255,1,0,255,255,0,9,255,255,0,7,255,255,0,2,255,255,11,0,255,255,255,0,2,17,0,255,255,255,255,19,0,0,14,255,255,255,255,255,6,0,255,255,255,255,255,255,0,5,255,255,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,17,255,255,255,255,0,11,255,1,255,255,255,255,0,0,255,0,255,255,255,255,0,0,255,13,255,255,255,255,0,17,255,0,7,0,6,0,4,0,255,7,255,255,255,255,0,9,255,0,255,255,255,255,0,0,255,0,255,255,255,255,5,5,255,0,255,255,255,255,0,1,255,7,255,255,255,255,0,0,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,1,0,0,0,9,255,255,2,9,255,255,255,2,6,255,0,255,255,255,255,255,0,255,10,255,255,255,255,255,255,255,0,255,255,255,255,255,255,255,4,255,255,255,255,255,255,255,0,255,255,255,255,255,255,255,0,255,255,255,255,255,10,255,8,4,255,255,255,0,0,255,255,0,6,0,0,4,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,6,25,5,0,0,255,255,0,255,255,255,255,255,255,255,0,255,255,255,255,255,255,255,0,255,255,255,255,255,255,255,0,9,0,3,2,255,255,255,0,255,255,255,255,255,255,255,21,255,255,255,255,255,255,255,0,255,255,255,255,255,255,255,0,255,255,255,255,255,255,255,4,0,16,0,0,21,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,1,10,0,0,255,255,255,0,0,255,255,3,0,255,255,15,255,255,255,255,0,1,255,0,255,255,255,255,5,11,255,16,0,255,255,0,0,0,255,255,0,0,0,255,0,8,255,255,255,255,255,255,13,0,255,16,255,255,255,255,17,0,255,0,10,255,255,2,0,255,255,255,13,0,0,2,255,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,13,0,255,255,255,255,255,14,0,0,255,255,255,255,0,0,2,4,255,255,255,255,255,255,0,17,255,255,255,255,255,255,4,0,255,255,255,255,255,255,0,0,255,255,255,255,255,255,0,10,255,255,255,255,255,255,11,0,255,255,255,255,255,255,0,3,255,255,255,255,5,0,5,0,2,0,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,255,255,255,255,0,0,255,0,255,255,255,255,0,4,255,0,255,255,255,255,0,0,255,5,255,255,255,255,4,9,255,0,255,0,0,255,1,2,255,10,255,0,2,255,0,0,255,0,255,10,0,255,22,11,255,0,0,0,0,5,0,0,255,0,8,255,255,0,19,11,255,9,255,255,255,255,0,3,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,6,1,0,4,0,255,255,0,255,255,255,255,255,255,255,22,255,255,255,255,255,255,255,0,255,255,255,255,255,255,255,0,0,12,0,1,255,255,255,0,255,255,255,255,255,255,255,0,255,255,255,255,255,255,255,1,255,255,255,255,255,255,255,0,255,255,255,255,255,255,255,0,4,0,3,0,17,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,255,255,255,255,255,255,255,4,255,255,255,255,255,255,255,0,255,255,255,255,255,255,255,8,255,255,255,255,255,255,255,0,255,255,255,255,255,255,255,0,255,255,255,255,255,255,255,21,255,255,255,255,255,255,255,0,255,255,255,255,255,255,255,0,255,255,255,255,255,255,255,4,0,16,0,0,21,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,255,255,255,255,11,0,255,3,255,255,255,255,0,8,255,0,10,255,255,0,3,255,255,255,0,0,4,14,255,255,255,255,255,8,1,255,255,255,255,255,255,0,1,255,255,255,255,255,0,3,6,3,255,255,255,0,5,255,255,0,20,255,255,0,255,255,255,255,5,0,255,0,255,255,255,255,10,0,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,8,255,255,255,255,0,0,255,0,255,255,255,255,9,5,255,3,255,255,255,255,0,5,255,0,6,255,255,1,0,255,255,0,9,255,255,0,7,255,255,0,2,255,255,11,0,255,255,255,0,2,17,0,255,255,255,255,19,0,0,14,255,255,255,255,255,6,0,255,255,255,255,255,255,0,5,255,255,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,255,255,255,255,8,0,255,0,255,255,255,255,0,0,255,0,255,255,255,255,3,0,255,5,255,255,255,255,15,8,255,0,255,255,255,255,0,0,255,7,255,255,255,255,0,1,255,0,255,255,255,255,0,12,255,0,255,255,255,255,0,0,255,0,8,255,255,8,10,255,255,255,0,11,1,10,255,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,255,255,255,255,0,0,255,0,255,255,255,255,0,3,255,6,255,255,255,255,0,12,255,7,255,255,255,255,8,0,255,0,4,0,4,11,0,0,255,0,255,255,255,255,0,0,255,0,255,255,255,255,17,0,255,6,255,255,255,255,0,0,255,1,255,255,255,255,2,8,255,0,255,255,255,255,2,0,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,6,255,255,255,255,0,0,255,0,255,255,255,255,0,4,255,9,255,255,255,255,4,0,255,1,0,255,255,3,3,255,255,1,10,255,255,0,0,255,255,0,7,255,255,6,10,255,255,255,0,13,0,0,255,255,255,255,13,0,12,3,255,255,255,255,255,0,2,255,255,255,255,255,255,13,0,255,255,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,8,0,17,12,0,12,0,255,0,255,255,255,255,255,255,255,0,255,255,255,255,255,255,255,7,255,255,255,255,255,255,255,0,5,0,14,0,255,255,255,6,255,255,255,255,255,255,255,0,255,255,255,255,255,255,255,0,255,255,255,255,255,255,255,0,255,255,255,255,255,255,255,8,255,255,255,255,255,255,255],
[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,11,0,0,0,255,255,255,5,0,255,255,12,10,255,255,10,255,255,255,255,6,19,255,0,255,255,255,255,0,0,255,8,255,255,255,255,7,0,255,4,255,255,255,255,0,0,255,5,255,255,255,255,3,13,255,3,255,255,255,255,11,0,255,0,8,255,255,14,0,255,255,255,0,0,15,0,255,255,255],
]
train_y =['E','G','Y','K','4','G','R','C','3','5','6','O','5','W','1','J','6','2','7','C','V','L','I','2','C','O','1','R','7','Q','O','Y','T','A','D','Z','R','M','Q','U','N','9','D','Q','S','Z','G','J','S','3','G','Z','M','B','A','J','1','4','D','M','P','Q','9','A','E','V','W','Z','D','O','W','G','S','T','7','X','K','M','S','2','1','D','2','K','B','2','0','B','H','Q','O','A','H','0','V','5','I','8','V','E','Z','9','7','M','E','C','L','6','9','V','H','C','E','9','1','W','E','L','X','V','U','H','V','F','O']
def prepareData(img):
x = []
threshold = 100
i=0
startLocX = 7
endLocX = 21
startLocY = 6
increment = 8
for i in range(5):
char = img[startLocX:endLocX,startLocY:startLocY+increment]
char[char > threshold] = 255
startLocY = startLocY + increment + 1
x.append(char.ravel())
return x
#create the classifier
clf = LogisticRegression()
clf.fit(train_x, train_y)
#get the input captcha
rows,cols = tuple(raw_input().split())
pixels = []
for i in range(int(rows)):
line = raw_input()
row = []
for p in line.split():
vals = [int(val) for val in p.split(",")]
row.append(sum(vals)/len(vals))
pixels.append(row)
#convert it to an np array
pixels = np.array(pixels)
#extract each of the charecters from the captcha
x = prepareData(pixels)
#get the prediction for each of the charecter and concat the output to form the string
output = ""
for char in x:
output = output + str(clf.predict(char)[0])
print output
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment