from math import sqrt

input = "GAADAGDAAGDAAGDGGADGAAGAAAGGDAADAGDGDGADDAGDDAADGAGAGDDAGDGDAAGDDAAGAAGDDDDGADGAAAGAGGDGDGDGDAGAAGGGADAADGADGDGAGAGGAGGGAGDADAADGGGAGADDGDDAAAGGAGADAAAADGAGGGDAAGADADAADAGAAAGADDDDADDDDDAGGAGAAGDGDAGAADDGADGDDAGDDGDDGDGAGDGGDAGAGDGGDGGGDADAGDADGGGADDDGGGAAAGGDDAAGAAGAADGGDAGDGDAGDDGDDADDGGGAGDDAGDGDAGGAAGADADADGDDDDADDAGDGGDADAAADGGGGAGGGGDDGAAAAGDDDGDAGDAAADGAAGGGDGDDDGAAGDGGAGGDDDADGADAGGAAAAGAADGGAAAGGGGDDDDGAAGDDADDAGDADDDAADGDGAGGGGGDGDGAGDAGADDAGGAGDAGAGDAAAGDADGGAAGDGDDDGADGAAAGDGDDADGGGA"

actions = ("A", "G", "D")

sol = dict()

def avance(direction, x, y):
    if direction%4 == 0:
        y += 100
    elif direction%4 == 1:
        x += 100
    elif direction%4 == 2:
        y -= 100
    else:
        x -= 100
    return x, y

def action(direction, x, y, c):
    if c == "A":
        x, y = avance(direction, x, y)
    elif c == "G":
        direction -= 1
    else:
        direction += 1
    return direction, x, y

def chemin(s):
    direction = 0
    x = 0
    y = 0

    for c in s:
        direction, x, y = action(direction, x, y, c)
    
    d = sqrt(x**2 + y**2)
    return x, y, d

for i in range(len(input)):
    for a in actions:
        if a == input[i]:
            continue
        s = input[:i] + a + input[i+1:]
        x, y, d = chemin(s)
        sol[(x, y,)] = d

print(len(sol), ",", int(max(sol[k] for k in sol)))
