Go: package main

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

var scanner = bufio.NewScanner(os.Stdin)
var title = [4]int{0, 90, 180, 270}

func main() {
	p := make([][]string, 8)
	for i := range p {
		scanner.Scan()
		p[i] = strings.Split(scanner.Text(), "")
	}
	// log.Println(p)
	for i := 1; i < 4; i++ {
		fmt.Println(title[i])
		p = spin(p)
		print_p(p)
	}
}

func spin(p [][]string) [][]string {
	ret := make([][]string, 8)
	for i := range ret {
		ret[i] = make([]string, 8)
	}
	for i := 0; i < 8; i++ {
		for j := 0; j < 8; j++ {
			ret[i][j] = p[7-j][i]
		}
	}
	return ret
}

func print_p(p [][]string) {
	for _, v := range p {
		fmt.Println(strings.Join(v, ""))
	}
}

C++: #include <map>
#include <set>
#include <list>
#include <cmath>
#include <queue>
#include <stack>
#include <cstdio>
#include <string>
#include <vector>
#include <complex>
#include <cstdlib>
#include <cstring>
#include <numeric>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <functional>

#define mp       make_pair
#define pb       push_back
#define all(x)   (x).begin(),(x).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define repi(i,a,b) for(int i = (a); i < (b); i++)

using namespace std;

typedef    long long          ll;
typedef    unsigned long long ull;
typedef    vector<bool>       vb;
typedef    vector<int>        vi;
typedef    vector<vb>         vvb;
typedef    vector<vi>         vvi;
typedef    pair<int,int>      pii;

const int INF=1<<29;
const double EPS=1e-9;

const int dx[]={1,0,-1,0},dy[]={0,-1,0,1};

int main(){
	char board[10][10];
	rep(i, 8)rep(j, 8){
		cin>>board[i][j];
	}
	for(int i =90;i <=270;i+=90){
		char tmp[10][10];
		cout <<i<<endl;
		for(int j = 0;j <8;j++){
			for(int k = 0;k <8;k++){
				tmp[j][k]=board[7-k][j];
			}
		}
		rep(j,8){
			rep(k,8){
				cout <<tmp[j][k];
			}
			cout <<endl;
		}
		rep(j, 8)rep(k, 8)board[i][j]=tmp[i][j];

	}
	return 0;
}

C++: //44
#include<iostream>

using namespace std;

int main(){
  char g[8][9];
  for(int i=0;i<8;i++){
    cin>>g[i];
  }
  cout<<90<<endl;
  for(int i=0;i<8;i++){
    for(int j=7;j>=0;j--){
      cout<<g[j][i];
    }
    cout<<endl;
  }
  cout<<180<<endl;
  for(int i=7;i>=0;i--){
    for(int j=7;j>=0;j--){
      cout<<g[i][j];
    }
    cout<<endl;
  }
  cout<<270<<endl;
  for(int i=7;i>=0;i--){
    for(int j=0;j<8;j++){
      cout<<g[j][i];
    }
    cout<<endl;
  }
  return 0;
}

C++: #include <iostream>

using namespace std;

int main(int argc, char **argv)
{
	char array[8][8];
	
	for(int i = 0; i < 8; i++){
		for(int j = 0; j < 8; j++){
			cin >> array[i][j];
		}
	}
	
	
	cout << "90" << endl;
	for(int i = 0; i < 8; i++){
		for(int j = 7; j >= 0; j--){
			cout << array[j][i];
		}
		cout << endl;
	}
	
	cout << "180" << endl;
	for(int i = 7; i >= 0; i--){
		for(int j = 7; j >= 0; j--){
			cout << array[i][j];
		}
		cout << endl;
	}
	
	cout << "270" << endl;
	for(int i = 7; i >= 0; i--){
		for(int j = 0; j < 8; j++){
			cout << array[j][i];
		}
		cout << endl;
	}
	
	return 0;
}

C++: #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <cassert>
#include <iostream>
#include <cctype>
#include <sstream>
#include <string>
#include <list>
#include <vector>
#include <queue>
#include <set>
#include <stack>
#include <map>
#include <utility>
#include <numeric>
#include <algorithm>
#include <iterator>
#include <bitset>
#include <complex>
#include <fstream>
using namespace std;
typedef long long ll;
const double EPS = 1e-9;
typedef vector<int> vint;
typedef pair<int, int> pint;
#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for(int i = x; i < n; i++)
template<class T> T RoundOff(T a){ return int(a+.5-(a<0)); }
template<class T, class C> void chmax(T& a, C b){ if(a < b) a = b; }
template<class T, class C> void chmin(T& a, C b){ if(b < a) a = b; }
template<class T, class C> pair<T, C> mp(T a, C b){ return make_pair(a, b); }

