Go: package main

import (
	"bufio"
	"os"
	"strings"
	"strconv"
	"reflect"
	"fmt"
)

var scanner = bufio.NewScanner(os.Stdin)

func scanBoard() [][]int {
	ret := make([][]int, 8)
	for k := range ret {
		ret[k] = make([]int, 8)
		for l := range ret[k] {
			ret[k][l] = 0
		}
	}
	for i := 0; i < 8; i++ {
		scanner.Scan()
		row := strings.Split(scanner.Text(), "")
		for j := 0; j < 8; j++ {
			ret[i][j], _ = strconv.Atoi(row[j])
		}
	}
	return ret
}

func main() {
	for {
		var board [][]int
		var ans string
		if board = scanBoard(); reflect.DeepEqual(board, [][]int{}) {
			break
		}
		fmt.Println(board)
		for i := 0; i < 7; i++ {
			for j := 0; j < 7; j++ {
				if board[i][j] == 1 && board[i+1][j] == 1 && board[i][j+1] == 1 && board[i+1][j+1] == 1 {
					ans = "A"
				}
			}
		}
		for i := 0; i < 5; i++ {
			for j := 0; j < 8; j++ {
				if board[i][j] == 1 && board[i+1][j] == 1 && board[i+2][j] == 1 && board[i+3][j] == 1 {
					ans = "B"
				}
			}
		}
		for i := 0; i < 8; i++ {
			for j := 0; j < 5; j++ {
				if board[i][j] == 1 && board[i][j+1] == 1 && board[i][j+2] == 1 && board[i][j+3] == 1 {
					ans = "C"
				}
			}
		}
		for i := 0; i < 6; i++ {
			for j := 0; j < 7; j++ {
				if board[i][j+1] == 1 && board[i+1][j] == 1 && board[i+1][j+1] == 1 && board[i+2][j] == 1 {
					ans = "D"
				}
			}
		}
		for i := 0; i < 7; i++ {
			for j := 0; j < 6; j++ {
				if board[i][j] == 1 && board[i][j+1] == 1 && board[i+1][j+1] == 1 && board[i+1][j+2] == 1 {
					ans = "E"
				}
			}
		}
		for i := 0; i < 7; i++ {
			for j := 0; j < 6; j++ {
				if board[i][j+1] == 1 && board[i][j+2] == 1 && board[i+1][j] == 1 && board[i+1][j+1] == 1 {
					ans = "G"
				}
			}
		}
		for i := 0; i < 6; i++ {
			for j := 0; j < 7; j++ {
				if board[i][j] == 1 && board[i+1][j] == 1 && board[i+1][j+1] == 1 && board[i+2][j+1] == 1 {
					ans = "F"
				}
			}
		}
		fmt.Println(ans)
	}
}

C++: #include <iostream>
#include <array>

using namespace std;

char checkData( array< int, 4 > data_i, array< int, 4 > data_j )
{
        int i = 0, j = 0;
        if (
                        data_i[i] + 1 == data_i[i+1] &&
                        data_j[j] == data_j[j+1] &&
                        data_i[i] == data_i[i+2] &&
                        data_j[j] + 1 == data_j[i+2] &&
                        data_i[i] + 1 == data_i[j+3] &&
                        data_j[j] + 1 == data_j[j+3]
           )
        {
                return 'A';
        }
        else if (
                        data_i[i] == data_i[i+1] &&
                        data_j[j] + 1 == data_j[j+1] &&
                        data_i[i] == data_i[i+2] &&
                        data_j[j] + 2 == data_j[j+2] &&
                        data_i[i] == data_i[i+3] &&
                        data_j[j] + 3 == data_j[j+3]
        )
        {
                return 'B';
        }
        else if (
                        data_i[i] + 1 == data_i[i+1] &&
                        data_j[j] == data_j[j+1] &&
                        data_i[i] + 2 == data_i[i+2] &&
                        data_j[j] == data_j[j+2] &&
                        data_i[i] + 3 == data_i[j+3] &&
                        data_j[j] == data_j[j+3]
        )
        {
                return 'C';
        }
        else if (
                        data_i[i] - 1 == data_i[i+1] &&
                        data_j[j] + 1 == data_j[j+1] &&
                        data_i[i] == data_i[i+2] &&
                        data_j[j] + 1 == data_j[j+2] &&
                        data_i[i] - 1 == data_i[i+3] &&
                        data_j[j] + 2 == data_j[j+3]
        )
        {
                return 'D';
        }
        else if (
                        data_i[i] + 1 == data_i[i+1] &&
                        data_j[j] == data_j[j+1] &&
                        data_i[i] + 1 == data_i[i+2] &&
                        data_j[j] + 1 == data_j[j+2] &&
                        data_i[i] + 2 == data_i[i+3] &&
                        data_j[j] + 1 == data_j[j+3]
        )
        {
                return 'E';
        }
        else if (
                        data_i[i] == data_i[i+1] &&
                        data_j[j] + 1 == data_j[j+2] &&
                        data_i[i] + 1 == data_i[i+2] &&
                        data_j[j] + 1 == data_j[j+2] &&
                        data_i[i] + 1 == data_i[i+2] &&
                        data_j[j] + 1 == data_j[j+3]
        )
        {
                return 'F';
        }
        else
        {
                return 'G';
        }


}


