import java.util.ArrayList;
import java.util.List;

class Match {
    private String matchId;
    private String date;
    private int headshots;
    private int totalShots;
    private double accuracy;

    public Match(String matchId, String date, int headshots, int totalShots) {
        this.matchId = matchId;
        this.date = date;
        this.headshots = headshots;
        this.totalShots = totalShots;
        this.accuracy = (double) headshots / totalShots * 100;
    }

    public String getMatchId() {
        return matchId;
    }

    public String getDate() {
        return date;
    }

    public int getHeadshots() {
        return headshots;
    }

    public int getTotalShots() {
        return totalShots;
    }

    public double getAccuracy() {
        return accuracy;
    }

    @Override
    public String toString() {
        return "MatchID: " + matchId + ", Date: " + date + ", Headshots: " + headshots + ", TotalShots: " + totalShots + ", Accuracy: " + String.format("%.2f", accuracy) + "%";
    }
}

public class PlayerStatistics {
    private String playerName;
    private List<Match> matches;
    private int totalHeadshots;
    private int totalShots;
    private double totalAccuracy;

    public PlayerStatistics(String playerName) {
        this.playerName = playerName;
        this.matches = new ArrayList<>();
        this.totalHeadshots = 0;
        this.totalShots = 0;
        this.totalAccuracy = 0.0;
    }

    public void addMatch(Match match) {
        matches.add(match);
        totalHeadshots += match.getHeadshots();
        totalShots += match.getTotalShots();
        totalAccuracy = (double) totalHeadshots / totalShots * 100;
    }

    public void printStatistics() {
        System.out.println("Player: " + playerName);
        System.out.println("Total Headshots: " + totalHeadshots);
        System.out.println("Total Shots: " + totalShots);
        System.out.println("Total Accuracy: " + String.format("%.2f", totalAccuracy) + "%");
        System.out.println("Match Details:");
        for (Match match : matches) {
            System.out.println(match.toString());
        }
    }

    public static void main(String[] args) {
        PlayerStatistics player = new PlayerStatistics("YourGameID");
        player.addMatch(new Match("123456789", "2023-10-01", 5, 50));
        player.addMatch(new Match("987654321", "2023-10-02", 3, 40));
        player.printStatistics();
    }
}