int main()
{
    vector<string> board;
	rep(i, 8) cin >> board[i];
	
	rep(i, 3)
	{
		cout << (i + 1) * 90 << endl;
		
		rep(i, 8) rep(j, 8) board[i][j] = board[7 - j][i];

		rep(i, 8) cout << board[i] << endl;
	}
}

C++: #include<iostream>
using namespace std;

int x[10][10];
int y[10][10];
char c;

void TheRotate90() {
	for (int j = 0; j < 8; j++) {
		for (int k = 0; k < 8; k++) {
			y[k][7 - j] = x[j][k];
		}
	}
}

int main() {
	for (int i = 0; i < 8; i++) {
		for (int j = 0; j < 8; j++) {
			cin >> c;
			if (c == '#') { x[i][j] = 1; }
			else { x[i][j] = 0; }
		}
	}
	for (int i = 1; i < 4; i++) {
		cout << i * 90 << endl;
		TheRotate90();
		for (int j = 0; j < 8; j++) {
			for (int k = 0; k < 8; k++) {
				x[j][k] = y[j][k];
				if (x[j][k] == 0) { cout << '*'; }
				else { cout << '#'; }
			}
			cout << endl;
		}
	}
	return 0;
}

C++: #include <cstdio>

using namespace std;

int main(){
  char strs[8][8];
  for(int i = 0; i < 8; i++){
    scanf("%s", strs[i]);
  }
  printf("90\n");
  for(int i = 7; i >= 0; i--){
    for(int j = 0; j < 8; j++){
      printf("%c", strs[i][j]);
    }
    printf("\n");
  }
  printf("180\n");
  for(int i = 7; i >= 0; i--){
    for(int j = 7; j >= 0; j--){
      printf("%c", strs[i][j]);
    }
    printf("\n");
  }
  printf("270\n");
  for(int i = 7; i >= 0; i--){
    for(int j = 0; j < 8; j++){
      printf("%c", strs[j][i]);
    }
    printf("\n");
  }
  return 0;
}

C++: #include <iostream>

using namespace std;

#define rep(i,n) for(int i = 0 ; i < n ; i++)

int main(){
  char a[8][8][4];

  rep(i,8){
    rep(j,8){
      cin >> a[i][j][0];
    }
  }

  rep(k,3){
    cout << (k+1)*90 << endl;
    rep(i,8){
      rep(j,8){
	cout << a[7-j][i][k];
	a[i][j][k+1] = a[7-j][i][k];
      }
      cout << endl;
    }
  }

  return 0;
}

C++: #include <stdio.h>
#include <iostream>

using namespace std;

int main() {
	char hyou[8][8];
	for (int i = 0; i < 8; i++) {
		for (int j = 0; j < 8; j++) {
			cin >> hyou[i][j];
		}
	}

	cout << "90" << endl;
	for (int i = 0; i < 8; i++) {
		for (int j = 7; j >= 0; j--) {
			cout << hyou[j][i];
		} 
		cout << endl;
	}

	cout << "180" << endl;
	for (int i = 7; i >= 0; i--) {
		for (int j = 7; j >= 0; j--) {
			cout << hyou[i][j];
		}
		cout << endl;
	}

	cout << "270" << endl;
	for (int i = 7; i >= 0; i--) {
		for (int j = 0; j < 8; j++) {
			cout << hyou[j][i];
		}
		cout << endl;
	}
	return 0;
}

C++: #include <bits/stdc++.h>
#define PB push_back
#define MP make_pair
#define rep(i,n) for (int i=0;i<(n);i++)
using namespace std;
typedef long long ll;
int main(){
    char s[10][10];
    for(int i=0;i<8;i++)cin>>s[i];

    cout<<90<<endl;
    for(int i=0;i<8;i++){
        for(int j=7;j>=0;j--)cout<<s[j][i];
        cout<<endl;
    }


    cout<<180<<endl;
    for(int i=7;i>=0;i--){
        for(int j=7;j>=0;j--)cout<<s[i][j];
        cout<<endl;
    }

    cout<<270<<endl;
    for(int i=7;i>=0;i--){
        for(int j=0;j<8;j++)cout<<s[j][i];
        cout<<endl;
    }
}

C++: #include <cstdio>

using namespace std;

int main(){
  char strs[8][8];
  for(int i = 0; i < 8; i++){
    scanf("%s", strs[i]);
  }
  printf("90\n");
  for(int i = 0; i < 8; i++){
    for(int j = 7; j >= 0; j--){
      printf("%c", strs[j][i]);
    }
    printf("\n");
  }
  printf("180\n");
  for(int i = 7; i >= 0; i--){
    for(int j = 7; j >= 0; j--){
      printf("%c", strs[i][j]);
    }
    printf("\n");
  }
  printf("270\n");
  for(int i = 7; i >= 0; i--){
    for(int j = 0; j < 8; j++){
      printf("%c", strs[j][i]);
    }
    printf("\n");
  }
  return 0;
}