int main()
{
        char table[8][8];
        array< int, 4 > data_i;
        array< int, 4 > data_j;
        int tmp = 0, inum = 0, jnum = 0, i, j;

        while ( cin >> table[0] )
        {
                for ( i = 1 ; i < 8 ; i++ )
                {
                        cin >> table[i];
                }
                for ( i = 0 ; i < 8 ; i++ )
                {
                        for ( j = 0 ; j < 8 ; j++ )
                        {
                                if ( table[i][j] == '1' )
                                {
                                        data_i[inum] = i;
                                        data_j[jnum] = j;
                                        inum++;
                                        jnum++;
                                }
                        }
                }
                inum = 0;
                jnum = 0;
                cout << checkData( data_j, data_i ) << endl;
        }
        return 0;
}

C++: #include <iostream>
#include <string>
#include <math.h>
#include <stdio.h>
#include <ctype.h>
#include <algorithm>

using namespace std;

char Types(char x[12][11]);

int main () {
    char x[12][11];

//    for(int i=0; i<12; i++){
//        for(int j=0; j<11; j++){
//            cout<<x[i][j];
//        }
//    }
    while(1){
        for(int i=0; i<12; i++){
            for(int j=0; j<11; j++){
                x[i][j]='0';
            }
        }
        for(int i=1; i<9; i++){
            for(int j=0; j<8; j++){
                cin>>x[i][j];
            }
        }
        char ans = Types(x);
        
        if(ans == 'Z'){
            break;
        }
        
        cout << ans <<endl;
    }
    
    return 0;
}

char Types(char x[12][11]){
    for(int i=1; i<9; i++){
        for(int j=0; j<8; j++){
            if(x[i][j]=='1'){
                if(x[i+1][j]=='1'&&x[i][j+1]=='1'&&x[i+1][j+1]=='1'){
                    return 'A';
                }else if(x[i+1][j]=='1'&&x[i+2][j]=='1'&&x[i+3][j]=='1'){
                    return 'B';
                }else if(x[i][j+1]=='1'&&x[i][j+2]=='1'&&x[i][j+3]=='1'){
                    return 'C';
                }else if(x[i+1][j]=='1'&&x[i+1][j-1]=='1'&&x[i+2][j-1]=='1'){
                    return 'D';
                }else if(x[i][j+1]=='1'&&x[i+1][j+1]=='1'&&x[i+1][j+2]=='1'){
                    return 'E';
                }else if(x[i+1][j]=='1'&&x[i+1][j+1]=='1'&&x[i+2][j+1]=='1'){
                    return 'F';
                }else if(x[i][j+1]=='1'&&x[i+1][j]=='1'&&x[i-1][j+1]=='1'){
                    return 'G';
                }
            }
        }
    }
    return 'Z';
}

C++: #include<iostream>
#include<vector>
#define MAX  999999
bool prime[MAX];
using namespace std;

int main(void){
  int n ;
  
  vector<int> dp(0,0);
  //isPrime();

  fill(prime,prime+MAX,true);
  int cnt = 0;
  prime[0]=prime[1]=false;
  for(int i = 2 ; i < MAX ; i ++){
    if(prime[i]){
      cnt += i;
      for(int j = 2 ; j * i < MAX ; j ++){
        prime[i*j] = false;
      }
    dp.push_back(cnt);
    }
  }  
  
  
  while(cin>>n,n)
  cout<<dp[n-1]<<endl;
}