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 <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <functional>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

#define REP( i, m, n ) for ( int i = (int)( m ); i < (int)( n ); i++ )
#define UREP( i, m, n ) for ( unsigned int i = (unsigned int)( m ); i < (unsigned int)( n ); i++ )
#define ITER( c ) __typeof( (c).begin() )
#define IREP( c, it ) for ( ITER(c) it = (c).begin(); it != (c).end(); ++it )
#define ALL( c ) (c).begin(), (c).end()
#define PB( n ) push_back( ( n ) )
#define MP( a, b ) make_pair( ( a ), ( b ) )
#define fst first
#define snd second

vector<string> rot( vector<string> org )
{
	vector<string> res;

	REP( i, 0, 8 )
	{
		string line;
		for ( int j = 7; 0 <= j; j-- )
		{
			line += org[j][i];
		}
		res.PB( line );
	}

	return res;
}

void output( vector<string> vs )
{
	UREP( i, 0, vs.size() )
	{
		UREP( j, 0, vs[i].length() )
		{
			cout << vs[i][j];
		}
		cout << endl;
	}

	return;
}

int main()
{
	vector<string> pattern;

	REP( i, 0, 8 )
	{
		string input;
		cin >> input;
		pattern.PB( input );
	}

	for ( int s = 90; s <= 270; s += 90 )
	{
		cout << s << endl;
		pattern = rot( pattern );
		output( pattern );
	}

	return 0;
}

C++: #include <cstdio>

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

C++: #include <vector>
#include <iostream>
#include <utility>
#include <algorithm>
#include <string>
#include <deque>
#include <queue>
#include <tuple>
#include <queue>
#include <functional>
#include <cmath>
#include <iomanip>
#include <map>
#include <set>
#include <numeric>
#include <unordered_map>
#include <unordered_set>
#include <complex>
#include <iterator>
#include <array>
#include <memory>
#include <stack>
#define vi vector<int>
#define vvi vector<vector<int> >
#define ll long long int
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
#define ld long double
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,s,n) for(int i=s;i<n;i++)
#define all(in) in.begin(), in.end()
template<class T, class S> void cmin(T &a, const S &b) { if (a > b)a = b; }
template<class T, class S> void cmax(T &a, const S &b) { if (a < b)a = b; }
#define MAX 9999999
using namespace std;
typedef pair<int, int> pii;
typedef pair<double,double>pdd;
typedef pair<ll,ll>pll;
int main(){
    vector<string>v(8);
    rep(i,8)cin>>v[i];
    cout<<90<<endl;
    rep(j,8){rep(i,8)cout<<v[7-i][j]; cout<<endl;}
    cout<<180<<endl;
    rep(i,8){rep(j,8)cout<<v[7-i][7-j]; cout<<endl;}
    cout<<270<<endl;
    rep(j,8){rep(i,8)cout<<v[i][7-j]; cout<<endl;}
}

C++: #include <iostream>
using namespace std;
int main(){
	string s[8];
	for(int i=0;i<8;++i)getline(cin,s[i]);
	cout<<"90\n";
	for(int j=0;j<8;++j){
		for(int i=7;i>=0;--i)cout<<s[i][j];
		cout<<"\n";
	}
	cout<<"180\n";
	for(int j=7;j>=0;--j){
		for(int i=7;i>=0;--i)cout<<s[j][i];
		cout<<"\n";
	}
	cout<<"270\n";
	for(int j=7;j>=0;--j){
		for(int i=0;i<8;++i)cout<<s[i][j];
		cout<<"\n";
	}
	return 0;
}

C++: #include <stdio.h>
int main(){
    char a[8][8];
    for(int i=0;i<8;i++){
        scanf("%s",a[i]);
    }
    printf("90\n");
    for(int i=7;i>=0;i--){
        for(int j=0;j<8;j++){
            printf("%c",a[i][j]);
        }
        printf("\n");
    }
    printf("180\n");
    for(int i=0;i<8;i++){
        for(int j=0;j<8;j++){
            printf("%c",a[j][i]);
        }
        printf("\n");
    }
    printf("270\n");
    for(int i=7;i>=0;i--){
        for(int j=0;j<8;j++){
            printf("%c",a[j][i]);
        }
        printf("\n");
    }
}

C++: #include<iostream>

using namespace std;

char data[8][8];

int main(){


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

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

  cout << "180" <<endl;

  for(int j = 0; j < 8; j++){
    for(int i = 0; i < 8; i++){
      cout << data[i][j];
    }
    cout << endl;
  }

  cout << "270" << endl;

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

C++: #include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <bitset>
#include <cmath>

static const int MOD = 1000000007;
using ll = long long;
using u32 = unsigned;
using u64 = unsigned long long;
using namespace std;

template<class T> constexpr T INF = ::numeric_limits<T>::max()/32*15+208;

int main() {
    vector<string> v(8);
    for (auto &&i : v) cin >> i;
    for (int i = 0; i < 3; ++i) {
        cout << 90*(i+1) << "\n";
        auto vv = v;
        for (int j = 0; j < 8; ++j) {
            for (int k = 0; k < 8; ++k) {
                vv[j][k] = v[7-k][j];
            }
        }
        for (auto &&l : vv) {
            cout << l << "\n";
        }
        v = vv;
    }
    return 0;
}

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

int main(){
	int angle = 90;
	string s[8];
	for(int i = 0;i < 8;++i){
		cin >> s[i];
	}
	swap(s[0],s[7]);
	cout << angle << endl;
	for(int i = 0;i < 8;++i){
		for(int j = 0;j < 8;++j){
			printf("%c",s[i][j]);
		}
		printf("\n");
	}
	for(int i = 0;i < 8;++i){
		swap(s[i][0],s[i][7]);
	}
	cout << angle * 2 << endl;
	for(int i = 0;i < 8;++i){
		for(int j = 0;j < 8;++j){
			printf("%c",s[i][j]);
		}
		printf("\n");
	}
	swap(s[0],s[7]);
	cout << angle * 3 << endl;
	for(int i = 0;i < 8;++i){
		for(int j = 0;j < 8;++j){
			printf("%c",s[i][j]);
		}
		printf("\n");
	}
	return 0;
}

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

void Rotation(char array[][9])
{
  char tmp[9][9];
  
  memset(tmp, '\0', sizeof(tmp));
  for (int i = 0; i < 8; i++){
    for (int j = 0; j < 8; j++){
      tmp[j][i] = array[7 - i][j];
    }
  }

  for (int i = 0; i < 8; i++){
    for (int j = 0; j < 8; j++){
      array[j][i] = tmp[j][i];
    }
  }
  for (int i = 0; i < 8; i++) printf("%s\n", array[i]);
}
int main()
{
  char array[9][9];

  for (int i = 0; i < 8; i++) scanf("%s", array[i]);

  for (int i = 0; i < 3; i++){
    printf("%d\n", (i + 1) * 90);
    Rotation(array);
  }

  return (0);
}