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 <cstdio>
#include <iostream>
 
using namespace std;
 
int main(){
     
    char n[10][10];
     
    for(int i = 0;i < 8;i++){
    cin >> n[i];
    }
     
    cout << "90" << endl;
     
    for(int i = 0;i < 8;i++){
        for(int j = 7;j >= 0;j--){
            cout << n[j][i];
        }
        cout << endl;
    }
     
    cout << "180" << endl;
     
    for(int i = 7;i >= 0;i--){
        for(int j = 7;j >= 0;j--){
        cout << n[i][j];
        }
        cout << endl;
    }
     
    cout << "270" << endl;
     
    for(int i = 7;i >= 0;i--){
        for(int j = 0;j < 8;j++){
        cout << n[j][i];
        }
        cout << endl;
    }
     
    return 0;
     
}

C++: #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <cstring>
#include <climits>
#include <sstream>
using namespace std;
static const double EPS = 1e-5;
typedef long long ll;

char pat[8][8];
char rot[8][8];

main(){
	for(int i=0;i<8;i++){
		for(int j=0;j<8;j++){
			cin>>pat[i][j];
		}
	}
	
	for(int i=1;i<=3;i++){
		cout<<i*90<<endl;
		for(int j=0;j<8;j++){
			for(int k=0;k<8;k++){
				rot[j][k]=pat[7-k][j];
				cout<<rot[j][k];
			}
			cout<<endl;
		}
		memcpy(pat,rot,sizeof(rot));
	}
}

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

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

C++: #include <iostream>

using namespace std;

int main(void){

  char r[8][8];

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

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

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

  return 0;
}

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

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

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

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

C++: #include <bits/stdc++.h>
using namespace std ;

#define pb(n) push_back(n)
#define fi first
#define se second
#define all(r) (r).begin(),(r).end()
#define gsort(st,en) sort((st),(en),greater<int>())
#define vmax(ary) *max_element(all(ary))
#define vmin(ary) *min_element(all(ary))
#define debug(x) cout<<#x<<": "<<x<<endl
#define fcout(n) cout<<fixed<<setprecision((n))
#define scout(n) cout<<setw(n)
#define vary(type,name,size,init) vector< type> name(size,init)

#define rep(i,n) for(int i = 0; i < (int)(n);++i)
#define REP(i,a,b) for(int i = (a);i < (int)(b);++i)
#define repi(it,array) for(auto it = array.begin(),end = array.end(); it != end;++it)
#define repa(n,array) for(auto &n :(array))

using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using dict = map<string,int>;
using pii = pair<int,int> ;

constexpr int imax = ((1<<30)-1)*2+1 ;
constexpr int inf = 100000000;
constexpr double PI = acos(-1.0) ;
double eps = 1e-10 ;
const int dy[] = {-1,0,1,0};
const int dx[] = {0,-1,0,1};

inline bool value(int x,int y,int w,int h){
  return (x >= 0 && x < w && y >= 0 && y < h);
}

template<typename T>
void Unique(vector<T> &v){
  sort(all(v));
  v.erase(unique(all(v)),v.end());
}

template<typename T>
T ston(string& str, T n){
  istringstream sin(str) ;
  T num ;
  sin >> num ;
  return num ;
}

void Ans(bool f){
  if(f) cout << "YES"<<endl;
  else cout << "NO"<<endl;
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  char c[8][8];
  rep(i,8){
    rep(j,8){
      cin >> c[j][i];
    }
  }
  cout << 90 <<endl;
  rep(i,8){
    rep(j,8){
      cout << c[i][7-j];
    }
    cout << endl;
  }
  cout << 180 <<endl;
  rep(i,8){
    rep(j,8){
      cout << c[7-j][7-i];
    }
    cout << endl;
  }
  cout << 270 <<endl;
  rep(i,8){
    rep(j,8){
      cout << c[7-i][j];
    }
    cout << endl;
  }
  return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<vector>
#include<map>
#include<string>
using namespace std;
int main(){
    char s[10][10];
    for(int i=0;i<8;i++)cin>>s[i];

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


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

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

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

C++: #include <iostream>
#include <cstdio>
#include <algorithm>

using namespace std;

int main(){
	
	string str[8];
	
	for(int i = 0; i < 8; i++){
		cin >> str[i];
	}
	printf("90\n");
	for(int x = 0; x < 8; x++){
		for(int y = 7; y >= 0; y--){
			printf("%c", str[y][x]);
		}
		printf("\n");
	}
	
	printf("180\n");
	for(int y = 7; y >= 0; y--){
		for(int x = 7; x >= 0; x--){
			printf("%c", str[y][x]);
		}
		printf("\n");
	}
	
	printf("270\n");
	for(int x = 7; x >= 0; x--){
		for(int y = 0; y < 8; y++){
			printf("%c", str[y][x]);
		}
		printf("\n");
	}
	
	return 0;
}